Package org.dlese.dpc.schemedit
Class JspFunctions
java.lang.Object
org.dlese.dpc.schemedit.JspFunctions
Provides functionality used by jsp function calls.
- Author:
- ostwald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanarrayContains(String[] items, String item) NOT YET DOCUMENTEDstatic StringdecodePath(String s) Removes jsp-encoded xpath indexing from a stringstatic booleanfileExists(String relativePath, HttpServletRequest request) Test for existence of file relative to the jsp page in which the function is called.static AsnStandardsNodegetAsnStandard(String asnId, CATServiceHelper helper) static DcsDataDocReadergetDcsDataDocReader(DocReader docReader) Gets the dcsDataDocReader attribute of the JspFunctions classstatic StringgetDcsField(String fieldName, DocReader docReader) Gets the dcsField attribute of the JspFunctions classstatic StringgetFullName(String username, UserManager userManager) Gets the fullName attribute of the JspFunctions classstatic StringGets the localizedSchemaXML attribute of the JspFunctions classstatic StringgetNamedXPath(String pathName, String xmlFormat, FrameworkRegistry reg) Returns the xpath for the provided named schema path (pathName) as configured for the specified framework (xmlFormat).static ListgetPrompts(String xpath, MetaDataFramework framework) Gets the prompts defined in the fieldFile for the current xpath and framework.static StringgetSetLabel(SetInfo setInfo) Gets the setLabel attribute of the JspFunctions classstatic StringgetStatusLabel(String rawLabel, String collection, SessionBean sessionBean) Gets the statusLabel for the specified collection, converting rawLabel to it's human-readable form if it is a "finalStatus".static booleanhasCollectionRole(User user, String role, String collection) Returns true if user has specified permission for specified collectinostatic booleanNOT YET DOCUMENTEDstatic booleanisAuthorized(String operation, SessionBean sessionBean) Gets the authorized attribute of the JspFunctions classstatic booleanisAuthorized(String operation, SessionBean sessionBean, String collection) Gets the authorized attribute of the JspFunctions classstatic booleanlistContains(List items, String item) NOT YET DOCUMENTEDstatic voidThe main program for the JspFunctions classstatic voidNOT YET DOCUMENTEDstatic StringConverts either a list or a iterable to a comma-delmited string, which can then be converted into a list for use by Javascript (and in particular Prototype.Array),static StringTruncate provided string to specified length.
-
Constructor Details
-
JspFunctions
public JspFunctions()
-
-
Method Details
-
hasRole
NOT YET DOCUMENTED- Parameters:
user- NOT YET DOCUMENTEDrole- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
hasCollectionRole
Returns true if user has specified permission for specified collectino- Parameters:
user- the user ojectrole- role represented as a string (e.g., "manager")- Returns:
- true if user has at least specified role
-
isAuthorized
Gets the authorized attribute of the JspFunctions class- Parameters:
operation- NOT YET DOCUMENTEDsessionBean- NOT YET DOCUMENTED- Returns:
- The authorized value
-
getNamedXPath
Returns the xpath for the provided named schema path (pathName) as configured for the specified framework (xmlFormat). Used on the "create collection page" to give background information about some optional information associated with some frameworks.- Parameters:
pathName- configured path name (from framework config)xmlFormat- speicified metadata framework (e.g., "adn")reg- the FrameworkRegistry- Returns:
- The bestPracticesLink value
-
isAuthorized
Gets the authorized attribute of the JspFunctions class- Parameters:
operation- NOT YET DOCUMENTEDsessionBean- NOT YET DOCUMENTEDcollection- NOT YET DOCUMENTED- Returns:
- The authorized value
-
fileExists
Test for existence of file relative to the jsp page in which the function is called.- Parameters:
relativePath- NOT YET DOCUMENTEDrequest- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
getDcsDataDocReader
Gets the dcsDataDocReader attribute of the JspFunctions class- Parameters:
docReader- Description of the Parameter- Returns:
- The dcsDataDocReader value
-
truncate
Truncate provided string to specified length.- Parameters:
s- string to truncatelength- truncation length- Returns:
- truncated string
-
getFullName
Gets the fullName attribute of the JspFunctions class- Parameters:
username- a usernameuserManager- the UserManager- Returns:
- the fullName of specified user
-
getStatusLabel
Gets the statusLabel for the specified collection, converting rawLabel to it's human-readable form if it is a "finalStatus".- Parameters:
rawLabel- NOT YET DOCUMENTEDcollection- NOT YET DOCUMENTEDsessionBean- NOT YET DOCUMENTED- Returns:
- The statusLabel value
-
getSetLabel
Gets the setLabel attribute of the JspFunctions class- Parameters:
setInfo- NOT YET DOCUMENTED- Returns:
- The setLabel value
-
listContains
NOT YET DOCUMENTED- Parameters:
items- NOT YET DOCUMENTEDitem- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
arrayContains
NOT YET DOCUMENTED- Parameters:
items- NOT YET DOCUMENTEDitem- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
toCommaDelimited
Converts either a list or a iterable to a comma-delmited string, which can then be converted into a list for use by Javascript (and in particular Prototype.Array),Used when we want to convert a jsp object (List or Array) into a javascript variable.
- Parameters:
o- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
getDcsField
Gets the dcsField attribute of the JspFunctions class- Parameters:
fieldName- Description of the ParameterdocReader- Description of the Parameter- Returns:
- The dcsField value
-
decodePath
Removes jsp-encoded xpath indexing from a stringe.g., /itemRecord/foo_1_/farb_4_ becomes /itemRecord/foo/farb
- Parameters:
s- Description of the Parameter- Returns:
- Description of the Return Value
-
getLocalizedSchemaXML
Gets the localizedSchemaXML attribute of the JspFunctions class- Parameters:
url- NOT YET DOCUMENTED- Returns:
- The localizedSchemaXML value
-
getPrompts
Gets the prompts defined in the fieldFile for the current xpath and framework.- Parameters:
xpath- xpath for promptframework- the framework- Returns:
- a list of prompt strings, or null
-
getAsnStandard
-
main
The main program for the JspFunctions class- Parameters:
args- The command line arguments
-
prtln
NOT YET DOCUMENTED- Parameters:
s- NOT YET DOCUMENTED
-