public class ResourcesContentConnector extends Object implements info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
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,
com.vaadin.data.Item item)
Creates a new folder () in
JcrResourceOrigin . |
info.magnolia.resourceloader.Resource |
createNewResource(info.magnolia.resourceloader.Resource parentResource,
com.vaadin.data.Item item)
Creates a new
Resource in JCR resources repository. |
String |
getDefaultItemId() |
com.vaadin.data.Item |
getItem(Object itemId) |
String |
getItemId(com.vaadin.data.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 getItemUrlFragment(Object itemId)
getItemUrlFragment
in interface info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
public String getItemIdByUrlFragment(String urlFragment)
getItemIdByUrlFragment
in interface info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
public String getDefaultItemId()
getDefaultItemId
in interface info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
public com.vaadin.data.Item getItem(Object itemId)
getItem
in interface info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
public String getItemId(com.vaadin.data.Item item)
getItemId
in interface info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
public boolean canHandleItem(Object itemId)
canHandleItem
in interface info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
public info.magnolia.resourceloader.ResourceOrigin getOrigin()
public info.magnolia.resourceloader.Resource createNewFolder(info.magnolia.resourceloader.Resource parentResource, com.vaadin.data.Item item)
JcrResourceOrigin
.public info.magnolia.resourceloader.Resource createNewResource(info.magnolia.resourceloader.Resource parentResource, com.vaadin.data.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.