|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.FoldersEJB
@RolesAllowed(value={}) public class FoldersEJB
EJB implementation of the FoldersExt
interface.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Folders |
---|
NAME |
Constructor Summary | |
---|---|
FoldersEJB()
|
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(Folder folder)
Create a folder with the specified name. |
|
ResourceSummary |
createFolder(java.util.UUID parentId,
java.lang.String name,
java.lang.String title,
boolean publish)
Create a folder with the specified name and title. |
|
ResourceSummary |
createRoot(java.lang.String name)
Create a root folder with the specified name. |
|
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. |
|
PagedCollection<ResourceSummary> |
getAccessibleChildren(java.util.UUID folderId)
List all of the children of the specified folder which are accessible to current user. |
|
protected IRepositoryFactory |
getRepoFactory()
Accessor. |
|
protected javax.ejb.TimerService |
getTimerService()
Accessor. |
|
java.lang.Boolean |
nameExistsInFolder(java.util.UUID folderId,
java.lang.String name)
Query whether given folder has a resource with given name. |
|
PagedCollection<ResourceSummary> |
roots()
List the root folders available. |
|
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 folderId,
Folder delta)
Update the specified folder. |
|
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 FoldersEJB()
Method Detail |
---|
@PermitAll public ResourceSummary create(Folder folder)
create
in interface Folders
folder
- Details of the new folder.
@PermitAll public ResourceSummary createFolder(java.util.UUID parentId, java.lang.String name, java.lang.String title, boolean publish)
createFolder
in interface Folders
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.
@RolesAllowed(value="ROOT_CREATE") public ResourceSummary createRoot(java.lang.String name)
createRoot
in interface Folders
name
- The name of the root folder.
@RolesAllowed(value="FOLDER_UPDATE") public void update(java.util.UUID folderId, Folder delta)
update
in interface Folders
folderId
- The id of the folder to update.delta
- The updated details of the folder.@PermitAll public java.lang.Boolean nameExistsInFolder(java.util.UUID folderId, java.lang.String name)
nameExistsInFolder
in interface Folders
folderId
- The id of the folder to check.name
- The name of the resource.
@RolesAllowed(value="FOLDER_READ") public PagedCollection<ResourceSummary> roots()
roots
in interface Folders
@PermitAll public PagedCollection<ResourceSummary> getAccessibleChildren(java.util.UUID folderId)
getAccessibleChildren
in interface Folders
folderId
- The folder.
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 |