Accessing a File (URL) without uuid (by folder or folderId)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2011 11:18 AM
lets imagine some files in a Site Share Documents
the normal access to the file (to use as a link) is:
what i like to have is something like that:
is something like that possible
/testfolder/testsubfolder/test-1.png/testfolder/testsubfolder/test-2.png
the normal access to the file (to use as a link) is:
http://localhost/share/proxy/alfresco/api/node/content/workspace/SpacesStore/39d8b5b5-6f66-4aae-a284...http://localhost/share/proxy/alfresco/api/node/content/workspace/SpacesStore/8b5b39d5-84aa-664e-a6f2...
what i like to have is something like that:
http://localhost/share/proxy/alfresco/api/node/content/workspace/SpacesStore/{folder_ID}/test.png
orhttp://localhost/share/proxy/alfresco/api/node/content/workspace/SpacesStore/testfolder/testsubfolde...
is something like that possible
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2011 10:06 AM
When I have a question about "does Alfresco have a URL that does XXXX?" I always start by looking at the Web Script Index. The Web Script Index for repository web scripts is accessible at http://localhost:8080/alfresco/service/index while the Web Script Index for the Share web scripts is accessible at http://localhost:8080/share/service/index. (The web script engine runs on both the repo tier and the Share tier, each with a different set of web scripts and capabilities).
The "getContent" URL you are referring to is a repository tier web script. You can tell that because the URL you provided uses Share's proxy servlet. In this case, Share is proxying that request back to the repository tier.
If you go to the repository Web Script index and search for something like "/api/node/content" you'll find the getContent web script. You'll note it has several possible URLs bound to it and that a few of them use the path rather than the node reference:
So, in your example, assuming your files were in a Share site called test-site-1, you could get to those documents like this:
(Even if you had found the right web script, that "documentLibrary" part of the path might have thrown you off because it isn't visible in the UI. To find stuff like that you should use the Node Browser, either in Explorer or in Alfresco 4 Share).
If you wanted to hit the same web script through Share's proxy servlet, you would use this:
Jeff
The "getContent" URL you are referring to is a repository tier web script. You can tell that because the URL you provided uses Share's proxy servlet. In this case, Share is proxying that request back to the repository tier.
If you go to the repository Web Script index and search for something like "/api/node/content" you'll find the getContent web script. You'll note it has several possible URLs bound to it and that a few of them use the path rather than the node reference:
/alfresco/s/api/path/content{property}/{store_type}/{store_id}/{nodepath}?a={attach?}&streamId={streamId?}/alfresco/s/api/path/{store_type}/{store_id}/{nodepath}/content{property}?a={attach?}&streamId={streamId?}/alfresco/s/cmis/p/{path}/content{property}?a={attach?}&streamId={streamId?}
So, in your example, assuming your files were in a Share site called test-site-1, you could get to those documents like this:
http://localhost:8080/alfresco/s/api/path/content/workspace/SpacesStore//Sites/test-site-1/documentL...http://localhost:8080/alfresco/s/api/path/content/workspace/SpacesStore//Sites/test-site-1/documentL...
(Even if you had found the right web script, that "documentLibrary" part of the path might have thrown you off because it isn't visible in the UI. To find stuff like that you should use the Node Browser, either in Explorer or in Alfresco 4 Share).
If you wanted to hit the same web script through Share's proxy servlet, you would use this:
http://localhost:8080/share/proxy/alfresco/api/path/content/workspace/SpacesStore//Sites/test-site-1...
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2011 10:41 AM
Actually, in testing out the proxy version of that URL I think I may have found a bug. The proxy servlet appears to be stripping out the extra slash. I've filed a Jira on it:
https://issues.alfresco.com/jira/browse/ALF-11942
Jeff
https://issues.alfresco.com/jira/browse/ALF-11942
Jeff
