[opencms-dev] Visibility of the OpenCMS Object inside Struts Action

Stephan Hartmann hartmann at metamesh.de
Mon May 9 16:34:09 CEST 2005


Maximiliano Basili schrieb:
> org.opencms.main.OpenCms#initCmsObject("Guest"); ??
> 
> Do you mean: 
> CmsObject cmso = org.opencms.main.OpenCms.initCmsObject("Guest"); ??
> 

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

Regards,
Stephan

> But what about if I want to access with admin permissions??
> After CmsObject creation I need to create resources but with "Guest",
> I think it is not posible...
> BTW thanks! for the answer I can keep reading in that way...
> do you know how can I log-in with the Admin User or with other that
> has permissions for create/update resources...
> 
> thanks again.
> 
> Matute 
> 
> 2005/5/3, Stephan Hartmann <hartmann at metamesh.de>:
> 
>>You can create your own CmsObject with
>>
>>org.opencms.main.OpenCms#initCmsObject("Guest");
>>
>>But you have to make sure that your OpenCms servlet has been started before.
>>
>>Regards,
>>Stephan
>>
>>--
>>Stephan Hartmann
>>
>>metamesh
>>
>>Lippstädter Str. 22
>>44143 Dortmund
>>
>>http://www.metamesh.de/
>>
>>Maximiliano Basili schrieb:
>>
>>>Hi all...
>>>
>>>I want to work with struts inisde opencms.
>>>I have a Struts Action that has to create a resource so I need the
>>>OpenCMS object,
>>>
>>>I want to know how can I access the opencms object inside that struts action,
>>>I put some code that I test:
>>>
>>>      protected CmsObject getCmsObject(HttpServletRequest req)
>>>                      throws ServletException {
>>>              CmsFlexController controller = (CmsFlexController) req
>>>                              .getAttribute(CmsFlexController.ATTRIBUTE_NAME);
>>>
>>>              if (controller == null) {
>>>                      throw new ServletException(
>>>                                      "OpenCmsStrutsAction could not obtain CmsObject! ATT_NAME ==> " +
>>>CmsFlexController.ATTRIBUTE_NAME);
>>>              } else
>>>                      return controller.getCmsObject();
>>>      }
>>>
>>>
>>>The controller is null I think because for this point I can't reach
>>>the OpenCMS Servlet so I can't access to the VFS....
>>>
>>>Any suggestions will be appreciated...
>>>
>>>Thanks in advance!!
>>>
>>>Matute (Matías Basilico)
>>>
>>>
>>>_______________________________________________
>>>This mail is send to you from the opencms-dev mailing list
>>>To change your list options, or to unsubscribe from the list, please visit
>>>http://mail.opencms.org/mailman/listinfo/opencms-dev
>>
>>
>>
> 
> 


-- 
Stephan Hartmann

metamesh

Lippstädter Str. 22
44143 Dortmund

http://www.metamesh.de/




More information about the opencms-dev mailing list