arlut.csd.ganymede
Class xmlobject

java.lang.Object
  |
  +--arlut.csd.ganymede.xmlobject

public class xmlobject
extends java.lang.Object

This class is a data holding structure that is intended to hold object and field data for an XML object element for GanymedeXMLSession.


Field Summary
(package private)  java.lang.String actionMode
          Action mode for this object, should be null, "create", "edit", "delete", or "inactivate".
(package private) static boolean debug
           
(package private)  boolean embedded
          If true, this object was an embedded object
(package private)  java.util.Hashtable fields
          Hashtable mapping non-XML-coded xmlfield names to xmlfield objects.
(package private)  boolean forceCreate
          Create only flag.
(package private)  java.lang.String id
          The local identifier string for this object
(package private)  arlut.csd.ganymede.Invid invid
          The server-side object identifier for this object.
(package private)  boolean knownNonExistent
          If true, the invid for this field is known to not exist on the server.
(package private)  int num
          The object number, if known.
(package private)  arlut.csd.ganymede.db_object objref
          Reference to server-side object, if we have already created it/got a reference to it from the server.
(package private)  java.lang.Short type
          The short object type id for this object type.
(package private)  java.lang.String typeString
          Descriptive typeString for this object.
(package private)  arlut.csd.ganymede.GanymedeXMLSession xSession
          Reference to the GanymedeXMLSession working with us.
 
Constructor Summary
xmlobject(arlut.csd.Util.XMLElement openElement, boolean embedded, arlut.csd.ganymede.GanymedeXMLSession xSession)
          This constructor takes the XMLElement defining an object to be created or manipulated on the server and loads all information for this object into the xmlobject created.
xmlobject(arlut.csd.Util.XMLElement openElement, arlut.csd.ganymede.GanymedeXMLSession xSession)
          This constructor takes the XMLElement defining an object to be created or manipulated on the server and loads all information for this object into the xmlobject created.
 
Method Summary
 arlut.csd.ganymede.ReturnVal createOnServer(arlut.csd.ganymede.Session session)
          This method causes this object to be created on the server.
 arlut.csd.ganymede.ReturnVal editOnServer(arlut.csd.ganymede.Session session)
          This method causes this object to be checked out for editing on the server.
 arlut.csd.ganymede.FieldTemplate getFieldDef(java.lang.String fieldName)
          This method returns a field definition for a named field.
 arlut.csd.ganymede.Invid getInvid()
          This method returns an invid for this xmlobject record, performing a lookup on the server if necessary.
 java.lang.String getMode()
           
 short getType()
           
 arlut.csd.ganymede.ReturnVal registerFields(int mode)
          This method uploads non-Invid field information contained in this object up to the Ganymede server.
 void setInvid(arlut.csd.ganymede.Invid invid)
          This method sets the invid for this object, if it is discovered from the server during processing.
 java.lang.String toString()
           
 java.lang.String toString(boolean showAll)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

static final boolean debug
See Also:
Constant Field Values

id

java.lang.String id

The local identifier string for this object


typeString

java.lang.String typeString

Descriptive typeString for this object. This is the contents of the <object>'s type attribute, in XML (underscores for spaces) encoding.


actionMode

java.lang.String actionMode

Action mode for this object, should be null, "create", "edit", "delete", or "inactivate".


type

java.lang.Short type

The short object type id for this object type.

Will be null if undefined.


invid

arlut.csd.ganymede.Invid invid

The server-side object identifier for this object. Will be null until we create or locate this object in the server.


knownNonExistent

boolean knownNonExistent

If true, the invid for this field is known to not exist on the server.


num

int num

The object number, if known. This may be used to identify an object on the server if the object is not thought to have a unique identifier string.

Will be negative one if undefined.


fields

java.util.Hashtable fields

Hashtable mapping non-XML-coded xmlfield names to xmlfield objects.


objref

arlut.csd.ganymede.db_object objref

Reference to server-side object, if we have already created it/got a reference to it from the server.


forceCreate

boolean forceCreate

Create only flag. If this flag is true, this object was explicitly specified as a new object to be created, rather than one that should be created only if an object with the same type/id pair isn't found on the server.


embedded

boolean embedded

If true, this object was an embedded object


xSession

arlut.csd.ganymede.GanymedeXMLSession xSession

Reference to the GanymedeXMLSession working with us.

Constructor Detail

xmlobject

public xmlobject(arlut.csd.Util.XMLElement openElement,
                 arlut.csd.ganymede.GanymedeXMLSession xSession)
          throws org.xml.sax.SAXException

This constructor takes the XMLElement defining an object to be created or manipulated on the server and loads all information for this object into the xmlobject created.

This constructor reads all elements from the xmlclient XML stream up to and including the matching close element for this object.


xmlobject

public xmlobject(arlut.csd.Util.XMLElement openElement,
                 boolean embedded,
                 arlut.csd.ganymede.GanymedeXMLSession xSession)
          throws org.xml.sax.SAXException

This constructor takes the XMLElement defining an object to be created or manipulated on the server and loads all information for this object into the xmlobject created.

This constructor reads all elements from the xmlclient XML stream up to and including the matching close element for this object.

Method Detail

getMode

public java.lang.String getMode()

createOnServer

public arlut.csd.ganymede.ReturnVal createOnServer(arlut.csd.ganymede.Session session)

This method causes this object to be created on the server.

This method uses the standard ReturnVal return semantics.


editOnServer

public arlut.csd.ganymede.ReturnVal editOnServer(arlut.csd.ganymede.Session session)

This method causes this object to be checked out for editing on the server.

This method uses the standard ReturnVal return semantics.


registerFields

public arlut.csd.ganymede.ReturnVal registerFields(int mode)

This method uploads non-Invid field information contained in this object up to the Ganymede server.

This method skips any Invid fields, which will need to be resolved in a second pass.

Parameters:
mode - 0 to register all non-invids, 1 to register just invids, 2 to register both

getType

public short getType()

getInvid

public arlut.csd.ganymede.Invid getInvid()

This method returns an invid for this xmlobject record, performing a lookup on the server if necessary.


setInvid

public void setInvid(arlut.csd.ganymede.Invid invid)

This method sets the invid for this object, if it is discovered from the server during processing. Used to provide invids for newly created embedded objects, for instance.


getFieldDef

public arlut.csd.ganymede.FieldTemplate getFieldDef(java.lang.String fieldName)

This method returns a field definition for a named field. The fieldName string is assumed to be underscore-for-space XML encoded.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean showAll)