public class ResourcesContentConnector extends Object
ContentConnector
implementation for the new resources app.
In particular, it delegates creation of Items
to the ResourcesContainer
,
and uses LayeredResource
ResourcesContainer.RESOURCE_PATH
as a string representation.
Constructor and Description |
---|
ResourcesContentConnector(info.magnolia.resourceloader.ResourceOrigin resourceOrigin)
Deprecated.
since 2.4.2 - use
ResourcesContentConnector(ResourceOrigin, Context) instead. |
ResourcesContentConnector(info.magnolia.resourceloader.ResourceOrigin resourceOrigin,
info.magnolia.context.Context context) |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandleItem(Object itemId) |
info.magnolia.resourceloader.Resource |
createNewFolder(info.magnolia.resourceloader.Resource parentResource,
Item item)
Creates a new folder () in
JcrResourceOrigin . |
info.magnolia.resourceloader.Resource |
createNewResource(info.magnolia.resourceloader.Resource parentResource,
Item item)
Creates a new
Resource in JCR resources repository. |
String |
getDefaultItemId() |
Item |
getItem(Object itemId) |
String |
getItemId(Item item) |
String |
getItemIdByUrlFragment(String urlFragment) |
String |
getItemUrlFragment(Object itemId) |
info.magnolia.resourceloader.ResourceOrigin |
getOrigin() |
@Inject public ResourcesContentConnector(info.magnolia.resourceloader.ResourceOrigin resourceOrigin, info.magnolia.context.Context context)
@Deprecated public ResourcesContentConnector(info.magnolia.resourceloader.ResourceOrigin resourceOrigin)
ResourcesContentConnector(ResourceOrigin, Context)
instead.public String getDefaultItemId()
public Item getItem(Object itemId)
public String getItemId(Item item)
public boolean canHandleItem(Object itemId)
public info.magnolia.resourceloader.ResourceOrigin getOrigin()
public info.magnolia.resourceloader.Resource createNewFolder(info.magnolia.resourceloader.Resource parentResource, Item item)
JcrResourceOrigin
.public info.magnolia.resourceloader.Resource createNewResource(info.magnolia.resourceloader.Resource parentResource, Item item)
Resource
in JCR resources repository. Should the item have JcrConstants.JCR_DATA
property and its JcrConstants.JCR_MIMETYPE
be other than any text type,
then the binary will be saved under a sub-node of the resource node named JcrResourceOrigin.BINARY_NODE_NAME
of type NodeTypes.Resource#NAME
together with related data such as mimeType, extension and size.
The resource name will be by default the name of the file, unless changed by the user through the UI. In case of a text file the contents are saved directly under the resource node in the JcrResourceOrigin.TEXT_PROPERTY
property.Copyright © 2015 Magnolia International Ltd.. All rights reserved.