org.nees.repo.chef
Class DisplayMetadataObject

java.lang.Object
  extended byorg.nees.repo.chef.DisplayMetadataObject

public class DisplayMetadataObject
extends java.lang.Object

This class holds information about a MetadataObject so it can be displayed and manipulated in a user interface. The Relations of an object are represented by DisplayRelations which are kept in the read-only displayRelations property.

Typical Usage:

Used by the CHEF UI code to pass information about MD objects to the velocity templates used to display the objects.

Life Cycle:

Constructed by the CHEF UI code and passed to velocity templates, which use them to construct HTML views of the objects.

See Also:
DisplayRelation

Constructor Summary
DisplayMetadataObject(MetadataObject obj, NMDSFacade nmdsFacade, Schema s)
           
 
Method Summary
protected  void createDisplayRelations()
          Creates display relations for all the editable relations of the object.
 void createReferenceRelation(DisplayRelation dr)
          Fill in values for a reference display relation.
 int getAccessionNumber()
          Get the object's accession number.
 Identifier getClassId()
          Get the object's class ID.
 java.lang.String getClassTitle()
          Get the class's title
 java.lang.String getCreateTime()
          Get the object's creation time in local string form.
 Identifier getIdentifier()
          Get the object's ID.
 java.lang.String getIdentifierAsString()
          Get the object's ID.
 LogicalName getLogicalName()
          If it's a file, get its logical name
 MetadataClass getMetadataClass()
           
 MetadataObject getMetadataObject()
           
 Schema getSchema()
           
 java.util.Vector getSingleReferenceDisplayRelations()
           
 java.util.Vector getSingleStringDisplayRelations()
           
 MetadataObjectSummary getSummary()
          Get the object's MetadataObjectSummary.
 java.lang.String getTitle()
          Get the object's title.
 java.lang.String getUpdateTime()
          Get the object's update time in local string form.
 java.util.Vector getVectorReferenceDisplayRelations()
           
 java.util.Vector getVectorStringDisplayRelations()
           
 int getVersion()
          Get the object's version number.
 boolean isContainer()
          Determine whether an object is a container/folder.
 boolean isFile()
          Is the object a file?
 boolean isViewable(Identifier relationID)
          Is the relation viewable?
 void refreshSummary()
          Refresh the object's summary information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayMetadataObject

public DisplayMetadataObject(MetadataObject obj,
                             NMDSFacade nmdsFacade,
                             Schema s)
Method Detail

getMetadataObject

public MetadataObject getMetadataObject()

getSchema

public Schema getSchema()

getMetadataClass

public MetadataClass getMetadataClass()
                               throws MetadataException
Throws:
MetadataException

createDisplayRelations

protected void createDisplayRelations()
Creates display relations for all the editable relations of the object. Stores informaton about each relation's type, cardinality, ID etc.


createReferenceRelation

public void createReferenceRelation(DisplayRelation dr)
Fill in values for a reference display relation.


getSingleStringDisplayRelations

public java.util.Vector getSingleStringDisplayRelations()

getSingleReferenceDisplayRelations

public java.util.Vector getSingleReferenceDisplayRelations()

getVectorStringDisplayRelations

public java.util.Vector getVectorStringDisplayRelations()
Returns:
a vector of all the vector string relation types

getVectorReferenceDisplayRelations

public java.util.Vector getVectorReferenceDisplayRelations()

getTitle

public java.lang.String getTitle()
Get the object's title.

Returns:
the object's title.

getSummary

public MetadataObjectSummary getSummary()
Get the object's MetadataObjectSummary.


getVersion

public int getVersion()
Get the object's version number.


getAccessionNumber

public int getAccessionNumber()
Get the object's accession number.


getCreateTime

public java.lang.String getCreateTime()
Get the object's creation time in local string form.


getUpdateTime

public java.lang.String getUpdateTime()
Get the object's update time in local string form.


getClassId

public Identifier getClassId()
                      throws MetadataException
Get the object's class ID.

Throws:
MetadataException

getClassTitle

public java.lang.String getClassTitle()
                               throws MetadataException
Get the class's title

Throws:
MetadataException

getIdentifier

public Identifier getIdentifier()
Get the object's ID.


getIdentifierAsString

public java.lang.String getIdentifierAsString()
Get the object's ID.


isContainer

public boolean isContainer()
Determine whether an object is a container/folder.


isViewable

public boolean isViewable(Identifier relationID)
Is the relation viewable?

Parameters:
relationID - the relationID

isFile

public boolean isFile()
               throws MetadataException
Is the object a file?

Throws:
MetadataException

getLogicalName

public LogicalName getLogicalName()
                           throws MetadataException
If it's a file, get its logical name

Throws:
MetadataException

refreshSummary

public void refreshSummary()
                    throws NMDSException
Refresh the object's summary information.

Throws:
NMDSException