This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Configuring the OC AutoNumber Event
Natalie Reiman edited this page Aug 8, 2018
·
2 revisions
Add the following AutoNumber bean to your project-bean-config.xml.
<bean id="AutoNumber" class="com.tsgrp.opencontent.core.event.events.AutoNumberEvent" init-method="init">
<property name="ocPolicyComponent" ref="ocPolicyComponent" />
<property name="priority" value="1" />
<property name="enabled" value="true" />
<property name="eventType" value="BEFORE_CREATE" />
<property name="eventFilters">
<list value-type="com.tsgrp.opencontent.core.event.OCEventFilter">
<ref bean="objectTypeDoc" />
</list>
</property>
<property name="autoNumberFormat" value="${app_department~deptLabelMap}-${objectType~docTypeMap}-${AutoNumber}" />
</bean>
Note: The autoNumberFormat is used to name the new object being uploaded.
- You can change the values of the tokens and the String they are separated by.
- Each token value must be a valid property found on the new file's OCO, and the separator String must be the same b/w each token.
- Optionally, you can include a lookup map if you want to replace the value that comes back from a property. Other Examples:
<property name="autoNumberFormat" value="${objectName}-${departmentName}-${mimeType}-${AutoNumber}" />
<property name="autoNumberFormat" value="${objectName} and ${objectType} and ${AutoNumber}" />
<property name="autoNumberFormat" value="${objectName~objNameMap}_${objectType}_${AutoNumber}" />
Add an entry to the ProjectPicklists bean for each lookup map you included in the autoNumberFormat.
<entry key="deptLabelMap" value="Government Administration,GA;Information Technology,IT;Human Resource,HR;Safety,SA;Environmental,EN;Internal Audit,IA;Ethics & Compliance,EC" />
<entry key="docTypeMap" value="Claims Document,CLD;Controlled Document,COD;Policy,PO" />
Add an objectTypeFilter bean to your project-bean-config.xml. This bean determines the object types that will not be auto numbered.
<bean id="objectTypeDoc" class="com.tsgrp.opencontent.core.event.filters.ObjectTypeFilter">
<property name="invert" value="true" />
<property name="objectTypes">
<list value-type="java.lang.String">
<value>Document</value>
<value>AutoNumber</value>
</list>
</property>
</bean>
Type
- Label: AutoNumber
- ocName: AutoNumber
Properties
- Label: Number
- ocName: Number
- Data Type: integer
- Include the Name and Number properties from your new AutoNumber OTC.
- Set up the action
createContentlessObject
to use your new Auto Number Form. - Create the new contentless object. Set the name value to be something easy like "Num", and set the number value to be 1.
- The new docs file names should include the tokens and the auto number.
OpenContent (OC) © 2016 Technology Services Group