Now I'm getting a different error...my code is borrowed from the WebDAV
PutMethod:


String namespaceName  = Domain.getDefaultNamespace();

                NamespaceAccessToken nat = Domain.accessNamespace(new
SecurityToken(this), namespaceName);
                        
                nat.begin();
                
                CredentialsToken cred = new CredentialsToken("root");
                
                SlideToken slideToken = new SlideTokenImpl();
                
                Content content = nat.getContentHelper();
                
        //      content.create( slideToken , "Test" , true );
                
                String resourcePath="";//TODO
                
                
                NodeRevisionDescriptors revisionDescriptors =
                           content.retrieve(slideToken, resourcePath);
                
                   NodeRevisionNumber revisionNumber =
                           revisionDescriptors.getLatestRevision();
                   NodeRevisionDescriptor oldRevisionDescriptor = null;
                   if (revisionNumber != null) {
                           try {
                                   oldRevisionDescriptor = content.retrieve
                                           (slideToken,
revisionDescriptors);
                           } catch (RevisionDescriptorNotFoundException e) {
                           }
                   }
                            
                   NodeRevisionDescriptor revisionDescriptor = null;
                   if (oldRevisionDescriptor == null) {
                           revisionDescriptor = new
NodeRevisionDescriptor();
                   } else {
                           revisionDescriptor = oldRevisionDescriptor;
                           revisionDescriptor.setContentLength(-1);
                   }
                
                         
                   // Changed for DeltaV --end--
                
                   NodeRevisionContent revisionContent =
                           new NodeRevisionContent();
                   //revisionContent.setContent(req.getReader());
                   revisionContent.setContent( new ByteArrayInputStream(
"TEST".getBytes() ) );
                
                   // Get content length
                   revisionDescriptor.setContentLength(100);
                
                   // Last modification date
                   revisionDescriptor.setLastModified(new Date());
                
                   // Etag generation
        
//revisionDescriptor.setETag(PropertyHelper.computeEtag(resourcePath,
revisionDescriptor) );
                
                   // Get content type (allow content-type to be updated
here)
                  // String contentType = req.getContentType();
                   
                  //   revisionDescriptor.setContentType(contentType);
                
                  // Resource type
                  revisionDescriptor.setResourceType("");
                        
                  content.store(slideToken, "", revisionDescriptor,
                                                 revisionContent);
                
                 nat.commit();



and I'm getting the following exception:

org.apache.slide.common.ServiceAccessException: Service TxFileStore at
store/content  working on work/content access error : main-1081443098296-5:
Failed to undo change / create of '/_1.0' (ERR_SYSTEM)
        at
org.apache.slide.store.txfile.AbstractTxFileStoreService.throwInternalError(
AbstractTxFileStoreService.java:414)
        at
org.apache.slide.store.txfile.TxFileContentStore.storeRevisionContent(TxFile
ContentStore.java:125)
        at
org.apache.slide.store.AbstractStore.storeRevisionContent(AbstractStore.java
:1237)
        at
org.apache.slide.store.ExtendedStore.storeRevisionContent(ExtendedStore.java
:367)
        at org.apache.slide.content.ContentImpl.store(ContentImpl.java:996)
        at TxFileContentStoreTest.run(TxFileContentStoreTest.java:121)
        at TxFileContentStoreTest.main(TxFileContentStoreTest.java:43)




Good news is that I can see the generated file in my working folder.



Any help much appreciated...

Rgds
Mike Smith


-----Original Message-----
From: Mike Smith [mailto:[EMAIL PROTECTED] 
Sent: 08 April 2004 17:39
To: 'Slide Users Mailing List'
Subject: RE: how do I start to use Slide API

Disabling security AND locking(!?) resolves my current issue....

-----Original Message-----
From: Mike Smith [mailto:[EMAIL PROTECTED] 
Sent: 08 April 2004 17:09
To: 'Slide Users Mailing List'
Subject: RE: how do I start to use Slide API

Hi,

I'm looking at trying to accomplish the same result...This is my first look
at Slide and so far it looks like it will meet our requirements.

We are definitely going to need to perform some heavy customization around
security (at the file system layer), as well as some other minor changes -
publishing the content repository as a normal share.

Our end goal is to provide a transactional file store that enables us to
synchronize metadata and security model changes with published 'workspaces'
or folders.

My current focus is on testing the transactional file store. I understand
some of it's limitations but it is compatible with our requirements/current
thinking in terms of implementation. 

First up, I got Slide 1 up and running quickly and easily, so I think I know
the absolute basics.

Now I'm trying to run my test class and I get a runtime error. Details
below.


String namespaceName  = Domain.getDefaultNamespace();

NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(this),
namespaceName);
                        
nat.begin();
                
CredentialsToken cred = new CredentialsToken("root");
                
SlideToken slideToken = new SlideTokenImpl();
                
Content content = nat.getContentHelper();
                
String resourcePath="/";//TODO
                
NodeRevisionDescriptors revisionDescriptors =
                           content.retrieve(slideToken, resourcePath);

....do some work and then commit


The error I'm getting is:

java.lang.NullPointerException
        at
org.apache.slide.security.SecurityImpl.getPrincipal(SecurityImpl.java:967)
        at
org.apache.slide.security.ACLSecurityImpl.evaluateAcl(ACLSecurityImpl.java:2
97)
        at
org.apache.slide.security.ACLSecurityImpl.hasPermission(ACLSecurityImpl.java
:123)
        at
org.apache.slide.security.SecurityImpl.checkPermission(SecurityImpl.java:461
)
        at
org.apache.slide.security.SecurityImpl.checkCredentials(SecurityImpl.java:39
3)
        at
org.apache.slide.structure.StructureImpl.retrieve(StructureImpl.java:159)
        at
org.apache.slide.content.ContentImpl.retrieve(ContentImpl.java:155)
        at TxFileContentStoreTest.run(TxFileContentStoreTest.java:72)
        at TxFileContentStoreTest.main(TxFileContentStoreTest.java:43)

                        

I had a look through the Slide 2 docs and I couldn't see anything on
security config.....

Many Thanks
Mike
        

-----Original Message-----
From: Oliver Zeigermann [mailto:[EMAIL PROTECTED] 
Sent: 07 April 2004 09:31
To: Slide Users Mailing List
Subject: Re: how do I start to use Slide API

Although drastic, the only thing I can recommend is to use the WebDAV 
layer as API. It is maintained well, while the core Slide API really has 
some strange oddities. Only program directly to the Slide API if you, 
really, really must. But this is only my *very personal* impression.

Oliver

Slide Tao wrote:

> hi,
> 
> first, thanks for all friends who had helped me before.
> 
> So far I have set up Slide2 using JDBCstore to store metadata and 
> filesystem to store files. Now I want to use Slide API to create my own 
> code to manage the Slide Server. How can I?
> 
> I have read some examples providing by Slide1.0.16. But I am so 
> confused. The examples seems to load the Domain infomation from the 
> Domain.xml files. How can I load the Domain information from the Domain 
> of the Slide Server?? In examples, to create a new slideToken, no 
> username and password need to be checked, and just put "root" in the 
> CredentialsToken. Who can explain the process to me.
> 
> Any reply would be much appreciated.
> 
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*. 
> http://join.msn.com/?page=features/featuredemail
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> .
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to