org.apache.lenya.cms.publication
Class DublinCoreProxy

java.lang.Object
  extended by org.apache.lenya.cms.publication.DublinCoreProxy
All Implemented Interfaces:
DublinCore

public class DublinCoreProxy
extends java.lang.Object
implements DublinCore

A proxy to the dublin core meta implementation so that meta data is only read from file when it is actually requested.


Field Summary
 
Fields inherited from interface org.apache.lenya.cms.publication.DublinCore
ELEMENT_CONTRIBUTOR, ELEMENT_COVERAGE, ELEMENT_CREATOR, ELEMENT_DATE, ELEMENT_DESCRIPTION, ELEMENT_FORMAT, ELEMENT_IDENTIFIER, ELEMENT_LANGUAGE, ELEMENT_PUBLISHER, ELEMENT_RELATION, ELEMENT_RIGHTS, ELEMENT_SOURCE, ELEMENT_SUBJECT, ELEMENT_TITLE, ELEMENT_TYPE, TERM_ABSTRACT, TERM_ACCESSRIGHTS, TERM_ALTERNATIVE, TERM_AUDIENCE, TERM_AVAILABLE, TERM_BIBLIOGRAPHICCITATION, TERM_CONFORMSTO, TERM_CREATED, TERM_DATEACCEPTED, TERM_DATECOPYRIGHTED, TERM_DATESUBMITTED, TERM_EDUCATIONLEVEL, TERM_EXTENT, TERM_HASFORMAT, TERM_HASPART, TERM_HASVERSION, TERM_ISFORMATOF, TERM_ISPARTOF, TERM_ISREFERENCEDBY, TERM_ISREPLACEDBY, TERM_ISREQUIREDBY, TERM_ISSUED, TERM_ISVERSIONOF, TERM_MEDIATOR, TERM_MEDIUM, TERM_MODIFIED, TERM_REFERENCES, TERM_REPLACES, TERM_REQUIRES, TERM_SPATIAL, TERM_TABLEOFCONTENTS, TERM_TEMPORAL, TERM_VALID
 
Constructor Summary
DublinCoreProxy(Document aDocument)
          Creates a new instance of Dublin Core
 
Method Summary
 void addValue(java.lang.String key, java.lang.String value)
          Adds a value for a certain key.
 void addValues(java.lang.String key, java.lang.String[] values)
          Add all values for a certain key.
 java.lang.String getCreator()
          Get the creator
 java.lang.String getDateCreated()
          Get the date of creation
 java.lang.String getDateIssued()
          Get the date of issue
 java.lang.String getDescription()
          Get the description
 java.lang.String getFirstValue(java.lang.String key)
          Returns the first value for a certain key.
 java.lang.String getIdentifier()
          Get the identifier
 java.lang.String getIsReferencedBy()
          Get isReferencedBy
 java.lang.String getPublisher()
          Get the publisher
 java.lang.String getRights()
          Get the rights
 java.lang.String getSubject()
          Get the subject.
 java.lang.String getTitle()
          Get the title
 java.lang.String[] getValues(java.lang.String key)
          Returns the values for a certain key.
protected  DublinCoreImpl instance()
          Instanciate a dublin core implementation object
 void removeAllValues(java.lang.String key)
          Removes all values for a certain key.
 void removeValue(java.lang.String key, java.lang.String value)
          Removes a specific value for a certain key.
 void replaceBy(DublinCore other)
          Replace the contents of the current dublin core by the contents of other.
 void save()
          Save the meta data.
 void setCreator(java.lang.String creator)
          Set the DC creator
 void setDateCreated(java.lang.String dateCreated)
          Set the date of creation
 void setDateIssued(java.lang.String dateIssued)
          Set the date of issue
 void setDescription(java.lang.String description)
          Set the DC Description
 void setIdentifier(java.lang.String identifier)
          Set the DC Identifier
 void setIsReferencedBy(java.lang.String isReferencedBy)
          Set isReferencedBy
 void setPublisher(java.lang.String publisher)
          Set the publisher
 void setRights(java.lang.String rights)
          Set the DC Rights
 void setSubject(java.lang.String subject)
          Set the DC Subject
 void setTitle(java.lang.String title)
          Set the DC title
 void setValue(java.lang.String key, java.lang.String value)
          Sets the value for a certain key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DublinCoreProxy

public DublinCoreProxy(Document aDocument)
Creates a new instance of Dublin Core

Parameters:
aDocument - the document for which the Dublin Core instance is created.
Method Detail

instance

protected DublinCoreImpl instance()
                           throws DocumentException
Instanciate a dublin core implementation object

Returns:
a real dublin core object
Throws:
DocumentException - when an error occurs.

getCreator

public java.lang.String getCreator()
                            throws DocumentException
Description copied from interface: DublinCore
Get the creator

Specified by:
getCreator in interface DublinCore
Returns:
the creator
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getCreator()

getDateCreated

public java.lang.String getDateCreated()
                                throws DocumentException
Description copied from interface: DublinCore
Get the date of creation

Specified by:
getDateCreated in interface DublinCore
Returns:
the date of creation
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getDateCreated()

getDateIssued

public java.lang.String getDateIssued()
                               throws DocumentException
Description copied from interface: DublinCore
Get the date of issue

Specified by:
getDateIssued in interface DublinCore
Returns:
the date of issue
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getDateIssued()

getDescription

public java.lang.String getDescription()
                                throws DocumentException
Description copied from interface: DublinCore
Get the description

Specified by:
getDescription in interface DublinCore
Returns:
the description
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getDescription()

getIdentifier

public java.lang.String getIdentifier()
                               throws DocumentException
Description copied from interface: DublinCore
Get the identifier

Specified by:
getIdentifier in interface DublinCore
Returns:
the identifier
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getIdentifier()

getPublisher

public java.lang.String getPublisher()
                              throws DocumentException
Description copied from interface: DublinCore
Get the publisher

Specified by:
getPublisher in interface DublinCore
Returns:
the publisher
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getPublisher()

getRights

public java.lang.String getRights()
                           throws DocumentException
Description copied from interface: DublinCore
Get the rights

Specified by:
getRights in interface DublinCore
Returns:
the rights
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getRights()

getIsReferencedBy

public java.lang.String getIsReferencedBy()
                                   throws DocumentException
Description copied from interface: DublinCore
Get isReferencedBy

Specified by:
getIsReferencedBy in interface DublinCore
Returns:
isReferencedBy
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getIsReferencedBy()

getSubject

public java.lang.String getSubject()
                            throws DocumentException
Description copied from interface: DublinCore
Get the subject.

Specified by:
getSubject in interface DublinCore
Returns:
the subject
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getSubject()

getTitle

public java.lang.String getTitle()
                          throws DocumentException
Description copied from interface: DublinCore
Get the title

Specified by:
getTitle in interface DublinCore
Returns:
the title
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.getTitle()

setCreator

public void setCreator(java.lang.String creator)
                throws DocumentException
Description copied from interface: DublinCore
Set the DC creator

Specified by:
setCreator in interface DublinCore
Parameters:
creator - the Creator
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setCreator(java.lang.String)

setDateCreated

public void setDateCreated(java.lang.String dateCreated)
                    throws DocumentException
Description copied from interface: DublinCore
Set the date of creation

Specified by:
setDateCreated in interface DublinCore
Parameters:
dateCreated - the date of creation
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setDateCreated(java.lang.String)

setDateIssued

public void setDateIssued(java.lang.String dateIssued)
                   throws DocumentException
Description copied from interface: DublinCore
Set the date of issue

Specified by:
setDateIssued in interface DublinCore
Parameters:
dateIssued - the date of issue
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setDateIssued(java.lang.String)

setDescription

public void setDescription(java.lang.String description)
                    throws DocumentException
Description copied from interface: DublinCore
Set the DC Description

Specified by:
setDescription in interface DublinCore
Parameters:
description - the description
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setDescription(java.lang.String)

setIdentifier

public void setIdentifier(java.lang.String identifier)
                   throws DocumentException
Description copied from interface: DublinCore
Set the DC Identifier

Specified by:
setIdentifier in interface DublinCore
Parameters:
identifier - the identifier
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setIdentifier(java.lang.String)

setPublisher

public void setPublisher(java.lang.String publisher)
                  throws DocumentException
Description copied from interface: DublinCore
Set the publisher

Specified by:
setPublisher in interface DublinCore
Parameters:
publisher - the publisher
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setPublisher(java.lang.String)

setRights

public void setRights(java.lang.String rights)
               throws DocumentException
Description copied from interface: DublinCore
Set the DC Rights

Specified by:
setRights in interface DublinCore
Parameters:
rights - the rights
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setRights(java.lang.String)

setIsReferencedBy

public void setIsReferencedBy(java.lang.String isReferencedBy)
                       throws DocumentException
Description copied from interface: DublinCore
Set isReferencedBy

Specified by:
setIsReferencedBy in interface DublinCore
Parameters:
isReferencedBy - isReferencedBy
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setIsReferencedBy(java.lang.String)

setSubject

public void setSubject(java.lang.String subject)
                throws DocumentException
Description copied from interface: DublinCore
Set the DC Subject

Specified by:
setSubject in interface DublinCore
Parameters:
subject - the subject
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setSubject(java.lang.String)

setTitle

public void setTitle(java.lang.String title)
              throws DocumentException
Description copied from interface: DublinCore
Set the DC title

Specified by:
setTitle in interface DublinCore
Parameters:
title - the title
Throws:
DocumentException - if an error occurs
See Also:
DublinCore.setTitle(java.lang.String)

save

public void save()
          throws DocumentException
Description copied from interface: DublinCore
Save the meta data.

Specified by:
save in interface DublinCore
Throws:
DocumentException - if the meta data could not be made persistent.
See Also:
DublinCore.save()

getValues

public java.lang.String[] getValues(java.lang.String key)
                             throws DocumentException
Description copied from interface: DublinCore
Returns the values for a certain key.

Specified by:
getValues in interface DublinCore
Parameters:
key - The key.
Returns:
An array of strings.
Throws:
DocumentException - when something went wrong.
See Also:
DublinCore.getValues(java.lang.String)

getFirstValue

public java.lang.String getFirstValue(java.lang.String key)
                               throws DocumentException
Description copied from interface: DublinCore
Returns the first value for a certain key.

Specified by:
getFirstValue in interface DublinCore
Parameters:
key - The key.
Returns:
A string or null if no value is set for this key.
Throws:
DocumentException - if an error occurs.
See Also:
DublinCore.getFirstValue(java.lang.String)

addValue

public void addValue(java.lang.String key,
                     java.lang.String value)
              throws DocumentException
Description copied from interface: DublinCore
Adds a value for a certain key.

Specified by:
addValue in interface DublinCore
Parameters:
key - The key.
value - The value to add.
Throws:
DocumentException - when something went wrong.
See Also:
DublinCore.addValue(java.lang.String, java.lang.String)

removeValue

public void removeValue(java.lang.String key,
                        java.lang.String value)
                 throws DocumentException
Description copied from interface: DublinCore
Removes a specific value for a certain key.

Specified by:
removeValue in interface DublinCore
Parameters:
key - The key.
value - The value to remove.
Throws:
DocumentException - when something went wrong.
See Also:
DublinCore.removeValue(java.lang.String, java.lang.String)

removeAllValues

public void removeAllValues(java.lang.String key)
                     throws DocumentException
Description copied from interface: DublinCore
Removes all values for a certain key.

Specified by:
removeAllValues in interface DublinCore
Parameters:
key - The key.
Throws:
DocumentException - when something went wrong.
See Also:
DublinCore.removeAllValues(java.lang.String)

replaceBy

public void replaceBy(DublinCore other)
               throws DocumentException
Description copied from interface: DublinCore
Replace the contents of the current dublin core by the contents of other.

Specified by:
replaceBy in interface DublinCore
Parameters:
other - The other dublin core object.
Throws:
DocumentException - if an error occurs.
See Also:
DublinCore.replaceBy(org.apache.lenya.cms.publication.DublinCore)

addValues

public void addValues(java.lang.String key,
                      java.lang.String[] values)
               throws DocumentException
Description copied from interface: DublinCore
Add all values for a certain key.

Specified by:
addValues in interface DublinCore
Parameters:
key - The key
values - The value to add
Throws:
DocumentException - if something went wrong
See Also:
DublinCore.addValues(java.lang.String, java.lang.String[])

setValue

public void setValue(java.lang.String key,
                     java.lang.String value)
              throws DocumentException
Description copied from interface: DublinCore
Sets the value for a certain key. All existing values will be removed.

Specified by:
setValue in interface DublinCore
Parameters:
key - The key.
value - The value to set.
Throws:
DocumentException - when something went wrong.
See Also:
DublinCore.setValue(java.lang.String, java.lang.String)


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.