Source Code Cross Referenced for ResourceToolAction.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » content » api » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » sakai » org.sakaiproject.content.api 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL:  $
003:         * $Id:  $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2006, 2007 The Sakai Foundation.
007:         * 
008:         * Licensed under the Educational Community License, Version 1.0 (the "License"); 
009:         * you may not use this file except in compliance with the License. 
010:         * You may obtain a copy of the License at
011:         * 
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software 
015:         * distributed under the License is distributed on an "AS IS" BASIS, 
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
017:         * See the License for the specific language governing permissions and 
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.sakaiproject.content.api;
021:
022:        import java.util.List;
023:        import java.util.Vector;
024:
025:        /**
026:         * ResourceToolAction defines the way in which actions are described in a resource-type registration. 
027:         * Each action should have its own ResourceToolAction defined in the registration.  
028:         * If the action requires user interaction by a helper, the resource-type registration should include
029:         * an action definition that implements the InteractionAction interface.  
030:         * If an action requires action by another webapp but does not involve user interaction (i.e. it does
031:         * not delegate the user interaction to a helper), the resource-type registration should include an
032:         * action definition that implements the ServiceLevelAction interface.
033:         * Most actions for new resources types are likely to be similar to familiar actions on resources (e.g. 
034:         * "create", "revise", "delete", etc) and permissions for these actions are handled by the Content Hosting
035:         * Service.  If an action requires custom permissions, the definition of that action implements the
036:         * CustomToolAction interface to provide a way for the Resources tool to determine whether to show 
037:         * the action as an option in a particular context to a particular user.
038:         * A ResourceToolAction deinition should implement at least one of those subinterfaces, and it may
039:         * implement all three.  If a ResourceToolAction implements both InteractionAction and ServiceLevelAction,
040:         * the activity of the helper defined by InteractionAction will occur before the service-level activity 
041:         * defined by ServiceLevelAction.
042:         * 
043:         * @see org.sakaiproject.content.api.ResourceType
044:         */
045:        public interface ResourceToolAction {
046:            /**
047:             * ActionType defines identifiers for types of actions related to resources.
048:             */
049:            public enum ActionType {
050:                /**
051:                 * Create upload -- Handled by Resources tool.  Can create multiple uploads at once.  
052:                 * 		Metadata and content supplied in same form.  Requires content.new permission 
053:                 * 		in parent folder.
054:                 */
055:                NEW_UPLOAD,
056:
057:                /**
058:                 * Create folder -- Handled by Resources tool.  Can create multiple folders at once.  
059:                 * 		No content; requires metadata only.  Requires content.new permission in parent 
060:                 * 		folder.
061:                 */
062:                NEW_FOLDER,
063:
064:                /**
065:                 * Create URLs -- Handled by Resources tool.  Can create multiple URLs at once.  
066:                 * 		No content; requires metadata only.  Requires content.new permission in parent 
067:                 * 		folder.
068:                 */
069:                NEW_URLS,
070:
071:                /**
072:                 * Create other -- Handled by helper and Resources tool.  Can create one item at a time.  
073:                 * 		Content (and possibly some properties) handled by helper. Metadata supplied in 
074:                 * 		form that appears after helper finishes.  Requires content.new permission in 
075:                 * 		parent folder.
076:                 */
077:                CREATE,
078:
079:                /**
080:                 * Delete -- Handled by Resources tool.  Requires content.delete permission
081:                 */
082:                DELETE,
083:
084:                /**
085:                 * Revise content -- Handled by helper.  Requires content.revise.any permission (or 
086:                 * 		content.revise.own if user is creator).
087:                 */
088:                REVISE_CONTENT,
089:
090:                /**
091:                 * Replace content -- Handled by Resources tool.  Requires content.revise.any permission 
092:                 * 		(or content.revise.own if user is creator).
093:                 */
094:                REPLACE_CONTENT,
095:
096:                /**
097:                 * Revise metadata -- Handled by Resources tool.  Requires content.revise.any permission 
098:                 * 		(or content.revise.own if user is creator).
099:                 */
100:                REVISE_METADATA,
101:
102:                /**
103:                 * Copy -- Handled by Resources tool.  Requires content.read permission for item being 
104:                 * 		copied and content.new permission in folder to which it's copied.
105:                 */
106:                COPY,
107:
108:                /**
109:                 * Move -- Handled by Resources tool.  Requires content.delete (or content.update ?) permission for 
110:                 * 		item being moved and content.new permission in folder to which it's moved.
111:                 */
112:                MOVE,
113:
114:                /**
115:                 * Duplicate -- Handled by Resources tool.  Requires content.read permission for item being 
116:                 * 		duplicated and content.new permission in parent folder.
117:                 */
118:                DUPLICATE,
119:
120:                /**
121:                 * View content -- Handled by AccessServlet (via Resources tool) or helper.  Requires 
122:                 * 		content.read permission.
123:                 */
124:                VIEW_CONTENT,
125:
126:                /**
127:                 * View metadata -- Handled by Resources tool.  Requires content.read permission.
128:                 */
129:                VIEW_METADATA,
130:
131:                /**
132:                 * Paste Moved Items -- Handled by Resources tool.  Requires content.new permission.  The action 
133:                 * 		is only available after a MOVE action and before some other action that
134:                 * 		cancels the PASTE_MOVED.
135:                 */
136:                PASTE_MOVED,
137:
138:                /**
139:                 * Paste Copied Items -- Handled by Resources tool.  Requires content.new permission.  The action 
140:                 * 		is only available after a COPY action and before some other action that
141:                 * 		cancels the PASTE_COPIED.
142:                 */
143:                PASTE_COPIED,
144:
145:                /**
146:                 * Defines a custom sort order for the contents of a folder -- Handled by Resources tool.  Requires 
147:                 * 		content.revise permission for the folder.    
148:                 */
149:                REVISE_ORDER,
150:
151:                /**
152:                 * Revise folder permissions -- Handled by Resources tool.  Requires site.upd permission.  
153:                 */
154:                REVISE_PERMISSIONS,
155:
156:                /**
157:                 * Custom action -- Handled by helper.  May be interactive or service-level.  Custom actions
158:                 * 		must implement the CustomToolAction interface to provide Resources tool with a way to 
159:                 * 		determine permissions, as well as either InteractionAction or ServiceLevelAction.
160:                 */
161:                CUSTOM_TOOL_ACTION
162:
163:            }
164:
165:            public static final String CREATE = "create";
166:            public static final String DELETE = "delete";
167:            public static final String COPY = "copy";
168:            public static final String REVISE_CONTENT = "revise";
169:            public static final String REPLACE_CONTENT = "replace";
170:            public static final String REVISE_METADATA = "properties";
171:            public static final String ACCESS_CONTENT = "access";
172:            public static final String ACCESS_PROPERTIES = "info";
173:            public static final String DUPLICATE = "duplicate";
174:            public static final String MOVE = "move";
175:            public static final String PASTE_MOVED = "paste_moved";
176:            public static final String PASTE_COPIED = "paste_copied";
177:            public static final String PERMISSIONS = "revise_permissions";
178:            public static final String REORDER = "revise_order";
179:
180:            public static final String ACTION_DELIMITER = ":";
181:
182:            /**
183:             * Prefix for all keys to Tool Session attributes used in messaging between ResourcesAction and
184:             * helpers related to registered resource tool actions. Removing all attributes whose keys begin
185:             * with this prefix cleans up the tool session after a helper completes its work. 
186:             * ResourcesAction will cleanup tool session.
187:             */
188:            public static final String PREFIX = "resourceToolAction.";
189:
190:            public static final String ACTION_PIPE = PREFIX + "action_pipe";
191:
192:            public static final String STARTED = PREFIX + "started";
193:
194:            public static final String STATE_MODE = PREFIX + "state_mode";
195:
196:            public static final String DONE = PREFIX + "done";
197:
198:            /**
199:             * Access the id of this action (which must be unique within this type and must be limited to alphnumeric characters).
200:             * @return
201:             */
202:            public String getId();
203:
204:            /**
205:             * Access the id of the ResourceType this action relates to.
206:             * @return
207:             */
208:            public String getTypeId();
209:
210:            /**
211:             * Access the enumerated constant for this action.
212:             * @return
213:             */
214:            public ActionType getActionType();
215:
216:            /**
217:             * Access a very short localized string that will be used as a label for this action in the user interface.  
218:             * If string is longer than about 20 characters, it may be truncated. Shorter strings (less than 10 characters)
219:             * are preferred.  If this method returns null, the Resources tool will assign a label based on the ActionType. 
220:             * @return
221:             */
222:            public String getLabel();
223:
224:            /**
225:             * Should the resources tool make this action available to the current user with respect to the specified entity?
226:             * @param entity
227:             * @return
228:             */
229:            public boolean available(ContentEntity entity);
230:
231:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.