Commit 565d58eb authored by Jean-Paul Smets's avatar Jean-Paul Smets

Various comments added

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13049 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent da0354d4
...@@ -103,7 +103,8 @@ class ConversionCacheMixin: ...@@ -103,7 +103,8 @@ class ConversionCacheMixin:
security.declareProtected(Permissions.View, 'getCacheTime') security.declareProtected(Permissions.View, 'getCacheTime')
def getCacheTime(self, **format): def getCacheTime(self, **format):
""" """
Checks when if ever was the file produced Checks when
if ever was the file produced
""" """
self.updateConversionCache() self.updateConversionCache()
return self._cached_time.get(makeSortedTuple(format), 0) return self._cached_time.get(makeSortedTuple(format), 0)
...@@ -344,6 +345,11 @@ class Document(XMLObject): ...@@ -344,6 +345,11 @@ class Document(XMLObject):
force - convert doc even if it has a cached version which seems to be up2date force - convert doc even if it has a cached version which seems to be up2date
**kw can be various things - e.g. resolution **kw can be various things - e.g. resolution
TODO:
- implement guards API so that conversion to certain
formats require certain permission
- force parameter should be somehow restricted
to prevent denial of service attack
""" """
pass pass
...@@ -355,6 +361,10 @@ class Document(XMLObject): ...@@ -355,6 +361,10 @@ class Document(XMLObject):
format - the format specied in the form of an extension format - the format specied in the form of an extension
string (ex. jpeg, html, text, txt, etc.) string (ex. jpeg, html, text, txt, etc.)
**kw can be various things - e.g. resolution **kw can be various things - e.g. resolution
TODO:
- implement guards API so that conversion to certain
formats require certain permission
""" """
pass pass
...@@ -390,7 +400,7 @@ class Document(XMLObject): ...@@ -390,7 +400,7 @@ class Document(XMLObject):
return searchable_text return searchable_text
# Compatibility with CMF Catalog # Compatibility with CMF Catalog
SearchableText = getSearchableText # XXX-JPS - Here wa have a security issue - ask seb what to do SearchableText = getSearchableText
### Relation getters ### Relation getters
def getSearchableReferenceList(self): def getSearchableReferenceList(self):
...@@ -410,7 +420,7 @@ class Document(XMLObject): ...@@ -410,7 +420,7 @@ class Document(XMLObject):
self.log('please set document reference regexp in preferences') self.log('please set document reference regexp in preferences')
return [] return []
res = rx_search.finditer(text) res = rx_search.finditer(text)
res = [(r.group(),r.groupdict()) for r in res] res = [(r.group(), r.groupdict()) for r in res]
return res return res
security.declareProtected(Permissions.View, 'getImplicitSuccessorValueList') security.declareProtected(Permissions.View, 'getImplicitSuccessorValueList')
...@@ -604,6 +614,7 @@ class Document(XMLObject): ...@@ -604,6 +614,7 @@ class Document(XMLObject):
portal_type and reference has the same version and language portal_type and reference has the same version and language
XXX should delegate to script with proxy roles XXX should delegate to script with proxy roles
XXX-JPS revision ?
""" """
catalog = getToolByName(self, 'portal_catalog', None) catalog = getToolByName(self, 'portal_catalog', None)
# XXX why this does not work??? # XXX why this does not work???
...@@ -641,6 +652,8 @@ class Document(XMLObject): ...@@ -641,6 +652,8 @@ class Document(XMLObject):
""" """
Returns a list revision strings for a given reference, version, language Returns a list revision strings for a given reference, version, language
XXX should it return revision strings, or docs (as the func name would suggest)? XXX should it return revision strings, or docs (as the func name would suggest)?
XXX-JPS return values - getRevisionList returns revisions
""" """
# Use portal_catalog # Use portal_catalog
if not self._checkCompleteCoordinates(): if not self._checkCompleteCoordinates():
...@@ -660,6 +673,8 @@ class Document(XMLObject): ...@@ -660,6 +673,8 @@ class Document(XMLObject):
def _checkCompleteCoordinates(self): def _checkCompleteCoordinates(self):
""" """
test if the doc has all coordinates test if the doc has all coordinates
XXX-JPS - revision ?
""" """
reference = self.getReference() reference = self.getReference()
version = self.getVersion() version = self.getVersion()
...@@ -705,6 +720,8 @@ class Document(XMLObject): ...@@ -705,6 +720,8 @@ class Document(XMLObject):
def getOriginalLanguage(self): def getOriginalLanguage(self):
""" """
Returns the original language of this document. Returns the original language of this document.
XXX-JPS not implemented yet ?
""" """
# Approach 1: use portal_catalog and creation dates # Approach 1: use portal_catalog and creation dates
# Approach 2: use workflow analysis (delegate to script if necessary) # Approach 2: use workflow analysis (delegate to script if necessary)
...@@ -887,6 +904,8 @@ class Document(XMLObject): ...@@ -887,6 +904,8 @@ class Document(XMLObject):
""" """
API method - some subclasses store data in a certain 'base' format API method - some subclasses store data in a certain 'base' format
(e.g. OOoDocument uses ODF) (e.g. OOoDocument uses ODF)
XXX-JPS What is this ? Explain. Name unclear
""" """
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment