FW: [opencms-dev] External_new_upload ... More specific + CmsObje ct from other webapp??

M Butcher mbutcher at grcomputing.net
Wed Oct 8 04:46:01 CEST 2003


Hi Vangelis,

On Tue, 2003-10-07 at 06:40, Vlachogiannis Evangelos wrote:
> To make my question more specific when I am using an CmsObject is it enough
> to use CmsObject.login ... Method in order to be able to acccess any
> resource accessible from the logged in user?

CmsObject.login will log the user in and apply access controls... so,
yes. You are right. I am not sure why your code isn't working. What does
cms.loginUser return?

> Another question: Is there a way of getting and using the CmsObject from
> another web application (serialization?... Any suggestion??) ?
> 

Not that I know of. The closest I could get is trading XML documents
with another application (via a SOAP-like protocol). Since XML is
integral to OpenCMS, it's pretty easy to add on.

I believe someone else on this list used a UNIX shell script with wget
to accomplish this sort of thing, but I don't know the details.

> Thnx Vangelis
> 
> -----Original Message-----
> From: Vlachogiannis Evangelos [mailto:evlach at aegean.gr] 
> Sent: Tuesday, October 07, 2003 1:26 AM
> To: 'opencms-dev at opencms.org'
> Subject: [opencms-dev] External_new_upload
> 
> 
> Hi all,
> 
> I am trying to upload/unlock/publish a resource at once from outside
> jetspeed. I have created a class/action/template (attached) like
> CmsNewResourceUpload containing the following code:
> 
> cms.loginUser("admin","admin");
> System.out.println("trying to create..."); cms.createResource(currentFolder
> + filename, type.getResourceTypeName(), new Hashtable(), filecontent, null);
> System.out.println("created..."); cms.unlockResource( currentFolder +
> filename );
> cms.publishResource( currentFolder + filename);	
> 
> What I am getting is no uploaded file and the following console message:
> 
> step: 2
> filename: New_Text_Document.txt
> currentFolder: /release/
> title: null
> newtype: plain
> overwrite: false
> cancel: false
> Step2@@@@@@@@@
> logged in suc
> trying to create...
> com.opencms.core.CmsException: 1 Access denied. Detailed error:
> [com.opencms.file.mySql.CmsResourceBroker]
> /default/vfs/release/New_Text_Document.txt.
> 
> Could anyone help me please?
> 
> Thnx in advance,
> Vangelis
> 
> 
> _______________________________________________
> 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
-- 
M Butcher <mbutcher at grcomputing.net>



More information about the opencms-dev mailing list