cancel
Showing results for 
Search instead for 
Did you mean: 

'Friendly' URL's

jknotzke
Champ in-the-making
Champ in-the-making
Hi,

  I am looking for some more information regarding this document: http://wiki.alfresco.com/wiki/URL_Addressability

  Specifically where it states:


Available in Alfresco 1.4!

The reference to the content can now be specified as a 'path' URL argument rather than as NodeRef element. For example:

/alfresco/download/direct?path=/Company%20Home/My%20Home%20Space/myimage.jpg

   What I am hoping to do, is create a more "friendly" URL that will permit me to dynamically create URLS in another web application as reference.

  Is this possible and how would I go about achieving this ?

  Thanks!
 
  J
5 REPLIES 5

jbarmash
Champ in-the-making
Champ in-the-making
yes, it's possible.  Basically you can create your own servlet that can then interpret the URL.   We also allow you to do it quite easily with web scripts, i.e. create a script

/s/{publication}/{month}/{issue_num}, where the stuff inside the brackets can be used as a parameter to your web script and pulled out.    So it's quite easy. 

Also, see this blog post by one of our Solution Engineers which implemented a simple URL scheme.
http://drquyong.com/myblog/?p=21

ragamuffndave
Champ in-the-making
Champ in-the-making
Experiencing the same challenge as you shampoo in that we'd like to be able to dynamically create a url pointing to an alfresco site (space)… so from this external app, we'd like the user to click on the url and be taken directly into the site inside alfresco… has anyone found a way to do this?  It seems like a simple task, but one that's taken many hours to solve and we've found no solution yet…

Because the problem is linking to a site (space) requires the knowledge of a node-id or space-id which we obviously don't know in advance… so alternatively, is there a way to determine the node-id or space-id given a particular path in alfresco (i.e. is there a way to call a webscript passing in a path that would return the space-id)?

Thanks!

ragamuffndave
Champ in-the-making
Champ in-the-making
Nevermind… we worked it out… we developed a web script that simply takes a "path" to a space and does a lookup of the space id and then forwards on to the correct place… so for example the link a user clicks on might look something like this:

http://myalfrescoserver.com/alfresco/s/d/starbucks/international/australia/melbourne/bourkestreet

where 'd' is the name of the webscript, and the rest is the path in the repository we want to visit.  The webscript does a childByNamePath lookup on the path from the companyhome node to see if it exists, and if it does, finds the node id, and constructs a url similar to the following and forwards the user to it:

http://myalfrescoserver.com/alfresco/navigate/browse/workspace/SpacesStore/1235-7684-5611-7894

where the number on the end is the node id of the space we want to go to…

Hope this helps… feel free to ask for more details if you're still interested.

pmonks
Star Contributor
Star Contributor
I believe the /api/path/content Web Script included in Alfresco already does something like this.

Cheers,
Peter

ragamuffndave
Champ in-the-making
Champ in-the-making
The web script you mention only provides a link to download content, not to link to a space inside Alfresco… which is what the web script we wrote does… thanks anyways! Smiley Very Happy