DFC Code & DFC Java API Example for Forms Creation

Options
mitesh
edited January 21, 2009 in Documentum #1

Hello All,

I am searching out for the Form related DFC Code Example, I have the requirement of Creation of Form Object & set/get the values in Form Object metadata.

I am new to Form Object DFC , I am searchig out for any Link through which I can download Form Object DFC & API can be downloaded ? or any Article by EMC specially for Forms DFC will be really helpful for me.

Thanks,

Comments

  • alomartinez
    edited January 20, 2009 #2
    Options

    Try with this

    import

    com.documentum.fc.client.IDfClient;

    import

    com.documentum.fc.common.DfTime;import com.documentum.fc.common.IDfId;import com.documentum.fc.common.IDfTime;

    importimport com.documentum.fc.client.IDfSysObject;import com.documentum.fc.client.IDfSessionManager;import com.documentum.fc.client.IDfSysObject;import com.documentum.fc.client.IDfSessionManager; com.documentum.fc.client.IDfSessionManager;import com.documentum.fc.client.IDfSysObject;import

    com.documentum.services.xforms.IFormService;

    try

    {     IDfClient client = DfClient.getLocalClient();     IDfSessionManager sMgr = getDfSession().getSessionManager();     IFormService FS = (IFormService)client.newService(com.documentum.services.xforms.IFormService.

    class.getName(),sMgr);

         IDfId templateId = getDfSession().getIdByQualification("dm_xfm_form where definition_state = 2 and object_name=''tamplate_form_name");

         if(templateId == null || templateId.isNull()) {

              System.out.println("ERROR!!!");

         } else {

              IDfTime myTime = new DfTime();

              String XFormInstanceObjectName = myTime.getDate().toString();

              IDfId xFormObjectId = FS.createFormInstance(templateId, XFormInstanceObjectName, getPath("/Temp"), getDfSession().getDocbaseName());

              String idForm = xFormObjectId.getId().toString();

              if (idForma!="") {

                   IDfSysObject frm= (IDfSysObject);

                   getDfSession().getObject(new DfId(idForma));

                   frm.setString("object_name", "Object Name");

                   frm.save();

              } else {

                   System.out.println("ERROR!!!");

              }

         }}

    catch (DfException e) {

         System.out.println("ERROR onClickNuevaSeccion msg: " + e.getMessage());

    }

  • mitesh
    edited January 21, 2009 #3
    Options

    can you provide me some sample code for , Geting values from Form Object controls & setting some values to Form object controls ?