[opencms-dev] Accessing resources depends on site - getCurrentSite not working?

Martin Lehnert martin.lehnert at hannecke-its.de
Fri Apr 29 09:22:09 CEST 2005


In my OpenCms-installation (beta2) are still the two default sites present ("/sites/default" and "/"). Right now I am adding a new tool in the new administration area which needs access to resources in the sites/default/... folder. But obviously the path to a resource located in this subfolder depends on the selection that I have made in the OpenCms-Site-Selection box at the top of the screen (When "/" is selected, I need to pass the entire path including "/sites/default" which is not necessary when "/sites/default" is already selected.)
Since I need this access (and since the access takes place while being an admin who is able to switch between sites) I tried to come along with using the static method "getCurrentSite" from the SiteManager ... But unfortunately it always return "/sites/default", no matter what I have selected in the selection box. Has this method another purpose I don't understand or is this a bug? And if it works properly, what other possibilities do I have to make sure to access my resources without being dependent on the setting of the selection box? I noticed that some parts of the TemplateOne-demo do not work when the root-site is selected. While I understand that it is obviously necessary to prevent guests from entering the system-part of the VFS by cutting this part of the path, I don't think that it has to be necessary that all this depends on the selection of the displayed site.
I use this selection for viewing and accessing purposes since I am adding content to the system-area, and feel that it should not have any impact on the path-results of java-methods.

Please give me some insight what I am missing here or how I can safely access resources from the admin-area.

Greetings,

Martin Lehnert
Hannecke IT-Solutions GmbH
Martin-Luther-Str. 5b
97072 Würzburg
Tel.: 0931-99 135 24
Fax: 0931-99 135 29
Email: martin.lehnert at hannecke-its.de 




More information about the opencms-dev mailing list