private ObjectFields getObjectFields(String pid)
            throws UnrecognizedFieldException, ObjectIntegrityException,
            RepositoryConfigurationException, StreamIOException,
            ServerException {
        DOReader r =
                m_repoReader.getReader(Server.USE_DEFINITIVE_STORE,
                                       ReadOnlyContext.EMPTY,
                                       pid);
        ObjectFields f;
        // If there's a DC record available, use SAX to parse the most
        // recent version of it into f.
        Datastream dcmd = null;
        try {
            dcmd = r.GetDatastream("DC", null);
        } catch (ClassCastException cce) {
            throw new ObjectIntegrityException("Object " + r.GetObjectPID()
                    + " has a DC datastream, but it's not inline XML.");
        }
        if (dcmd != null) {
            f = new ObjectFields(m_resultFields, dcmd.getContentStream());
            // add dcmDate if wanted
            for (String element : m_resultFields) {
                if (element.equals("dcmDate")) {
                    f.setDCMDate(dcmd.DSCreateDT);
                }
            }
        } else {
            f = new ObjectFields();
        }
        // add non-dc values from doReader for the others in m_resultFields[]
        //        Disseminator[] disses=null;
        for (String n : m_resultFields) {
            if (n.equals("pid")) {
                f.setPid(pid);
            }
            if (n.equals("label")) {
                f.setLabel(r.GetObjectLabel());
            }
            if (n.equals("state")) {
                f.setState(r.GetObjectState());
            }
            if (n.equals("ownerId")) {
                f.setOwnerId(r.getOwnerId());
            }
            if (n.equals("cDate")) {
                f.setCDate(r.getCreateDate());
            }
            if (n.equals("mDate")) {
                f.setMDate(r.getLastModDate());
            }
        }
        return f;
    }
private ObjectFields getObjectFields ( String pid ) throws UnrecognizedFieldException , ObjectIntegrityException , RepositoryConfigurationException , StreamIOException , ServerException { DOReader r = m_repoReader . getReader ( Server . USE_DEFINITIVE_STORE , ReadOnlyContext . EMPTY , pid ) ; ObjectFields f ; Datastream dcmd = null ; try { dcmd = r . GetDatastream ( "DC" , null ) ; } catch ( ClassCastException cce ) { throw new ObjectIntegrityException ( "Object " + r . GetObjectPID ( ) + " has a DC datastream, but it's not inline XML." ) ; } if ( dcmd != null ) { f = new ObjectFields ( m_resultFields , dcmd . getContentStream ( ) ) ; for ( String element : m_resultFields ) { if ( element . equals ( "dcmDate" ) ) { f . setDCMDate ( dcmd . DSCreateDT ) ; } } } else { f = new ObjectFields ( ) ; } for ( String n : m_resultFields ) { if ( n . equals ( "pid" ) ) { f . setPid ( pid ) ; } if ( n . equals ( "label" ) ) { f . setLabel ( r . GetObjectLabel ( ) ) ; } if ( n . equals ( "state" ) ) { f . setState ( r . GetObjectState ( ) ) ; } if ( n . equals ( "ownerId" ) ) { f . setOwnerId ( r . getOwnerId ( ) ) ; } if ( n . equals ( "cDate" ) ) { f . setCDate ( r . getCreateDate ( ) ) ; } if ( n . equals ( "mDate" ) ) { f . setMDate ( r . getLastModDate ( ) ) ; } } return f ; }
For the given pid, get a reader on the object from the repository and
return an ObjectFields object with resultFields fields populated.

@param pid
the unique identifier of the object for which the information is
requested.
@return ObjectFields populated with the requested fields
@throws UnrecognizedFieldException
if a resultFields value isn't valid
@throws ObjectIntegrityException
if the underlying digital object can't be parsed
@throws RepositoryConfigurationException
if the sax parser can't be constructed
@throws StreamIOException
if an error occurs while reading the serialized digital object
stream
@throws ServerException
if any other kind of error occurs while reading the underlying
object