Filenet中操作CE的Operation基础
By:Roy.LiuLast updated:2011-09-16
其实FILENET 中已经有了CE_Operations,已经有了很多方法,但还是想自己来实现,所以写了个方法类似的东西,实现其中一个方法而已,好玩的。
public void changeFolderPorperty(String objectstore,String casefolderid,String property,String propertyValue) throws VWException, PropertyNotFoundException{
logger.info("GpsOperations:changeFolderProperty>:Begin to Modify CaseFolderID:"+casefolderid+",property:"+
property+",value:"+propertyValue);
objectstore = WcmEncodingUtil.decodeLabel(objectstore);
if (objectstore == null || objectstore.equalsIgnoreCase("")) {
logger.info("the objectstore be a valid value.");
throw new VWException("GpsOperations:changeFolderProperty:",
"Invalid argument specified; the Id must be a valid value.");
}
if (casefolderid == null || casefolderid.equalsIgnoreCase("")) {
logger.info("the casefolderid must be a valid value.");
throw new VWException("GpsOperations:changeFolderProperty",
"Invalid argument specified; the Id must be a valid value.");
}
if (casefolderid.indexOf("{") == -1) {
casefolderid = "{" + casefolderid;
}
if (casefolderid.indexOf("}") == -1) {
casefolderid = casefolderid + "}";
}
ObjectStore os = ObjectFactory.getObjectStore(objectstore, ceSession);
GettableObject go =os.getObject(BaseObject.TYPE_FOLDER, casefolderid);
logger.info("Get type:"+go.getClass());
logger.info("Get type:"+go.getName());
logger.info("Get type:"+go.getObjectStoreId());
if (!(go instanceof Folder)) {
logger.info("casefolderid must be a valid value");
throw new VWException("GpsOperations:changeFolderProperty",
"Invalid argument specified; the sourceDocId must be a valid value");
}
Folder casefolder=(Folder)go;
Properties props = ObjectFactory.getProperties();
Property prop = ObjectFactory.getProperty(property);
prop.setValue(propertyValue);
props.add(prop);
casefolder.setProperties(props);
logger.info("GpsOperations:changeFolderProperty>:Modify CaseFolderID:"+casefolderid+",property:"+
property+",value:"+propertyValue+"success.");
}
public void changeFolderPorperty(String objectstore,String casefolderid,String property,String propertyValue) throws VWException, PropertyNotFoundException{
logger.info("GpsOperations:changeFolderProperty>:Begin to Modify CaseFolderID:"+casefolderid+",property:"+
property+",value:"+propertyValue);
objectstore = WcmEncodingUtil.decodeLabel(objectstore);
if (objectstore == null || objectstore.equalsIgnoreCase("")) {
logger.info("the objectstore be a valid value.");
throw new VWException("GpsOperations:changeFolderProperty:",
"Invalid argument specified; the Id must be a valid value.");
}
if (casefolderid == null || casefolderid.equalsIgnoreCase("")) {
logger.info("the casefolderid must be a valid value.");
throw new VWException("GpsOperations:changeFolderProperty",
"Invalid argument specified; the Id must be a valid value.");
}
if (casefolderid.indexOf("{") == -1) {
casefolderid = "{" + casefolderid;
}
if (casefolderid.indexOf("}") == -1) {
casefolderid = casefolderid + "}";
}
ObjectStore os = ObjectFactory.getObjectStore(objectstore, ceSession);
GettableObject go =os.getObject(BaseObject.TYPE_FOLDER, casefolderid);
logger.info("Get type:"+go.getClass());
logger.info("Get type:"+go.getName());
logger.info("Get type:"+go.getObjectStoreId());
if (!(go instanceof Folder)) {
logger.info("casefolderid must be a valid value");
throw new VWException("GpsOperations:changeFolderProperty",
"Invalid argument specified; the sourceDocId must be a valid value");
}
Folder casefolder=(Folder)go;
Properties props = ObjectFactory.getProperties();
Property prop = ObjectFactory.getProperty(property);
prop.setValue(propertyValue);
props.add(prop);
casefolder.setProperties(props);
logger.info("GpsOperations:changeFolderProperty>:Modify CaseFolderID:"+casefolderid+",property:"+
property+",value:"+propertyValue+"success.");
}
From:一号门
Previous:转一个SPRING MVC 学习的入门资料
Next:曾经
COMMENTS