11-28-2006 11:30 AM
12-04-2006 06:20 AM
12-04-2006 07:18 AM
12-04-2006 07:38 AM
12-04-2006 11:01 AM
public void wsCreateLink(String sourceNode,
String destinationNode)
{
String storeSchema = Constants.WORKSPACE_STORE;
String storeAddress = "SpacesStore";
final Store STORE = new Store(storeSchema, storeAddress);
try
{
//node to link
Reference ref = new Reference();
ref.setStore(STORE);
ref.setUuid(sourceNode);
//node destination 14c29a12-7be0-11db-83b6-f5ef9685f99e
ParentReference destinationFolder = new ParentReference();
destinationFolder.setStore(STORE);
destinationFolder.setUuid(destinationNode);
destinationFolder.setAssociationType(Constants.ASSOC_CONTAINS);
destinationFolder.setChildName("poppi");
Predicate pred = new Predicate();
pred.setStore(STORE);
pred.setNodes(new Reference[]{ref});
NamedValue[] prop = new NamedValue[4];
prop[0] = new NamedValue();
prop[0].setName(Constants.PROP_NAME);
prop[0].setValue("Name");
prop[0].setIsMultiValue(false);
prop[1] = new NamedValue();
prop[1].setName(Constants.PROP_TITLE);
prop[1].setValue("Title");
prop[1].setIsMultiValue(false);
prop[2] = new NamedValue();
prop[2].setName(Constants.PROP_DESCRIPTION);
prop[2].setValue("Description");
prop[2].setIsMultiValue(false);
prop[3] = new NamedValue();
prop[3].setName("{http://www.alfresco.org/model/content/1.0}destination");
prop[2].setName(Constants.PROP_DESCRIPTION);
prop[2].setValue("Descrizione");
prop[2].setIsMultiValue(false);
prop[3].setValue("workspace://SpacesStore/75710e09-83a4-11db-a5ec-7f23e300cdcd");
prop[3].setIsMultiValue(false);
CMLCreate create = new CMLCreate();
create.setParent(destinationFolder);
create.setAssociationType(Constants.ASSOC_CONTAINS);
create.setType("{http://www.alfresco.org/model/application/1.0}filelink");
create.setProperty(prop);
create.setChildName("Childname");
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] result = repositoryService.update(cml);
}
catch (Exception e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
The code works well. the only problem that remains unsolved for me (please let me know if someone has knowledge about it) is how to show into the web client the link icon instead of the normal icon. This is only a detail but it could be useful would like to provide me with a solution.09-29-2014 01:54 AM
09-29-2014 05:07 AM
12-04-2006 11:03 AM
12-05-2006 03:20 AM
12-05-2006 03:34 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.