Package org.dspace.app.util
Class DCInput
- java.lang.Object
-
- org.dspace.app.util.DCInput
-
public class DCInput extends Object
Class representing a line in an input form.- Author:
- Brian S. Hughes, based on work by Jenny Toves, OCLC
-
-
Field Summary
Fields Modifier and Type Field Description static StringSUBMISSION_SCOPEThe scope of the input sets, this restricts hidden metadata fields from view by the end user during submission.static StringWORKFLOW_SCOPEThe scope of the input sets, this restricts hidden metadata fields from view during workflow processing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareNameVariantsAllowed()Get the nameVariants flag for this rowStringgetDisplayString(String pairTypeName, String storedString)Gets the display string that corresponds to the passed storage string in a particular display-storage pair set.StringgetElement()Get the DC element for this form field.List<String>getExternalSources()StringgetFieldName()StringgetFilter()StringgetHints()Get the hint for this form fieldStringgetInputType()Get the input type for this rowStringgetLabel()Get the label for this form field.booleangetLanguage()Get the language for this form field.ListgetPairs()Get the name of the pairs typeStringgetPairsType()Get the name of the pairs typePatterngetPattern()StringgetQualifier()Get the DC qualifier for this form field.StringgetRegex()StringgetRelationshipType()booleangetRepeatable()Alternate way of calling isRepeatable()StringgetSchema()Get the DC namespace prefix for this form field.StringgetScope()StringgetSearchConfiguration()StringgetStoredString(String pairTypeName, String displayedString)Gets the stored string that corresponds to the passed display string in a particular display-storage pair set.StringgetStyle()Get the style for this form fieldList<String>getTypeBindList()Get the type bind list for use in determining whether to display this field in angular dynamic form buildingList<String>getValueLanguageList()Get the list of language tagsStringgetVocabulary()Get the name of the controlled vocabulary that is associated with this fieldStringgetWarning()Get the warning string for a missing required field, formatted for an HTML table.protected voidinitRegex(String regex)booleanisAllowedFor(String typeName)Decides if this field is valid for the document typebooleanisClosedVocabulary()The closed attribute of the vocabulary tag for this field as set in submission-forms.xml<field> ..... <vocabulary closed="true">nsrc</vocabulary> </field>booleanisMetadataField()Verify whether the current field contains a metadata field.booleanisQualdropValue()booleanisReadOnly(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.booleanisRelationshipField()Verify whether the current field contains an entity relationship.booleanisRepeatable()Get the repeatable flag for this rowbooleanisRequired()Is there a required string for this form field?booleanisVisible(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.voidsetVocabulary(String vocabulary)Set the name of the controlled vocabulary that is associated with this fieldbooleanvalidate(String value)
-
-
-
Field Detail
-
WORKFLOW_SCOPE
public static final String WORKFLOW_SCOPE
The scope of the input sets, this restricts hidden metadata fields from view during workflow processing.- See Also:
- Constant Field Values
-
SUBMISSION_SCOPE
public static final String SUBMISSION_SCOPE
The scope of the input sets, this restricts hidden metadata fields from view by the end user during submission.- See Also:
- Constant Field Values
-
-
Method Detail
-
initRegex
protected void initRegex(String regex)
-
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
-
areNameVariantsAllowed
public boolean areNameVariantsAllowed()
Get the nameVariants flag for this row- Returns:
- the nameVariants flag
-
getInputType
@Nullable 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 field.- Returns:
- the DC element
-
getSchema
public String getSchema()
Get the DC namespace prefix for this form field.- 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 field?- Returns:
- true if a required string is set
-
getQualifier
public String getQualifier()
Get the DC qualifier for this form field.- Returns:
- the DC qualifier
-
getLanguage
public boolean getLanguage()
Get the language for this form field.- Returns:
- the language state
-
getHints
public String getHints()
Get the hint for this form field- Returns:
- the hints
-
getLabel
public String getLabel()
Get the label for this form field.- Returns:
- the label
-
getStyle
public String getStyle()
Get the style for this form field- Returns:
- the style
-
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
-
getValueLanguageList
public List<String> getValueLanguageList()
Get the list of language tags- Returns:
- the list of language
-
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:
pairTypeName- Name of display-storage pair set to searchstoredString- 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:
pairTypeName- Name of display-storage pair set to searchdisplayedString- 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 submission-forms.xml<field> ..... <vocabulary closed="true">nsrc</vocabulary> </field>- Returns:
- the closedVocabulary flags: true if the entry should be restricted only to vocabulary terms, false otherwise
-
isAllowedFor
public boolean isAllowedFor(String typeName)
Decides if this field is valid for the document type- Parameters:
typeName- Document type name- Returns:
- true when there is no type restriction or typeName is allowed
-
getScope
public String getScope()
-
getPattern
public Pattern getPattern()
-
getRegex
public String getRegex()
-
getFieldName
public String getFieldName()
-
getRelationshipType
public String getRelationshipType()
-
getSearchConfiguration
public String getSearchConfiguration()
-
getFilter
public String getFilter()
-
isQualdropValue
public boolean isQualdropValue()
-
validate
public boolean validate(String value)
-
getTypeBindList
public List<String> getTypeBindList()
Get the type bind list for use in determining whether to display this field in angular dynamic form building- Returns:
- list of bound types
-
isRelationshipField
public boolean isRelationshipField()
Verify whether the current field contains an entity relationship. This also implies a relationship type is defined for this field. The field can contain both an entity relationship and a metadata field simultaneously.- Returns:
- true if the field contains a relationship.
-
isMetadataField
public boolean isMetadataField()
Verify whether the current field contains a metadata field. This also implies a field type is defined for this field. The field can contain both an entity relationship and a metadata field simultaneously.- Returns:
- true if the field contains a metadata field.
-
-