Package io.milton.http.annotated
Class AnnoCollectionResource
java.lang.Object
io.milton.http.annotated.AnnoResource
io.milton.http.annotated.AnnoCollectionResource
- All Implemented Interfaces:
CommonResource,ConditionalCompatibleResource,AccessControlledResource,CollectionResource,CopyableResource,DeletableCollectionResource,DeletableResource,DigestResource,DisplayNameResource,ExtMakeCalendarResource,GetableResource,LockableResource,LockingCollectionResource,MakeCollectionableResource,MoveableResource,PostableResource,PropFindableResource,PutableResource,ReportableResource,Resource
- Direct Known Subclasses:
AnnoAddressBookResource,AnnoCalendarHomeResource,AnnoCalendarResource,AnnoPrincipalResource,AnnoSchedulingInboxResource
public class AnnoCollectionResource
extends AnnoResource
implements CollectionResource, PutableResource, MakeCollectionableResource, LockingCollectionResource, DeletableCollectionResource, ExtMakeCalendarResource
Placeholder object to represent a node in an annotations hierachy acting as a
collection
A source object (ie your pojo) is considered a collection if it can have
children , ie if there exists at least one @ChildOf or @ChildrenOf method
which has that object as its source type. Note this is keyed on the class.
This class includes methods suitable for use in page templating logic for
navigating through the hierarchy.
- Author:
- brad
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.milton.resource.AccessControlledResource
AccessControlledResource.Priviledge -
Field Summary
Fields inherited from class io.milton.http.annotated.AnnoResource
acl, annoFactory, jsonResult, nameOverride, parent, realm, sourceFields inherited from interface io.milton.resource.AccessControlledResource
NONE, READ_BROWSE, READ_CONTENT, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionAnnoCollectionResource(AnnotationResourceFactory outer, Object source, AnnoCollectionResource parent) -
Method Summary
Modifier and TypeMethodDescriptioncreateAndLock(String name, LockTimeout timeout, LockInfo lockInfo) createCalendar(String newName, Map<QName, String> fieldsToSet) createCollection(String newName) createNew(String newName, InputStream inputStream, Long length, String contentType) protected ResourceListfindChildren(boolean isChildLookup) Locate a resource from the given path evaluated relative to this resource.getChildren(boolean isChildLookup) getFiles()getRoot()protected voidinitChildren(boolean isChildLookup) Called when the children list is first accessed This will create the children ResourceList and populate it with known child resourcesbooleanisLockedOutRecursive(Request request) Methods inherited from class io.milton.http.annotated.AnnoResource
authenticate, authenticate, authorise, checkRedirect, copyTo, delete, getAccessControlList, getAnnoFactory, getAsList, getContentLength, getContentType, getContentType, getCreateDate, getCurrentLock, getDisplayName, getHref, getLink, getMaxAgeSeconds, getModifiedDate, getName, getNameOverride, getParent, getPrincipalCollectionHrefs, getPrincipalURL, getPriviledges, getRealm, getSource, getUniqueId, is, isCompatible, isDigestAllowed, lock, moveTo, processForm, refreshLock, sendContent, setAccessControlList, setDisplayName, setNameOverride, unlockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.milton.resource.DeletableResource
deleteMethods inherited from interface io.milton.resource.LockableResource
getCurrentLock, lock, refreshLock, unlockMethods inherited from interface io.milton.resource.Resource
authenticate, authorise, checkRedirect, getModifiedDate, getName, getRealm, getUniqueId
-
Constructor Details
-
AnnoCollectionResource
public AnnoCollectionResource(AnnotationResourceFactory outer, Object source, AnnoCollectionResource parent)
-
-
Method Details
-
child
- Specified by:
childin interfaceCollectionResource- Throws:
NotAuthorizedExceptionBadRequestException
-
getChildren
- Specified by:
getChildrenin interfaceCollectionResource- Throws:
NotAuthorizedExceptionBadRequestException
-
getChildren
public List<? extends Resource> getChildren(boolean isChildLookup) throws NotAuthorizedException, BadRequestException -
getResourceList
-
getSubFolders
-
getFiles
-
findChildren
protected ResourceList findChildren(boolean isChildLookup) throws NotAuthorizedException, BadRequestException -
initChildren
protected void initChildren(boolean isChildLookup) throws NotAuthorizedException, BadRequestException Called when the children list is first accessed This will create the children ResourceList and populate it with known child resources- Parameters:
isChildLookup- - indicates this is being called in the context of a call to load a single child by name- Throws:
NotAuthorizedExceptionBadRequestException
-
getChildrenMap
public Map<String,CommonResource> getChildrenMap() throws NotAuthorizedException, BadRequestException -
getChildrenOfType
public Map<String,ResourceList> getChildrenOfType() throws NotAuthorizedException, BadRequestException -
createCollection
public CollectionResource createCollection(String newName) throws NotAuthorizedException, ConflictException, BadRequestException - Specified by:
createCollectionin interfaceMakeCollectionableResource- Throws:
NotAuthorizedExceptionConflictExceptionBadRequestException
-
createCalendar
public CollectionResource createCalendar(String newName, Map<QName, String> fieldsToSet) throws NotAuthorizedException, ConflictException, BadRequestException- Specified by:
createCalendarin interfaceExtMakeCalendarResource- Throws:
NotAuthorizedExceptionConflictExceptionBadRequestException
-
createNew
public Resource createNew(String newName, InputStream inputStream, Long length, String contentType) throws IOException, ConflictException, NotAuthorizedException, BadRequestException - Specified by:
createNewin interfacePutableResource- Throws:
IOExceptionConflictExceptionNotAuthorizedExceptionBadRequestException
-
getRoot
- Overrides:
getRootin classAnnoResource
-
createAndLock
public LockToken createAndLock(String name, LockTimeout timeout, LockInfo lockInfo) throws NotAuthorizedException - Specified by:
createAndLockin interfaceLockingCollectionResource- Throws:
NotAuthorizedException
-
isLockedOutRecursive
- Specified by:
isLockedOutRecursivein interfaceDeletableCollectionResource
-
find
-
findPath
Locate a resource from the given path evaluated relative to this resource. Supports ".." and "." segments, any other strings are considered file names- Parameters:
p-- Returns:
- Throws:
NotAuthorizedExceptionBadRequestException
-