As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
package cmis; import java.math.BigInteger; import java.util.Iterator; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; import org.apache.axis2.client.ServiceClient; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.context.ConfigurationContextFactory; import org.apache.axis2.databinding.types.xsd.QName; import org.apache.axis2.jaxws.description.xml.handler.ObjectFactory; import org.oasis_open.docs.ns.cmis.ws._200908.ObjectServiceStub; import org.oasis_open.docs.ns.cmis.ws._200908.ObjectServiceStub.CmisPropertiesType; import org.oasis_open.docs.ns.cmis.ws._200908.ObjectServiceStub.CmisProperty; import org.oasis_open.docs.ns.cmis.ws._200908.ObjectServiceStub.CmisPropertyString; import org.oasis_open.docs.ns.cmis.ws._200908.ObjectServiceStub.CreateFolder; import org.oasis_open.docs.ns.cmis.ws._200908.ObjectServiceStub.CreateFolderResponse; import com.sun.org.apache.bcel.internal.Constants; public class ObjectClient { public static void main(String[] args) throws Exception { ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("D:\\Softwares\\axis2-1.5.1-bin\\axis2-1.5.1\\repository","D:\\Softwares\\axis2-1.5.1-bin\\axis2-1.5.1\\repository\\modules\\client.axis2.xml"); ObjectServiceStub stub = new ObjectServiceStub(ctx, "http://localhost:8080/alfresco/cmis/ObjectService"); CreateFolder cf = new ObjectServiceStub.CreateFolder(); cf.setRepositoryId("46f8b242-9f61-423b-b824-c6118f470f01"); cf.setFolderId("workspace://SpacesStore/0fceb8de-fe45-439a-9ac4-30b32c7671e0"); [b]// How to set property name and property values?[/b] CreateFolderResponse fr = stub.createFolder(cf); }//end main }//end class
CmisPropertiesType docPropType = cf.addNewProperties();
ObjectServiceStub stub = new ObjectServiceStub(SERVICE_URL); CreateFolder cf = new ObjectServiceStub.CreateFolder(); CmisPropertiesType propsType = new ObjectServiceStub.CmisPropertiesType(); CmisPropertiesTypeChoice_type0 choiceType1 = new ObjectServiceStub.CmisPropertiesTypeChoice_type0(); CmisPropertiesTypeChoice_type0 choiceType2 = new ObjectServiceStub.CmisPropertiesTypeChoice_type0(); CmisPropertyId propId1 = new ObjectServiceStub.CmisPropertyId(); CmisPropertyString propId2 = new ObjectServiceStub.CmisPropertyString(); CmisPropertyDefinitionId propDefId1 = new ObjectServiceStub.CmisPropertyDefinitionId(); CmisChoiceIdType cIdType1 = new ObjectServiceStub.CmisChoiceIdType(); cIdType1.setValue("cmis:objectTypeId"); propDefId1.addDefaultValue(cIdType1); propId1.setPropertyType(new EnumPropertyType.fromString("id"); propId1.setValue("cmis:folder"); choiceType1.setPropertyDefinitionId(propDefId1); //Not sure about this choiceType1.setPropertyId(propId1); CmisPropertyDefinitionId propDefId2 = new ObjectServiceStub.CmisPropertyDefinitionId(); CmisChoiceIdType cIdType2 = new ObjectServiceStub.CmisChoiceIdType(); cIdType2.setValue("cmis:name"); propDefId2.addDefaultValue(cIdType2); propId2.setPropertyType(new EnumPropertyType.fromString("string"); propId2.setValue("YourFolderName"); choiceType2.setPropertyDefinitionId(propDefId2); //Not sure about this choiceType2.setPropertyString(propId2); propsType.setCmisPropertiesTypeChoice_type0(new CmisPropertiesTypeChoice_type0[]{ choiceType1 ,choiceType2}); cf.setRepositoryId("YourRepositoryId"); cf.setFolderId("YourFolderId"); cf.setProperties(propsType); CreateFolderResponse resp = stub.createFolder(cf);