public class ResourcesExplorerGenerator extends ServiceableGenerator
ExplorerNode
.Modifier and Type | Field and Description |
---|---|
protected ExplorerApplicationExtensionPoint |
_explorerApplicationEP
The explorer application EP
|
protected AmetysObjectResolver |
_resolver
The resolver for ametys object
|
protected UserManager |
_userManager
The user manager
|
static String |
RESOURCE
Constant for resource
|
static String |
RESOURCE_COLLECTION
Constant for resource collection
|
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Constructor and Description |
---|
ResourcesExplorerGenerator() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_matchFilter(Resource resource,
String[] allowedExtensions)
Determines if the resource matches the allowed extensions
|
void |
generate() |
protected void |
getAdditionalAttributes(AttributesImpl attrs,
Resource resource)
Get the additional attributes
|
protected AttributesImpl |
getExplorerNodeAttributes(ExplorerNode node)
Returns the attributes corresponding to an Explorer node.
|
protected AttributesImpl |
getResourceAttributes(Resource resource)
Returns the attributes corresponding to a Resource.
|
protected String |
getResourcesIconCls(Resource resource)
CSS suffix class name getter for the icon resource.
|
protected void |
saxCollection(ExplorerNode node)
SAX a
ExplorerNode |
protected void |
saxCollection(ExplorerNode node,
boolean saxNode)
SAX a
ExplorerNode |
protected void |
saxCollection(ExplorerNode node,
boolean saxNode,
String nodeTag)
SAX a
ExplorerNode |
protected void |
saxCollection(ExplorerNode node,
int depth,
boolean saxNode,
String nodeTag)
SAX a
ExplorerNode |
protected void |
saxCollection(ExplorerNode node,
int depth,
String[] allowedExtensions)
SAX a
ExplorerNode |
protected void |
saxExplorerNode(ExplorerNode node,
int depth)
SAX a
ExplorerNode |
protected void |
saxExplorerNode(ExplorerNode node,
int depth,
String[] allowedExtensions)
SAX a
ExplorerNode |
protected void |
saxResource(Resource resource)
SAX a
Resource |
void |
service(ServiceManager sManager) |
dispose
recycle, setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
public static final String RESOURCE_COLLECTION
public static final String RESOURCE
protected AmetysObjectResolver _resolver
protected UserManager _userManager
protected ExplorerApplicationExtensionPoint _explorerApplicationEP
public ResourcesExplorerGenerator()
public void service(ServiceManager sManager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableGenerator
ServiceException
public void generate() throws IOException, SAXException, ProcessingException
protected void saxCollection(ExplorerNode node) throws SAXException
ExplorerNode
node
- The node to saxSAXException
- If an error occurred while saxingprotected void saxCollection(ExplorerNode node, boolean saxNode) throws SAXException
ExplorerNode
node
- The node to saxsaxNode
- True to wrap the collection with an XML node representing the current node.SAXException
- If an error occurred while saxingprotected void saxCollection(ExplorerNode node, boolean saxNode, String nodeTag) throws SAXException
ExplorerNode
node
- The node to saxsaxNode
- True to wrap the collection with an XML node representing the current node.nodeTag
- The tag to useSAXException
- If an error occurred while saxingprotected void saxCollection(ExplorerNode node, int depth, boolean saxNode, String nodeTag) throws SAXException
ExplorerNode
node
- The node to saxdepth
- The recursive depth to saxsaxNode
- True to wrap the collection with an XML node representing the current node.nodeTag
- The tag to useSAXException
- If an error occurred while saxingprotected void saxCollection(ExplorerNode node, int depth, String[] allowedExtensions) throws SAXException
ExplorerNode
node
- The node to saxdepth
- The recursive depth to saxallowedExtensions
- The allowed file extensions (lower-case). Can be null or empty to not filter on file extensionsSAXException
- If an error occurred while saxingprotected boolean _matchFilter(Resource resource, String[] allowedExtensions)
resource
- The resourceallowedExtensions
- allowed file extensionsprotected void saxExplorerNode(ExplorerNode node, int depth) throws SAXException
ExplorerNode
node
- The explorer node to SAX.depth
- The recursive depth to saxSAXException
- If an error occurred while SAXingprotected void saxExplorerNode(ExplorerNode node, int depth, String[] allowedExtensions) throws SAXException
ExplorerNode
node
- The explorer node to SAX.depth
- The recursive depth to saxallowedExtensions
- allowed file extensionsSAXException
- If an error occurred while SAXingprotected AttributesImpl getExplorerNodeAttributes(ExplorerNode node)
node
- The explorer node to SAX.protected void saxResource(Resource resource) throws SAXException
Resource
resource
- The resource to SAXSAXException
- If an error occurred while SAXingprotected AttributesImpl getResourceAttributes(Resource resource)
resource
- The resource to SAXprotected String getResourcesIconCls(Resource resource)
resource
- The resourceprotected void getAdditionalAttributes(AttributesImpl attrs, Resource resource)
attrs
- The attributesresource
- The resource