|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ModifyingResourceProvider
A modifying resource provider is an extension of a resource provider which
is only supported if the resource provider has been created through
a ResourceProviderFactory
.
A modifying resource provider allows to create, update, and delete
resources. Update is handled through ModifiableValueMap
.
All changes should be kept in a transient store until commit(ResourceResolver)
is called. revert(ResourceResolver)
discards all transient changes.
If the modifying resource provider needs to clean up resources when it
is discarded like removing objects from the transient state which are
not committed etc., it should also implement the DynamicResourceProvider
interface.
ResourceProviderFactory.getResourceProvider(java.util.Map)
,
ResourceProviderFactory.getAdministrativeResourceProvider(java.util.Map)
Field Summary |
---|
Fields inherited from interface org.apache.sling.api.resource.ResourceProvider |
---|
OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME |
Method Summary | |
---|---|
void |
commit(ResourceResolver resolver)
Commit all transient changes: create, delete and updates |
Resource |
create(ResourceResolver resolver,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> properties)
Create a new resource at the given path. |
void |
delete(ResourceResolver resolver,
java.lang.String path)
Delete the resource at the given path. |
boolean |
hasChanges(ResourceResolver resolver)
Are there any transient changes? |
void |
revert(ResourceResolver resolver)
Revert all transient changes: create, delete and updates. |
Methods inherited from interface org.apache.sling.api.resource.ResourceProvider |
---|
getResource, getResource, listChildren |
Method Detail |
---|
Resource create(ResourceResolver resolver, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> properties) throws PersistenceException
commit(ResourceResolver)
is called.
resolver
- The current resource resolver.path
- The resource path.properties
- Optional properties
PersistenceException
- If anything failsvoid delete(ResourceResolver resolver, java.lang.String path) throws PersistenceException
commit(ResourceResolver)
is called.
resolver
- The current resource resolver.path
- The resource path.
PersistenceException
- If anything failsvoid revert(ResourceResolver resolver)
resolver
- The current resource resolver.void commit(ResourceResolver resolver) throws PersistenceException
resolver
- The current resource resolver.
PersistenceException
- If anything failsboolean hasChanges(ResourceResolver resolver)
resolver
- The current resource resolver.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |