def set(self, instance, value, **kwargs): """ Check if value is an actual date/time value. If not, attempt to convert it to one; otherwise, set to None. Assign all properties passed as kwargs to object. """ val = value if not value: val = None elif not isinstance(value, DateTime): for fmt in ['date_format_long', 'date_format_short']: fmtstr = instance.translate(fmt, domain='bika', mapping={}) fmtstr = fmtstr.replace(r"${", '%').replace('}', '') try: val = strptime(value, fmtstr) except ValueError: continue try: val = DateTime(*list(val)[:-6]) except DateTimeError: val = None if val.timezoneNaive(): # Use local timezone for tz naive strings # see http://dev.plone.org/plone/ticket/10141 zone = val.localZone(safelocaltime(val.timeTime())) parts = val.parts()[:-1] + (zone, ) val = DateTime(*parts) break else: logger.warning("DateTimeField failed to format date " "string '%s' with '%s'" % (value, fmtstr)) super(DateTimeField, self).set(instance, val, **kwargs)
def __call__(self): """ Entry point of WorksheetPrintView. If context.portal_type is a Worksheet, then the PrintView is initialized to manage only that worksheet. If the context.portal_type is a WorksheetFolder and there are items selected in the request (items param), the PrintView will show the preview for all the selected Worksheets. By default, returns a HTML-encoded template, but if the request contains a param 'pdf' with value 1, will flush a pdf for the worksheet. """ if self.context.portal_type == 'Worksheet': self._worksheets = [self.context] elif self.context.portal_type == 'WorksheetFolder' \ and self.request.get('items', ''): uids = self.request.get('items').split(',') uc = getToolByName(self.context, 'uid_catalog') self._worksheets = [obj.getObject() for obj in uc(UID=uids)] else: # Warn and redirect to referer logger.warning('WorksheetPrintView: type not allowed: %s' % self.context.portal_type) self.destination_url = self.request.get_header( "referer", self.context.absolute_url()) # Generate PDF? if self.request.form.get('pdf', '0') == '1': return self._flush_pdf() else: return self.template()
def set(self, instance, value, **kwargs): """ Check if value is an actual date/time value. If not, attempt to convert it to one; otherwise, set to None. Assign all properties passed as kwargs to object. """ val = value if not value: val = None elif not isinstance(value, DateTime): for fmt in ['date_format_long', 'date_format_short']: fmtstr = instance.translate(fmt, domain='bika', mapping={}) fmtstr = fmtstr.replace(r"${", '%').replace('}', '') try: val = strptime(value, fmtstr) except ValueError: continue try: val = DateTime(*list(val)[:-6]) except DateTimeError: val = None if val.timezoneNaive(): # Use local timezone for tz naive strings # see http://dev.plone.org/plone/ticket/10141 zone = val.localZone(safelocaltime(val.timeTime())) parts = val.parts()[:-1] + (zone,) val = DateTime(*parts) break else: logger.warning("DateTimeField failed to format date " "string '%s' with '%s'" % (value, fmtstr)) super(DateTimeField, self).set(instance, val, **kwargs)
def strptime(context, value): """given a string, this function tries to return a DateTime.DateTime object with the date formats from i18n translations """ val = "" for fmt in ['date_format_long', 'date_format_short']: fmtstr = context.translate(fmt, domain='bika', mapping={}) fmtstr = fmtstr.replace(r"${", '%').replace('}', '') try: val = _strptime(value, fmtstr) except ValueError: continue try: val = DateTime(*list(val)[:-6]) except DateTimeError: val = "" if val.timezoneNaive(): # Use local timezone for tz naive strings # see http://dev.plone.org/plone/ticket/10141 zone = val.localZone(safelocaltime(val.timeTime())) parts = val.parts()[:-1] + (zone,) val = DateTime(*parts) break else: logger.warning("DateTimeField failed to format date " "string '%s' with '%s'" % (value, fmtstr)) return val
def __call__(self): """ Entry point of WorksheetPrintView. If context.portal_type is a Worksheet, then the PrintView is initialized to manage only that worksheet. If the context.portal_type is a WorksheetFolder and there are items selected in the request (items param), the PrintView will show the preview for all the selected Worksheets. By default, returns a HTML-encoded template, but if the request contains a param 'pdf' with value 1, will flush a pdf for the worksheet. """ if self.context.portal_type == 'Worksheet': self._worksheets = [self.context] elif self.context.portal_type == 'WorksheetFolder' \ and self.request.get('items', ''): uids = self.request.get('items').split(',') uc = getToolByName(self.context, 'uid_catalog') self._worksheets = [obj.getObject() for obj in uc(UID=uids)] else: # Warn and redirect to referer logger.warning('WorksheetPrintView: type not allowed: %s' % self.context.portal_type) self.destination_url = self.request.get_header("referer", self.context.absolute_url()) # Generate PDF? if self.request.form.get('pdf', '0') == '1': return self._flush_pdf() else: return self.template()
def get_workflow_actions(self): """ Compile a list of possible workflow transitions for items in this Table. """ # cbb return empty list if we are unable to select items if not self.show_select_column: return [] workflow = getToolByName(self.context, 'portal_workflow') # get all transitions for all items. transitions = {} actions = [] for obj in [i.get('obj', '') for i in self.items]: obj = hasattr(obj, 'getObject') and obj.getObject() or obj for it in workflow.getTransitionsFor(obj): transitions[it['id']] = it # the list is restricted to and ordered by these transitions. if 'transitions' in self.review_state: for transition_dict in self.review_state['transitions']: if transition_dict['id'] in transitions: actions.append(transitions[transition_dict['id']]) else: actions = transitions.values() new_actions = [] # remove any invalid items with a warning for a,action in enumerate(actions): if isinstance(action, dict) \ and 'id' in action: new_actions.append(action) else: logger.warning("bad action in custom_actions: %s. (complete list: %s)."%(action,actions)) # and these are removed if 'hide_transitions' in self.review_state: actions = [a for a in actions if a['id'] not in self.review_state['hide_transitions']] # cheat: until workflow_action is abolished, all URLs defined in # GS workflow setup will be ignored, and the default will apply. # (that means, WorkflowAction-bound URL is called). for i, action in enumerate(actions): actions[i]['url'] = '' # if there is a self.review_state['some_state']['custom_actions'] attribute # on the BikaListingView, add these actions to the list. if 'custom_actions' in self.review_state: for action in self.review_state['custom_actions']: if isinstance(action, dict) \ and 'id' in action: actions.append(action) for a,action in enumerate(actions): actions[a]['title'] = t(PMF(actions[a]['id'] + "_transition_title")) return actions
def csvDate2BikaDate(self, DateTime): #11/03/2014 14:46:46 --> %d/%m/%Y %H:%M %p try: dtobj = datetime.strptime(DateTime, "%a %b %d %H:%M:%S %Y") return dtobj.strftime("%Y%m%d %H:%M:%S") except ValueError: warn = "No date format known." logger.warning(warn) return DateTime
def csvDate2BikaDate(self,DateTime): #11/03/2014 14:46:46 --> %d/%m/%Y %H:%M %p try: dtobj = datetime.strptime(DateTime, "%a %b %d %H:%M:%S %Y") return dtobj.strftime("%Y%m%d %H:%M:%S") except ValueError: warn = "No date format known." logger.warning(warn) return DateTime
def isAttributeHidden(classname, fieldname): try: registry = queryUtility(IRegistry) hiddenattributes = registry.get('bika.lims.hiddenattributes', ()) if hiddenattributes is not None: for alist in hiddenattributes: if alist[0] == classname: return fieldname in alist[1:] except: logger.warning( 'Probem accessing optionally hidden attributes in registry') return False
def __call__(self): bc = getToolByName(self.context, 'bika_catalog') items = self.request.get('items', '') if items: self.items = [o.getObject() for o in bc(id=items.split(","))] else: self.items = [self.context,] new_items = [] for i in self.items: outitems = self._populateItems(i) new_items.extend(outitems) self.items = new_items if not self.items: logger.warning("Cannot print stickers: no items specified in request") self.request.response.redirect(self.context.absolute_url()) return return self.template()
def __call__(self): bc = getToolByName(self.context, 'bika_catalog') items = self.request.get('items', '') if items: self.items = [o.getObject() for o in bc(id=items.split(","))] else: self.items = [ self.context, ] new_items = [] for i in self.items: outitems = self._populateItems(i) new_items.extend(outitems) self.items = new_items if not self.items: logger.warning( "Cannot print stickers: no items specified in request") self.request.response.redirect(self.context.absolute_url()) return return self.template()
def _submit_arimport_p(self): """ load the profiles import layout """ ars = [] samples = [] valid_batch = False client = self.aq_parent contact_obj = None cc_contact_obj = None # validate contact for contact in client.objectValues('Contact'): if contact.getUsername() == self.getContactID(): contact_obj = contact if self.getCCContactID() == None: if contact_obj != None: break else: if contact.getUsername() == self.getCCContactID(): cc_contact_obj = contact if contact_obj != None: break if contact_obj == None: valid_batch = False # get Keyword to ServiceId Map services = {} service_uids = {} for service in self.bika_setup_catalog( portal_type = 'AnalysisService'): obj = service.getObject() keyword = obj.getKeyword() if keyword: services[keyword] = '%s:%s' % (obj.UID(), obj.getPrice()) service_uids[obj.UID()] = '%s:%s' % (obj.UID(), obj.getPrice()) samplepoints = self.bika_setup_catalog( portal_type = 'SamplePoint', Title = self.getSamplePoint()) if not samplepoints: valid_batch = False profiles = {} aritems = self.objectValues('ARImportItem') request = self.REQUEST title = 'Submitting AR Import' bar = ProgressBar( self, request, title, description='') event.notify(InitialiseProgressBar(bar)) row_count = 0 item_count = len(aritems) prefix = 'Sample' for aritem in aritems: # set up analyses ar_profile = None analyses = [] row_count += 1 for profilekey in aritem.getAnalysisProfile(): this_profile = None if not profiles.has_key(profilekey): profiles[profilekey] = [] # there is no profilekey index l_prox = self._findProfileKey(profilekey) if l_prox: profiles[profilekey] = \ [s.UID() for s in l_prox.getService()] this_profile = l_prox else: #TODO This will not find it!! # there is no profilekey index c_prox = self.bika_setup_catalog( portal_type = 'AnalysisProfile', getClientUID = client.UID(), getProfileKey = profilekey) if c_prox: obj = c_prox[0].getObject() profiles[profilekey] = \ [s.UID() for s in obj.getService()] this_profile = obj if ar_profile is None: ar_profile = obj else: ar_profile = None profile = profiles[profilekey] for analysis in profile: if not service_uids.has_key(analysis): service = tool.lookupObject(analysis) keyword = service.getKeyword() service_uids[obj.UID()] = '%s:%s' % (obj.UID(), obj.getPrice()) if keyword: services[keyword] = '%s:%s' % (obj.UID(), obj.getPrice()) if service_uids.has_key(analysis): if not service_uids[analysis] in analyses: analyses.append(service_uids[analysis]) else: valid_batch = False for analysis in aritem.getAnalyses(full_objects=True): if not services.has_key(analysis): for service in self.bika_setup_catalog( portal_type = 'AnalysisService', getKeyword = analysis): obj = service.getObject() services[analysis] = '%s:%s' % (obj.UID(), obj.getPrice()) service_uids[obj.UID()] = '%s:%s' % (obj.UID(), obj.getPrice()) if services.has_key(analysis): analyses.append(services[analysis]) else: valid_batch = False sampletypes = self.portal_catalog( portal_type = 'SampleType', sortable_title = aritem.getSampleType().lower(), ) if not sampletypes: valid_batch = False return sampletypeuid = sampletypes[0].getObject().UID() if aritem.getSampleDate(): date_items = aritem.getSampleDate().split('/') sample_date = DateTime( int(date_items[2]), int(date_items[0]), int(date_items[1])) else: sample_date = None sample_id = '%s-%s' % (prefix, tmpID()) sample = _createObjectByType("Sample", client, sample_id) sample.unmarkCreationFlag() sample.edit( SampleID = sample_id, ClientReference = aritem.getClientRef(), ClientSampleID = aritem.getClientSid(), SampleType = aritem.getSampleType(), DateSampled = sample_date, SamplingDate = sample_date, DateReceived = DateTime(), Remarks = aritem.getClientRemarks(), ) sample._renameAfterCreation() sample.setSamplePoint(self.getSamplePoint()) sample.setSampleID(sample.getId()) event.notify(ObjectInitializedEvent(sample)) sample.at_post_create_script() sample_uid = sample.UID() samples.append(sample_id) aritem.setSample(sample_uid) priorities = self.bika_setup_catalog( portal_type = 'ARPriority', sortable_title = aritem.Priority.lower(), ) if len(priorities) < 1: logger.warning( 'Invalid Priority: validation should have prevented this') priority = '' else: priority = priorities[0].getObject() ar_id = tmpID() ar = _createObjectByType("AnalysisRequest", client, ar_id) report_dry_matter = False ar.unmarkCreationFlag() ar.edit( RequestID = ar_id, Contact = self.getContact(), CCContact = self.getCCContact(), CCEmails = self.getCCEmailsInvoice(), ClientOrderNumber = self.getOrderID(), ReportDryMatter = report_dry_matter, Profile = ar_profile, Analyses = analyses, Remarks = aritem.getClientRemarks(), Priority = priority, ) ar.setSample(sample_uid) sample = ar.getSample() ar.setSampleType(sampletypeuid) ar_uid = ar.UID() aritem.setAnalysisRequest(ar_uid) ars.append(ar_id) ar._renameAfterCreation() progress_index = float(row_count)/float(item_count)*100.0 progress = ProgressState(request, progress_index) event.notify(UpdateProgressEvent(progress)) self._add_services_to_ar(ar, analyses) self.setDateApplied(DateTime()) self.reindexObject()
def _submit_arimport_c(self): """ load the classic import layout """ ars = [] samples = [] valid_batch = True client = self.aq_parent contact_obj = None cc_contact_obj = None # validate contact for contact in client.objectValues('Contact'): if contact.getUsername() == self.getContactID(): contact_obj = contact if self.getCCContactID() == None: if contact_obj != None: break else: if contact.getUsername() == self.getCCContactID(): cc_contact_obj = contact if contact_obj != None: break if contact_obj == None: valid_batch = False # get Keyword to ServiceId Map services = {} for service in self.bika_setup_catalog( portal_type = 'AnalysisService'): obj = service.getObject() keyword = obj.getKeyword() if keyword: services[keyword] = '%s:%s' % (obj.UID(), obj.getPrice()) samplepoints = self.bika_setup_catalog( portal_type = 'SamplePoint', Title = self.getSamplePoint()) if not samplepoints: valid_batch = False aritems = self.objectValues('ARImportItem') request = self.REQUEST title = 'Submitting AR Import' bar = ProgressBar( self, request, title, description='') event.notify(InitialiseProgressBar(bar)) SamplingWorkflowEnabled = \ self.bika_setup.getSamplingWorkflowEnabled() row_count = 0 item_count =len(aritems) prefix = 'Sample' for aritem in aritems: row_count += 1 # set up analyses analyses = [] for analysis in aritem.getAnalyses(full_objects=True): if services.has_key(analysis): analyses.append(services[analysis]) else: valid_batch = False sampletypes = self.portal_catalog( portal_type = 'SampleType', sortable_title = aritem.getSampleType().lower(), ) if not sampletypes: valid_batch = False return sampletypeuid = sampletypes[0].getObject().UID() if aritem.getSampleDate(): date_items = aritem.getSampleDate().split('/') sample_date = DateTime( int(date_items[2]), int(date_items[1]), int(date_items[0])) else: sample_date = None sample_id = '%s-%s' % (prefix, tmpID()) sample = _createObjectByType("Sample", client, sample_id) sample.unmarkCreationFlag() sample.edit( SampleID = sample_id, ClientReference = aritem.getClientRef(), ClientSampleID = aritem.getClientSid(), SampleType = aritem.getSampleType(), DateSampled = sample_date, SamplingDate = sample_date, DateReceived = DateTime(), ) sample._renameAfterCreation() #sp_id = client.invokeFactory('SamplePoint', id=tmpID()) #sp = client[sp_id] #sp.edit(title=self.getSamplePoint()) sample.setSamplePoint(self.getSamplePoint()) sample.setSampleID(sample.getId()) event.notify(ObjectInitializedEvent(sample)) sample.at_post_create_script() sample_uid = sample.UID() samples.append(sample_id) aritem.setSample(sample_uid) priorities = self.bika_setup_catalog( portal_type = 'ARPriority', sortable_title = aritem.Priority.lower(), ) if len(priorities) < 1: logger.warning( 'Invalid Priority: validation should have prevented this') #Create AR ar_id = tmpID() ar = _createObjectByType("AnalysisRequest", client, ar_id) if aritem.getReportDryMatter().lower() == 'y': report_dry_matter = True else: report_dry_matter = False ar.unmarkCreationFlag() ar.edit( RequestID = ar_id, Contact = self.getContact(), CCContact = self.getCCContact(), CCEmails = self.getCCEmailsInvoice(), ClientOrderNumber = self.getOrderID(), ReportDryMatter = report_dry_matter, Analyses = analyses, Priority = priorities[0].getObject(), ) ar.setSample(sample_uid) sample = ar.getSample() ar.setSampleType(sampletypeuid) ar_uid = ar.UID() aritem.setAnalysisRequest(ar_uid) ars.append(ar_id) ar._renameAfterCreation() self._add_services_to_ar(ar, analyses) progress_index = float(row_count)/float(item_count)*100.0 progress = ProgressState(request, progress_index) event.notify(UpdateProgressEvent(progress)) #TODO REmove for production - just to look pretty #time.sleep(1) self.setDateApplied(DateTime()) self.reindexObject()
def setupCatalogs(self, portal): # an item should belong to only one catalog. # that way looking it up means first looking up *the* catalog # in which it is indexed, as well as making it cheaper to index. def addIndex(cat, *args): try: cat.addIndex(*args) except: pass def addColumn(cat, col): try: cat.addColumn(col) except: pass # create lexicon wordSplitter = Empty() wordSplitter.group = 'Word Splitter' wordSplitter.name = 'Unicode Whitespace splitter' caseNormalizer = Empty() caseNormalizer.group = 'Case Normalizer' caseNormalizer.name = 'Unicode Case Normalizer' stopWords = Empty() stopWords.group = 'Stop Words' stopWords.name = 'Remove listed and single char words' elem = [wordSplitter, caseNormalizer, stopWords] zc_extras = Empty() zc_extras.index_type = 'Okapi BM25 Rank' zc_extras.lexicon_id = 'Lexicon' # bika_analysis_catalog bac = getToolByName(portal, 'bika_analysis_catalog', None) if bac == None: logger.warning('Could not find the bika_analysis_catalog tool.') return try: bac.manage_addProduct['ZCTextIndex'].manage_addLexicon( 'Lexicon', 'Lexicon', elem) except: logger.warning( 'Could not add ZCTextIndex to bika_analysis_catalog') pass at = getToolByName(portal, 'archetype_tool') at.setCatalogsByType('Analysis', ['bika_analysis_catalog']) at.setCatalogsByType('ReferenceAnalysis', ['bika_analysis_catalog']) at.setCatalogsByType('DuplicateAnalysis', ['bika_analysis_catalog']) addIndex(bac, 'path', 'ExtendedPathIndex', ('getPhysicalPath')) addIndex(bac, 'allowedRolesAndUsers', 'KeywordIndex') addIndex(bac, 'UID', 'FieldIndex') addIndex(bac, 'Title', 'FieldIndex') addIndex(bac, 'Description', 'ZCTextIndex', zc_extras) addIndex(bac, 'id', 'FieldIndex') addIndex(bac, 'Type', 'FieldIndex') addIndex(bac, 'portal_type', 'FieldIndex') addIndex(bac, 'created', 'DateIndex') addIndex(bac, 'Creator', 'FieldIndex') addIndex(bac, 'title', 'FieldIndex', 'Title') addIndex(bac, 'sortable_title', 'FieldIndex') addIndex(bac, 'description', 'FieldIndex', 'Description') addIndex(bac, 'review_state', 'FieldIndex') addIndex(bac, 'worksheetanalysis_review_state', 'FieldIndex') addIndex(bac, 'cancellation_state', 'FieldIndex') addIndex(bac, 'getDueDate', 'DateIndex') addIndex(bac, 'getDateSampled', 'DateIndex') addIndex(bac, 'getDateReceived', 'DateIndex') addIndex(bac, 'getResultCaptureDate', 'DateIndex') addIndex(bac, 'getDateAnalysisPublished', 'DateIndex') addIndex(bac, 'getClientUID', 'FieldIndex') addIndex(bac, 'getAnalyst', 'FieldIndex') addIndex(bac, 'getClientTitle', 'FieldIndex') addIndex(bac, 'getRequestID', 'FieldIndex') addIndex(bac, 'getClientOrderNumber', 'FieldIndex') addIndex(bac, 'getKeyword', 'FieldIndex') addIndex(bac, 'getServiceTitle', 'FieldIndex') addIndex(bac, 'getServiceUID', 'FieldIndex') addIndex(bac, 'getCategoryUID', 'FieldIndex') addIndex(bac, 'getCategoryTitle', 'FieldIndex') addIndex(bac, 'getPointOfCapture', 'FieldIndex') addIndex(bac, 'getDateReceived', 'DateIndex') addIndex(bac, 'getResultCaptureDate', 'DateIndex') addIndex(bac, 'getSampleTypeUID', 'FieldIndex') addIndex(bac, 'getSamplePointUID', 'FieldIndex') addIndex(bac, 'getRawSamplePoints', 'KeywordsIndex') addIndex(bac, 'getRawSampleTypes', 'KeywordIndex') addIndex(bac, 'getRetested', 'FieldIndex') addIndex(bac, 'getReferenceAnalysesGroupID', 'FieldIndex') addColumn(bac, 'path') addColumn(bac, 'UID') addColumn(bac, 'id') addColumn(bac, 'Type') addColumn(bac, 'portal_type') addColumn(bac, 'getObjPositionInParent') addColumn(bac, 'Title') addColumn(bac, 'Description') addColumn(bac, 'title') addColumn(bac, 'sortable_title') addColumn(bac, 'description') addColumn(bac, 'review_state') addColumn(bac, 'cancellation_state') addColumn(bac, 'getRequestID') addColumn(bac, 'getReferenceAnalysesGroupID') addColumn(bac, 'getResultCaptureDate') addColumn(bac, 'Priority') # bika_catalog bc = getToolByName(portal, 'bika_catalog', None) if bc == None: logger.warning('Could not find the bika_catalog tool.') return try: bc.manage_addProduct['ZCTextIndex'].manage_addLexicon( 'Lexicon', 'Lexicon', elem) except: logger.warning('Could not add ZCTextIndex to bika_catalog') pass at = getToolByName(portal, 'archetype_tool') at.setCatalogsByType('Batch', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('AnalysisRequest', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('Sample', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('SamplePartition', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('ReferenceSample', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('Report', [ 'bika_catalog', ]) at.setCatalogsByType('Worksheet', ['bika_catalog', 'portal_catalog']) addIndex(bc, 'path', 'ExtendedPathIndex', ('getPhysicalPath')) addIndex(bc, 'allowedRolesAndUsers', 'KeywordIndex') addIndex(bc, 'UID', 'FieldIndex') addIndex(bc, 'SearchableText', 'ZCTextIndex', zc_extras) addIndex(bc, 'Title', 'ZCTextIndex', zc_extras) addIndex(bc, 'Description', 'ZCTextIndex', zc_extras) addIndex(bc, 'id', 'FieldIndex') addIndex(bc, 'getId', 'FieldIndex') addIndex(bc, 'Type', 'FieldIndex') addIndex(bc, 'portal_type', 'FieldIndex') addIndex(bc, 'created', 'DateIndex') addIndex(bc, 'Creator', 'FieldIndex') addIndex(bc, 'getObjPositionInParent', 'GopipIndex') addIndex(bc, 'title', 'FieldIndex', 'Title') addIndex(bc, 'sortable_title', 'FieldIndex') addIndex(bc, 'description', 'FieldIndex', 'Description') addIndex(bc, 'review_state', 'FieldIndex') addIndex(bc, 'inactive_state', 'FieldIndex') addIndex(bc, 'worksheetanalysis_review_state', 'FieldIndex') addIndex(bc, 'cancellation_state', 'FieldIndex') addIndex(bc, 'getAnalysisCategory', 'KeywordIndex') addIndex(bc, 'getAnalysisService', 'KeywordIndex') addIndex(bc, 'getAnalyst', 'FieldIndex') addIndex(bc, 'getAnalysts', 'KeywordIndex') addIndex(bc, 'BatchDate', 'DateIndex') addIndex(bc, 'getClientOrderNumber', 'FieldIndex') addIndex(bc, 'getClientReference', 'FieldIndex') addIndex(bc, 'getClientSampleID', 'FieldIndex') addIndex(bc, 'getClientTitle', 'FieldIndex') addIndex(bc, 'getClientUID', 'FieldIndex') addIndex(bc, 'getContactTitle', 'FieldIndex') addIndex(bc, 'getDateDisposed', 'DateIndex') addIndex(bc, 'getDateExpired', 'DateIndex') addIndex(bc, 'getDateOpened', 'DateIndex') addIndex(bc, 'getDatePublished', 'DateIndex') addIndex(bc, 'getDateReceived', 'DateIndex') addIndex(bc, 'getDateSampled', 'DateIndex') addIndex(bc, 'getDisposalDate', 'DateIndex') addIndex(bc, 'getDueDate', 'DateIndex') addIndex(bc, 'getExpiryDate', 'DateIndex') addIndex(bc, 'getInvoiced', 'FieldIndex') addIndex(bc, 'getPreserver', 'FieldIndex') addIndex(bc, 'getProfilesTitle', 'FieldIndex') addIndex(bc, 'getReferenceDefinitionUID', 'FieldIndex') addIndex(bc, 'getRequestID', 'FieldIndex') addIndex(bc, 'getSampleID', 'FieldIndex') addIndex(bc, 'getSamplePointTitle', 'FieldIndex') addIndex(bc, 'getSamplePointUID', 'FieldIndex') addIndex(bc, 'getSampler', 'FieldIndex') addIndex(bc, 'getSampleTypeTitle', 'FieldIndex') addIndex(bc, 'getSampleTypeUID', 'FieldIndex') addIndex(bc, 'getSampleUID', 'FieldIndex') addIndex(bc, 'getSamplingDate', 'DateIndex') addIndex(bc, 'getServiceTitle', 'FieldIndex') addIndex(bc, 'getWorksheetTemplateTitle', 'FieldIndex') addIndex(bc, 'Priority', 'FieldIndex') addIndex(bc, 'BatchUID', 'FieldIndex') addColumn(bc, 'path') addColumn(bc, 'UID') addColumn(bc, 'id') addColumn(bc, 'Type') addColumn(bc, 'portal_type') addColumn(bc, 'creator') addColumn(bc, 'Created') addColumn(bc, 'Title') addColumn(bc, 'Description') addColumn(bc, 'sortable_title') addColumn(bc, 'review_state') addColumn(bc, 'inactive_state') addColumn(bc, 'cancellation_state') addColumn(bc, 'getAnalysts') addColumn(bc, 'getSampleID') addColumn(bc, 'getRequestID') addColumn(bc, 'getClientOrderNumber') addColumn(bc, 'getClientReference') addColumn(bc, 'getClientSampleID') addColumn(bc, 'getContactTitle') addColumn(bc, 'getClientTitle') addColumn(bc, 'getProfilesTitle') addColumn(bc, 'getSamplePointTitle') addColumn(bc, 'getSampleTypeTitle') addColumn(bc, 'getAnalysisCategory') addColumn(bc, 'getAnalysisService') addColumn(bc, 'getDatePublished') addColumn(bc, 'getDateReceived') addColumn(bc, 'getDateSampled') addColumn(bc, 'review_state') # bika_setup_catalog bsc = getToolByName(portal, 'bika_setup_catalog', None) if bsc == None: logger.warning('Could not find the setup catalog tool.') return try: bsc.manage_addProduct['ZCTextIndex'].manage_addLexicon( 'Lexicon', 'Lexicon', elem) except: logger.warning('Could not add ZCTextIndex to bika_setup_catalog') pass at = getToolByName(portal, 'archetype_tool') at.setCatalogsByType('Department', [ 'bika_setup_catalog', ]) at.setCatalogsByType('Container', [ 'bika_setup_catalog', ]) at.setCatalogsByType('ContainerType', [ 'bika_setup_catalog', ]) at.setCatalogsByType('AnalysisCategory', [ 'bika_setup_catalog', ]) at.setCatalogsByType('AnalysisService', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('AnalysisSpec', [ 'bika_setup_catalog', ]) at.setCatalogsByType('SampleCondition', ['bika_setup_catalog']) at.setCatalogsByType('SampleMatrix', [ 'bika_setup_catalog', ]) at.setCatalogsByType('SampleType', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SamplePoint', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('StorageLocation', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SamplingDeviation', [ 'bika_setup_catalog', ]) at.setCatalogsByType('Instrument', [ 'bika_setup_catalog', ]) at.setCatalogsByType('InstrumentType', [ 'bika_setup_catalog', ]) at.setCatalogsByType('Method', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Multifile', ['bika_setup_catalog']) at.setCatalogsByType('AttachmentType', [ 'bika_setup_catalog', ]) at.setCatalogsByType('Calculation', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('AnalysisProfile', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('ARTemplate', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('LabProduct', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('LabContact', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Manufacturer', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Preservation', [ 'bika_setup_catalog', ]) at.setCatalogsByType('ReferenceDefinition', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SRTemplate', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SubGroup', [ 'bika_setup_catalog', ]) at.setCatalogsByType('Supplier', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Unit', [ 'bika_setup_catalog', ]) at.setCatalogsByType('WorksheetTemplate', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('BatchLabel', [ 'bika_setup_catalog', ]) at.setCatalogsByType('ARPriority', [ 'bika_setup_catalog', ]) addIndex(bsc, 'path', 'ExtendedPathIndex', ('getPhysicalPath')) addIndex(bsc, 'allowedRolesAndUsers', 'KeywordIndex') addIndex(bsc, 'UID', 'FieldIndex') addIndex(bsc, 'SearchableText', 'ZCTextIndex', zc_extras) addIndex(bsc, 'Title', 'ZCTextIndex', zc_extras) addIndex(bsc, 'Description', 'ZCTextIndex', zc_extras) addIndex(bsc, 'id', 'FieldIndex') addIndex(bsc, 'getId', 'FieldIndex') addIndex(bsc, 'Type', 'FieldIndex') addIndex(bsc, 'portal_type', 'FieldIndex') addIndex(bsc, 'created', 'DateIndex') addIndex(bsc, 'Creator', 'FieldIndex') addIndex(bsc, 'getObjPositionInParent', 'GopipIndex') addIndex(bsc, 'title', 'FieldIndex', 'Title') addIndex(bsc, 'sortable_title', 'FieldIndex') addIndex(bsc, 'description', 'FieldIndex', 'Description') addIndex(bsc, 'review_state', 'FieldIndex') addIndex(bsc, 'inactive_state', 'FieldIndex') addIndex(bsc, 'cancellation_state', 'FieldIndex') addIndex(bsc, 'getAccredited', 'FieldIndex') addIndex(bsc, 'getAnalyst', 'FieldIndex') addIndex(bsc, 'getInstrumentType', 'FieldIndex') addIndex(bsc, 'getInstrumentTypeName', 'FieldIndex') addIndex(bsc, 'getBlank', 'FieldIndex') addIndex(bsc, 'getCalculationTitle', 'FieldIndex') addIndex(bsc, 'getCalculationUID', 'FieldIndex') addIndex(bsc, 'getCalibrationExpiryDate', 'FieldIndex') addIndex(bsc, 'getCategoryTitle', 'FieldIndex') addIndex(bsc, 'getCategoryUID', 'FieldIndex') addIndex(bsc, 'getClientUID', 'FieldIndex') addIndex(bsc, 'getDepartmentTitle', 'FieldIndex') addIndex(bsc, 'getDuplicateVariation', 'FieldIndex') addIndex(bsc, 'getFormula', 'FieldIndex') addIndex(bsc, 'getFullname', 'FieldIndex') addIndex(bsc, 'getHazardous', 'FieldIndex') addIndex(bsc, 'getInstrumentTitle', 'FieldIndex') addIndex(bsc, 'getKeyword', 'FieldIndex') addIndex(bsc, 'getManagerName', 'FieldIndex') addIndex(bsc, 'getManagerPhone', 'FieldIndex') addIndex(bsc, 'getManagerEmail', 'FieldIndex') addIndex(bsc, 'getMaxTimeAllowed', 'FieldIndex') addIndex(bsc, 'getModel', 'FieldIndex') addIndex(bsc, 'getName', 'FieldIndex') addIndex(bsc, 'getPointOfCapture', 'FieldIndex') addIndex(bsc, 'getPrice', 'FieldIndex') addIndex(bsc, 'getSamplePointTitle', 'KeywordIndex') addIndex(bsc, 'getSamplePointUID', 'FieldIndex') addIndex(bsc, 'getSampleTypeTitle', 'KeywordIndex') addIndex(bsc, 'getSampleTypeUID', 'FieldIndex') addIndex(bsc, 'getServiceTitle', 'FieldIndex') addIndex(bsc, 'getServiceUID', 'FieldIndex') addIndex(bsc, 'getTotalPrice', 'FieldIndex') addIndex(bsc, 'getUnit', 'FieldIndex') addIndex(bsc, 'getVATAmount', 'FieldIndex') addIndex(bsc, 'getVolume', 'FieldIndex') addIndex(bsc, 'sortKey', 'FieldIndex') addIndex(bsc, 'getMethodID', 'FieldIndex') addIndex(bsc, 'getDocumentID', 'FieldIndex') addColumn(bsc, 'path') addColumn(bsc, 'UID') addColumn(bsc, 'id') addColumn(bsc, 'getId') addColumn(bsc, 'Type') addColumn(bsc, 'portal_type') addColumn(bsc, 'getObjPositionInParent') addColumn(bsc, 'Title') addColumn(bsc, 'Description') addColumn(bsc, 'title') addColumn(bsc, 'sortable_title') addColumn(bsc, 'description') addColumn(bsc, 'review_state') addColumn(bsc, 'inactive_state') addColumn(bsc, 'cancellation_state') addColumn(bsc, 'getAccredited') addColumn(bsc, 'getInstrumentType') addColumn(bsc, 'getInstrumentTypeName') addColumn(bsc, 'getBlank') addColumn(bsc, 'getCalculationTitle') addColumn(bsc, 'getCalculationUID') addColumn(bsc, 'getCalibrationExpiryDate') addColumn(bsc, 'getCategoryTitle') addColumn(bsc, 'getCategoryUID') addColumn(bsc, 'getClientUID') addColumn(bsc, 'getDepartmentTitle') addColumn(bsc, 'getDuplicateVariation') addColumn(bsc, 'getFormula') addColumn(bsc, 'getFullname') addColumn(bsc, 'getHazardous') addColumn(bsc, 'getInstrumentTitle') addColumn(bsc, 'getKeyword') addColumn(bsc, 'getManagerName') addColumn(bsc, 'getManagerPhone') addColumn(bsc, 'getManagerEmail') addColumn(bsc, 'getMaxTimeAllowed') addColumn(bsc, 'getModel') addColumn(bsc, 'getName') addColumn(bsc, 'getPointOfCapture') addColumn(bsc, 'getPrice') addColumn(bsc, 'getSamplePointTitle') addColumn(bsc, 'getSamplePointUID') addColumn(bsc, 'getSampleTypeTitle') addColumn(bsc, 'getSampleTypeUID') addColumn(bsc, 'getServiceTitle') addColumn(bsc, 'getServiceUID') addColumn(bsc, 'getTotalPrice') addColumn(bsc, 'getUnit') addColumn(bsc, 'getVATAmount') addColumn(bsc, 'getVolume')
def setupCatalogs(self, portal): # an item should belong to only one catalog. # that way looking it up means first looking up *the* catalog # in which it is indexed, as well as making it cheaper to index. def addIndex(cat, *args): try: cat.addIndex(*args) except: pass def addColumn(cat, col): try: cat.addColumn(col) except: pass # create lexicon wordSplitter = Empty() wordSplitter.group = 'Word Splitter' wordSplitter.name = 'Unicode Whitespace splitter' caseNormalizer = Empty() caseNormalizer.group = 'Case Normalizer' caseNormalizer.name = 'Unicode Case Normalizer' stopWords = Empty() stopWords.group = 'Stop Words' stopWords.name = 'Remove listed and single char words' elem = [wordSplitter, caseNormalizer, stopWords] zc_extras = Empty() zc_extras.index_type = 'Okapi BM25 Rank' zc_extras.lexicon_id = 'Lexicon' # bika_analysis_catalog bac = getToolByName(portal, 'bika_analysis_catalog', None) if bac == None: logger.warning('Could not find the bika_analysis_catalog tool.') return try: bac.manage_addProduct['ZCTextIndex'].manage_addLexicon('Lexicon', 'Lexicon', elem) except: logger.warning('Could not add ZCTextIndex to bika_analysis_catalog') pass at = getToolByName(portal, 'archetype_tool') at.setCatalogsByType('Analysis', ['bika_analysis_catalog']) at.setCatalogsByType('ReferenceAnalysis', ['bika_analysis_catalog']) at.setCatalogsByType('DuplicateAnalysis', ['bika_analysis_catalog']) addIndex(bac, 'path', 'ExtendedPathIndex', ('getPhysicalPath')) addIndex(bac, 'allowedRolesAndUsers', 'KeywordIndex') addIndex(bac, 'UID', 'FieldIndex') addIndex(bac, 'Title', 'FieldIndex') addIndex(bac, 'Description', 'ZCTextIndex', zc_extras) addIndex(bac, 'id', 'FieldIndex') addIndex(bac, 'Type', 'FieldIndex') addIndex(bac, 'portal_type', 'FieldIndex') addIndex(bac, 'created', 'DateIndex') addIndex(bac, 'Creator', 'FieldIndex') addIndex(bac, 'title', 'FieldIndex', 'Title') addIndex(bac, 'sortable_title', 'FieldIndex') addIndex(bac, 'description', 'FieldIndex', 'Description') addIndex(bac, 'review_state', 'FieldIndex') addIndex(bac, 'worksheetanalysis_review_state', 'FieldIndex') addIndex(bac, 'cancellation_state', 'FieldIndex') addIndex(bac, 'getDueDate', 'DateIndex') addIndex(bac, 'getDateSampled', 'DateIndex') addIndex(bac, 'getDateReceived', 'DateIndex') addIndex(bac, 'getResultCaptureDate', 'DateIndex') addIndex(bac, 'getDateAnalysisPublished', 'DateIndex') addIndex(bac, 'getClientUID', 'FieldIndex') addIndex(bac, 'getAnalyst', 'FieldIndex') addIndex(bac, 'getClientTitle', 'FieldIndex') addIndex(bac, 'getRequestID', 'FieldIndex') addIndex(bac, 'getClientOrderNumber', 'FieldIndex') addIndex(bac, 'getKeyword', 'FieldIndex') addIndex(bac, 'getServiceTitle', 'FieldIndex') addIndex(bac, 'getServiceUID', 'FieldIndex') addIndex(bac, 'getCategoryUID', 'FieldIndex') addIndex(bac, 'getCategoryTitle', 'FieldIndex') addIndex(bac, 'getPointOfCapture', 'FieldIndex') addIndex(bac, 'getDateReceived', 'DateIndex') addIndex(bac, 'getResultCaptureDate', 'DateIndex') addIndex(bac, 'getSampleTypeUID', 'FieldIndex') addIndex(bac, 'getSamplePointUID', 'FieldIndex') addIndex(bac, 'getRawSamplePoints', 'KeywordsIndex') addIndex(bac, 'getRawSampleTypes', 'KeywordIndex') addIndex(bac, 'getRetested', 'FieldIndex') addIndex(bac, 'getReferenceAnalysesGroupID', 'FieldIndex') addColumn(bac, 'path') addColumn(bac, 'UID') addColumn(bac, 'id') addColumn(bac, 'Type') addColumn(bac, 'portal_type') addColumn(bac, 'getObjPositionInParent') addColumn(bac, 'Title') addColumn(bac, 'Description') addColumn(bac, 'title') addColumn(bac, 'sortable_title') addColumn(bac, 'description') addColumn(bac, 'review_state') addColumn(bac, 'cancellation_state') addColumn(bac, 'getRequestID') addColumn(bac, 'getReferenceAnalysesGroupID') addColumn(bac, 'getResultCaptureDate') addColumn(bac, 'Priority') # bika_catalog bc = getToolByName(portal, 'bika_catalog', None) if bc == None: logger.warning('Could not find the bika_catalog tool.') return try: bc.manage_addProduct['ZCTextIndex'].manage_addLexicon('Lexicon', 'Lexicon', elem) except: logger.warning('Could not add ZCTextIndex to bika_catalog') pass at = getToolByName(portal, 'archetype_tool') at.setCatalogsByType('Batch', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('AnalysisRequest', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('Sample', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('SamplePartition', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('ReferenceSample', ['bika_catalog', 'portal_catalog']) at.setCatalogsByType('Report', ['bika_catalog', ]) at.setCatalogsByType('Worksheet', ['bika_catalog', 'portal_catalog']) addIndex(bc, 'path', 'ExtendedPathIndex', ('getPhysicalPath')) addIndex(bc, 'allowedRolesAndUsers', 'KeywordIndex') addIndex(bc, 'UID', 'FieldIndex') addIndex(bc, 'SearchableText', 'ZCTextIndex', zc_extras) addIndex(bc, 'Title', 'ZCTextIndex', zc_extras) addIndex(bc, 'Description', 'ZCTextIndex', zc_extras) addIndex(bc, 'id', 'FieldIndex') addIndex(bc, 'getId', 'FieldIndex') addIndex(bc, 'Type', 'FieldIndex') addIndex(bc, 'portal_type', 'FieldIndex') addIndex(bc, 'created', 'DateIndex') addIndex(bc, 'Creator', 'FieldIndex') addIndex(bc, 'getObjPositionInParent', 'GopipIndex') addIndex(bc, 'title', 'FieldIndex', 'Title') addIndex(bc, 'sortable_title', 'FieldIndex') addIndex(bc, 'description', 'FieldIndex', 'Description') addIndex(bc, 'review_state', 'FieldIndex') addIndex(bc, 'inactive_state', 'FieldIndex') addIndex(bc, 'worksheetanalysis_review_state', 'FieldIndex') addIndex(bc, 'cancellation_state', 'FieldIndex') addIndex(bc, 'getAnalysisCategory', 'KeywordIndex') addIndex(bc, 'getAnalysisService', 'KeywordIndex') addIndex(bc, 'getAnalyst', 'FieldIndex') addIndex(bc, 'getAnalysts', 'KeywordIndex') addIndex(bc, 'BatchDate', 'DateIndex') addIndex(bc, 'getClientOrderNumber', 'FieldIndex') addIndex(bc, 'getClientReference', 'FieldIndex') addIndex(bc, 'getClientSampleID', 'FieldIndex') addIndex(bc, 'getClientTitle', 'FieldIndex') addIndex(bc, 'getClientUID', 'FieldIndex') addIndex(bc, 'getContactTitle', 'FieldIndex') addIndex(bc, 'getDateDisposed', 'DateIndex') addIndex(bc, 'getDateExpired', 'DateIndex') addIndex(bc, 'getDateOpened', 'DateIndex') addIndex(bc, 'getDatePublished', 'DateIndex') addIndex(bc, 'getDateReceived', 'DateIndex') addIndex(bc, 'getDateSampled', 'DateIndex') addIndex(bc, 'getDisposalDate', 'DateIndex') addIndex(bc, 'getDueDate', 'DateIndex') addIndex(bc, 'getExpiryDate', 'DateIndex') addIndex(bc, 'getInvoiced', 'FieldIndex') addIndex(bc, 'getPreserver', 'FieldIndex') addIndex(bc, 'getProfilesTitle', 'FieldIndex') addIndex(bc, 'getReferenceDefinitionUID', 'FieldIndex') addIndex(bc, 'getRequestID', 'FieldIndex') addIndex(bc, 'getSampleID', 'FieldIndex') addIndex(bc, 'getSamplePointTitle', 'FieldIndex') addIndex(bc, 'getSamplePointUID', 'FieldIndex') addIndex(bc, 'getSampler', 'FieldIndex') addIndex(bc, 'getSampleTypeTitle', 'FieldIndex') addIndex(bc, 'getSampleTypeUID', 'FieldIndex') addIndex(bc, 'getSampleUID', 'FieldIndex') addIndex(bc, 'getSamplingDate', 'DateIndex') addIndex(bc, 'getServiceTitle', 'FieldIndex') addIndex(bc, 'getWorksheetTemplateTitle', 'FieldIndex') addIndex(bc, 'Priority', 'FieldIndex') addIndex(bc, 'BatchUID', 'FieldIndex') addColumn(bc, 'path') addColumn(bc, 'UID') addColumn(bc, 'id') addColumn(bc, 'Type') addColumn(bc, 'portal_type') addColumn(bc, 'creator') addColumn(bc, 'Created') addColumn(bc, 'Title') addColumn(bc, 'Description') addColumn(bc, 'sortable_title') addColumn(bc, 'review_state') addColumn(bc, 'inactive_state') addColumn(bc, 'cancellation_state') addColumn(bc, 'getAnalysts') addColumn(bc, 'getSampleID') addColumn(bc, 'getRequestID') addColumn(bc, 'getClientOrderNumber') addColumn(bc, 'getClientReference') addColumn(bc, 'getClientSampleID') addColumn(bc, 'getContactTitle') addColumn(bc, 'getClientTitle') addColumn(bc, 'getProfilesTitle') addColumn(bc, 'getSamplePointTitle') addColumn(bc, 'getSampleTypeTitle') addColumn(bc, 'getAnalysisCategory') addColumn(bc, 'getAnalysisService') addColumn(bc, 'getDatePublished') addColumn(bc, 'getDateReceived') addColumn(bc, 'getDateSampled') addColumn(bc, 'review_state') # bika_setup_catalog bsc = getToolByName(portal, 'bika_setup_catalog', None) if bsc == None: logger.warning('Could not find the setup catalog tool.') return try: bsc.manage_addProduct['ZCTextIndex'].manage_addLexicon('Lexicon', 'Lexicon', elem) except: logger.warning('Could not add ZCTextIndex to bika_setup_catalog') pass at = getToolByName(portal, 'archetype_tool') at.setCatalogsByType('Department', ['bika_setup_catalog', ]) at.setCatalogsByType('Container', ['bika_setup_catalog', ]) at.setCatalogsByType('ContainerType', ['bika_setup_catalog', ]) at.setCatalogsByType('AnalysisCategory', ['bika_setup_catalog', ]) at.setCatalogsByType('AnalysisService', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('AnalysisSpec', ['bika_setup_catalog', ]) at.setCatalogsByType('SampleCondition', ['bika_setup_catalog']) at.setCatalogsByType('SampleMatrix', ['bika_setup_catalog', ]) at.setCatalogsByType('SampleType', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SamplePoint', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('StorageLocation', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SamplingDeviation', ['bika_setup_catalog', ]) at.setCatalogsByType('Instrument', ['bika_setup_catalog', ]) at.setCatalogsByType('InstrumentType', ['bika_setup_catalog', ]) at.setCatalogsByType('Method', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Multifile', ['bika_setup_catalog']) at.setCatalogsByType('AttachmentType', ['bika_setup_catalog', ]) at.setCatalogsByType('Calculation', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('AnalysisProfile', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('ARTemplate', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('LabProduct', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('LabContact', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Manufacturer', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Preservation', ['bika_setup_catalog', ]) at.setCatalogsByType('ReferenceDefinition', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SRTemplate', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('SubGroup', ['bika_setup_catalog', ]) at.setCatalogsByType('Supplier', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('Unit', ['bika_setup_catalog', ]) at.setCatalogsByType('WorksheetTemplate', ['bika_setup_catalog', 'portal_catalog']) at.setCatalogsByType('BatchLabel', ['bika_setup_catalog', ]) at.setCatalogsByType('ARPriority', ['bika_setup_catalog', ]) addIndex(bsc, 'path', 'ExtendedPathIndex', ('getPhysicalPath')) addIndex(bsc, 'allowedRolesAndUsers', 'KeywordIndex') addIndex(bsc, 'UID', 'FieldIndex') addIndex(bsc, 'SearchableText', 'ZCTextIndex', zc_extras) addIndex(bsc, 'Title', 'ZCTextIndex', zc_extras) addIndex(bsc, 'Description', 'ZCTextIndex', zc_extras) addIndex(bsc, 'id', 'FieldIndex') addIndex(bsc, 'getId', 'FieldIndex') addIndex(bsc, 'Type', 'FieldIndex') addIndex(bsc, 'portal_type', 'FieldIndex') addIndex(bsc, 'created', 'DateIndex') addIndex(bsc, 'Creator', 'FieldIndex') addIndex(bsc, 'getObjPositionInParent', 'GopipIndex') addIndex(bsc, 'title', 'FieldIndex', 'Title') addIndex(bsc, 'sortable_title', 'FieldIndex') addIndex(bsc, 'description', 'FieldIndex', 'Description') addIndex(bsc, 'review_state', 'FieldIndex') addIndex(bsc, 'inactive_state', 'FieldIndex') addIndex(bsc, 'cancellation_state', 'FieldIndex') addIndex(bsc, 'getAccredited', 'FieldIndex') addIndex(bsc, 'getAnalyst', 'FieldIndex') addIndex(bsc, 'getInstrumentType', 'FieldIndex') addIndex(bsc, 'getInstrumentTypeName', 'FieldIndex') addIndex(bsc, 'getBlank', 'FieldIndex') addIndex(bsc, 'getCalculationTitle', 'FieldIndex') addIndex(bsc, 'getCalculationUID', 'FieldIndex') addIndex(bsc, 'getCalibrationExpiryDate', 'FieldIndex') addIndex(bsc, 'getCategoryTitle', 'FieldIndex') addIndex(bsc, 'getCategoryUID', 'FieldIndex') addIndex(bsc, 'getClientUID', 'FieldIndex') addIndex(bsc, 'getDepartmentTitle', 'FieldIndex') addIndex(bsc, 'getDuplicateVariation', 'FieldIndex') addIndex(bsc, 'getFormula', 'FieldIndex') addIndex(bsc, 'getFullname', 'FieldIndex') addIndex(bsc, 'getHazardous', 'FieldIndex') addIndex(bsc, 'getInstrumentTitle', 'FieldIndex') addIndex(bsc, 'getKeyword', 'FieldIndex') addIndex(bsc, 'getManagerName', 'FieldIndex') addIndex(bsc, 'getManagerPhone', 'FieldIndex') addIndex(bsc, 'getManagerEmail', 'FieldIndex') addIndex(bsc, 'getMaxTimeAllowed', 'FieldIndex') addIndex(bsc, 'getModel', 'FieldIndex') addIndex(bsc, 'getName', 'FieldIndex') addIndex(bsc, 'getPointOfCapture', 'FieldIndex') addIndex(bsc, 'getPrice', 'FieldIndex') addIndex(bsc, 'getSamplePointTitle', 'KeywordIndex') addIndex(bsc, 'getSamplePointUID', 'FieldIndex') addIndex(bsc, 'getSampleTypeTitle', 'KeywordIndex') addIndex(bsc, 'getSampleTypeUID', 'FieldIndex') addIndex(bsc, 'getServiceTitle', 'FieldIndex') addIndex(bsc, 'getServiceUID', 'FieldIndex') addIndex(bsc, 'getTotalPrice', 'FieldIndex') addIndex(bsc, 'getUnit', 'FieldIndex') addIndex(bsc, 'getVATAmount', 'FieldIndex') addIndex(bsc, 'getVolume', 'FieldIndex') addIndex(bsc, 'sortKey', 'FieldIndex') addIndex(bsc, 'getMethodID', 'FieldIndex') addIndex(bsc, 'getDocumentID', 'FieldIndex') addColumn(bsc, 'path') addColumn(bsc, 'UID') addColumn(bsc, 'id') addColumn(bsc, 'getId') addColumn(bsc, 'Type') addColumn(bsc, 'portal_type') addColumn(bsc, 'getObjPositionInParent') addColumn(bsc, 'Title') addColumn(bsc, 'Description') addColumn(bsc, 'title') addColumn(bsc, 'sortable_title') addColumn(bsc, 'description') addColumn(bsc, 'review_state') addColumn(bsc, 'inactive_state') addColumn(bsc, 'cancellation_state') addColumn(bsc, 'getAccredited') addColumn(bsc, 'getInstrumentType') addColumn(bsc, 'getInstrumentTypeName') addColumn(bsc, 'getBlank') addColumn(bsc, 'getCalculationTitle') addColumn(bsc, 'getCalculationUID') addColumn(bsc, 'getCalibrationExpiryDate') addColumn(bsc, 'getCategoryTitle') addColumn(bsc, 'getCategoryUID') addColumn(bsc, 'getClientUID') addColumn(bsc, 'getDepartmentTitle') addColumn(bsc, 'getDuplicateVariation') addColumn(bsc, 'getFormula') addColumn(bsc, 'getFullname') addColumn(bsc, 'getHazardous') addColumn(bsc, 'getInstrumentTitle') addColumn(bsc, 'getKeyword') addColumn(bsc, 'getManagerName') addColumn(bsc, 'getManagerPhone') addColumn(bsc, 'getManagerEmail') addColumn(bsc, 'getMaxTimeAllowed') addColumn(bsc, 'getModel') addColumn(bsc, 'getName') addColumn(bsc, 'getPointOfCapture') addColumn(bsc, 'getPrice') addColumn(bsc, 'getSamplePointTitle') addColumn(bsc, 'getSamplePointUID') addColumn(bsc, 'getSampleTypeTitle') addColumn(bsc, 'getSampleTypeUID') addColumn(bsc, 'getServiceTitle') addColumn(bsc, 'getServiceUID') addColumn(bsc, 'getTotalPrice') addColumn(bsc, 'getUnit') addColumn(bsc, 'getVATAmount') addColumn(bsc, 'getVolume')