public abstract class GraphicElementManagerImpl extends Object implements GraphicElementManager, org.jboss.dashboard.annotation.Startable
Modifier and Type | Field and Description |
---|---|
protected String |
baseDir |
protected List |
baseElements |
protected Class |
classToHandle |
protected String |
classToHandleName |
protected Properties |
defaultElementProperties |
protected String |
descriptorFileName |
protected List |
elements |
protected String |
elementsDir |
Constructor and Description |
---|
GraphicElementManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addFileToResource(String name,
File file,
GraphicElement element,
String descriptorFileName)
Add a file inside given element
|
void |
createOrUpdate(GraphicElement element)
Create or update existing element
|
void |
delete(GraphicElement element)
Delete existing element
|
protected void |
deployBaseElements()
Reads zipped elements in a directory and deploys them all.
|
protected void |
deployZippedElement(File zipFile,
String elementId)
Deploys an element (zip file).
|
GraphicElement |
getAvailableElement(String id)
Get an element visible for a given context.
|
GraphicElement[] |
getAvailableElements()
Get the elements visible for a given context.
|
GraphicElement[] |
getAvailableElements(String workspaceId,
Long sectionId,
Long panelId)
Get the elements visible for a given context.
|
GraphicElement |
getDefaultElement()
Returns the default element, that is, the one whose id is 'default' and workspace is null.
|
protected String |
getDefaultResourceId() |
GraphicElement |
getElement(String id,
String workspaceId,
Long sectionId,
Long panelId)
Returns an element by its id and context.
|
GraphicElement |
getElementByDbid(String dbid)
Get an element by dbid.
|
GraphicElement[] |
getElements()
Returns all elements installed in the system
|
GraphicElement[] |
getElements(String workspaceId)
Return all elements belonging to given workspace
|
GraphicElement[] |
getElements(String workspaceId,
Long sectionId)
Return all elements belonging to given workspace and section
|
GraphicElement[] |
getElements(String workspaceId,
Long sectionId,
Long panelId)
Return all elements belonging to given workspace and section
|
String |
getElementsDir()
Return the base directory for elements, once deployed.
|
GraphicElement[] |
getManageableElements()
Get the elements manageable for a given context.
|
GraphicElement[] |
getManageableElements(String workspaceId,
Long sectionId,
Long panelId)
Get the elements visible for a given context.
|
org.jboss.dashboard.annotation.Priority |
getPriority() |
boolean |
isBaseElement(GraphicElement element)
Determines if given element is a base element.
|
protected void |
loadDbElements()
Take all elements in DB, and load them
|
void |
start() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementScopeDescriptor
protected Class classToHandle
protected String classToHandleName
protected String descriptorFileName
protected Properties defaultElementProperties
protected String baseDir
protected String elementsDir
protected List elements
protected List baseElements
public org.jboss.dashboard.annotation.Priority getPriority()
getPriority
in interface org.jboss.dashboard.annotation.Startable
public void start() throws Exception
start
in interface org.jboss.dashboard.annotation.Startable
Exception
protected void loadDbElements() throws Exception
Exception
protected void deployBaseElements() throws Exception
Exception
protected void deployZippedElement(File zipFile, String elementId) throws Exception
Exception
public GraphicElement[] getElements()
getElements
in interface GraphicElementManager
public GraphicElement[] getElements(String workspaceId)
getElements
in interface GraphicElementManager
workspaceId
- Set to null to indicate elements that apply to all workspaces.public GraphicElement[] getElements(String workspaceId, Long sectionId)
getElements
in interface GraphicElementManager
workspaceId
- Set to null to indicate elements that apply to all workspaces.sectionId
- Set to null to indicate elements that apply to all sections.public GraphicElement[] getElements(String workspaceId, Long sectionId, Long panelId)
getElements
in interface GraphicElementManager
workspaceId
- Set to null to indicate elements that apply to all workspaces.sectionId
- Set to null to indicate elements that apply to all sections.panelId
- Set to null to indicate elements that apply to all panel instances.public GraphicElement[] getAvailableElements()
getAvailableElements
in interface GraphicElementManager
public GraphicElement[] getAvailableElements(String workspaceId, Long sectionId, Long panelId)
getAvailableElements
in interface GraphicElementManager
public GraphicElement[] getManageableElements()
getManageableElements
in interface GraphicElementManager
public GraphicElement[] getManageableElements(String workspaceId, Long sectionId, Long panelId)
getManageableElements
in interface GraphicElementManager
public GraphicElement getAvailableElement(String id)
getAvailableElement
in interface GraphicElementManager
id
- Desired element idpublic GraphicElement getElementByDbid(String dbid)
getElementByDbid
in interface GraphicElementManager
public GraphicElement getElement(String id, String workspaceId, Long sectionId, Long panelId)
getElement
in interface GraphicElementManager
public GraphicElement getDefaultElement()
getDefaultElement
in interface GraphicElementManager
protected String getDefaultResourceId()
public boolean isBaseElement(GraphicElement element)
isBaseElement
in interface GraphicElementManager
public String getElementsDir()
GraphicElementManager
getElementsDir
in interface GraphicElementManager
public void createOrUpdate(GraphicElement element) throws Exception
createOrUpdate
in interface GraphicElementManager
Exception
public void delete(GraphicElement element)
delete
in interface GraphicElementManager
public void addFileToResource(String name, File file, GraphicElement element, String descriptorFileName) throws Exception
GraphicElementManager
addFileToResource
in interface GraphicElementManager
name
- resource name to usefile
- file to addelement
- graphic element to modifyException
Copyright © 2012-2015 JBoss by Red Hat. All Rights Reserved.