Changeset 12410
- Timestamp:
- 7 Jan 2015, 08:49:38 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/batching.py
r12267 r12410 37 37 from waeup.ikoba.interfaces import IIkobaUtils 38 38 from waeup.ikoba.interfaces import MessageFactory as _ 39 from waeup.ikoba.documents.interfaces import IPDFDocument, IHTMLDocument 39 from waeup.ikoba.documents.interfaces import ( 40 IPDFDocument, IHTMLDocument, IRESTDocument) 40 41 from waeup.ikoba.utils.batching import BatchProcessor 41 42 … … 54 55 55 56 location_fields = ['document_id',] 57 additional_fields = ['class_name',] 58 56 59 factory_name = None 57 60 58 additional_fields = ['class_name'] 59 additional_headers = ['class_name'] 61 mode = None 60 62 61 mode = None 63 @property 64 def available_fields(self): 65 return sorted(list(set( 66 self.additional_fields + 67 getFields(self.iface).keys()))) 62 68 63 69 def parentsExist(self, row, site): … … 118 124 if class_name != self.factory_name.strip('waeup.'): 119 125 errs.append(('class_name','wrong processor')) 120 document_id = row.get('document_id', None)121 126 return errs, inv_errs, conv_dict 127 122 128 123 129 class PDFDocumentProcessor(DocumentProcessorBase): … … 132 138 factory_name = 'waeup.PDFDocument' 133 139 134 class HTMLDocumentProcessor(PDFDocumentProcessor): 140 141 class HTMLDocumentProcessor(DocumentProcessorBase): 135 142 """A batch processor for IHTMLDocument objects. 136 143 """ … … 142 149 143 150 factory_name = 'waeup.HTMLDocument' 151 152 153 class RESTDocumentProcessor(DocumentProcessorBase): 154 """A batch processor for IRESTDocument objects. 155 """ 156 util_name = 'restdocumentprocessor' 157 grok.name(util_name) 158 159 name = _('Public REST Document Processor') 160 iface = IRESTDocument 161 162 factory_name = 'waeup.RESTDocument' -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/export.py
r12365 r12410 24 24 from waeup.ikoba.utils.batching import ExporterBase 25 25 from waeup.ikoba.utils.helpers import iface_names 26 from waeup.ikoba.documents.interfaces import IPDFDocument, IHTMLDocument 26 from waeup.ikoba.documents.interfaces import ( 27 IPDFDocument, IHTMLDocument, IRESTDocument) 27 28 28 29 … … 99 100 class_name = 'HTMLDocument' 100 101 title = _(u'Public HTML Documents') 102 103 104 class RESTDocumentExporter(DocumentExporterBase): 105 """Exporter for documents. 106 """ 107 grok.name('restdocuments') 108 iface = IRESTDocument 109 class_name = 'RESTDocument' 110 title = _(u'Public REST Documents') -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/utils.py
r12378 r12410 131 131 'pdfdocuments', 132 132 'htmldocuments', 133 'restdocuments', 133 134 'users', 134 135 'products', … … 144 145 'pdfdocumentprocessor', 145 146 'htmldocumentprocessor', 147 'restdocumentprocessor', 146 148 'userprocessor') 147 149
Note: See TracChangeset for help on using the changeset viewer.