Hi all.
I'm trying to create virtual document with DFS and I need to explicitly set the version of a component.
How can i do this with DFS?
I'm trying to do it like this
public void createVD(){
ObjectIdentity identity = new ObjectIdentity();
identity.setRepositoryName("repo");
DataObject packO = new DataObject();
packO.setIdentity(identity);
packO.setType("my_type");
PropertySet properties = new PropertySet();
properties.getProperties().add(new StringProperty("object_name", false, "vd_object_name"));
properties.getProperties().add(new NumberProperty("r_is_virtual_doc", false, null, 1, null, null));
packO.setProperties(properties);
ObjectIdentity oi = new ObjectIdentity();
...
ObjectIdentitySet ois = new ObjectIdentitySet();
ois.getIdentities().add(oi);
List<DataObject> docOL = getObjectService().get(ois, options).getDataObjects();
DataObject docO = docOL.get(0);
ObjectRelationship relation = new ObjectRelationship();
relation.setTarget(docO);
relation.setName("virtual_document");
relation.setTargetRole("child");
PropertySet ps = new PropertySet();
ps.getProperties().add(new StringProperty("version_label", false, "1.1"));
ps.getProperties().add(new NumberProperty("use_node_ver_label", false, null, 1, null, null));
relation.setRelationshipProperties(ps);
packO.getRelationships().add(relation);
docO = client.update(docO, null);
DataPackage dataPackage = new DataPackage(packO);
getObjectService().create(dataPackage, operationOptions );
}
but it does not work