10-21-2008 05:58 AM
// properties
CmisPropertiesType createCmisPropertiesType = of.createCmisPropertiesType();
List<CmisProperty> properties = createCmisPropertiesType.getProperty();
CmisPropertyString property = of.createCmisPropertyString();
property.setName("ObjectTypeId");
property.setValue("[color=#FFBF00]Document[/color]");
CmisPropertyString property2 = of.createCmisPropertyString();
property2.setName("Name");
property2.setValue("Some name");
properties.add(property);
properties.add(property2);
// content
CmisContentStreamType cmisContentStreamType = of.createCmisContentStreamType();
DataHandler handler = new DataHandler(new InpuStreamDataSource(new FileInputStream(new File("c:/a.txt")),"a.txt"));
cmisContentStreamType.setStream(handler);
cmisContentStreamType.setFilename("a.txt");
// create document - does not work 😞
objectService.createDocument(repoId,"[color=#FFBF00]Document[/color]",createCmisPropertiesType, rootFolderId, cmisContentStreamType, EnumVersioningState.MAJOR);
11-06-2008 10:03 AM
11-14-2008 04:34 AM
11-24-2008 06:21 AM
03-12-2009 11:50 AM
09-16-2009 07:05 AM
03-03-2010 12:03 AM
package cmis;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.jaxws.description.xml.handler.ObjectFactory;
import org.oasis_open.docs.ns.cmis.core._200908.CmisAccessControlListType;
import org.oasis_open.docs.ns.cmis.core._200908.CmisPropertiesType;
import org.oasis_open.docs.ns.cmis.messaging._200908.CreateFolder;
import org.oasis_open.docs.ns.cmis.messaging._200908.CreateFolderResponse;
import org.oasis_open.docs.ns.cmis.ws._200908.ObjectServiceStub;
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 CreateFolder();
cf.setRepositoryId("46f8b242-9f61-423b-b824-c6118f470f01");
cf.setFolderId("workspace://SpacesStore/0fceb8de-fe45-439a-9ac4-30b32c7671e0");
/* How to set properties? */
}
}
03-14-2010 09:55 AM
org.oasis_open.docs.ns.cmis.core._200908.ObjectFactory;
org.oasis_open.docs.ns.cmis.messaging._200908.ObjectFactory
But this is not the same class!
//this is the list for all your properties
CmisPropertiesType newNodeProperties = new CmisPropertiesType();
//build your custom name property
CmisPropertyString nameProperty = objectFactory.createCmisPropertyString();
nameProperty.setPropertyDefinitionId("cmis:name");
nameProperty.getValue().add("This is the name value of your new node");
//add the new property value to the properties list
newNodeProperties.getProperty().add(nameProperty);
Hope this helps.
05-19-2010 08:21 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.