public class DNXProfile
extends java.lang.Object
DNXProfile defines the behavior of the DNX document in terms of:
1) Attributes of each DNX section
2) Mapping of DNX values from/to PREMIS objects or TechnicalMetadata objects (not implemented yet)
The DNX section contains:
1) the section description
2) the section PREMIS object type association (relevant for IE, REP or FILE)
3) the section METS association (TECHMD, DIGIPROVMD , RIGHTSMD or SOURCEMD)
4) list of mandatory sections
5) repeatable section or not (if yes, the representative key for display)
5) list of valid keys per section
For each key, the profile holds the following attributes:
1) description
2) data type (STRING, INTEGER, DATETIME, BOOLEAN, or CONTROL_LIST)
3) mandatory or not
Modifier and Type | Class and Description |
---|---|
static class |
DNXProfile.EditPermission |
static class |
DNXProfile.MetsMapping |
static class |
DNXProfile.SectionKeyType |
Constructor and Description |
---|
DNXProfile()
Constructor - gets the profile Excel file as a parameter, parses the Excel into an internal data type
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCorrectionRoutine(java.lang.String sectionId,
java.lang.String sectionKeyId)
Returns the section key's "correctionRoutine" attribute.
|
java.lang.String |
getDescription(java.lang.String sectionId) |
java.lang.String |
getDescription(java.lang.String sectionId,
java.lang.String sectionKeyId) |
java.lang.String |
getDisplayKey(java.lang.String sectionId)
Returns the section's "displayKey" attribute.
|
DNXProfile.EditPermission |
getEditPermission(java.lang.String sectionId) |
DNXProfile.EditPermission |
getEditPermission(java.lang.String sectionId,
java.lang.String sectionKeyId)
Checks the section's attribute "editPermission" and returns the enumeration of the attribute's value.
|
java.lang.String |
getSectionKeyControlListName(java.lang.String sectionId,
java.lang.String sectionKeyId)
Returns the section's "type" attribute.
|
java.util.List<java.lang.String> |
getSectionKeyList(java.lang.String sectionId)
Returns the list of section key identifiers that the profile XML defined for the given sectionId.
For example: List<String> list = dnxProfile.getSectionKeyList(DNXConstants.CONTROL.sectionId); |
DNXProfile.SectionKeyType |
getSectionKeyType(java.lang.String sectionId,
java.lang.String sectionKeyId)
Returns the section's "type" attribute as an enumeration of STRING, INTEGER, DATETIME, BOOLEAN, CONTROLLEDLIST and POPULATOR
In case the value in the file is empty returns STRING.
|
java.util.List<java.lang.String> |
getSectionList()
Returns the list of section identifiers that the profile XML defined.
|
java.util.List<java.lang.String> |
getSectionListForFILE() |
java.util.List<java.lang.String> |
getSectionListForIE() |
java.util.List<java.lang.String> |
getSectionListForREP() |
java.lang.String |
getValidationRoutine(java.lang.String sectionId,
java.lang.String sectionKeyId)
Returns the section key's "validationRoutine" attribute.
|
boolean |
hasSection(java.lang.String sectionid) |
boolean |
hasSectionKey(java.lang.String sectionid,
java.lang.String keyid) |
boolean |
isMandatoryForPermanent(java.lang.String sectionId)
Checks the section's "mandatoryForPermanent" attribute.
|
boolean |
isMandatoryForPermanent(java.lang.String sectionId,
java.lang.String sectionKeyId)
Checks the section key's "mandatoryForPermanent" attribute.
|
boolean |
isMandatoryForStageing(java.lang.String sectionId,
java.lang.String sectionKeyId)
Checks the section key's "mandatoryForStaging" attribute.
|
boolean |
isMandatoryForStaging(java.lang.String sectionId)
Checks the section's "mandatoryForStaging" attribute.
|
boolean |
isRelevantForDigiprovMD(java.lang.String sectionId)
Checks the section's "metsMapping" attribute.
|
boolean |
isRelevantForFILE(java.lang.String sectionId)
Checks the section's "relevantForFile" attribute.
|
boolean |
isRelevantForIE(java.lang.String sectionId)
Checks the section's "relevantForIE" attribute.
|
boolean |
isRelevantForREP(java.lang.String sectionId)
Checks the section's "relevantForRep" attribute.
|
boolean |
isRelevantForRightsMD(java.lang.String sectionId)
Checks the section's "metsMapping" attribute.
|
boolean |
isRelevantForSourceMD(java.lang.String sectionId)
Checks the section's "metsMapping" attribute.
|
boolean |
isRelevantForTechMD(java.lang.String sectionId)
Checks the section's "metsMapping" attribute.
|
boolean |
isRepeatable(java.lang.String sectionId)
Checks the section's "repeating" attribute.
|
static void |
main(java.lang.String[] args) |
static void |
println(java.lang.String msg) |
public DNXProfile() throws java.lang.Exception
java.lang.Exception
public java.util.List<java.lang.String> getSectionList()
public java.util.List<java.lang.String> getSectionKeyList(java.lang.String sectionId)
sectionId
- the section identifierspublic java.lang.String getDescription(java.lang.String sectionId)
sectionId
- the section identifierpublic java.lang.String getDescription(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic boolean isRelevantForIE(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isRelevantForREP(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isRelevantForFILE(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isRepeatable(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isMandatoryForPermanent(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isMandatoryForPermanent(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic boolean isMandatoryForStaging(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isMandatoryForStageing(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic boolean isRelevantForTechMD(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isRelevantForDigiprovMD(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isRelevantForRightsMD(java.lang.String sectionId)
sectionId
- the section identifierpublic boolean isRelevantForSourceMD(java.lang.String sectionId)
sectionId
- the section identifierpublic DNXProfile.EditPermission getEditPermission(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifierpublic DNXProfile.EditPermission getEditPermission(java.lang.String sectionId)
public java.lang.String getValidationRoutine(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic java.lang.String getCorrectionRoutine(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic java.lang.String getDisplayKey(java.lang.String sectionId)
sectionId
- the section identifierpublic java.lang.String getSectionKeyControlListName(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic DNXProfile.SectionKeyType getSectionKeyType(java.lang.String sectionId, java.lang.String sectionKeyId)
sectionId
- the section identifiersectionKeyId
- the section key identifierpublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static void println(java.lang.String msg)
public java.util.List<java.lang.String> getSectionListForIE()
public java.util.List<java.lang.String> getSectionListForFILE()
public java.util.List<java.lang.String> getSectionListForREP()
public boolean hasSection(java.lang.String sectionid)
public boolean hasSectionKey(java.lang.String sectionid, java.lang.String keyid)