01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/content/tags/sakai_2-4-1/content-api/api/src/java/org/sakaiproject/content/api/ContentEntity.java $
03: * $Id: ContentEntity.java 22313 2007-03-08 04:28:29Z jimeng@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.content.api;
21:
22: import org.sakaiproject.content.api.GroupAwareEntity;
23:
24: public interface ContentEntity extends GroupAwareEntity {
25: /**
26: * Access this ContentEntity's containing collection, or null if this entity is the site collection.
27: * @return
28: */
29: public ContentCollection getContainingCollection();
30:
31: /**
32: * Check whether an entity is a ContentResource.
33: * @return true if the entity implements the ContentResource interface, false otherwise.
34: */
35: public boolean isResource();
36:
37: /**
38: * Check whether an entity is a ContentCollection.
39: * @return true if the entity implements the ContentCollection interface, false otherwise.
40: */
41: public boolean isCollection();
42:
43: /**
44: * Access the "type" of this ContentEntity, which defines which ResourceType registration defines
45: * its properties.
46: * @return
47: */
48: public String getResourceType();
49:
50: /**
51: *
52: * @return
53: */
54: public ContentHostingHandler getContentHandler();
55:
56: /**
57: *
58: * @param chh
59: */
60: public void setContentHandler(ContentHostingHandler chh);
61:
62: /**
63: *
64: * @return
65: */
66: public ContentEntity getVirtualContentEntity();
67:
68: /**
69: *
70: * @param ce
71: */
72: public void setVirtualContentEntity(ContentEntity ce);
73:
74: /**
75: *
76: * @param nextId
77: * @return
78: */
79: public ContentEntity getMember(String nextId);
80:
81: /**
82: * Access the URL which can be used to access the entity. Will return a relative or absolute url,
83: * depending on value of the parameter. If parameter is true, URL will be relative to the server's
84: * root. Otherwise, it will be a complete URL starting with the base URL of the server.
85: * @param relative
86: * @return The URL which can be used to access the resource.
87: */
88: public String getUrl(boolean relative);
89:
90: }
|