Page 1 of 1
URL to folder
PostPosted:Tue Aug 15, 2017 6:50 am
by Beau_M
Just wondering if there is a way to link to a directory within the folder tree. For example we have an SOP directory nested within several other folders, I want to be able to link to it from another page so that users can go straight there rather than sift through to find it.
Re: URL to folder
PostPosted:Thu Aug 17, 2017 8:06 pm
by jllort
In the properties panel you have URL link, basically the link is your OpenKM URL with parameter ?uuid=UUID OF THE OBJECT ( it can be a document, folder, etc. )
Re: URL to folder
PostPosted:Tue Aug 29, 2017 6:10 am
by Beau_M
Strangely I've got the URL wording, but no button. It only shows in Internet Explorer, but not in any other browser?
Re: URL to folder
PostPosted:Wed Aug 30, 2017 7:11 am
by jllort
IN community version the icon to copy the URL needs flash support. Should be shown at the bottom of properties panel.
Re: URL to folder
PostPosted:Thu Oct 19, 2017 10:25 pm
by Beau_M
Don't know if anyone would find this useful, but the workaround to not using flash for clipboard access for us was as follows;
In documents.java and Folder.java (you'll need a clipboard icon)
Code: Select allString url = Main.get().workspaceUserProperties.getApplicationURL();
url += "?uuid=" + URL.encodeQueryString(URL.encodeQueryString(document.getUuid()));
tableProperties.setHTML(1, 1, "<img class=\"js-textareacopybtn\" src=\"/OpenKM/img/clipboard.png\" title=\"Copy URL to clipboard\" onclick=\"copyTextToClipboard('" + url + "')\">");
In frontend/index.jsp
Code: Select all<script type="text/javascript" src="../js/clipboard.js"></script>
In js/clipboard.js
Code: Select allfunction copyTextToClipboard(ToCopy) {
var textArea = document.createElement('textarea');
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;
textArea.style.width = '2em';
textArea.style.height = '2em';
textArea.style.padding = 0;
textArea.style.border = 'none';
textArea.style.outline = 'none';
textArea.style.boxShadow = 'none';
textArea.style.background = 'transparent';
textArea.value = ToCopy;
document.body.appendChild(textArea);
textArea.select();
try { var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Copying text command was ' + msg);
} catch (err) {
console.log('Oops, unable to copy');
}
document.body.removeChild(textArea);
}
Re: URL to folder
PostPosted:Sun Oct 22, 2017 7:19 pm
by jllort
From github you create a merge request with this changes ( to be merged into version 6.3-DEV ) and we can consider include in the source code.
Re: URL to folder
PostPosted:Mon Oct 23, 2017 10:07 pm
by Beau_M
Not sure if I did that correctly, are you able to check that I've actually made the request properly?
Re: URL to folder
PostPosted:Tue Oct 24, 2017 7:16 am
by jllort
I think not. it should be a new pull request here
https://github.com/openkm/document-mana ... stem/pulls , the idea is create a fork, and then from the fork you can create a pull request from your branch to ours. I suggest try it ... if you finally do not success on it, share with us the patch ( but I suggest invest some time in the pull request, because will be useful for you with other github projects ).
Re: URL to folder
PostPosted:Wed Oct 25, 2017 12:07 am
by Beau_M
Hadn't done the last step, should be good now.
Re: URL to folder
PostPosted:Fri Oct 27, 2017 7:13 am
by jllort
Yes now I see the merge request. Did you tested with all the browsers ( firefox, chrome and IE ? )