|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.MigrationEJB
@RolesAllowed(value="MIGRATE") public class MigrationEJB
EJB3 implementation of the Migration
API.
Field Summary |
---|
Fields inherited from interface ccc.services.Migration |
---|
NAME |
Constructor Summary | |
---|---|
MigrationEJB()
|
Method Summary | ||
---|---|---|
void |
applyWorkingCopy(java.util.UUID resourceId,
java.util.UUID userId,
java.util.Date happenedOn,
boolean isMajorEdit,
java.lang.String comment)
Apply a resource's working copy. |
|
void |
changeAcl(java.util.UUID resourceId,
ACL acl,
java.util.UUID actorId,
java.util.Date happenedOn)
Change the ACL for a resource. |
|
protected void |
checkPermission(java.lang.String... permissions)
Check that the current user has ONE OF the specified permissions. |
|
protected void |
checkRead(ResourceEntity r)
Check that a resource is readable by a user. |
|
protected void |
checkWrite(ResourceEntity r)
Check that a resource is write-able by a user. |
|
CommandFactory |
commands()
Accessor. |
|
ResourceSummary |
createFolder(java.util.UUID parentId,
java.lang.String name,
java.lang.String title,
boolean publish,
java.util.UUID actorId,
java.util.Date happenedOn)
Create a folder with the specified name and title. |
|
ResourceSummary |
createPage(java.util.UUID parentId,
Page delta,
boolean publish,
java.util.UUID actorId,
java.util.Date happenedOn)
Creates a new page. |
|
protected UserEntity |
currentUser()
Accessor. |
|
protected java.util.UUID |
currentUserId()
Accessor. |
|
void |
deleteResource(java.util.UUID resourceId,
java.util.UUID actorId,
java.util.Date happenedOn)
Delete a resource. |
|
protected
|
execute(Command<T> command)
Execute a command on behalf of the current user. |
|
protected java.util.Collection<? extends ResourceEntity> |
filterAccessibleTo(UserEntity u,
java.util.List<? extends ResourceEntity> resources)
Filter a collection of resources based on accessibility. |
|
protected IRepositoryFactory |
getRepoFactory()
Accessor. |
|
protected javax.ejb.TimerService |
getTimerService()
Accessor. |
|
void |
includeInMainMenu(java.util.UUID resourceId,
boolean include,
java.util.UUID actorId,
java.util.Date happenedOn)
Specify whether a resource should be included in a site's main menu. |
|
void |
lock(java.util.UUID resourceId,
java.util.UUID actorId,
java.util.Date happenedOn)
Lock the specified resource. |
|
void |
publish(java.util.UUID resourceId,
java.util.UUID userId,
java.util.Date date)
Publish the specified resource. |
|
protected
|
sudoExecute(Command<T> command,
java.util.UUID actorId,
java.util.Date happenedOn)
Execute a command on behalf of another user. |
|
void |
unlock(java.util.UUID resourceId,
java.util.UUID actorId,
java.util.Date happenedOn)
Unlock the specified Resource. |
|
void |
unpublish(java.util.UUID resourceId,
java.util.UUID userId,
java.util.Date publishDate)
Unpublish the specified resource. |
|
void |
updateMetadata(java.util.UUID resourceId,
java.lang.String title,
java.lang.String description,
java.util.Set<java.lang.String> tags,
java.util.Map<java.lang.String,java.lang.String> metadata,
java.util.UUID actorId,
java.util.Date happenedOn)
Update metadata of the resource. |
|
void |
updatePage(java.util.UUID pageId,
Page delta,
java.util.UUID actorId,
java.util.Date happenedOn)
Update the specified page on the server. |
|
void |
updateResourceTemplate(java.util.UUID resourceId,
java.util.UUID templateId,
java.util.UUID actorId,
java.util.Date happenedOn)
Update the specified resource's template on the server. |
|
protected UserEntity |
userForId(java.util.UUID userId)
Look up the user for the specified ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MigrationEJB()
Method Detail |
---|
public ResourceSummary createFolder(java.util.UUID parentId, java.lang.String name, java.lang.String title, boolean publish, java.util.UUID actorId, java.util.Date happenedOn)
createFolder
in interface Migration
parentId
- The folder in which the new folder should be created.name
- The name of the new folder.title
- The title of the folder.publish
- True if the title should be published, false otherwise.actorId
- The user id of the actor.happenedOn
- When the command happened.
public ResourceSummary createPage(java.util.UUID parentId, Page delta, boolean publish, java.util.UUID actorId, java.util.Date happenedOn)
createPage
in interface Migration
parentId
- The folder in which the page will be created.delta
- The page's details.publish
- True if the folder should be published, false otherwise.actorId
- The user id of the actor.happenedOn
- When the command happened.
public void updatePage(java.util.UUID pageId, Page delta, java.util.UUID actorId, java.util.Date happenedOn)
updatePage
in interface Migration
pageId
- The id of the page to update.delta
- The changes to apply.actorId
- The user id of the actor.happenedOn
- When the command happened.public void lock(java.util.UUID resourceId, java.util.UUID actorId, java.util.Date happenedOn)
lock
in interface Migration
resourceId
- The uuid of the resource to lock.actorId
- The user id of the actor.happenedOn
- When the command happened.public void publish(java.util.UUID resourceId, java.util.UUID userId, java.util.Date date)
publish
in interface Migration
resourceId
- The id of the resource to update.userId
- The id of the publishing user.date
- The date the resource was published.public void unlock(java.util.UUID resourceId, java.util.UUID actorId, java.util.Date happenedOn)
unlock
in interface Migration
resourceId
- The resource to unlock.actorId
- The user id of the actor.happenedOn
- When the command happened.public void unpublish(java.util.UUID resourceId, java.util.UUID userId, java.util.Date publishDate)
unpublish
in interface Migration
resourceId
- The id of the resource to update.userId
- The id of the un-publishing user.publishDate
- The date the resource was un-published.public void updateResourceTemplate(java.util.UUID resourceId, java.util.UUID templateId, java.util.UUID actorId, java.util.Date happenedOn)
updateResourceTemplate
in interface Migration
resourceId
- The id of the resource to update.templateId
- The new template to set for the resource.actorId
- The user id of the actor.happenedOn
- When the command happened.public void includeInMainMenu(java.util.UUID resourceId, boolean include, java.util.UUID actorId, java.util.Date happenedOn)
includeInMainMenu
in interface Migration
resourceId
- The id of the resource to update.include
- True if the resource should be included, false otherwise.actorId
- The user id of the actor.happenedOn
- When the command happened.public void updateMetadata(java.util.UUID resourceId, java.lang.String title, java.lang.String description, java.util.Set<java.lang.String> tags, java.util.Map<java.lang.String,java.lang.String> metadata, java.util.UUID actorId, java.util.Date happenedOn)
updateMetadata
in interface Migration
resourceId
- The id of the resource to update.title
- The new title to set.description
- The new description to set.tags
- The new tags to set.metadata
- The metadata to update.actorId
- The user id of the actor.happenedOn
- When the command happened.public void changeAcl(java.util.UUID resourceId, ACL acl, java.util.UUID actorId, java.util.Date happenedOn)
changeAcl
in interface Migration
resourceId
- The resource to update.acl
- The access control list for this resource.actorId
- The user id of the actor.happenedOn
- When the command happened.public void applyWorkingCopy(java.util.UUID resourceId, java.util.UUID userId, java.util.Date happenedOn, boolean isMajorEdit, java.lang.String comment)
applyWorkingCopy
in interface Migration
resourceId
- The id of the resource.userId
- The user applying the working copy.happenedOn
- When the command happened.isMajorEdit
- Was this a major change.comment
- A comment describing the change.public void deleteResource(java.util.UUID resourceId, java.util.UUID actorId, java.util.Date happenedOn)
deleteResource
in interface Migration
resourceId
- The id of the existing resource.actorId
- The user id of the actor.happenedOn
- When the command happened.protected IRepositoryFactory getRepoFactory()
public CommandFactory commands()
protected final javax.ejb.TimerService getTimerService()
protected final <T> T sudoExecute(Command<T> command, java.util.UUID actorId, java.util.Date happenedOn)
T
- The command's return type.command
- The command to execute.actorId
- The actor executing the command.happenedOn
- When the command was executed.
protected final <T> T execute(Command<T> command)
T
- The command's return type.command
- The command to execute.
protected UserEntity userForId(java.util.UUID userId)
userId
- The user's ID.
protected UserEntity currentUser()
protected java.util.UUID currentUserId()
protected void checkRead(ResourceEntity r)
r
- The resource to check.protected void checkWrite(ResourceEntity r)
r
- The resource to check.protected void checkPermission(java.lang.String... permissions)
permissions
- The permissions to check.protected java.util.Collection<? extends ResourceEntity> filterAccessibleTo(UserEntity u, java.util.List<? extends ResourceEntity> resources)
u
- The user reading the collection.resources
- The un-filtered collection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |