Source Code Cross Referenced for TextDocumentType.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » content » types » 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.types 
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.types;
021:
022:        import java.util.EnumMap;
023:        import java.util.Hashtable;
024:        import java.util.Iterator;
025:        import java.util.List;
026:        import java.util.Map;
027:        import java.util.Set;
028:        import java.util.Vector;
029:
030:        import org.sakaiproject.component.cover.ComponentManager;
031:        import org.sakaiproject.content.api.ContentEntity;
032:        import org.sakaiproject.content.api.InteractionAction;
033:        import org.sakaiproject.content.api.ResourceToolAction;
034:        import org.sakaiproject.content.api.ResourceType;
035:        import org.sakaiproject.content.api.ServiceLevelAction;
036:        import org.sakaiproject.content.api.ResourceToolAction.ActionType;
037:        import org.sakaiproject.content.types.FileUploadType.FileUploadAccessAction;
038:        import org.sakaiproject.content.types.FileUploadType.FileUploadCopyAction;
039:        import org.sakaiproject.content.types.FileUploadType.FileUploadCreateAction;
040:        import org.sakaiproject.content.types.FileUploadType.FileUploadDeleteAction;
041:        import org.sakaiproject.content.types.FileUploadType.FileUploadDuplicateAction;
042:        import org.sakaiproject.content.types.FileUploadType.FileUploadMoveAction;
043:        import org.sakaiproject.content.types.FileUploadType.FileUploadReviseAction;
044:        import org.sakaiproject.content.util.BaseResourceType;
045:        import org.sakaiproject.entity.api.Reference;
046:        import org.sakaiproject.entity.api.ResourceProperties;
047:        import org.sakaiproject.user.api.User;
048:        import org.sakaiproject.user.api.UserDirectoryService;
049:        import org.sakaiproject.util.ResourceLoader;
050:
051:        /**
052:         * 
053:         * 
054:         *
055:         */
056:        public class TextDocumentType extends BaseResourceType {
057:            public static final String MY_HELPER_ID = "sakai.resource.type.helper";
058:
059:            protected EnumMap<ResourceToolAction.ActionType, List<ResourceToolAction>> actionMap = new EnumMap<ResourceToolAction.ActionType, List<ResourceToolAction>>(
060:                    ResourceToolAction.ActionType.class);
061:
062:            protected Map<String, ResourceToolAction> actions = new Hashtable<String, ResourceToolAction>();
063:            protected String typeId = ResourceType.TYPE_TEXT;
064:            protected String helperId = "sakai.resource.type.helper";
065:
066:            protected UserDirectoryService userDirectoryService;
067:
068:            /** Resource bundle using current language locale */
069:            private static ResourceLoader rb = new ResourceLoader("types");
070:
071:            public TextDocumentType() {
072:                this .userDirectoryService = (UserDirectoryService) ComponentManager
073:                        .get("org.sakaiproject.user.api.UserDirectoryService");
074:
075:                actions.put(ResourceToolAction.CREATE,
076:                        new TextDocumentCreateAction());
077:                // actions.put(ResourceToolAction.ACCESS_CONTENT, new TextDocumentAccessAction());
078:                actions.put(ResourceToolAction.REVISE_CONTENT,
079:                        new TextDocumentReviseAction());
080:                actions.put(ResourceToolAction.REPLACE_CONTENT,
081:                        new TextDocumentReplaceAction());
082:                actions.put(ResourceToolAction.REVISE_METADATA,
083:                        new TextDocumentPropertiesAction());
084:                actions.put(ResourceToolAction.COPY,
085:                        new TextDocumentCopyAction());
086:                actions.put(ResourceToolAction.DUPLICATE,
087:                        new TextDocumentDuplicateAction());
088:                actions.put(ResourceToolAction.MOVE,
089:                        new TextDocumentMoveAction());
090:                actions.put(ResourceToolAction.DELETE,
091:                        new TextDocumentDeleteAction());
092:
093:                // initialize actionMap with an empty List for each ActionType
094:                for (ResourceToolAction.ActionType type : ResourceToolAction.ActionType
095:                        .values()) {
096:                    actionMap.put(type, new Vector<ResourceToolAction>());
097:                }
098:
099:                // for each action in actions, add a link in actionMap
100:                Iterator<String> it = actions.keySet().iterator();
101:                while (it.hasNext()) {
102:                    String id = it.next();
103:                    ResourceToolAction action = actions.get(id);
104:                    List<ResourceToolAction> list = actionMap.get(action
105:                            .getActionType());
106:                    if (list == null) {
107:                        list = new Vector<ResourceToolAction>();
108:                        actionMap.put(action.getActionType(), list);
109:                    }
110:                    list.add(action);
111:                }
112:
113:            }
114:
115:            public class TextDocumentReplaceAction implements  InteractionAction {
116:
117:                public boolean available(ContentEntity entity) {
118:                    return true;
119:                }
120:
121:                public ActionType getActionType() {
122:                    return ResourceToolAction.ActionType.REPLACE_CONTENT;
123:                }
124:
125:                public String getId() {
126:                    return ResourceToolAction.REPLACE_CONTENT;
127:                }
128:
129:                public String getLabel() {
130:                    return rb.getString("action.replace");
131:                }
132:
133:                public String getTypeId() {
134:                    return typeId;
135:                }
136:
137:                public void cancelAction(Reference reference,
138:                        String initializationId) {
139:
140:                }
141:
142:                public void finalizeAction(Reference reference,
143:                        String initializationId) {
144:
145:                }
146:
147:                public String getHelperId() {
148:                    return helperId;
149:                }
150:
151:                public List getRequiredPropertyKeys() {
152:                    List<String> rv = new Vector<String>();
153:                    rv.add(ResourceProperties.PROP_CONTENT_ENCODING);
154:                    return rv;
155:                }
156:
157:                public String initializeAction(Reference reference) {
158:                    return null;
159:                }
160:            }
161:
162:            public class TextDocumentPropertiesAction implements 
163:                    ServiceLevelAction {
164:                /* (non-Javadoc)
165:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
166:                 */
167:                public boolean available(ContentEntity entity) {
168:                    return true;
169:                }
170:
171:                /* (non-Javadoc)
172:                 * @see org.sakaiproject.content.api.ServiceLevelAction#cancelAction(org.sakaiproject.entity.api.Reference)
173:                 */
174:                public void cancelAction(Reference reference) {
175:                    // TODO Auto-generated method stub
176:
177:                }
178:
179:                /* (non-Javadoc)
180:                 * @see org.sakaiproject.content.api.ServiceLevelAction#finalizeAction(org.sakaiproject.entity.api.Reference)
181:                 */
182:                public void finalizeAction(Reference reference) {
183:                    // TODO Auto-generated method stub
184:
185:                }
186:
187:                /* (non-Javadoc)
188:                 * @see org.sakaiproject.content.api.ServiceLevelAction#initializeAction(org.sakaiproject.entity.api.Reference)
189:                 */
190:                public void initializeAction(Reference reference) {
191:                    // TODO Auto-generated method stub
192:
193:                }
194:
195:                /* (non-Javadoc)
196:                 * @see org.sakaiproject.content.api.ServiceLevelAction#isMultipleItemAction()
197:                 */
198:                public boolean isMultipleItemAction() {
199:                    // TODO Auto-generated method stub
200:                    return false;
201:                }
202:
203:                /* (non-Javadoc)
204:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
205:                 */
206:                public ActionType getActionType() {
207:                    // TODO Auto-generated method stub
208:                    return ResourceToolAction.ActionType.REVISE_METADATA;
209:                }
210:
211:                /* (non-Javadoc)
212:                 * @see org.sakaiproject.content.api.ResourceToolAction#getId()
213:                 */
214:                public String getId() {
215:                    // TODO Auto-generated method stub
216:                    return ResourceToolAction.REVISE_METADATA;
217:                }
218:
219:                /* (non-Javadoc)
220:                 * @see org.sakaiproject.content.api.ResourceToolAction#getLabel()
221:                 */
222:                public String getLabel() {
223:                    // TODO Auto-generated method stub
224:                    return rb.getString("action.props");
225:                }
226:
227:                /* (non-Javadoc)
228:                 * @see org.sakaiproject.content.api.ResourceToolAction#getTypeId()
229:                 */
230:                public String getTypeId() {
231:                    // TODO Auto-generated method stub
232:                    return typeId;
233:                }
234:
235:            }
236:
237:            public class TextDocumentCopyAction implements  ServiceLevelAction {
238:                /* (non-Javadoc)
239:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
240:                 */
241:                public boolean available(ContentEntity entity) {
242:                    return true;
243:                }
244:
245:                public String getId() {
246:                    return ResourceToolAction.COPY;
247:                }
248:
249:                public String getLabel() {
250:                    return rb.getString("action.copy");
251:                }
252:
253:                public boolean isMultipleItemAction() {
254:                    return true;
255:                }
256:
257:                public String getTypeId() {
258:                    return typeId;
259:                }
260:
261:                /* (non-Javadoc)
262:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
263:                 */
264:                public ActionType getActionType() {
265:                    return ResourceToolAction.ActionType.COPY;
266:                }
267:
268:                /* (non-Javadoc)
269:                 * @see org.sakaiproject.content.api.ServiceLevelAction#cancelAction(org.sakaiproject.entity.api.Reference)
270:                 */
271:                public void cancelAction(Reference reference) {
272:                    // TODO Auto-generated method stub
273:
274:                }
275:
276:                /* (non-Javadoc)
277:                 * @see org.sakaiproject.content.api.ServiceLevelAction#finalizeAction(org.sakaiproject.entity.api.Reference)
278:                 */
279:                public void finalizeAction(Reference reference) {
280:                    // TODO Auto-generated method stub
281:
282:                }
283:
284:                /* (non-Javadoc)
285:                 * @see org.sakaiproject.content.api.ServiceLevelAction#initializeAction(org.sakaiproject.entity.api.Reference)
286:                 */
287:                public void initializeAction(Reference reference) {
288:                    // TODO Auto-generated method stub
289:
290:                }
291:
292:            }
293:
294:            public class TextDocumentCreateAction implements  InteractionAction {
295:                /* (non-Javadoc)
296:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
297:                 */
298:                public boolean available(ContentEntity entity) {
299:                    return true;
300:                }
301:
302:                public void cancelAction(Reference reference,
303:                        String initializationId) {
304:                    // TODO Auto-generated method stub
305:
306:                }
307:
308:                public void finalizeAction(Reference reference,
309:                        String initializationId) {
310:                    // TODO Auto-generated method stub
311:
312:                }
313:
314:                /* (non-Javadoc)
315:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
316:                 */
317:                public ActionType getActionType() {
318:                    return ResourceToolAction.ActionType.CREATE;
319:                }
320:
321:                public String getId() {
322:                    return ResourceToolAction.CREATE;
323:                }
324:
325:                public String getLabel() {
326:                    return rb.getString("create.text");
327:                }
328:
329:                public String getTypeId() {
330:                    return typeId;
331:                }
332:
333:                public String getHelperId() {
334:                    return helperId;
335:                }
336:
337:                public List getRequiredPropertyKeys() {
338:                    List<String> rv = new Vector<String>();
339:                    rv.add(ResourceProperties.PROP_CONTENT_ENCODING);
340:                    return rv;
341:                }
342:
343:                public String initializeAction(Reference reference) {
344:                    return null;
345:
346:                }
347:
348:            }
349:
350:            public class TextDocumentDeleteAction implements  ServiceLevelAction {
351:                /* (non-Javadoc)
352:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
353:                 */
354:                public boolean available(ContentEntity entity) {
355:                    return true;
356:                }
357:
358:                /* (non-Javadoc)
359:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
360:                 */
361:                public ActionType getActionType() {
362:                    return ResourceToolAction.ActionType.DELETE;
363:                }
364:
365:                public String getId() {
366:                    return ResourceToolAction.DELETE;
367:                }
368:
369:                public String getLabel() {
370:                    return rb.getString("action.delete");
371:                }
372:
373:                public boolean isMultipleItemAction() {
374:                    return true;
375:                }
376:
377:                public String getTypeId() {
378:                    return typeId;
379:                }
380:
381:                /* (non-Javadoc)
382:                 * @see org.sakaiproject.content.api.ServiceLevelAction#cancelAction(org.sakaiproject.entity.api.Reference)
383:                 */
384:                public void cancelAction(Reference reference) {
385:                    // TODO Auto-generated method stub
386:
387:                }
388:
389:                /* (non-Javadoc)
390:                 * @see org.sakaiproject.content.api.ServiceLevelAction#finalizeAction(org.sakaiproject.entity.api.Reference)
391:                 */
392:                public void finalizeAction(Reference reference) {
393:                    // TODO Auto-generated method stub
394:
395:                }
396:
397:                /* (non-Javadoc)
398:                 * @see org.sakaiproject.content.api.ServiceLevelAction#initializeAction(org.sakaiproject.entity.api.Reference)
399:                 */
400:                public void initializeAction(Reference reference) {
401:                    // TODO Auto-generated method stub
402:
403:                }
404:
405:            }
406:
407:            public class TextDocumentDuplicateAction implements 
408:                    ServiceLevelAction {
409:                /* (non-Javadoc)
410:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
411:                 */
412:                public boolean available(ContentEntity entity) {
413:                    return true;
414:                }
415:
416:                /* (non-Javadoc)
417:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
418:                 */
419:                public ActionType getActionType() {
420:                    return ResourceToolAction.ActionType.DUPLICATE;
421:                }
422:
423:                public String getId() {
424:                    return ResourceToolAction.DUPLICATE;
425:                }
426:
427:                public String getLabel() {
428:                    return rb.getString("action.duplicate");
429:                }
430:
431:                public boolean isMultipleItemAction() {
432:                    // TODO Auto-generated method stub
433:                    return false;
434:                }
435:
436:                public String getTypeId() {
437:                    return typeId;
438:                }
439:
440:                /* (non-Javadoc)
441:                 * @see org.sakaiproject.content.api.ServiceLevelAction#cancelAction(org.sakaiproject.entity.api.Reference)
442:                 */
443:                public void cancelAction(Reference reference) {
444:                    // TODO Auto-generated method stub
445:
446:                }
447:
448:                /* (non-Javadoc)
449:                 * @see org.sakaiproject.content.api.ServiceLevelAction#finalizeAction(org.sakaiproject.entity.api.Reference)
450:                 */
451:                public void finalizeAction(Reference reference) {
452:                    // TODO Auto-generated method stub
453:
454:                }
455:
456:                /* (non-Javadoc)
457:                 * @see org.sakaiproject.content.api.ServiceLevelAction#initializeAction(org.sakaiproject.entity.api.Reference)
458:                 */
459:                public void initializeAction(Reference reference) {
460:                    // TODO Auto-generated method stub
461:
462:                }
463:
464:            }
465:
466:            public class TextDocumentMoveAction implements  ServiceLevelAction {
467:                /* (non-Javadoc)
468:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
469:                 */
470:                public boolean available(ContentEntity entity) {
471:                    return true;
472:                }
473:
474:                /* (non-Javadoc)
475:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
476:                 */
477:                public ActionType getActionType() {
478:                    return ResourceToolAction.ActionType.MOVE;
479:                }
480:
481:                public String getId() {
482:                    return ResourceToolAction.MOVE;
483:                }
484:
485:                public String getLabel() {
486:                    return rb.getString("action.move");
487:                }
488:
489:                public boolean isMultipleItemAction() {
490:                    return true;
491:                }
492:
493:                public String getTypeId() {
494:                    return typeId;
495:                }
496:
497:                /* (non-Javadoc)
498:                 * @see org.sakaiproject.content.api.ServiceLevelAction#cancelAction(org.sakaiproject.entity.api.Reference)
499:                 */
500:                public void cancelAction(Reference reference) {
501:                    // TODO Auto-generated method stub
502:
503:                }
504:
505:                /* (non-Javadoc)
506:                 * @see org.sakaiproject.content.api.ServiceLevelAction#finalizeAction(org.sakaiproject.entity.api.Reference)
507:                 */
508:                public void finalizeAction(Reference reference) {
509:                    // TODO Auto-generated method stub
510:
511:                }
512:
513:                /* (non-Javadoc)
514:                 * @see org.sakaiproject.content.api.ServiceLevelAction#initializeAction(org.sakaiproject.entity.api.Reference)
515:                 */
516:                public void initializeAction(Reference reference) {
517:                    // TODO Auto-generated method stub
518:
519:                }
520:
521:            }
522:
523:            public class TextDocumentReviseAction implements  InteractionAction {
524:                /* (non-Javadoc)
525:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
526:                 */
527:                public boolean available(ContentEntity entity) {
528:                    return true;
529:                }
530:
531:                public void cancelAction(Reference reference,
532:                        String initializationId) {
533:                    // TODO Auto-generated method stub
534:
535:                }
536:
537:                public void finalizeAction(Reference reference,
538:                        String initializationId) {
539:                    // TODO Auto-generated method stub
540:
541:                }
542:
543:                /* (non-Javadoc)
544:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
545:                 */
546:                public ActionType getActionType() {
547:                    return ResourceToolAction.ActionType.REVISE_CONTENT;
548:                }
549:
550:                public String getId() {
551:                    return ResourceToolAction.REVISE_CONTENT;
552:                }
553:
554:                public String getLabel() {
555:                    return rb.getString("action.revise");
556:                }
557:
558:                public String getTypeId() {
559:                    return typeId;
560:                }
561:
562:                public String getHelperId() {
563:                    return helperId;
564:                }
565:
566:                public List getRequiredPropertyKeys() {
567:                    List<String> rv = new Vector<String>();
568:                    rv.add(ResourceProperties.PROP_CONTENT_ENCODING);
569:                    return rv;
570:                }
571:
572:                public String initializeAction(Reference reference) {
573:                    return null;
574:                }
575:
576:            }
577:
578:            public class TextDocumentAccessAction implements  InteractionAction {
579:                /* (non-Javadoc)
580:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
581:                 */
582:                public boolean available(ContentEntity entity) {
583:                    return true;
584:                }
585:
586:                public void cancelAction(Reference reference,
587:                        String initializationId) {
588:                    // TODO Auto-generated method stub
589:
590:                }
591:
592:                public void finalizeAction(Reference reference,
593:                        String initializationId) {
594:                    // TODO Auto-generated method stub
595:
596:                }
597:
598:                /* (non-Javadoc)
599:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
600:                 */
601:                public ActionType getActionType() {
602:                    return ResourceToolAction.ActionType.VIEW_CONTENT;
603:                }
604:
605:                public String getId() {
606:                    return ResourceToolAction.ACCESS_CONTENT;
607:                }
608:
609:                public String getLabel() {
610:                    return rb.getString("action.access");
611:                }
612:
613:                public String getTypeId() {
614:                    return typeId;
615:                }
616:
617:                public String getHelperId() {
618:                    return helperId;
619:                }
620:
621:                public List getRequiredPropertyKeys() {
622:                    return null;
623:                }
624:
625:                public String initializeAction(Reference reference) {
626:                    // TODO Auto-generated method stub
627:                    return null;
628:                }
629:
630:            }
631:
632:            public class ReviseMetadataAction implements  ServiceLevelAction {
633:                /* (non-Javadoc)
634:                 * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
635:                 */
636:                public boolean available(ContentEntity entity) {
637:                    return true;
638:                }
639:
640:                /* (non-Javadoc)
641:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
642:                 */
643:                public ActionType getActionType() {
644:                    return ResourceToolAction.ActionType.REVISE_METADATA;
645:                }
646:
647:                public String getId() {
648:                    return ResourceToolAction.REVISE_METADATA;
649:                }
650:
651:                public boolean isMultipleItemAction() {
652:                    // TODO Auto-generated method stub
653:                    return false;
654:                }
655:
656:                public String getLabel() {
657:                    return rb.getString("xxxxxxxxx.xxxxxxxxx");
658:                }
659:
660:                public String getTypeId() {
661:                    return typeId;
662:                }
663:
664:                public String getHelperId() {
665:                    return helperId;
666:                }
667:
668:                /* (non-Javadoc)
669:                 * @see org.sakaiproject.content.api.ServiceLevelAction#cancelAction(org.sakaiproject.entity.api.Reference)
670:                 */
671:                public void cancelAction(Reference reference) {
672:                    // TODO Auto-generated method stub
673:
674:                }
675:
676:                /* (non-Javadoc)
677:                 * @see org.sakaiproject.content.api.ServiceLevelAction#finalizeAction(org.sakaiproject.entity.api.Reference)
678:                 */
679:                public void finalizeAction(Reference reference) {
680:                    // TODO Auto-generated method stub
681:
682:                }
683:
684:                /* (non-Javadoc)
685:                 * @see org.sakaiproject.content.api.ServiceLevelAction#initializeAction(org.sakaiproject.entity.api.Reference)
686:                 */
687:                public void initializeAction(Reference reference) {
688:                    // TODO Auto-generated method stub
689:
690:                }
691:
692:            }
693:
694:            public abstract class ViewMetadataAction implements 
695:                    ServiceLevelAction {
696:                /* (non-Javadoc)
697:                 * @see org.sakaiproject.content.api.ResourceToolAction#getActionType()
698:                 */
699:                public ActionType getActionType() {
700:                    return ResourceToolAction.ActionType.VIEW_METADATA;
701:                }
702:
703:                public String getId() {
704:                    return ResourceToolAction.ACCESS_PROPERTIES;
705:                }
706:
707:                public boolean isMultipleItemAction() {
708:                    // TODO Auto-generated method stub
709:                    return false;
710:                }
711:
712:            }
713:
714:            public ResourceToolAction getAction(String actionId) {
715:                return actions.get(actionId);
716:            }
717:
718:            public List<ResourceToolAction> getActions(Reference entityRef,
719:                    Set permissions) {
720:                // TODO: use entityRef to filter actions
721:                List<ResourceToolAction> rv = new Vector<ResourceToolAction>();
722:                rv.addAll(actions.values());
723:                return rv;
724:            }
725:
726:            public List<ResourceToolAction> getActions(Reference entityRef,
727:                    User user, Set permissions) {
728:                // TODO: use entityRef and user to filter actions
729:                List<ResourceToolAction> rv = new Vector<ResourceToolAction>();
730:                rv.addAll(actions.values());
731:                return rv;
732:            }
733:
734:            public String getIconLocation(ContentEntity entity) {
735:                // TODO Auto-generated method stub
736:                return null;
737:            }
738:
739:            public String getId() {
740:                return typeId;
741:            }
742:
743:            public String getLabel() {
744:                return rb.getString("type.text");
745:            }
746:
747:            /* (non-Javadoc)
748:             * @see org.sakaiproject.content.api.ResourceType#getLocalizedHoverText(org.sakaiproject.entity.api.Reference)
749:             */
750:            public String getLocalizedHoverText(ContentEntity member) {
751:                return rb.getString("type.text");
752:            }
753:
754:            /* (non-Javadoc)
755:             * @see org.sakaiproject.content.api.ResourceType#getActions(org.sakaiproject.content.api.ResourceType.ActionType)
756:             */
757:            public List<ResourceToolAction> getActions(ActionType type) {
758:                List<ResourceToolAction> list = actionMap.get(type);
759:                if (list == null) {
760:                    list = new Vector<ResourceToolAction>();
761:                    actionMap.put(type, list);
762:                }
763:                return new Vector<ResourceToolAction>(list);
764:            }
765:
766:            /* (non-Javadoc)
767:             * @see org.sakaiproject.content.api.ResourceType#getActions(java.util.List)
768:             */
769:            public List<ResourceToolAction> getActions(List<ActionType> types) {
770:                List<ResourceToolAction> list = new Vector<ResourceToolAction>();
771:                if (types != null) {
772:                    Iterator<ActionType> it = types.iterator();
773:                    while (it.hasNext()) {
774:                        ActionType type = it.next();
775:                        List<ResourceToolAction> sublist = actionMap.get(type);
776:                        if (sublist == null) {
777:                            sublist = new Vector<ResourceToolAction>();
778:                            actionMap.put(type, sublist);
779:                        }
780:                        list.addAll(sublist);
781:                    }
782:                }
783:                return list;
784:            }
785:
786:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.