[opencms-dev] Accessing files with a new CmsObject instance

bart vandendriessche bart at nascom.be
Fri Dec 10 10:03:13 CET 2004


Thanks for the tip, unfortunately however I'm using OpenCms 5.0.1 :)
But I believe this will get me a bit further regardless, will try to 
figure out where to go from here.

kr,
Bart

Thomas Maerz wrote:

>bart vandendriessche <bart at nascom.be> writes:
>
>  
>
>>This code however fails. Any help or tips on this matter are greatly
>>appreciated.
>>    
>>
>
>Only for OpenCms > 5.0.1
>
>,----
>| import org.opencms.file.CmsObject;
>| import org.opencms.file.CmsProject;
>| import org.opencms.main.CmsException;
>| import org.opencms.main.OpenCms;
>| 
>| // ...
>| 
>| cmsObject = OpenCms.initCmsObject( "Guest" );
>| cmsObject.loginUser( "Admin", "admin" );
>|             
>| CmsProject cmsProject = cmsObject.readProject( "Offline" );
>| cmsObject.getRequestContext().setCurrentProject( cmsProject );
>|             
>| cmsObject.getRequestContext().setSiteRoot( "/" );
>`----
>
>HTH.
>
>Regards,
>Thomas
>
>
>
>_______________________________________________
>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
>
>  
>




More information about the opencms-dev mailing list