|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.MetaDataFramework
public class MetaDataFramework
Encapsulates information about a metadata framework in support of creating, displaying, editing and managing metadata records.
MetaDataFramework instances are configured from a framework configuration
file, and registered in a FrameworkRegistry
.
Major components include:
SchemaHelper
instanceFieldInfoMap
for information
such as best practices and definitionsSchemaPathMap
FrameworkConfigReader
that
provides information from the framework configuration file
Constructor Summary | |
---|---|
MetaDataFramework(File configFile,
String docRoot)
Constructor for the MetaDataFramework object |
|
MetaDataFramework(FrameworkConfigReader configReader)
Constructor for the MetaDataFramework object |
|
MetaDataFramework(FrameworkConfigReader configReader,
String docRoot)
Constructor for the MetaDataFramework object |
|
MetaDataFramework(String configFilePath,
String docRoot)
Constructor for the MetaDataFramework object given the path to a config file for the particular framework (e.g., "adn"). |
Method Summary | |
---|---|
Document |
copyRecord(String xml,
String id,
CollectionConfig collectionConfig,
User user)
Copy the given xml record, inserting new values as specified by the Collection configuration. |
void |
destroy()
Description of the Method |
String |
getAutoFormDir()
Gets the directory to which metadata editor pages are written. |
int |
getBaseRenderLevel()
Gets the baseRenderLevel attribute of the MetaDataFramework object. |
String |
getBestPracticesLabel()
Gets the bestPracticesLabel attribute of the MetaDataFramework object |
FrameworkConfigReader |
getConfigReader()
Gets the configReader attribute of the MetaDataFramework object |
String |
getDateCreatedPath()
Gets the dateCreatedPath attribute of the MetaDataFramework object |
String |
getDiscussionURL()
Gets the discussionURL attribute of the MetaDataFramework object. |
String |
getDocRoot()
Gets the docRoot attribute of the MetaDataFramework object |
Document |
getEditableDocument(File file)
Gets a localized Document (with ampersands expanded) that is suitable for editing. |
Document |
getEditableDocument(String filePath)
Gets a localized Document (with ampersands expanded) that is suitable for editing. |
FieldInfoReader |
getFieldInfo(String xpath)
Gets the FieldInfo for the given xpath |
FieldInfoMap |
getFieldInfoMap()
Gets the fieldInfoMap attribute of the MetaDataFramework object |
String |
getIdPath()
Gets the idPath attribute of the MetaDataFramework object |
String |
getInitialFieldCollapse(String xpath)
Return configured value for initialFieldCollapse for this xpath |
List |
getMuiGroups()
Gets the muiGroups attribute of the MetaDataFramework object |
String |
getName()
Gets the name attribute of the MetaDataFramework. |
SchemaPath |
getNamedSchemaPath(String pathName)
Gets the namedSchemaPath attribute of the MetaDataFramework object |
String |
getNamedSchemaPathXpath(String pathName)
Gets the namedSchemaPath attribute of the MetaDataFramework object |
PageList |
getPageList()
Gets the pageList attribute of the MetaDataFramework object |
boolean |
getRebuildOnStart()
Gets the rebuildOnStart attribute of the MetaDataFramework object |
String |
getRecordsDir()
Gets the recordsDir attribute of the MetaDataFramework object |
String |
getRecordUrl(Document itemRecord)
Extracts the URL from the provided record using the "urlPath" configured SchemaPath for this framework. |
String |
getRenderer()
Gets the renderer that will create the editor for records of this framework. |
String |
getRootElementName()
Gets the rootElementName attribute of the MetaDataFramework. |
SchemaHelper |
getSchemaHelper()
Gets the schemaHelper attribute of the MetaDataFramework object |
SchemaPathMap |
getSchemaPathMap()
Gets the schemaPathMap for this framework. |
String |
getSchemaURI()
Gets the schemaFile attribute of the MetaDataFramework object |
StandardsManager |
getStandardsManager()
Gets the standardsManager attribute of the MetaDataFramework object |
String |
getUniqueUrlPath()
Gets the uniqueUrlPath attribute of the MetaDataFramework object |
String |
getUrlPath()
Gets the urlPath attribute of the MetaDataFramework object |
List |
getUrlPaths()
Returns normalized xpaths specified in framework configuration as "url paths". |
UserInfo |
getUserInfo()
Gets the userInfo been for this framework, which specifies xpaths that can be populated with attributes from the SessionUser object, such as name, institution, and email. |
XMLValidator |
getValidator()
Gets the validator attribute of the MetaDataFramework object |
String |
getVersion()
Gets the version attribute of the MetaDataFramework object |
VocabLayoutConfig |
getVocabLayouts()
Gets the vocabLayouts attribute of the MetaDataFramework object |
String |
getWorkingRenderer()
Gets the workingRenderer attribute of the MetaDataFramework object |
String |
getWorkingSchemaURI()
Gets the workingSchemaURI attribute (pointing to the location of the last successfully loaded schema) of the MetaDataFramework object. |
Document |
getWritableRecord(Document doc)
Converts a editable Document into an xml record that can be written to disk. |
String |
getWritableRecordXml(Document doc)
Gets the writableRecordXml attribute of the MetaDataFramework object |
String |
getXmlFormat()
Gets the xmlFormat attribute of the MetaDataFramework object |
void |
init()
Description of the Method |
boolean |
isInitialized()
Gets the initialized attribute of the MetaDataFramework object |
void |
loadSchemaHelper()
Load a SchemaHelper instance for this framework. |
Document |
makeMinimalRecord(String id)
Returns an instance document containing only required nodes, with the "id" field populated with provided id |
Document |
makeMinimalRecord(String id,
CollectionConfig collectionConfig)
Returns an instance document containing only required nodes, with the "id" field populated with provided id |
Document |
makeMinimalRecord(String id,
CollectionConfig collectionConfig,
User user)
Returns an instance document containing only required nodes, with the "id" field populated with provided id and collectionConfig fields populated if collectionConfig is provided. |
DocMap |
preprocessEditableDocument(DocMap docMap)
NOT YET DOCUMENTED |
Document |
preprocessEditableDocument(Document doc)
NOT YET DOCUMENTED |
void |
processOrderedElements(Document doc)
Orders elements as specified by the framework configuration. |
void |
refresh()
NOT YET DOCUMENTED |
void |
renderEditorPages()
Generate the pages of the editor for records of this MetaDataFramework. |
void |
resetValidator()
NOT YET DOCUMENTED |
void |
setBaseRenderLevel(int level)
Sets the baseRenderLevel attribute of the MetaDataFramework object |
void |
setBestPracticesLabel(String r)
Sets the bestPracticesLabel attribute of the MetaDataFramework object |
static void |
setDebug(boolean bool)
Sets the debug attribute of the MetaDataFramework class |
void |
setDiscussionURL(String s)
Sets the discussionURL attribute of the MetaDataFramework object |
void |
setDocRoot(String docRoot)
used by stand-alone AutoForm to explicitly set docRoot |
void |
setMuiGroups(MetadataVocab vocab,
String audience,
String language)
Returns a list of xpaths for which MUI Groups files exist for this framework. |
void |
setRebuildOnStart(boolean bool)
Sets the rebuildOnStart attribute of the MetaDataFramework object |
void |
setRecordsDir(File dir)
Sets the recordsDir attribute of the MetaDataFramework object |
void |
setRecordsDir(String dir)
Sets the recordsDir attribute of the MetaDataFramework object |
void |
setRenderer(String r)
Sets the renderer that will create the editor for records of this framework. |
void |
setRootElementName(String name)
Sets the rootElementName attribute of the MetaDataFramework object |
void |
setSchemaHelper(SchemaHelper schemaHelper)
Sets the schemaHelper attribute of the MetaDataFramework object |
void |
setSchemaURI(String uri)
Sets the schemaURI attribute of the MetaDataFramework object |
void |
setStandardsManager(StandardsManager standardsManager)
Sets the standardsManager attribute of the MetaDataFramework object (called by loadSchemaHelper) |
void |
setWorkingRenderer(String renderer)
Sets the workingRenderer attribute of the MetaDataFramework object |
void |
setWorkingSchemaURI(String uri)
Sets the workingSchemaURI attribute of the MetaDataFramework object |
String |
toString()
String representation for debugging |
List |
validateFieldInfoPaths()
check the fieldInfo paths to make sure they are legal schema paths ... |
String |
validateRecord(Object record)
NOT YET DOCUMENTED |
List |
validateVocabLayoutPaths()
check the vocabLayoutConfig paths to make sure they are legal schema paths ... |
void |
writeEditableDocument(Document doc,
File file)
Converts an editable Document into a writable xmlRecord (string) via getWritableRecordXml and writes it to
disk. |
void |
writeProps()
update config file with current values |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MetaDataFramework(String configFilePath, String docRoot)
configFilePath
- Description of the ParameterdocRoot
- The context document root as obtainied by calling
getServletContext().getRealPath("/");public MetaDataFramework(File configFile, String docRoot)
configFile
- Description of the ParameterdocRoot
- path to the application contextpublic MetaDataFramework(FrameworkConfigReader configReader)
configReader
- Description of the Parameterpublic MetaDataFramework(FrameworkConfigReader configReader, String docRoot)
configReader
- Description of the ParameterdocRoot
- Description of the ParameterMethod Detail |
---|
public void init()
public List validateVocabLayoutPaths()
public List validateFieldInfoPaths()
public void refresh()
public boolean isInitialized()
public VocabLayoutConfig getVocabLayouts()
public FrameworkConfigReader getConfigReader()
public void writeProps() throws Exception
Exception
- Description of the Exceptionpublic String getDocRoot()
public void setDocRoot(String docRoot)
docRoot
- The new docRoot valuepublic PageList getPageList()
public FieldInfoMap getFieldInfoMap()
public FieldInfoReader getFieldInfo(String xpath)
xpath
- Description of the Parameter
public String getInitialFieldCollapse(String xpath)
xpath
- NOT YET DOCUMENTED
public SchemaPathMap getSchemaPathMap()
public UserInfo getUserInfo()
public void setMuiGroups(MetadataVocab vocab, String audience, String language)
vocab
- The new muiGroups valueaudience
- The new muiGroups valuelanguage
- The new muiGroups valuepublic List getMuiGroups()
public StandardsManager getStandardsManager()
public void setStandardsManager(StandardsManager standardsManager)
standardsManager
- The new standardsManager valuepublic String getRenderer()
public void setRenderer(String r)
r
- The new renderer valuepublic String getBestPracticesLabel()
public void setBestPracticesLabel(String r)
r
- The new bestPracticesLabel valuepublic String getWorkingSchemaURI()
public void setWorkingSchemaURI(String uri)
uri
- The new workingSchemaURI valuepublic String getWorkingRenderer()
public void setWorkingRenderer(String renderer)
renderer
- The new workingRenderer valuepublic String getRecordsDir()
public void setRecordsDir(File dir)
dir
- The new recordsDir valuepublic void setRecordsDir(String dir)
dir
- The new recordsDir valuepublic SchemaHelper getSchemaHelper()
public void setSchemaHelper(SchemaHelper schemaHelper)
schemaHelper
- The new schemaHelper valuepublic void loadSchemaHelper() throws Exception
Exception
- Description of the Exceptionpublic String getRootElementName()
public void setRootElementName(String name)
name
- The new rootElementName valuepublic String getSchemaURI()
public XMLValidator getValidator()
public void resetValidator()
public String validateRecord(Object record)
record
- NOT YET DOCUMENTED
public String getUniqueUrlPath()
public String getNamedSchemaPathXpath(String pathName)
pathName
- Description of the Parameter
public SchemaPath getNamedSchemaPath(String pathName)
pathName
- Description of the Parameter
public List getUrlPaths()
public String getIdPath()
public String getDateCreatedPath()
public String getUrlPath()
public String getRecordUrl(Document itemRecord) throws Exception
itemRecord
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic void setSchemaURI(String uri)
uri
- The new schemaURI valuepublic String getAutoFormDir()
E.g., for "adn" format, the autoFormDir would be ${docRoot}/editor/adn.
public String getXmlFormat()
public String getVersion()
public String getName()
public int getBaseRenderLevel()
public void setBaseRenderLevel(int level)
level
- The new baseRenderLevel valuepublic String getDiscussionURL()
public void setDiscussionURL(String s)
s
- The new discussionURL valuepublic boolean getRebuildOnStart()
public void setRebuildOnStart(boolean bool)
bool
- The new rebuildOnStart valuepublic Document copyRecord(String xml, String id, CollectionConfig collectionConfig, User user) throws Exception
xml
- xml record to be copiedid
- id for new recordcollectionConfig
- the collection configurationuser
- the current user (from which to populate user
fields if so configured)
Exception
- Description of the Exceptionpublic Document makeMinimalRecord(String id) throws Exception
id
- id value to be inserted into the id field for created
record
Exception
public Document makeMinimalRecord(String id, CollectionConfig collectionConfig) throws Exception
id
- id value to be inserted into the id field for
created recordcollectionConfig
- NOT YET DOCUMENTED
Exception
public Document makeMinimalRecord(String id, CollectionConfig collectionConfig, User user) throws Exception
id
- id value to be inserted into the id field for
created recordcollectionConfig
- Description of the Parameteruser
- NOT YET DOCUMENTED
Exception
- Description of the Exceptionpublic void renderEditorPages() throws Exception
Exception
- Description of the Exceptionpublic Document getEditableDocument(File file) throws DocumentException
file
- file containing xml Record
DocumentException
- Description of the Exceptionpublic Document getEditableDocument(String filePath) throws DocumentException
filePath
- path to file containing xml record.
DocumentException
- Description of the Exceptionpublic String getWritableRecordXml(Document doc) throws DocumentException
doc
- NOT YET DOCUMENTED
DocumentException
- NOT YET DOCUMENTEDpublic Document getWritableRecord(Document doc) throws DocumentException
The xml record returned is delocalized (namespace info added) and the ampersands are contracted.
doc
- an editable Document
DocumentException
- Description of the Exceptionpublic void processOrderedElements(Document doc)
doc
- instanceDocument containing elements to be orderedpublic void writeEditableDocument(Document doc, File file) throws DocumentException
getWritableRecordXml
and writes it to
disk.
doc
- an editable Documentfile
- destination file for write operation.
DocumentException
- Description of the Exceptionpublic static void setDebug(boolean bool)
bool
- The new debug valuepublic String toString()
toString
in class Object
public DocMap preprocessEditableDocument(DocMap docMap)
docMap
- NOT YET DOCUMENTED
public Document preprocessEditableDocument(Document doc)
doc
- NOT YET DOCUMENTED
public void destroy()
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |