public class StructureLoader
extends org.xml.sax.helpers.DefaultHandler
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_DECLARATION_MODE |
static java.lang.String |
DEFAULT_TYPE_DECLARATION_MODE |
static java.lang.String |
SESSION_CUSTOM_LOADER |
static java.lang.String |
SESSION_USER_PK |
static SingletonCreator.Creator<StructureLoader> |
SINGLETON_CREATOR |
static java.lang.String |
TYPE_DECLARATION_MODE_APPEND |
static java.lang.String |
TYPE_DECLARATION_MODE_DELETE |
static java.lang.String |
TYPE_DECLARATION_MODE_REPLACE |
| Modifier | Constructor and Description |
|---|---|
protected |
StructureLoader() |
protected |
StructureLoader(StructureLoaderData presetData,
java.util.Set<PK> customStructureUserGroupPKs,
boolean initialized) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<SearchResultActionNode> |
addSearchResultActionsInternal(ComposedType type) |
static void |
assureLoaded(JaloSession jaloSession,
HttpServletRequest request) |
protected void |
checkOutdated(JaloSession jaloSession,
HttpServletRequest request,
boolean productiveMode) |
void |
checkToolbarActions(JaloSession session) |
protected Node |
createNode(Node parent,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes) |
static java.lang.String |
createTimeStamp()
Returns a unique timestamp.
|
void |
dumpStructure(java.io.OutputStream outputStream) |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName) |
void |
error(org.xml.sax.SAXParseException exception) |
void |
fatalError(org.xml.sax.SAXParseException exception) |
GroupNode |
findGroupNode(TreeNode root,
java.lang.String name) |
TabNode |
findTabNode(Node root,
java.lang.String id) |
static AttributeChipNode |
getAttributeChipNode(AttributeDescriptor desc) |
static java.lang.Class |
getAttributeDisplayClass(java.lang.Class attributeClass)
Returns a Class object of the attribute display chip which is mapped to the given attribute type class.
|
static java.lang.Class |
getAttributeEditorClass(java.lang.String editorType)
Returns a Class object of the attribute editor chip which is mapped to the given editor type string.
|
static AttributeTypeNode |
getAttributeTypeNode(java.lang.Class attributeClass)
Returns the
AttributeTypeNode which contains the default configuration of the display- and
editorchips of the given attribute class. |
static java.util.Map<java.lang.Class<?>,java.lang.Class<?>> |
getClassMappings(java.lang.Class<?> mappingNodeClass)
Returns the classmappings for the given mappingnode class.
|
protected java.util.Map<java.lang.Class<?>,java.lang.Class<?>> |
getClassMappingsInternal(java.lang.Class<?> mappingNodeClass) |
protected ConfigurationNode |
getConfigurationNode() |
static CreateAction |
getCreateAction() |
protected StructureLoaderData |
getData() |
static java.util.Map<java.lang.String,java.lang.String> |
getDefaultEditorTypes() |
static DefaultReferenceNode |
getDefaultReferenceNode(ComposedType type) |
static int |
getDefaultSearchResultViewMode(ComposedType type) |
static ClassConfigNode |
getDisplayNode(java.lang.Class attributeClass) |
static EditorNode |
getEditorNode(ComposedType type) |
static EditorNode |
getEditorNode(Item item) |
static EssentialsNode |
getEssentialsNode(ComposedType type) |
static ExplorerNode |
getExplorerLayout(ComposedType type) |
static ExplorerTreeNode |
getExplorerTreeNode() |
static int |
getExplorerTreeWidth()
Returns the width of the explorer tree.
|
static java.lang.String |
getIcon(ComposedType type) |
static java.util.Set<LabelNode> |
getLabelNodes(ComposedType type,
java.lang.String labelname) |
static java.util.Set<LabelNode> |
getLabelNodes(java.lang.String labelname) |
static java.util.Set<LabelNode> |
getLabelNodes(TypeNode typeNode,
java.lang.String labelname) |
static LoadAction |
getLoadAction() |
static StructureLoader |
getLoader() |
java.lang.String |
getParseResult() |
static java.lang.String |
getReferenceFinderAttributeName(ComposedType type) |
static java.util.List<java.lang.String> |
getReferenceSearchAttributeNames(ComposedType type)
In contrast to
getReferenceFinderAttributeName(ComposedType) this method tries to extract several
attribute names from the 'searchattribute' setting which are comma separated. |
static RemoveAction |
getRemoveAction() |
protected static StructureLoader |
getRootLoader() |
static SaveAction |
getSaveAction() |
static SearchNode |
getSearchNode(ComposedType type) |
static java.util.List<SearchResultActionNode> |
getSearchResultActions(ComposedType type)
returns a List of
SearchResultActionNodes for the given type |
static ItemLayoutNode |
getSearchResultItemLayoutNode(ComposedType type,
int viewMode) |
protected java.lang.String |
getTimestamp() |
static java.util.List<ToolbarActionNode> |
getToolbarActions()
returns a List of
ToolbarActionNodes |
java.util.List<ToolbarActionNode> |
getToolbarActionsInternal() |
static java.util.List<TypeNode> |
getToolbarCreateTypes()
returns a List of
TypeNodes |
java.util.List<TypeNode> |
getToolbarCreateTypesInternal() |
static java.util.List |
getTreeNodeChips(DisplayState displayState,
Chip parent) |
static ExplorableNode |
getTreeViewExplorableNode(ComposedType type)
Returns explorable node of the tree view section of the search result.
|
static TypeNode |
getTypeNode(ComposedType composedType) |
static java.util.Collection<TypeNode> |
getTypeNodes()
return Collection of
TypeNodes. |
java.util.Collection<TypeNode> |
getTypeNodesInternal() |
static boolean |
hasLoader() |
static boolean |
hasWarnings() |
boolean |
isOutdated() |
static boolean |
isUsingDBForStructure() |
protected boolean |
isValidForUser(User user) |
boolean |
loadStructure(java.io.InputStream isToRead,
java.lang.String schemaURL)
Starts the loading of throws structure from the specified stream.
|
boolean |
loadStructure(java.lang.String resourceName,
java.lang.String schemaURL)
Starts the loading of structure from the specified file.
|
protected boolean |
loadXML(java.io.InputStream isToRead,
java.lang.String schemaURL) |
static EditorNode |
modifyEditorNode(EditorNode toModify,
java.lang.String xmlCfg)
Applies changes to an existing
EditorNode defined within a given xml string. |
void |
printConfig(DisplayState displayState,
java.lang.String fileName) |
void |
printWarning(ComposedType type,
java.lang.String warning) |
void |
printWarning(java.lang.String warning) |
void |
printWarnings() |
void |
replaceTabRefNodes(Node root) |
protected void |
restoreData(StructureLoaderData newData) |
protected void |
setTimestamp(java.lang.String timestamp) |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes) |
protected java.util.Set<PK> |
toPKSet(java.util.Set<UserGroup> grps) |
java.lang.String |
toString() |
static void |
unsetCurrentLoader() |
void |
warning(org.xml.sax.SAXParseException exception) |
public static final java.lang.String TYPE_DECLARATION_MODE_APPEND
public static final java.lang.String TYPE_DECLARATION_MODE_DELETE
public static final java.lang.String TYPE_DECLARATION_MODE_REPLACE
public static final java.lang.String DEFAULT_TYPE_DECLARATION_MODE
public static final java.lang.String DEFAULT_DECLARATION_MODE
public static final java.lang.String SESSION_CUSTOM_LOADER
public static final java.lang.String SESSION_USER_PK
public static final SingletonCreator.Creator<StructureLoader> SINGLETON_CREATOR
protected StructureLoader()
protected StructureLoader(StructureLoaderData presetData, java.util.Set<PK> customStructureUserGroupPKs, boolean initialized)
public java.lang.String toString()
toString in class java.lang.Objectprotected boolean isValidForUser(User user)
public static boolean isUsingDBForStructure()
public boolean isOutdated()
public static void unsetCurrentLoader()
protected java.lang.String getTimestamp()
protected void setTimestamp(java.lang.String timestamp)
protected void checkOutdated(JaloSession jaloSession, HttpServletRequest request, boolean productiveMode)
public static void assureLoaded(JaloSession jaloSession, HttpServletRequest request)
public static java.lang.String createTimeStamp()
protected StructureLoaderData getData()
protected void restoreData(StructureLoaderData newData)
public static final boolean hasLoader()
public static final StructureLoader getLoader()
protected static final StructureLoader getRootLoader()
public static EditorNode modifyEditorNode(EditorNode toModify, java.lang.String xmlCfg)
EditorNode defined within a given xml string. The existing node is
not changed itself but copied, altered and returned. Please note that the newly created node does not
become part of the current hmc configuration but exists only for temporary usage.toModify - xmlCfg - public boolean loadStructure(java.lang.String resourceName,
java.lang.String schemaURL)
throws java.io.IOException
resourceName - Name of the XML file containing the structure.schemaURL - URL of the xsd file which will be used to validate the xml file.java.io.IOExceptionpublic void dumpStructure(java.io.OutputStream outputStream)
public boolean loadStructure(java.io.InputStream isToRead,
java.lang.String schemaURL)
throws java.io.IOException
isToRead - schemaURL - java.io.IOExceptionprotected boolean loadXML(java.io.InputStream isToRead,
java.lang.String schemaURL)
public static EssentialsNode getEssentialsNode(ComposedType type)
public static EditorNode getEditorNode(Item item)
public static EditorNode getEditorNode(ComposedType type)
public static ItemLayoutNode getSearchResultItemLayoutNode(ComposedType type, int viewMode)
public static int getDefaultSearchResultViewMode(ComposedType type)
public static ExplorableNode getTreeViewExplorableNode(ComposedType type)
type - public static DefaultReferenceNode getDefaultReferenceNode(ComposedType type)
public static java.lang.String getReferenceFinderAttributeName(ComposedType type)
public static java.util.List<java.lang.String> getReferenceSearchAttributeNames(ComposedType type)
getReferenceFinderAttributeName(ComposedType) this method tries to extract several
attribute names from the 'searchattribute' setting which are comma separated. Especially the
AutocompleteReferenceEditorChip can use more than one search attribute
which it will use performing an OR search on all attributes (and showing the results using all given attributes).type - the ComposedType for which to find the search attribute namespublic static ExplorerNode getExplorerLayout(ComposedType type)
public static java.lang.String getIcon(ComposedType type)
public static SearchNode getSearchNode(ComposedType type)
public static TypeNode getTypeNode(ComposedType composedType)
public static AttributeChipNode getAttributeChipNode(AttributeDescriptor desc)
public static java.util.List getTreeNodeChips(DisplayState displayState, Chip parent)
GenericExplorerMenuTreeNodeChipspublic void error(org.xml.sax.SAXParseException exception)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException exception)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void warning(org.xml.sax.SAXParseException exception)
throws org.xml.sax.SAXException
warning in interface org.xml.sax.ErrorHandlerwarning in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic java.lang.String getParseResult()
protected ConfigurationNode getConfigurationNode()
public static ExplorerTreeNode getExplorerTreeNode()
public static int getExplorerTreeWidth()
public static java.util.Collection<TypeNode> getTypeNodes()
TypeNodes.public java.util.Collection<TypeNode> getTypeNodesInternal()
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic static java.util.List<TypeNode> getToolbarCreateTypes()
TypeNodespublic java.util.List<TypeNode> getToolbarCreateTypesInternal()
public static java.util.List<ToolbarActionNode> getToolbarActions()
ToolbarActionNodespublic static java.util.List<SearchResultActionNode> getSearchResultActions(ComposedType type)
SearchResultActionNodes for the given typepublic static SaveAction getSaveAction()
public static LoadAction getLoadAction()
public static CreateAction getCreateAction()
public static RemoveAction getRemoveAction()
public java.util.List<ToolbarActionNode> getToolbarActionsInternal()
public java.util.List<SearchResultActionNode> addSearchResultActionsInternal(ComposedType type)
public void checkToolbarActions(JaloSession session)
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void replaceTabRefNodes(Node root)
protected Node createNode(Node parent, java.lang.String name, java.util.Map<java.lang.String,java.lang.String> attributes) throws NodeCreationFailedException
NodeCreationFailedExceptionpublic void printConfig(DisplayState displayState, java.lang.String fileName) throws java.io.IOException
java.io.IOExceptionpublic void printWarning(java.lang.String warning)
public void printWarning(ComposedType type, java.lang.String warning)
public static java.util.Map<java.lang.String,java.lang.String> getDefaultEditorTypes()
public static java.util.Map<java.lang.Class<?>,java.lang.Class<?>> getClassMappings(java.lang.Class<?> mappingNodeClass)
protected java.util.Map<java.lang.Class<?>,java.lang.Class<?>> getClassMappingsInternal(java.lang.Class<?> mappingNodeClass)
public static java.lang.Class getAttributeEditorClass(java.lang.String editorType)
public static java.lang.Class getAttributeDisplayClass(java.lang.Class attributeClass)
public static AttributeTypeNode getAttributeTypeNode(java.lang.Class attributeClass)
AttributeTypeNode which contains the default configuration of the display- and
editorchips of the given attribute class.public static ClassConfigNode getDisplayNode(java.lang.Class attributeClass)
public void printWarnings()
public static java.util.Set<LabelNode> getLabelNodes(java.lang.String labelname)
public static java.util.Set<LabelNode> getLabelNodes(ComposedType type, java.lang.String labelname)
public static java.util.Set<LabelNode> getLabelNodes(TypeNode typeNode, java.lang.String labelname)
public static boolean hasWarnings()
Copyright © 2017 SAP SE. All Rights Reserved.