cancel
Showing results for 
Search instead for 
Did you mean: 

View in source repository not working in 4.2.c

sharifu
Confirmed Champ
Confirmed Champ
I am using v 4.2.c on centos 64bit.  Replication works fine and I have just realised that view in source repository is not working. I need to fix this asap as end users are using it and have uploaded documents and cannot downgrade back to 4.0.d

I do not get any errors in the log files. When I click on view in source repository it opens same repository window.


So far I have manually changed the url value in the following xml file

webapps/share/WEB-INF/classes/alfresco/share-documentlibrary-config.xml:         <!– Transferred node: View in source repository –>
<!– <param name="href">{sourceRepositoryUrl}</param> –>
            <param name="href">http://hector.uk.domain.com:8080/share/page/site/SITE/documentlibrary</param>



This does open the source repository but not the correct URL. Im not sure how to debug.

5 REPLIES 5

sharifu
Confirmed Champ
Confirmed Champ
I have edited the javascript file webapps/share/components/documentlibrary/actions-min.js How ever I am not sure as to what params to return. I formatted the code so it is more readable. Following is what I currently have


viewInSourceRepositoryURL : function q(aa, ac) {
         var ab = aa.node, Z = aa.location.repositoryId, Y = this.options.replicationUrlMapping, ad;
         /*if (!Z || !Y || !Y[Z]) {
            return "#"
         }*/
         Z = "hector.uk.domain.com";
         console.log(Z);
         console.log(Y);
         console.log(Y[Z]);
         
         ad = ab.isContainer ? ac.folderDetailsUrl : ac.documentDetailsUrl;
         ad = ad.substring(Alfresco.constants.URL_CONTEXT.length);
         console.log("hector.uk.domain.com/share/'+ad);
         //return G(Y[Z], "/", ad)
         return G("?hector.uk.domain.com:8080/share/", "/", ad)
      },


I have noticed there is a problem with Y[Z] it comes up as undefined. The correct url is now there in "view source repository" but it is not opening in new window, Am i missing a parameter?

Hi,
Please turn on client-side javascript debugging  and check the values.
Don't make any changes in *.min.js and it is not recommended. Change the action.js file and minify it.

I hope your script is failing in,
  $combine(urlMapping[repoId], "/", siteUrl); 

Please check your value is present in "urlMapping".

My urlMapping[repoId] returns undefined. How can I hard code it? I need a quick fix. I have tried following but it doesn't work.


viewInSourceRepositoryURL : function q(aa, ac) {
         var ab = aa.node, Z = aa.location.repositoryId, Y = this.options.replicationUrlMapping, ad;
         console.log(Z);
         console.log(Y);
         console.log(this);
         /*if (!Z || !Y || !Y[Z]) {
            return "#"
         }*/
         //Z = "hector.uk.domain.com";
         Y = new Array();
         Y[Z] = "hector.uk.domain.com:8080/share/";
         /*console.log(Z);*/
         console.log(Y[Z]);
         
         ad = ab.isContainer ? ac.folderDetailsUrl : ac.documentDetailsUrl;
         ad = ad.substring(Alfresco.constants.URL_CONTEXT.length);
         return G(Y[Z], "/", ad)
      },

mrogers
Star Contributor
Star Contributor
You shouldn't need to hack share to get this working.    You should instead be configuring through share-config-custom.xml


<config evaluator="string-compare" condition="Replication">
      <share-urls>
         <!–
            To discover a Repository Id, browse to the remote server's CMIS landing page at:
              http://{server}:{port}/alfresco/service/cmis/index.html
            The Repository Id field is found under the "CMIS Repository Information" expandable panel.

            Example config entry:
              <share-url repositoryId="622f9533-2a1e-48fe-af4e-ee9e41667ea4">http://new-york-office:8080/share/</share-url>
         –>
      </share-urls>
   </config>

I have that but it is not working. As I have mentioned replication works but not when you click on "view in source repository". Unless I hardcode the url in the js.