Package ch.tocco.nice2.dms.impl
Class NodeFactoryImpl
java.lang.Object
ch.tocco.nice2.dms.impl.NodeFactoryImpl
- All Implemented Interfaces:
NodeFactory
-
Constructor Summary
ConstructorDescriptionNodeFactoryImpl
(CommandExecutor executor, ContentTreeService treeService, EntityDefaultValueService defaultValueService, ResourceContentService resourceContentService, BinaryFactory binaryFactory, CascadingDeleteService cascadingDeleteService, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateFolder
(String name, ContentTreeNode parent) Creates a newFolderNode
connected to the supplied parent node with the given name.createResourceNode
(String name, InputStream content, PublishStatus status, ContentTreeNode parent) Creates a newResourceNode
setup with the given content and connected to the given parent.findDomainByAlias
(String alias, ContentTreeContext context) Finds a domain node by the given alias.findDomainByLabel
(String label, ContentTreeContext context) Finds a domain node by the given label.getDomainNodes
(ContentTreeContext context) Returns the list of all domain nodes.void
loadContent
(ResourceNode resource, InputStream content) Loads the given content into the existingResourceNode
, setting its status toPublishStatus.CHANGED
.void
loadContentAndPublish
(ResourceNode resource, InputStream content) Loads the given content into the existingResourceNode
and immediately publishes it.
-
Constructor Details
-
NodeFactoryImpl
public NodeFactoryImpl(CommandExecutor executor, ContentTreeService treeService, EntityDefaultValueService defaultValueService, ResourceContentService resourceContentService, BinaryFactory binaryFactory, CascadingDeleteService cascadingDeleteService, SecurityManager securityManager)
-
-
Method Details
-
createResourceNode
public ResourceNode createResourceNode(String name, InputStream content, PublishStatus status, ContentTreeNode parent) throws IOException Description copied from interface:NodeFactory
Creates a newResourceNode
setup with the given content and connected to the given parent. The `Resource` is initially set to the suppliedPublishStatus
which must be eitherPublishStatus.PUBLISHED
orPublishStatus.OFFLINE
!- Specified by:
createResourceNode
in interfaceNodeFactory
- Throws:
IOException
-
loadContent
Description copied from interface:NodeFactory
Loads the given content into the existingResourceNode
, setting its status toPublishStatus.CHANGED
.- Specified by:
loadContent
in interfaceNodeFactory
- Throws:
IOException
-
loadContentAndPublish
Description copied from interface:NodeFactory
Loads the given content into the existingResourceNode
and immediately publishes it. The state of the resource will bePublishStatus.PUBLISHED
.- Specified by:
loadContentAndPublish
in interfaceNodeFactory
- Throws:
IOException
-
createFolder
Description copied from interface:NodeFactory
Creates a newFolderNode
connected to the supplied parent node with the given name.- Specified by:
createFolder
in interfaceNodeFactory
-
getDomainNodes
Description copied from interface:NodeFactory
Returns the list of all domain nodes.- Specified by:
getDomainNodes
in interfaceNodeFactory
-
findDomainByLabel
Description copied from interface:NodeFactory
Finds a domain node by the given label.- Specified by:
findDomainByLabel
in interfaceNodeFactory
-
findDomainByAlias
Description copied from interface:NodeFactory
Finds a domain node by the given alias.- Specified by:
findDomainByAlias
in interfaceNodeFactory
-