[opencms-dev] Access a file by uuid

Sebastian Himberger sebastian.himberger at gmx.de
Fri Dec 12 11:39:03 CET 2008


Hi Sandrine,

this user is important:

cmso.loginUser("Admin", "thePassWord");

because this is the one which will try to read the file. Also make sure
you have the correct uuid. You can get it via the context menü:
Advanced->Secure/Export: http://<domain>/permalink/<uuid>

best regards,
Sebastian


Sandrine Prousteau schrieb:
> I'm connected to the workplace as Admin (default administrator)...
>
> -----Message d'origine-----
> De : opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] De la part de Sebastian Himberger
> Envoyé : jeudi 11 décembre 2008 20:24
> À : The OpenCms mailing list
> Objet : Re: [opencms-dev] Access a file by uuid
>
> Hi,
>
> this works for me:
>
> <%@ page
> import="org.opencms.file.*,org.opencms.jsp.*,org.opencms.util.*,org.opencms.main.*"
> %>
> <%
>
> String uuid = "ceece147-3144-11dc-a69a-5f50d3bd539c";
>
> CmsObject cmso = OpenCms.initCmsObject("Guest");
> cmso.loginUser("Admin", "thePassWord");
>
> CmsResource res = cmso.readResource(new CmsUUID(uuid));
>
> out.println(res.getName());
>
> %>
>
> Are you sure the user who logs in has read access to the resource?
>
> best regards,
> Sebastian
>
> Yves Glodt schrieb:
>   
>> Hello,
>>
>>
>> is it possible to find and access a file in the VFS by it's uuid?
>>
>>
>> Background: I have certains PDF documents in my vfs which are not
>> accessible
>> for any user, logged in or not, and I want to serve them with
>> obfuscated urls
>> à la /getFile.jsp?id=xxxxxx and it would be nice if I could just use
>> the uuid
>> to identify them.
>> I use OpenCms 7.0.4. Maybe there is another way to achieve this...? :-)
>>
>>
>> Best regards,
>> Yves
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>     
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>   




More information about the opencms-dev mailing list