ogre.dms.util.client
Class FlowClient

java.lang.Object
  extended by ogre.dms.util.client.FlowClient

public class FlowClient
extends Object

Title: Flowring Docpedia Project

Description:

       User can get afMap from Flow Globals ,
ex:
var dataMap = Server.getGlobals(MyTask.getRootID()); //============================= afMap.put("ReqKey", reqKey); afMap.put("DMSServerIP", env.getServerIP()); afMap.put("DMSServerPort", env.getServerPortInString()); afMap.put("Type", type); public final static String APPROVE_TYPE_CHECKIN = "ApCkIn"; public final static String APPROVE_TYPE_PUBLISH = "ApPub"; public final static String APPROVE_TYPE_DELETE = "ApDel"; public final static String APPROVE_TYPE_CANCEL = "ApCan"; if (type is cancel ) afMap.put("OriginalRequest", request);

Version:
1.0 $Id: FlowClient.java,v 1.1.1.1.2.19.2.11 2010/07/15 02:11:27 karo Exp $
Author:
Docpedia team.

Constructor Summary
FlowClient(String dmsIP, String dmsPort)
          Create a FlowClient Object to let flow engine communicate with DMS.
 
Method Summary
 void approveCheckIn(String reqKey, String status, boolean whitSubDoc, boolean autoPublish, String checkinMode)
          Call this function when the process of check-in document is finished.
 void approveCheckIn(String reqKey, String status, boolean whitSubDoc, boolean autoPublish, String checkinMode, HashMap map)
          Call this function when the process of check-in document is finished.
 void approveObsolete(String reqKey, boolean approveResult, HashMap map)
          Obsolete Document
 void cancelApprove(String reqKey)
          Call this function when the process is cancelled.
 void cancelApprove(String reqKey, HashMap map)
          Call this function when the process is cancelled.
 void copyAttFileInfoToDMS(String fileInfoString, String reqKey, boolean removeOld)
          Copy attfileInfo of eform to DMS.
 String copyFileToFlow(VirtualDocument vd, pe.pase.Task MyTask)
          Copy physical files of the Virtual Documentall to Flow server and return attfileInfo String.
 String copyFileToFlow(VirtualDocument vd, pe.pase.Task MyTask, String subArtInsID)
          Copy sub Document(ISO Level 4 Doc)attFile to sub ArtInstance.
 void copyTaskAttFileInfoToDMS(String TaskAttachedFileList, String reqKey, boolean removeOld)
           
 String coverDateString(Long longDate)
          Transform millisecond into yyyy/mm/DD String
 void disconnectServer()
          Disconnect DMS connection.
protected  void finalize()
           
 void finishApprove(String reqKey, boolean result)
          Call this function when the process of creating document is finished.
 void finishApprove(String reqKey, boolean result, boolean withSubDoc)
          Call this function when the process of creating document is finished.
 void finishApprove(String reqKey, boolean result, boolean withSubDoc, boolean autoPublish)
          Call this function when the process of creating document is finished.
 void finishApprove(String reqKey, boolean result, boolean withSubDoc, boolean autoPublish, HashMap map)
          Call this function when the process of creating document is finished.
 void finishApprove(String reqKey, boolean result, boolean withSubDoc, HashMap map)
          Call this function when the process of creating document is finished.
 void finishApprove(String reqKey, boolean result, HashMap map)
          Call this function when the process of creating document is finished.
static FlowClient FlowClientInstance(String dmsIP, String dmsPort)
           
 void forceObsoleteDocument(String applyerMemberID, String docKey)
          Obsolete Document Deprecated.
 Vector getACL(String subject)
          get document ACL by Document Key or get folder ACL by Folder ID
 AttributeType getAttributeType(String typeID)
          Get AttributeType Object from DMS
 Vector getAttributeTypeFullPath(String attrTypeID)
          Get full path of attribute type
 Vector getAuthorityRecordItemByDocKey(String docKey)
          Get AuthorityRecordItem by Document Key
 String getCategoryString(VirtualDocument vd)
          Get CategoryList String of Virtual Document
 Vector getCoSignMemberList(String docKey)
          Get countersign record by Document Key
 String getCreationDate(VirtualDocument vd)
          Get CreationDate of Virtual Document
 Vector getDefaultACL(String folderID)
          get default ACL of folder
 Vector getDefaultVirtualDocumentACL(VirtualDocument vd)
          get Default Document ACL.
 DMCI getDMCI()
          Retrieve the DMCI instance that can get any Service which you need.
 String getDocBelongToDeptManagerByDocKeyVec(String docKeys)
          getFolderManagersByDocKeyVec V3.0
 String getExpiryDate(VirtualDocument vd)
          Get ExpiryDate of Virtual Document
 Vector getExtUserList()
          get all External Users.
 Vector getExtUserListByGroup(String groupID)
          Get all External Users by groupID.
 Vector getFolderFullPath(String subject)
          Get full path of folder from leaf to root by DocKey, FolderID or AttributeID.
 String getFolderManagersByDocKeyVec(String docKeys)
          getFolderManagersByDocKeyVec V3.0
 String getKeywordString(VirtualDocument vd)
          Get Keyword of Virtual Document
 String getParentVerDocKey(String docKey)
          Get Document Key of the last version.
 Vector getPDACL(String docKey)
          get physical document ACL by Document Key
 String getPlanPublishDate(VirtualDocument vd)
          Get PlanPublishDate of Virtual Document
 Vector getRelationRecordList(String docKey)
          Get Relation Record List by Document Key of source document
 Vector getRelationRecordList(String docKey, String type)
          Get Relation Record List by Document Key of source document and document type of target document.
 VirtualDocument getUpToDateDocument(String docID)
          Get up-to-date Virtual Document by DocumentID
 VirtualDocument getVirtualDocument(String reqKey)
          get the VirtualDocumet related to the request ID or DocKey Example: var dataMap = Server.getGlobals(MyTask.getRootID()); var reqKey = dataMap.get("ReqKey"); dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort")); var vd = dmsFlowClient.getVirtualDocument(reqKey);
 VirtualFolder getVirtualFolder(String folderID)
          get the VirtualFolder related to the request ID or folderID
 void insertAuthorityRecord(AuthorityRecordItem auRecItem)
          insert Authority Record to DMS
 void insertAuthorityRecord(HashMap hm)
          insert Authority Record to DMS Deprecated.
 void newCoSignMember(CoSignMember csMember)
          Bring CounterSign Record to DMS.
 void newCoSignMember(HashMap map)
          Bring CounterSign Record to DMS.
 void newDistributionMember(DistributionMember disMember)
          Bring Distribution Member to DMS Example: var dataMap = Server.getGlobals(MyTask.getRootID()); var reqKey = dataMap.get("ReqKey"); var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort")); var disMem = new Packages.ogre.dms.data.DistributionMember; disMem.setMemberID(memID); disMem.setDocKey(docKey); dmsFlowClient.newDistributionMember(disMem);
 void newDistributionMember(HashMap map)
          Bring Distribution Member to DMS Deprecated.
 void newNotifyMember(HashMap map)
          Bring Ntification Member to DMS Deprecated.
 void newNotifyMember(NotifyMember noMember)
          Bring Ntification Member to DMS Example: var dataMap = Server.getGlobals(MyTask.getRootID()); var reqKey = dataMap.get("ReqKey"); var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap .get("DMSServerPort")); var notifyMemMap = new java.util.HashMap(); notifyMemMap.put("MemberID", memID); notifyMemMap.put("DocKey", docKey); dmsFlowClient.newDistributionMember(notifyMemMap);
 String newPublishVD(String loginID, String docName, String docDescription, String[] keyWord, String[] category, String folderKey, String attributeTypeID, String fileInfoString)
          Create a Virtual Document and publish it
 void newSignRecord(HashMap map)
          Bring Sign Record to DMS, let users can see SignRecord when they click the Approving Record Tag of index card in DMS.
 void newSignRecord(SignRecord signRec)
          Bring Sign Record to DMS, let users can see SignRecord when they click the Approving Record Tag of index card in DMS.
 String newVD(String loginID, String docName, String docDescription, String[] keyWord, String[] category, String folderKey, String attributeTypeID, String fileInfoString)
          Create a new Virtual Document and put it in the workspace of assigned user
 DMSResult publishVD(String loginID, String docKey, String folderKey)
          Publish a Virtual Document to a assigned folder
 boolean removeAuthorDefaultACL(VirtualDocument vd)
          remove Author default ACL of dockeyID
 boolean removeDocumentPD(String docID)
          Remove all physical files of virtual document
 DMSResult setACL(String userID, String subject, Vector aciVec)
          update ACL of Virtual Document or Folder
 DMSResult setACL(String subject, Vector aciVec)
          update ACL of Virtual Document or Folder
 DMSResult setDefaultACL(String folderID, Vector aciVec)
          set default ACL of folder
 DMSResult setPDACL(String subject, Vector aciVec)
          set physical document ACL by Document Key or Folder ID
 DMSResult updateDefaultACL(DMSUser user, String docKey, String folderKey)
          copy folder ACL to document ACL
 void updateVDtoDMS(HashMap map, String reqKey, boolean removeOld)
          Update Virtual Document to DMS.
 void updateVDtoDMS(VirtualDocument vd, String reqKey, boolean removeOld)
          Update Virtual Document to DMS.
 boolean uploadFileToDMS(String filePath, String fileName, String reqKey)
          Upload a file into Virtual Document
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowClient

public FlowClient(String dmsIP,
                  String dmsPort)
Create a FlowClient Object to let flow engine communicate with DMS.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub, ApCkIn and ApObsolete
   var dmsFlowClient 
             = new Packages.ogre.dms.util.client.FlowClient(
                   dataMap.get("DMSServerIP"), 
                   dataMap.get("DMSServerPort")
               );
 

Parameters:
dmsIP - String
dmsPort - String
See Also:
getDMCI()
Method Detail

FlowClientInstance

public static FlowClient FlowClientInstance(String dmsIP,
                                            String dmsPort)

getDMCI

public DMCI getDMCI()
Retrieve the DMCI instance that can get any Service which you need.

Returns:
DMCI

disconnectServer

public void disconnectServer()
Disconnect DMS connection.


finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

finishApprove

public void finishApprove(String reqKey,
                          boolean result)
Call this function when the process of creating document is finished. DMS will determine to pubish the document or not by approving result.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   if (requestType.equals("ApPub")) {//when a user create a document the requestType will be set as "ApPub"
       dmsFlowClient.finishApprove(reqKey, true);
   }

Parameters:
reqKey - String request key
result - boolean approving result, true means Agree, false means Reject

finishApprove

public void finishApprove(String reqKey,
                          boolean result,
                          HashMap map)
Call this function when the process of creating document is finished. DMS will determine to pubish the document or not by approving result. This method can let DMS do aprroving statistics according to the time map

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap.get("DMSServerPort"));
   var cTime = new java.util.Date();
   var endTime = cTime.getTime().toString();//use current time as end time because finishApprove function is usually used in last node of the process
   var totalProcessTime = //count the total process time yourself. you can use current time to minus process startTime
   var timeMap = new java.util.HashMap();
   timeMap.put("endTime", endTime);
   timeMap.put("processTime", totalProcessTime);
   if (requestType.equals("ApPub")) {//when a user create a document the requestType will be set as "ApPub"
       dmsFlowClient.finishApprove(reqKey, true, timeMap);
   }
 

Parameters:
reqKey - String request key
result - boolean approving result, true means Agree, false means Reject
map - HashMap this map contains endTime and processTime

finishApprove

public void finishApprove(String reqKey,
                          boolean result,
                          boolean withSubDoc)
Call this function when the process of creating document is finished. DMS will determine to pubish the document or not by approving result. This method can control whether DMS publish subDoc (ISO Level 4 Doc) together with parent document or not.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap.get("DMSServerPort"));
   if (requestType.equals("ApPub")){//when a user create a document the requestType will be set as "ApPub"
       dmsFlowClient.finishApprove(reqKey, true, true);
   }
 

Parameters:
reqKey - String request key
result - boolean approving result, true means Agree, false means Reject
withSubDoc - boolean publish subDoc(ISO Level 4 Doc) together with parent document

finishApprove

public void finishApprove(String reqKey,
                          boolean result,
                          boolean withSubDoc,
                          HashMap map)
Call this function when the process of creating document is finished. DMS will determine to pubish the document or not by approving result. This method can control whether DMS publish subDoc (ISO Level 4 Doc) together with parent document or not. This method can let DMS do aprroving statistics according to the time map.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var cTime = new java.util.Date();
   var endTime = cTime.getTime().toString();//use current time as end time because finishApprove function is usually used in last node of the process
   var totalProcessTime = //count the total process time yourself. you can use current time to minus process startTime
   var timeMap = new java.util.HashMap();
   timeMap.put("endTime", endTime);
   timeMap.put("processTime", totalProcessTime);
   if (requestType.equals("ApPub")){//when a user create a document the requestType will be set as "ApPub"
       dmsFlowClient.finishApprove(reqKey, true, true, timeMap);
   }
 

Parameters:
reqKey - String request key
result - boolean approving result, true means Agree, false means Reject
withSubDoc - boolean publish subDoc(ISO Level 4 Doc) together with parent document
map - HashMap this map contains endTime and processTime

finishApprove

public void finishApprove(String reqKey,
                          boolean result,
                          boolean withSubDoc,
                          boolean autoPublish)
Call this function when the process of creating document is finished. DMS will determine to pubish the document or not by approving result. This method can control whether let DMS to publish subDoc (ISO Level 4 Doc) together with parent document or not. This method can also control whether let DMS to get publish Folder By VD AttributeType mapping automatically or not.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));     *
   if (requestType.equals("ApPub")){//when a user create a document the requestType will be set as "ApPub"
       dmsFlowClient.finishApprove(reqKey, true, true, true, timeMap);
   }
 

Parameters:
reqKey - String request key
result - boolean approving result, true means Agree, false means Reject
withSubDoc - boolean publish subDoc(ISO Level 4 Doc) together with parent document
autoPublish - boolean get publish Folder By VD AttributeType mapping automatically

finishApprove

public void finishApprove(String reqKey,
                          boolean result,
                          boolean withSubDoc,
                          boolean autoPublish,
                          HashMap map)
Call this function when the process of creating document is finished. DMS will determine to pubish the document or not by approving result. This method can control whether let DMS to publish subDoc (ISO Level 4 Doc) together with parent document or not. This method can also control whether let DMS to get publish Folder By VD AttributeType mapping automatically or not This method can let DMS do aprroving statistics according to the time map.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var cTime = new java.util.Date();
   var endTime = cTime.getTime().toString();//use current time as end time because finishApprove function is usually used in last node of the process
   var totalProcessTime = //count the total process time yourself. you can use current time to minus process startTime
   var timeMap = new java.util.HashMap();
   timeMap.put("endTime", endTime);
   timeMap.put("processTime", totalProcessTime);
   if (requestType.equals("ApPub")){//when a user create a document the requestType will be set as "ApPub"
       dmsFlowClient.finishApprove(reqKey, true, true, true, timeMap);
   }
 

Parameters:
reqKey - String request key
result - boolean approving result, true means Agree, false means Reject
withSubDoc - boolean publish subDoc(ISO Level 4 Doc) together with parent document
autoPublish - boolean get publish Folder By VD AttributeType mapping automatically
map - HashMap this map contains endTime and processTime

approveCheckIn

public void approveCheckIn(String reqKey,
                           String status,
                           boolean whitSubDoc,
                           boolean autoPublish,
                           String checkinMode)
Call this function when the process of check-in document is finished. DMS will determine to pubish the document or not by approving result. This method can control whether let DMS to publish subDoc(ISO Level 4 Doc) together with parent document or not. This method can also control whether let DMS to get publish Folder By VD AttributeType mapping automatically or not

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   if(requestType.equals("ApCkIn")){
        dmsFlowClient.approveCheckIn(reqKey, "Accept", true, true, "REVISION")
   }
 

Parameters:
reqKey - String request key
status - String approving result, "Accept" or "Reject"
whitSubDoc - boolean publish subDoc(ISO Level 4 Doc) together with parent document
autoPublish - boolean get publish Folder By VD AttributeType mapping automatically
checkinMode - String revise vision or just edit, "REVISION" or "EDIT"

approveCheckIn

public void approveCheckIn(String reqKey,
                           String status,
                           boolean whitSubDoc,
                           boolean autoPublish,
                           String checkinMode,
                           HashMap map)
Call this function when the process of check-in document is finished. DMS will determine to pubish the document or not by approving result. This method can control whether let DMS to publish subDoc(ISO Level 4 Doc) together with parent document or not. This method can also control whether let DMS to get publish Folder By VD AttributeType mapping automatically or not This method can let DMS do aprroving statistics according to the time map

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var cTime = new java.util.Date();
   var endTime = cTime.getTime().toString();//use current time as end time because approveCheckIn function is usually used in last node of the process
   var totalProcessTime = //count the total process time yourself. you can use current time to minus process startTime
   var timeMap = new java.util.HashMap();
   timeMap.put("endTime", endTime);
   timeMap.put("processTime", totalProcessTime);
   if (requestType.equals("ApCkIn")) {
       dmsFlowClient.approveCheckIn(reqKey, "Accept", true, true, "REVISION", timeMap)
   }
 

Parameters:
reqKey - String request key
status - String approving result, "Accept" or "Reject"
whitSubDoc - boolean publish subDoc(ISO Level 4 Doc) together with parent document
autoPublish - boolean get publish Folder By VD AttributeType mapping automatically
checkinMode - String revise vision or just edit, "REVISION" or "EDIT"
map - HashMap this map contains endTime and processTime

cancelApprove

public void cancelApprove(String reqKey)
Call this function when the process is cancelled.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   dmsFlowClient.cancelApprove(reqKey);
 

Parameters:
reqKey - String

cancelApprove

public void cancelApprove(String reqKey,
                          HashMap map)
Call this function when the process is cancelled. This method can let DMS do aprroving statistics according to the time map

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var cTime = new java.util.Date();
   var endTime = cTime.getTime().toString();//use current time as end time because cancelApprove function is usually used in the end of process
   var totalProcessTime = //count the total process time yourself. you can use current time to minus process startTime
   var timeMap = new java.util.HashMap();
   timeMap.put("endTime", endTime);
   timeMap.put("processTime", totalProcessTime);
   dmsFlowClient.cancelApprove(reqKey, timeMap);
 

Parameters:
reqKey - String

forceObsoleteDocument

public void forceObsoleteDocument(String applyerMemberID,
                                  String docKey)
Obsolete Document Deprecated.

Parameters:
applyerMemberID - String applyer memberID
docKey - String

approveObsolete

public void approveObsolete(String reqKey,
                            boolean approveResult,
                            HashMap map)
Obsolete Document

Parameters:
reqKey - String
approveResult - boolean
map - HashMap

getVirtualDocument

public VirtualDocument getVirtualDocument(String reqKey)
get the VirtualDocumet related to the request ID or DocKey

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var vd = dmsFlowClient.getVirtualDocument(reqKey);
 

Parameters:
ID - requestID
Returns:
VirtualDocument

getVirtualFolder

public VirtualFolder getVirtualFolder(String folderID)
get the VirtualFolder related to the request ID or folderID

Parameters:
ID - folderID
Returns:
VirtualFolder

removeDocumentPD

public boolean removeDocumentPD(String docID)
Remove all physical files of virtual document

Parameters:
docID - String
Returns:
boolean

uploadFileToDMS

public boolean uploadFileToDMS(String filePath,
                               String fileName,
                               String reqKey)
Upload a file into Virtual Document

Parameters:
filePath - String
fileName - String
reqKey - String VirtualDocument ID
Returns:
boolean

copyAttFileInfoToDMS

public void copyAttFileInfoToDMS(String fileInfoString,
                                 String reqKey,
                                 boolean removeOld)
Copy attfileInfo of eform to DMS.

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var attInfo = artIns.getAppValue("attInfo");//attached file component of artInstance
 dmsFlowClient.copyAttFileInfoToDMS(attInfo, reqKey, true);
 

Parameters:
fileInfoString - String AttfileInfoString from artIns
reqKey - requestID or DocumentKey
removeOld - boolean is need clear pd List of target vd

copyTaskAttFileInfoToDMS

public void copyTaskAttFileInfoToDMS(String TaskAttachedFileList,
                                     String reqKey,
                                     boolean removeOld)

updateVDtoDMS

public void updateVDtoDMS(HashMap map,
                          String reqKey,
                          boolean removeOld)
Update Virtual Document to DMS. Deprecated.

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var hm = new java.util.HashMap();
 hm.put("DocumentName", docName);
 hm.put("DocSecurityLevel", level);
 hm.put("ExpiryDate", expiryDate);
 hm.put("AttributeTypeID", attrTypeID);
 hm.put("VersionID", docVersion);
 hm.put("Description", description);
 dmsFlowClient.updateVDtoDMS(hm, reqKey, true);
 
   all keys of hm:
   DocumentKey //This is generated by the system and the system will not allow you to change it!
   DocumentName
   DocumentType
   Status
   ParentFolderID
   LastUpdateDate
   UnitType
   DocumentID //This is generated by the system and the system will not allow you to change it!
   VersionID
   UpToDate
   AuthorID
   AuthorName
   Description
   CreationDate
   ExpiryDate
   ActualPublishDate
   PlanPublishDate
   PublishFolderID
   ExtraFeatures
   RelatedDocuments
   RefDocumentTemplateID
   BelongToDept
   AuthorDept
   DocSecurityLevel
   DocLevel
   DocCategory
   AttributeTypeID
   Paperless
   Att1 ˜ Att35
 

Parameters:
map - HashMap
reqKey - String
removeOld - boolean remove original physical files or not

updateVDtoDMS

public void updateVDtoDMS(VirtualDocument vd,
                          String reqKey,
                          boolean removeOld)
Update Virtual Document to DMS.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var dmsServerIP = dataMap.get("DMSServerIP");
   var dmsServerPort = dataMap.get("DMSServerPort"); 
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dmsServerIP, dmsServerPort);
     
   var vd = dmsFlowClient.getVirtualDocument(reqKey);
   vd.setDocumentName(docName);
   vd.setDescription(description);
   vd.setExpiryDate(expiryDate);
     
   dmsFlowClient.updateVDtoDMS(vd, reqKey, true);
 

Parameters:
vd - VirtualDocument
reqKey - String
removeOld - boolean remove original physical files or not

newSignRecord

public void newSignRecord(HashMap map)
Bring Sign Record to DMS, let users can see SignRecord when they click the Approving Record Tag of index card in DMS. Deprecated. Call this function when the approver approved.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var signRecMap = new java.util.HashMap();
   signRecMap.put("RoleName", roleName); //the role name of the approver
   signRecMap.put("MemberName", name); //the name of the approver
   signRecMap.put("MemberID", memID); //the member ID of the approver
   signRecMap.put("DepName", dep); //the department name of the approver
   signRecMap.put("SignTime", date); //when the approver signed. type of date is String and use the format which you want to present(ex:2005-06-08 16:50:00)
   signRecMap.put("ProcessTime", duration); //how much time the approver spent
   signRecMap.put("Phase", processName); //the node name
   signRecMap.put("Result", isYesString); //result of approving
   signRecMap.put("Comment", managerReason); //approver's comment
   signRecMap.put("DocumentKey", docKey); //Document Key of the Virtual Document
   signRecMap.put("ReqType", requestType); //Request Type
   signRecMap.put("RootTaskID", rootTaskID); //Root Task ID
   signRecMap.put("StartTime", startTime.toString()); //the start time of this node. type is String, but the format is millisecond
   signRecMap.put("EndTime", new java.util.Date().getTime().toString());//the end time of this node. type is String, but the format is millisecond
   signRecMap.put("TaskID", MyTask.getID()); //the Task ID of this node
   dmsFlowClient.newSignRecord(signRecMap);
 

Parameters:
map - HashMap

newSignRecord

public void newSignRecord(SignRecord signRec)
Bring Sign Record to DMS, let users can see SignRecord when they click the Approving Record Tag of index card in DMS. Call this function when the approver approved.

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var signRec = new Packages.ogre.dms.data.SignRecord();
 signRec.setRoleName(roleName); //the role name of the approver
 signRec.setMemberName(name); //the name of the approver
 signRec.setMemberID(memID); //the member ID of the approver
 signRec.setDepName(dep); //the department name of the approver
 signRec.setSignTime(date); //when the approver signed. type of date is String and use the format which you want to present(ex:2005-06-08 16:50:00)
 signRec.setProcessTime(duration); //how much time the approver spent
 signRec.setPhase(processName); //the node name
 signRec.setResult(isYesString); //result of approving
 signRec.setComment(managerReason); //approver's comment
 signRec.setDocumentKey(docKey); //Document Key of the Virtual Document
 signRec.setReqType(requestType); //Request Type
 signRec.setRootTaskID(rootTaskID); //Root Task ID
 signRec.setStartTime(startTime.toString()); //the start time of this node. type is String, but the format is millisecond
 signRec.setEndTime(new java.util.Date().getTime().toString());//the end time of this node. type is String, but the format is millisecond
 signRec.setTaskID(MyTask.getID()); //the Task ID of this node
 dmsFlowClient.newSignRecord(signRec);
 

Parameters:
signRec - SignRecord

newCoSignMember

public void newCoSignMember(HashMap map)
Bring CounterSign Record to DMS. This is used for approving statistic in DMS Deprecated.

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var csignMemMap = new java.util.HashMap();
 csignMemMap.put("MemberID", memID); //the memberID of countersigner
 csignMemMap.put("DocKey", docKey); //Document Key
 csignMemMap.put("DocID", docID); //Document ID
 csignMemMap.put("ProcessTime", processTime); //how much time the countersigner spent
 csignMemMap.put("TaskID", coSignRootTaskID); //Root Task ID of CoSign Process
 csignMemMap.put("RootTaskID", rootTaskID); //Root Task ID of parent process
 csignMemMap.put("DepID", depID); //the department ID of countersigner
 csignMemMap.put("StartTime", startTime); //the start time of this node. type is String, but the format is millisecond
 csignMemMap.put("EndTime", endTime); //the end time of this node. type is String, but the format is millisecond
 dmsFlowClient.newCoSignMember(csignMemMap);
 

Parameters:
map - HashMap

newCoSignMember

public void newCoSignMember(CoSignMember csMember)
Bring CounterSign Record to DMS. This is used for approving statistic in DMS

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var csignMem = new Packages.ogre.dms.data.CoSignMember();
 csignMem.setMemberID(memID); //the memberID of countersigner
 csignMem.setDocKey(docKey); //Document Key
 csignMem.setDocID(docID); //Document ID
 csignMem.setProcessTime(processTime); //how much time the countersigner spent
 csignMem.setTaskID(coSignRootTaskID); //Root Task ID of CoSign Process
 csignMem.setRootTaskID(rootTaskID); //Root Task ID of parent process
 csignMem.setDepID(depID); //the department ID of countersigner
 csignMem.setStartTime(startTime); //the start time of this node. type is String, but the format is millisecond
 csignMem.setEndTime(endTime); //the end time of this node. type is String, but the format is millisecond
 dmsFlowClient.newCoSignMember(csignMem);
 

Parameters:
csMember - CoSignMember

newDistributionMember

public void newDistributionMember(HashMap map)
Bring Distribution Member to DMS Deprecated.

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var disMemMap = new java.util.HashMap();
 disMemMap.put("MemberID", memID);
 disMemMap.put("DocKey", docKey);
 dmsFlowClient.newDistributionMember(disMemMap);
 

Parameters:
map - HashMap

newDistributionMember

public void newDistributionMember(DistributionMember disMember)
Bring Distribution Member to DMS

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var disMem = new Packages.ogre.dms.data.DistributionMember;
   disMem.setMemberID(memID);
   disMem.setDocKey(docKey);
   dmsFlowClient.newDistributionMember(disMem);
 

Parameters:
disMember - DistributionMember

newNotifyMember

public void newNotifyMember(HashMap map)
Bring Ntification Member to DMS Deprecated.

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var notifyMemMap = new java.util.HashMap();
 notifyMemMap.put("MemberID", memID);
 notifyMemMap.put("DocKey", docKey);
 dmsFlowClient.newDistributionMember(notifyMemMap);
 

Parameters:
map - HashMap

newNotifyMember

public void newNotifyMember(NotifyMember noMember)
Bring Ntification Member to DMS

Example:

 var dataMap = Server.getGlobals(MyTask.getRootID());
 var reqKey = dataMap.get("ReqKey");
 var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"), dataMap
         .get("DMSServerPort"));
 var notifyMemMap = new java.util.HashMap();
 notifyMemMap.put("MemberID", memID);
 notifyMemMap.put("DocKey", docKey);
 dmsFlowClient.newDistributionMember(notifyMemMap);
 

Parameters:
map - HashMap

insertAuthorityRecord

public void insertAuthorityRecord(HashMap hm)
insert Authority Record to DMS Deprecated.

Parameters:
hm - HashMap

insertAuthorityRecord

public void insertAuthorityRecord(AuthorityRecordItem auRecItem)
insert Authority Record to DMS

Parameters:
auRecItem - AuthorityRecordItem

getAuthorityRecordItemByDocKey

public Vector getAuthorityRecordItemByDocKey(String docKey)
Get AuthorityRecordItem by Document Key

Parameters:
docKey - String
Returns:
Vector contains AuthorityRecordItem objects

getCoSignMemberList

public Vector getCoSignMemberList(String docKey)
Get countersign record by Document Key

Parameters:
docKey - String
Returns:
Vector contains CoSignMember objects

getAttributeType

public AttributeType getAttributeType(String typeID)
Get AttributeType Object from DMS

Parameters:
typeID - String
Returns:
AttributeType

getAttributeTypeFullPath

public Vector getAttributeTypeFullPath(String attrTypeID)
Get full path of attribute type

Parameters:
attrTypeID - String
Returns:
Vector

copyFileToFlow

public String copyFileToFlow(VirtualDocument vd,
                             pe.pase.Task MyTask)
Copy physical files of the Virtual Documentall to Flow server and return attfileInfo String.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var vd = dmsFlowClient.getVirtualDocument(reqKey);
   var attFileInfo = dmsFlowClient.copyFileToFlow(vd, MyTask);
   
   var artIns = MyTask.getArtInstance();
   artIns.setAppValue("attInfo", attFileInfo);//attInfo is the name of attachefile component in eform
 

Parameters:
vd - VirtualDocument
MyTask - Task
Returns:
String AttachFileInfo

copyFileToFlow

public String copyFileToFlow(VirtualDocument vd,
                             pe.pase.Task MyTask,
                             String subArtInsID)
Copy sub Document(ISO Level 4 Doc)attFile to sub ArtInstance.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var reqKey = dataMap.get("ReqKey");
   var dmsFlowClient = new Packages.ogre.dms.util.client.FlowClient(dataMap.get("DMSServerIP"),dataMap.get("DMSServerPort"));
   var level4RelationRecord = dmsFlowClient.getRelationRecordList(docKey, "iso4");
   for (var i = 0, j = level4RelationRecord.size(); i < j; i++) {
       var relRec = fourthLevelDoc.get(i); //RelationRecord object
       var targetID = relRec.getTargetID(); //iso level 4 documentID
       var vd = dmsFlowClient.getUpToDateDocument(reqKey);
       var artInsL4 = Server.createArtInstance("ART00041110425406235"); //create artInstance for level 4 eform
       var artInsID = artInsL4.getID();
       var attFileInfo = dmsFlowClient.copyFileToFlow(vd, MyTask, artInsID);
       artInsL4.setAppValue("attInfo", attFileInfo);//attInfo is the name of attached file component in eform
   }
 

Parameters:
vd - VirtualDocument sub Document VD
MyTask - Task root Process Task
subArtInsID - String sub Document create Form ArtInstanceID
Returns:
String attfileInfo

getParentVerDocKey

public String getParentVerDocKey(String docKey)
Get Document Key of the last version.

Example:

   var dataMap = Server.getGlobals(MyTask.getRootID());
   var requestType = dataMap.get("Type");//requestType has three types in common use: ApPub,ApCkIn and ApObsolete
   var reqKey = dataMap.get("ReqKey");
   var dmsFlowClient 
         = new Packages.ogre.dms.util.client.FlowClient(
                 dataMap.get("DMSServerIP"), 
                 dataMap.get("DMSServerPort")
           );
   var vd = dmsFlowClient.getVirtualDocument(reqKey);
   var docKey = vd.getDocumentKey();
   //last version is existent is always in check-in and obsolete status
   if ("ApCkIn".equals(requestType) || "ApObsolete".equals(requestType)) {
       var parentDocKey = dmsFlowClient.getParentVerDocKey(docKey);
   }
 

Parameters:
docKey - String
Returns:
String

getRelationRecordList

public Vector getRelationRecordList(String docKey)
Get Relation Record List by Document Key of source document

Parameters:
docKey - String
Returns:
Vector this vector contains RelationRecord objects

getRelationRecordList

public Vector getRelationRecordList(String docKey,
                                    String type)
Get Relation Record List by Document Key of source document and document type of target document.

Example:

   var docKey = vd.getDocumentKey(); //Document Key of source document
   var rrVec = dmsFlowClient. getRelationRecordList (docKey , "iso4");
   for (var i = 0, j = rrVec.size(); i < j; i++) {
       var docName = rrVec.get(i).getRelationName(); //Document Name of target document
       var docType = rrVec.get(i).getRelationType(); //iso4 or normal
       var sourceKey = rrVec.get(i).getSourceKey(); //Document Key of source document
       var targetKey = rrVec.get(i).getTargetKey(); //Document Key of target document
       var createDate = rrVec.get(i).getCreateDate(); //created date
   }
 

Parameters:
docKey - String
type - String "iso4" or "normal"
Returns:
Vector this vector contains RelationRecord objects

getUpToDateDocument

public VirtualDocument getUpToDateDocument(String docID)
Get up-to-date Virtual Document by DocumentID

Parameters:
docID - String
Returns:
VirtualDocument

getCategoryString

public String getCategoryString(VirtualDocument vd)
Get CategoryList String of Virtual Document

Parameters:
vd - VirtualDocument
Returns:
String categoryString

getKeywordString

public String getKeywordString(VirtualDocument vd)
Get Keyword of Virtual Document

Parameters:
vd - VirtualDocument
Returns:
String

getExpiryDate

public String getExpiryDate(VirtualDocument vd)
Get ExpiryDate of Virtual Document

Parameters:
vd - VirtualDocument
Returns:
String

getCreationDate

public String getCreationDate(VirtualDocument vd)
Get CreationDate of Virtual Document

Parameters:
vd - VirtualDocument
Returns:
String

getPlanPublishDate

public String getPlanPublishDate(VirtualDocument vd)
Get PlanPublishDate of Virtual Document

Parameters:
vd - VirtualDocument
Returns:
String

coverDateString

public String coverDateString(Long longDate)
Transform millisecond into yyyy/mm/DD String

Parameters:
longDate - Long
Returns:
String

updateDefaultACL

public DMSResult updateDefaultACL(DMSUser user,
                                  String docKey,
                                  String folderKey)
copy folder ACL to document ACL

Parameters:
user - DMSUser
docKey - String document key
folderKey - String folder ID
Returns:
DMSResult

setACL

public DMSResult setACL(String subject,
                        Vector aciVec)
update ACL of Virtual Document or Folder

Parameters:
subject - String Document Key or Folder ID
aciVec - Vector contains AccessControlItem objects
Returns:
DMSResult

setACL

public DMSResult setACL(String userID,
                        String subject,
                        Vector aciVec)
update ACL of Virtual Document or Folder

Parameters:
userID -
subject - String Document Key or Folder ID
aciVec - Vector contains AccessControlItem objects
Returns:
DMSResult
Since:
V3.0, ISODMS-1103

setPDACL

public DMSResult setPDACL(String subject,
                          Vector aciVec)
set physical document ACL by Document Key or Folder ID

Parameters:
subject - String Document Key or Folder ID
aciVec - Vector contains AccessControlItem objects
Returns:
DMSResult

setDefaultACL

public DMSResult setDefaultACL(String folderID,
                               Vector aciVec)
set default ACL of folder

Parameters:
folderID - String Folder ID
aciVec - Vector contains AccessControlItem objects
Returns:
DMSResult

getPDACL

public Vector getPDACL(String docKey)
get physical document ACL by Document Key

Parameters:
docKey - String document key
Returns:
Vector contains AccessControlItem objects

getACL

public Vector getACL(String subject)
get document ACL by Document Key or get folder ACL by Folder ID

Parameters:
subject - String Document Key or Folder ID
Returns:
Vector contains AccessControlItem objects

getDefaultACL

public Vector getDefaultACL(String folderID)
get default ACL of folder

Parameters:
folderID - String Folder id
Returns:
Vector contains AccessControlItem objects

removeAuthorDefaultACL

public boolean removeAuthorDefaultACL(VirtualDocument vd)
remove Author default ACL of dockeyID

Parameters:
dockeyID - String Document id
Returns:
Vector contains AccessControlItem objects

publishVD

public DMSResult publishVD(String loginID,
                           String docKey,
                           String folderKey)
Publish a Virtual Document to a assigned folder

Parameters:
loginID - String
docKey - String virtualDocument ID
folderKey - String target FolderID
Returns:
DMSResult

newVD

public String newVD(String loginID,
                    String docName,
                    String docDescription,
                    String[] keyWord,
                    String[] category,
                    String folderKey,
                    String attributeTypeID,
                    String fileInfoString)
Create a new Virtual Document and put it in the workspace of assigned user

Parameters:
loginID - String assigned user's login ID
docName - String
docDescription - String
keyWord - String[]
category - String[]
folderKey - String
attributeTypeID - String
fileInfoString - String attached file component on eform(artIns.getAppValue("Attfile"))
Returns:
String Document Key of the Virtual Document which is generated by the system

newPublishVD

public String newPublishVD(String loginID,
                           String docName,
                           String docDescription,
                           String[] keyWord,
                           String[] category,
                           String folderKey,
                           String attributeTypeID,
                           String fileInfoString)
Create a Virtual Document and publish it

Parameters:
loginID - String
docName - String
docDescription - String
keyWord - String
folderKey - String assigned floderID
attributeTypeID - String assigned attributeTypeID *
fileInfoString - artIns.getAppValue("fileAttName");
Returns:
String Document ID of the Virtual Document which is created

getFolderFullPath

public Vector getFolderFullPath(String subject)
Get full path of folder from leaf to root by DocKey, FolderID or AttributeID.

Example:

   var fullPathVec = dmsFlowClient.getFolderFullPath("ATT_0000000031");
   for (var i = 0, j = fullPathVec.size(); i < j; i++) {
       var folderName = fullPathVec.get(i).get("name");//i=0 is leaf folder name
       var folderID = fullPathVec.get(i).get("id");//FolderID
   }
 

Parameters:
subject - String DocKey, FolderID or AttributeID
Returns:
Vector

getExtUserList

public Vector getExtUserList()
get all External Users.

Example: var extUserList = dmsFlowClient.getExtUserList(); for (var i = 0, j = extUserList.size() ; i < j ; i++) { var userName = extUserList.get(i).getUserName(); //user's name var loginID = extUserList.get(i).getLoginID(); //user's login ID var userEmail = extUserList.get(i).getEMail(); // user's email var userHome = extUserList.get(i).getHome(); //user's company }

Returns:
Vector

getExtUserListByGroup

public Vector getExtUserListByGroup(String groupID)
Get all External Users by groupID.

Example:

   var groupID = "EXTGroup_0000000001";
   var extUserList = getExtUserListByGroup(groupID);
   for (var i = 0, j = extUserList.size() ; i < j ; i++) {
       var userName = extUserList.get(i).getUserName(); //user's name
       var loginID = extUserList.get(i).getLoginID(); //user's login ID
       var userEmail = extUserList.get(i).getEMail(); // user's email
       var userHome = extUserList.get(i).getHome(); //user's company
   }
 

Parameters:
groupID -
Returns:

getDefaultVirtualDocumentACL

public Vector getDefaultVirtualDocumentACL(VirtualDocument vd)
get Default Document ACL.

Returns:
Vector

getFolderManagersByDocKeyVec

public String getFolderManagersByDocKeyVec(String docKeys)
getFolderManagersByDocKeyVec V3.0

Returns:
String

getDocBelongToDeptManagerByDocKeyVec

public String getDocBelongToDeptManagerByDocKeyVec(String docKeys)
getFolderManagersByDocKeyVec V3.0

Returns:
String


Copyright(c) 2005-2012 by Flowring Technology Corp., 12 F., No 120, Sec 2, Gongdao 5th Rd., Hsin-Chu City 300, Taiwan(R.O.C.) All rights reserved.