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]