org.dspace.app.util
Class DCInput

java.lang.Object
  extended by org.dspace.app.util.DCInput

public class DCInput
extends Object

Class representing a line in an input form.

Version:
Author:
Brian S. Hughes, based on work by Jenny Toves, OCLC

Field Summary
static String SUBMISSION_SCOPE
          The scope of the input sets, this restricts hidden metadata fields from view by the end user during submission.
static String WORKFLOW_SCOPE
          The scope of the input sets, this restricts hidden metadata fields from view during workflow processing.
 
Constructor Summary
DCInput(Map fieldMap, Map listMap)
          Class constructor for creating a DCInput object based on the contents of a HashMap
 
Method Summary
 String getDisplayString(String pairTypeName, String storedString)
          Gets the display string that corresponds to the passed storage string in a particular display-storage pair set.
 String getElement()
          Get the DC element for this form row.
 String getHints()
          Get the hint for this form row, formatted for an HTML table
 String getInputType()
          Get the input type for this row
 String getLabel()
          Get the label for this form row.
 List getPairs()
          Get the name of the pairs type
 String getPairsType()
          Get the name of the pairs type
 String getQualifier()
          Get the DC qualifier for this form row.
 boolean getRepeatable()
          Alternate way of calling isRepeatable()
 String getSchema()
          Get the DC namespace prefix for this form row.
 String getStoredString(String pairTypeName, String displayedString)
          Gets the stored string that corresponds to the passed display string in a particular display-storage pair set.
 String getVocabulary()
          Get the name of the controlled vocabulary that is associated with this field
 String getWarning()
          Get the warning string for a missing required field, formatted for an HTML table.
 boolean isClosedVocabulary()
          The closed attribute of the vocabulary tag for this field as set in input-forms.xml .....
 boolean isReadOnly(String scope)
          Is this DCInput for display in readonly mode in the given scope? If the scope differ from which in visibility field then we use the out attribute of the visibility element.
 boolean isRepeatable()
          Get the repeatable flag for this row
 boolean isRequired()
          Is there a required string for this form row?
 boolean isVisible(String scope)
          Is this DCInput for display in the given scope? The scope should be either "workflow" or "submit", as per the input forms definition.
 void setVocabulary(String vocabulary)
          Set the name of the controlled vocabulary that is associated with this field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORKFLOW_SCOPE

public static String WORKFLOW_SCOPE
The scope of the input sets, this restricts hidden metadata fields from view during workflow processing.


SUBMISSION_SCOPE

public static String SUBMISSION_SCOPE
The scope of the input sets, this restricts hidden metadata fields from view by the end user during submission.

Constructor Detail

DCInput

public DCInput(Map fieldMap,
               Map listMap)
Class constructor for creating a DCInput object based on the contents of a HashMap

Parameters:
row - the corresponding row in the table
Method Detail

isVisible

public boolean isVisible(String scope)
Is this DCInput for display in the given scope? The scope should be either "workflow" or "submit", as per the input forms definition. If the internal visibility is set to "null" then this will always return true.

Parameters:
scope - String identifying the scope that this input's visibility should be tested for
Returns:
whether the input should be displayed or not

isReadOnly

public boolean isReadOnly(String scope)
Is this DCInput for display in readonly mode in the given scope? If the scope differ from which in visibility field then we use the out attribute of the visibility element. Possible values are: hidden (default) and readonly. If the DCInput is visible in the scope then this methods must return false

Parameters:
scope - String identifying the scope that this input's readonly visibility should be tested for
Returns:
whether the input should be displayed in a readonly way or fully hidden

isRepeatable

public boolean isRepeatable()
Get the repeatable flag for this row

Returns:
the repeatable flag

getRepeatable

public boolean getRepeatable()
Alternate way of calling isRepeatable()

Returns:
the repeatable flag

getInputType

public String getInputType()
Get the input type for this row

Returns:
the input type

getElement

public String getElement()
Get the DC element for this form row.

Returns:
the DC element

getSchema

public String getSchema()
Get the DC namespace prefix for this form row.

Returns:
the DC namespace prefix

getWarning

public String getWarning()
Get the warning string for a missing required field, formatted for an HTML table.

Returns:
the string prompt if required field was ignored

isRequired

public boolean isRequired()
Is there a required string for this form row?

Returns:
true if a required string is set

getQualifier

public String getQualifier()
Get the DC qualifier for this form row.

Returns:
the DC qualifier

getHints

public String getHints()
Get the hint for this form row, formatted for an HTML table

Returns:
the hints

getLabel

public String getLabel()
Get the label for this form row.

Returns:
the label

getPairsType

public String getPairsType()
Get the name of the pairs type

Returns:
the pairs type name

getPairs

public List getPairs()
Get the name of the pairs type

Returns:
the pairs type name

getVocabulary

public String getVocabulary()
Get the name of the controlled vocabulary that is associated with this field

Returns:
the name of associated the vocabulary

setVocabulary

public void setVocabulary(String vocabulary)
Set the name of the controlled vocabulary that is associated with this field

Parameters:
vocabulary - the name of the vocabulary

getDisplayString

public String getDisplayString(String pairTypeName,
                               String storedString)
Gets the display string that corresponds to the passed storage string in a particular display-storage pair set.

Parameters:
allPairs - HashMap of all display-storage pair sets
pairTypeName - Name of display-storage pair set to search
storageString - the string that gets stored
Returns:
the displayed string whose selection causes storageString to be stored, null if no match

getStoredString

public String getStoredString(String pairTypeName,
                              String displayedString)
Gets the stored string that corresponds to the passed display string in a particular display-storage pair set.

Parameters:
allPairs - HashMap of all display-storage pair sets
pairTypeName - Name of display-storage pair set to search
displayString - the string that gets displayed
Returns:
the string that gets stored when displayString gets selected, null if no match

isClosedVocabulary

public boolean isClosedVocabulary()
The closed attribute of the vocabulary tag for this field as set in input-forms.xml ..... nsrc

Returns:
the closedVocabulary flags: true if the entry should be restricted only to vocabulary terms, false otherwise


Copyright © 2010 DuraSpace. All Rights Reserved.