I am trying to create an action to create a new xform and open it in edit mode but i want it to be in the current folder because i am putting a button call this action in folder content form this is the code and the configuration
String parentFolderId= argList.get("objectId");
IDfSession dfSession = component.getDfSession();
IDfClientX clientx = new DfClientX();
String folderPath = "";
try
{
folderPath= DocumentumUtil.getFolderPathByFolderId(dfSession, parentFolderId) ;
System.out.println("FormName = " + formTemplateName +
", FormInstanceName = " + formInstanceName +
", FolderPath = " + folderPath);
IDfClient client = DfClient.getLocalClient();
IFormService xFormService = (IFormService)client.newService(IFormService.class.getName(), dfSession.getSessionManager());
System.out.println("xFormService = " + xFormService);
IDfId formTemplateId = dfSession.getIdByQualification("dm_xfm_form WHERE (definition_state = 2) AND (object_name = '" + formTemplateName + "' )");
System.out.println("formTemplateId = " + formTemplateId);
IDfId xFormObjectId = xFormService.createFormInstance(formTemplateId, formInstanceName, folderPath, dfSession.getDocbaseName());
System.out.println("xFormObjectId = " + xFormObjectId);
ArgumentList customArg = new ArgumentList();
customArg.add("objectId", xFormObjectId.toString());
bExecute = ActionService.execute("editfile", customArg, context, component, null);
// System.out.println("bExecute: " + bExecute);
}
catch (DfException e) {
e.printStackTrace();
}
return bExecute;
}
public String[] getRequiredParams()
{
// return new String[] { "objectId" };
return null;
}
}
<action id="CreateIncidentActionForm">
<params>
<param name="forminstancename" required="true" />
<param name="formname" required="true" />
<param name="objectId" required="true" />
</params>
<execution class="com.its.CreateIncidentActionForm">
<!-- <component>tseditxforms</component> -->
</execution>
</action>
</scope>
</config>