Page 1 of 1

link to another document in metadata

PostPosted:Tue Aug 02, 2016 11:56 am
by khpavel
Hello!

We use OpenKM Community 6.3.1.
I have a task to give users opportunity to create links between documents.
I think that the best way is to use metadata group "Document links"

Is it possible to create metadata field with type "select" with hierarhical list of documents (or simple list of documents with full path)?

Re: link to another document in metadata

PostPosted:Wed Aug 03, 2016 12:01 pm
by jllort
In the input exists type "folder" what is used for linking to folders, the link for other nodes types ( document, mail and record ) do not exists, but could be implemented ( if you want doing it I can guide for it ). Also you could use the type link, and there store the complete link to openkm nodes ( I'm talking about something like http://localhost:8080/OpenKM/frontend/i ... uid=XXXXXX )

Re: link to another document in metadata

PostPosted:Wed Aug 03, 2016 3:02 pm
by khpavel
Hello, jllort!

It is very interesting! I would like to make In the input links for other nodes types (prefer document node).
Please give me some instructions how to do it.

Re: link to another document in metadata

PostPosted:Thu Aug 04, 2016 10:28 pm
by jllort
First of all must extend latest dtd and create newer with new link types ( document, mail ).

Then take a look at FormManager.java ( this is the class which is drawing the form elements from OpenKM UI ). Look into the class for "GWTInput.TYPE_FOLDER" you'll see it in serveral places. From line 431 to line 474 is where is shown the path selector when you are editing the fields, here must create another else if. About the other "GWTInput.TYPE_FOLDER" the behaviour should be very similar, in almost cases I think with or is enought.

Another thing is Input.java class which it has variable definition public static final String TYPE_FOLDER = "folder"; The most easiest is looking for source code references.

Also I suggest take a look at GWTInput and when setFolder is referenced.

Finally, take advantage of using our portable dev environment at https://sourceforge.net/projects/openkmportabledev/

If you need more help tell us, if you success on it share with us the code and we will push with community.