|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.PagesEJB
@RolesAllowed(value={}) public class PagesEJB
EJB implementation of the PagesExt
interface.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Pages |
---|
NAME |
Constructor Summary | |
---|---|
PagesEJB()
|
Method Summary | ||
---|---|---|
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 |
create(Page page)
Creates a new page. |
|
protected UserEntity |
currentUser()
Accessor. |
|
protected java.util.UUID |
currentUserId()
Accessor. |
|
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. |
|
PagedCollection<ResourceSummary> |
list(PageCriteria criteria,
int pageNo,
int pageSize)
List existing pages. |
|
Page |
retrieve(java.util.UUID pageId)
Retrieve the page. |
|
Page |
retrieveWorkingCopy(java.util.UUID pageId)
Retrieve the working copy for a page. |
|
protected
|
sudoExecute(Command<T> command,
java.util.UUID actorId,
java.util.Date happenedOn)
Execute a command on behalf of another user. |
|
void |
update(java.util.UUID pageId,
Page delta)
Update the specified page on the server. |
|
void |
updateWorkingCopy(java.util.UUID pageId,
Page delta)
Update the working copy of the specified page. |
|
protected UserEntity |
userForId(java.util.UUID userId)
Look up the user for the specified ID. |
|
java.lang.String |
validate(Page page)
Validate a set of paragraphs against a given definition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PagesEJB()
Method Detail |
---|
@PermitAll public ResourceSummary create(Page page)
create
in interface Pages
page
- Details of the new page to create.
@RolesAllowed(value="PAGE_UPDATE") public void update(java.util.UUID pageId, Page delta)
update
in interface Pages
pageId
- The id of the page to update.delta
- The changes to apply.@RolesAllowed(value="PAGE_UPDATE") public void updateWorkingCopy(java.util.UUID pageId, Page delta)
updateWorkingCopy
in interface Pages
pageId
- The id of the page to update.delta
- The changes to apply.@RolesAllowed(value="PAGE_UPDATE") public java.lang.String validate(Page page)
validate
in interface Pages
page
- The page to test.
@PermitAll public Page retrieve(java.util.UUID pageId)
retrieve
in interface Pages
pageId
- The page's id.
@RolesAllowed(value="PAGE_UPDATE") public Page retrieveWorkingCopy(java.util.UUID pageId)
retrieveWorkingCopy
in interface Pages
pageId
- The page's id.
@PermitAll public PagedCollection<ResourceSummary> list(PageCriteria criteria, int pageNo, int pageSize)
list
in interface Pages
criteria
- The criteria by which to filter pages.pageNo
- The page of results to return.pageSize
- The number of results in a page.
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 |