For some specific reasons, I will need to automatically add or add a parameter to the URL for each request, if and only if this parameter already exists in the URL from the first request. In other words, if I have a URL /share/page/site/sample/documentlibrary?embedded , each request /share/page/site/sample/[whatever] should contain an inline parameter plus other parameters that could be added by the original request.
I work with Alfresco Share (v4.2.b), which means that the web application already exists, and although I can configure it, I have limitations because I cannot completely control it. If it was my web application built from scratch, that would not be a problem. According to the limitations that I have, the solution should ideally be as less intrusive as possible. At the same time, if this is a JavaScript-based solution, using YUI rather than another library is a plus, but not required.
I was looking for an approach, and after that I mean the following possible solutions:
Use JavaScript by adding a parameter to the URL before uploading each page. Sort of:
window.onbeforeunload = function(e) {
But I believe that this does not work, as I read and according to some tests that I did. There seems to be some kind of security constraint (which, by the way, makes sense).
Updating the href attribute for each link ( <a/> ) using JavaScript after the page has finished loading. For example, /share/page/site/sample/document-details?nodeRef=workspace://SpacesStore/089acea3-3b37-403d-9a8d-ae484ddd2ccb can be converted to /share/page/site/sample/document-details?nodeRef=workspace://SpacesStore/089acea3-3b37-403d-9a8d-ae484ddd2ccb&embedded . The problem with this solution is that both the GET or POST and href forms launched using JavaScript will not be available ...
Using any technology for rewriting a URL or library, for example UrlRewriteFilter (I have not had time to test it yet, sorry).
Create an Alfresco Share extension module that modifies or updates each request, perhaps with a module or subcomponent evaluator. I don’t know if this is compatible with extension modules, but I believe that I read somewhere that you can make changes to queries.
I need to add (for those who have knowledge of Alfresco Share) that options 1, 2 and 4 will be implemented as an extension module.
Well, I hope I explained my question well enough. I would really appreciate some advice or possible approaches. I will work on it anyway, and I will come up with any update.
source share