Try this to change the owner and set permissions (java). You will need the appropriate permissions on the account you're using to connect to the objectstore and make changes. You will first need to connect to the objectstore.
I'm not sure if you need to change the doc class/doc type and then add permissions but I've included this code as well. Please pick and choose what you need.
// GUID = the unique document id value, os = the connection to your objectstore
com.filenet.api.admin.ClassDefinition cf = null;
cf = Factory.ClassDefinition.fetchInstance(os, DocumentClass, null);
AccessPermissionList apl = cf.get_DefaultInstancePermissions();
Document doc = Factory.Document.fetchInstance(os, new Id(GUID), null);
//old permission list used to remove old permissions
com.filenet.api.admin.ClassDefinition cf_old = null;
cf_old = Factory.ClassDefinition.fetchInstance(os, doc.getClassName(), null);
AccessPermissionList apl_old = cf_old.get_DefaultInstancePermissions();
// New DocClass if needed
doc.changeClass("NewDocClass);
// set the new doc type if needed
doc.getProperties().putValue("Your_Symbolic_DOC_TYPE_Name", "NewDocType");
// Set the new Owner
doc.set_Owner("NewOwner");
// Wipe out old permissions
Iterator<AccessPermission> ilist_old = apl_old.iterator();
AccessPermissionList v_old = doc.get_Permissions();
while (ilist_old.hasNext()) {
AccessPermission ap_old = (AccessPermission)ilist_old.next();
v_old.removeAll(apl_old);
}
// save changes
doc.save(RefreshMode.REFRESH);
// Add the new permissions
Iterator<AccessPermission> ilist = apl.iterator();
AccessPermissionList v = doc.get_Permissions();
while (ilist.hasNext()) {
AccessPermission ap = (AccessPermission)ilist.next();
v.add(ap);
}
// save changes
doc.save(RefreshMode.REFRESH);