• Copy metadata of documents enregistred yet to new document

  • OpenKM a de nombreuses fonctionnalités interessantes, mais demande un minimum de configuration pour être pleinement exploité.
OpenKM a de nombreuses fonctionnalités interessantes, mais demande un minimum de configuration pour être pleinement exploité.

Moderator: dedisoft

Forum rules: Avant de poser une question, merci de regarder la documentation du wiki ou d'utiliser la fonction recherche du forum. Et rappelez vous que nous n'avons ni boule de cristal ni possibilité de lire dans les pensées, aussi pensez à spécifier quelle version d'OpenKM vous utilisez ainsi que la version du navigateur web et du système d'exploitation. Pour de plus amples informations lisez Comment reporter un bug efficacement (anglais).
 #45879  by jllort
 
Should be something like:
Code: Select all
String uuid_origin = "some uuid";
String uuid_destination = "some uuid";
Map properties = OKMPropertyGroup.getInstance().getPropertiesSimple(null, uuid_origin, "okg:group_name");
OKMPropertyGroup.getInstance().addGroup(null, uuid_destination, "okg:group_name"); // Adding empty group to destination
OKMPropertyGroup.getInstance().setPropertiesSimple(null, uuid_destination,  "okg:group_name", properties ); // Setting metadata to destination node
 #45881  by cherifmad
 
jllort wrote: Mon May 21, 2018 1:40 pm Should be something like:
Code: Select all
String uuid_origin = "some uuid";
String uuid_destination = "some uuid";
Map properties = OKMPropertyGroup.getInstance().getPropertiesSimple(null, uuid_origin, "okg:group_name");
OKMPropertyGroup.getInstance().addGroup(null, uuid_destination, "okg:group_name"); // Adding empty group to destination
OKMPropertyGroup.getInstance().setPropertiesSimple(null, uuid_destination,  "okg:group_name", properties ); // Setting metadata to destination node
please this script is a Beanshell script or a JBDC queries?
Where Can I run It ?
 #45884  by cherifmad
 
I have make some modification But, I didn't get the result. here is my modified code.
Code: Select all
String uuid_origin = "some uuid";
String uuid_destination = "some uuid";
Map properties = OKMPropertyGroup.getInstance().getPropertiesSimple(null, uuid_origin, "okg:abc.abc");
OKMPropertyGroup.getInstance().addGroup(null, uuid_destination, "okg:abc.abc"); // Adding empty group to destination
OKMPropertyGroup.getInstance().setPropertiesSimple(null, uuid_destination,  "okg:abc.abc", properties ); // Setting metadata to destination node
can I make modification in String uuid_origin and String uuid_destination code? If yes What should I write?
thanks for your unnderstanding
 #45894  by lnovoa
 
Hi!,
You must replace it with the uuid of the source and destination document.
If you want to know the value of the uuid, you select the document and in the properties tab you will find the value.
For example:

String uuid_origin = "d39e38e3-e561-4c46-8415-aca6dab0773c";
String uuid_destination = "829881b0-c859-4704-ba85-6e763d9e086f"
.......
 #45895  by cherifmad
 
lnovoa wrote: Tue May 22, 2018 8:05 am Hi!,
You must replace it with the uuid of the source and destination document.
If you want to know the value of the uuid, you select the document and in the properties tab you will find the value.
For example:

String uuid_origin = "d39e38e3-e561-4c46-8415-aca6dab0773c";
String uuid_destination = "829881b0-c859-4704-ba85-6e763d9e086f"
.......
@Inovoa
I have make this modification but nothing appears in the new document's Metadata
 #45898  by lnovoa
 
Has it given you any kind of error?

This is the script that I launched and it works correctly.

Code: Select all
import com.openkm.api.OKMPropertyGroup;
import java.util.Map;

String uuid_origin = "222bd16a-01f1-4b5b-89b7-be72183706bc";
String uuid_destination = "73a99248-6364-4443-b407-e3584c921fc1";
Map properties = OKMPropertyGroup.getInstance().getPropertiesSimple(null, uuid_origin, "okg:cdapodoc");
OKMPropertyGroup.getInstance().addGroup(null, uuid_destination, "okg:cdapodoc");
OKMPropertyGroup.getInstance().setPropertiesSimple(null, uuid_destination,  "okg:cdapodoc", properties );
 #45899  by cherifmad
 
lnovoa wrote: Tue May 22, 2018 1:27 pm Has it given you any kind of error?

This is the script that I launched and it works correctly.

Code: Select all
import com.openkm.api.OKMPropertyGroup;
import java.util.Map;

String uuid_origin = "222bd16a-01f1-4b5b-89b7-be72183706bc";
String uuid_destination = "73a99248-6364-4443-b407-e3584c921fc1";
Map properties = OKMPropertyGroup.getInstance().getPropertiesSimple(null, uuid_origin, "okg:cdapodoc");
OKMPropertyGroup.getInstance().addGroup(null, uuid_destination, "okg:cdapodoc");
OKMPropertyGroup.getInstance().setPropertiesSimple(null, uuid_destination,  "okg:cdapodoc", properties );
please this script is a beanshell script also?
 #45924  by cherifmad
 
lnovoa wrote: Wed May 23, 2018 10:34 am Hi!,

In the community version is the icon that is between statistics and metadata, it is a violet rhombus
thanks @Inovoa
I run it ( with my modification :" see my screenshot"); But an error appear.
thanks for you supporting
Attachments
test11.JPG
test11.JPG (139.71 KiB) Viewed 11330 times

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.