- Open Component Wizard : <domain _home>/ucm/cs/bin/ComponentWizard
a. Name the component "AutoNumberPrefix-ContentID-Filter"
b. Click on OK.
package project1;
import intradoc.common.ExecutionContext;
import intradoc.common.ServiceException;
import intradoc.common.SystemUtils;
import intradoc.data.DataBinder;
import intradoc.data.DataException;
import intradoc.data.Workspace;
import intradoc.shared.FilterImplementor;
public class CustomFilter implements FilterImplementor {
public int doFilter(Workspace ws, DataBinder binder, ExecutionContext ctx) throws
DataException, ServiceException {
// obtain the dDocType
String type = binder.getLocal("dDocType");
String dDocName = binder.getLocal("dDocName");
SystemUtils.info("dDocName:" + dDocName);
// if it exists (which it always should) set the autonumber prefix to that value
SystemUtils.info("type:" + type);
if (type != null) {
SystemUtils.info("inside if");
binder.putLocal("AutoNumberPrefix", type + "_");
SystemUtils.info("AutoNumberPrefix:" +
binder.getLocal("AutoNumberPrefix"));
}
// filter executed correctly, return CONTINUE
return FilterImplementor.CONTINUE;
}
}
4. Create folder structure inside your custom component location & put Java , class files to appropriate locations :
<domain_home>/ucm/cs/custom/AutoNumberPrefix-Content-ID-Filter/src/project1/CustomFilter.java
<domain_home>/ucm/cs/custom/AutoNumberPrefix-Content-ID-Filter/classes/project1/CustomFilter.class
5. Now open your AutoNumberPrefix-ContentID-Filter.hda and make following entries
7. Open Component Wizard enable your component and restart content server
8. Now check in new document without giving content ID , you can see the Content ID is auto generated based on document type.
copied from samples....
ReplyDeleteThanks Wriju for your comment.
DeleteFor more details you should refer these expert blog:
http://bexhuff.com/topic/technology/oracle-stellent
and for detail on auto number prefix please refer
http://bexhuff.com/2011/03/howto-component-samples-for-oracle-ucm-11g