Oliver
Mihir Solanki wrote:
Oliver,
I have one more question...
First I will explain you the scenario, that is what exactly I wanted to do.
I wanted to write a custom store in such a way that it will store the actual contents in the Clear case and the metadata information (i.e. descriptor information) in the oracle database.
Now what I am thinking is I will write a custom store and I will implement all the *Store interface. But, I will only write actual implementation for the methods of ContentStore interface. I will write implementation of these Method in such a way that it will create/update/retrieve/delete the contentFrom both clear case and database as and when required.
Is it OK? Or I have to implement methods of NodeStore (i.e. for metadata) also?
Please guide me on this...
Regards, Mihir
-----Original Message-----
From: Oliver Zeigermann [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 21, 2004 11:56 AM
To: Slide Users Mailing List
Subject: Re: FW: writing custom store
OK, now I got it: You want to know if it is sufficient to implement ContentStore, LockStore, SecurityStore, NodeStore,RevisionDescriptorsStore, RevisionDescriptorStore and the abstarct methods of AbstractServiceBase? Right?
The simple answer to this question is yes. However, you will have to fill *all* methods with meaningful code as the whole Slide system relies
on it as per contract. If you want only - say - content to be stored in your store, then only implement ContentStore and use other stores - maybe the default one - to do the other storing jobs. However, this will
result in scattered data.
As a general recommendation look at the code of the default store and learn how it works. If you understand it it will be pretty easy to implement your own store. Also have a look at
http://wiki.apache.org/jakarta-slide/CreateNewSlideStore
Oliver
Mihir Solanki wrote:
Oliver,
Yes I know that the method bodies are empty.
But please go through the code and let me know whether this is Sufficient to write the custom store (for both content and metadata)?
I am actually going to implement these methods as per my requirement.
Mihir
-----Original Message-----
From: Oliver Zeigermann [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 21, 2004 11:33 AM
To: Slide Users Mailing List
Subject: Re: FW: writing custom store
Mihir,
all your method bodies are empty! On exactly *what* shall we have a look?
Cheers,
Oliver
Mihir Solanki wrote:
Hi Michael,
Here with this email I am attaching the java source code For my custom store.
Please have a look and suggest me whether this is OK or NOT.
I have implemented all the *Store interfaces and extended my custom Store class from "AbstractServiceBase".
I am actually going to implement only those methods those are required to me.
One more thing is why I am writing the custom store is because my
actual
content (files) will be stored in the other repository then slide (say clear case) and the descriptor (metadata) information will be stored
in
the database.
So I think I am on the right track for doing the same...
Please do helpful...
Below is the Code for Custom Store
/* * Created on Jul 20, 2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and
Comments
*/ package org.apache.slide.store;
import java.util.Enumeration; import java.util.Hashtable;
import javax.transaction.xa.XAException; import javax.transaction.xa.XAResource; import javax.transaction.xa.Xid;
import org.apache.slide.common.AbstractServiceBase; import org.apache.slide.common.ServiceAccessException; import org.apache.slide.common.ServiceConnectionFailedException; import org.apache.slide.common.ServiceDisconnectionFailedException; import org.apache.slide.common.ServiceParameterErrorException; import org.apache.slide.common.ServiceParameterMissingException; import org.apache.slide.common.ServiceResetFailedException; import org.apache.slide.common.Uri; import org.apache.slide.content.NodeRevisionContent; import org.apache.slide.content.NodeRevisionDescriptor; import org.apache.slide.content.NodeRevisionDescriptors; import org.apache.slide.content.NodeRevisionNumber; import org.apache.slide.content.RevisionAlreadyExistException; import org.apache.slide.content.RevisionDescriptorNotFoundException; import org.apache.slide.content.RevisionNotFoundException; import org.apache.slide.lock.LockTokenNotFoundException; import org.apache.slide.lock.NodeLock; import org.apache.slide.security.NodePermission; import org.apache.slide.store.ContentStore; import org.apache.slide.store.LockStore; import org.apache.slide.store.NodeStore; import org.apache.slide.store.RevisionDescriptorStore; import org.apache.slide.store.RevisionDescriptorsStore; import org.apache.slide.store.SecurityStore; import org.apache.slide.structure.ObjectAlreadyExistsException; import org.apache.slide.structure.ObjectNode; import org.apache.slide.structure.ObjectNotFoundException;
/** * @author solankmi * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and
Comments
*/ public class CustomStore extends AbstractServiceBase implements ContentStore, LockStore, SecurityStore, NodeStore, RevisionDescriptorsStore, RevisionDescriptorStore {
public void setParameters(Hashtable parameters) throws ServiceParameterErrorException, ServiceParameterMissingException { }
public void connect() throws ServiceConnectionFailedException { } public void disconnect() throws ServiceDisconnectionFailedException { } public void reset() throws ServiceResetFailedException { } public boolean isConnected() throws ServiceAccessException { return false; } public NodeRevisionContent retrieveRevisionContent( Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException, RevisionNotFoundException { return null; }
public void createRevisionContent( Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws ServiceAccessException, RevisionAlreadyExistException {
} public void storeRevisionContent( Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws ServiceAccessException, RevisionNotFoundException { } public void removeRevisionContent( Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException {
} public void putLock(Uri uri, NodeLock lock) throws ServiceAccessException { } public void renewLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException { } public void removeLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException { } public void killLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException { } public Enumeration enumerateLocks(Uri uri) throws ServiceAccessException { return null; } public void grantPermission(Uri uri, NodePermission permission) throws ServiceAccessException { } public void revokePermission(Uri uri, NodePermission permission) throws ServiceAccessException { } public void revokePermissions(Uri uri) throws ServiceAccessException { } public Enumeration enumeratePermissions(Uri uri) throws ServiceAccessException { return null; } public ObjectNode retrieveObject(Uri uri) throws ServiceAccessException, ObjectNotFoundException { return null; } public void storeObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException { } public void createObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectAlreadyExistsException { } public void removeObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException { } public NodeRevisionDescriptors retrieveRevisionDescriptors(Uri uri) throws ServiceAccessException, RevisionDescriptorNotFoundException { return null; } public void createRevisionDescriptors( Uri uri, NodeRevisionDescriptors revisionDescriptors) throws ServiceAccessException { } public void storeRevisionDescriptors( Uri uri, NodeRevisionDescriptors revisionDescriptors) throws ServiceAccessException, RevisionDescriptorNotFoundException { } public void removeRevisionDescriptors(Uri uri) throws ServiceAccessException { } public NodeRevisionDescriptor retrieveRevisionDescriptor( Uri uri, NodeRevisionNumber revisionNumber) throws ServiceAccessException, RevisionDescriptorNotFoundException { return null; } public void createRevisionDescriptor( Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException { } public void storeRevisionDescriptor( Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException, RevisionDescriptorNotFoundException { } public void removeRevisionDescriptor( Uri uri, NodeRevisionNumber revisionNumber) throws ServiceAccessException { } public void commit(Xid arg0, boolean arg1) throws XAException { } public void end(Xid arg0, int arg1) throws XAException { } public void forget(Xid arg0) throws XAException { } public int getTransactionTimeout() throws XAException { return 0; } public boolean isSameRM(XAResource arg0) throws XAException { return false; } public int prepare(Xid arg0) throws XAException { return 0; } public Xid[] recover(int arg0) throws XAException { return null; } public void rollback(Xid arg0) throws XAException { } public boolean setTransactionTimeout(int arg0) throws XAException { return false; } public void start(Xid arg0, int arg1) throws XAException { } }
Thanks Mihir
-----Original Message-----
From: Michael Oliver [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 7:10 PM
To: 'Slide Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: writing custom store
All you need to do is look at the Tx*Stores, they extend AbstractTxFileStoreService
What I would do is look at those and while you certainly can have just one class to do it, there really isn't any advantage in doing that. Implement all the interfaces and do your development in a limited
scope
so both the working default Tx*Stores and your custom stores are
running
side by side so you can compare activities.
Michael Oliver
CTO
Matrix Intermedia Inc.
3325 N. Nellis Blvd, #1
Las Vegas, NV 89115
Phone:(702)643-7425
Fax:(520)844-1036
-----Original Message-----
From: Mihir Solanki [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 5:02 AM
To: Slide-Mailing
Subject: writing custom store
Hi all,
I want to write my own custom store.
Basically I wanted to write a single class (single store) for both
content and metadata.
Can anybody please tell me what all classes I have to look in slide
2.0
Also if possible please tell me from what all classes I have either extend or implement
my custom store class
If one can provide the custom class (sample code) then nothing better than it.
Thanks in advance,
Mihir
Sr. Software Engineer
SBU: eBiz, Gandhinagar
"Imaginations... its limits are only those of the mind itself"
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
