*/
public class ClientDocument implements IClientDocument {
protected IClient vorba;
-
- protected VamsasDocument doc;
-
+ protected org.vamsas.objects.core.VAMSAS[] roots;
protected byte[] appData;
/**
* collection of org.vamsas.client.object references
*/
protected Hashtable vamsasObjects;
-
+
/*
* (non-Javadoc)
*
* @see org.vamsas.client.IClientDocument#getApplicationData()
*/
+ /**
+ *
+ * @param data
+ * @param doc
+ * @param objects
+ * @param vorba
+ */
+ protected ClientDocument(byte[] data, VAMSAS[] roots, Hashtable objects, IClient vorba) {
+ // TODO Auto-generated constructor stub
+ appData = data;
+ this.roots =roots;
+ vamsasObjects = objects;
+ this.vorba = vorba;
+ }
+
public byte[] getApplicationData() {
// Look up client byte stash using client and user handle
-
- return null;
+ return appData;
}
/*
*/
public object[] getVamsasRoots() {
// extract root objects
- VAMSAS[] roots = doc.getVAMSAS();
if (roots == null)
return new VAMSAS[] { new VAMSAS() };
return roots;
*/
public void setVamsasRoots(VAMSAS[] newroots) {
// extract root objects
- VAMSAS[] roots = doc.getVAMSAS();
if (newroots != null) {
// check newroots for objects that were present in the old document
// check to see if the 'old' objects have been modified
}
} else {
throw new Error(
- "Client error when using setVamsasRoots : The vorbaId for object "
+ "SimpleClient error when using setVamsasRoots : The vorbaId for object "
+ i
+ " does not refer to an object of type VAMSAS in the current document!");
}
* @see org.vamsas.client.IClientDocument#registerObject(org.vamsas.client.object)
*/
public VorbaId registerObject(object unregistered) {
- VorbaId rtn;
if (!unregistered.isRegistered())
- unregistered.VorbaId.(rtn=unregistered.__vorba.makeVorbaId());
- else
- return unregistered.getVorbaId();
+ unregistered.setVorbaId(unregistered.__vorba.makeVorbaId());
+ return unregistered.getVorbaId();
}
/*
* (non-Javadoc)
* @see org.vamsas.client.IClientDocument#registerObjects(org.vamsas.client.object[])
*/
public VorbaId[] registerObjects(object[] unregistered) {
- // TODO Auto-generated method stub
+ if (unregistered!=null) {
+ VorbaId ids[] = new VorbaId[unregistered.length];
+ for (int i=0,k=unregistered.length; i<k; i++)
+ ids[i]=registerObject(unregistered[i]);
+ return ids;
+ }
return null;
}
* @see org.vamsas.client.IClientDocument#setApplicationData(byte[])
*/
public void setApplicationData(byte[] newData) {
- // TODO Auto-generated method stub
-
+ appData = newData;
}
}