Source Code Cross Referenced for ItemServiceImpl.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » tool » assessment » shared » impl » assessment » 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.tool.assessment.shared.impl.assessment 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL$
003:         * $Id$
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2005, 2006 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.tool.assessment.shared.impl.assessment;
021:
022:        import java.util.HashMap;
023:        import java.util.Map;
024:
025:        import org.apache.commons.logging.Log;
026:        import org.apache.commons.logging.LogFactory;
027:
028:        import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc;
029:        import org.sakaiproject.tool.assessment.facade.ItemFacade;
030:        import org.sakaiproject.tool.assessment.services.ItemService;
031:        import org.sakaiproject.tool.assessment.services.assessment.AssessmentServiceException;
032:        import org.sakaiproject.tool.assessment.shared.api.assessment.ItemServiceAPI;
033:
034:        /**
035:         * AssessmentServiceImpl implements a shared interface to get/set item
036:         * information.
037:         * @author Ed Smiley <esmiley@stanford.edu>
038:         */
039:        // Our API just uses our internal service. If we want, we can always replace
040:        // this internal service and use its implementation as our own.
041:        // Note that ItemFacade implements ItemDataIfc.
042:        public class ItemServiceImpl implements  ItemServiceAPI {
043:
044:            private static Log log = LogFactory.getLog(ItemServiceImpl.class);
045:
046:            /**
047:             * Get a particular item.
048:             *
049:             * @param itemId the item id
050:             * @param agentId the agent id
051:             * @return the item data interface
052:             */
053:            public ItemDataIfc getItem(Long itemId, String agentId) {
054:                ItemFacade item = null;
055:                try {
056:                    ItemService service = new ItemService();
057:                    item = service.getItem(itemId, agentId);
058:                } catch (Exception e) {
059:                    throw new AssessmentServiceException(e);
060:                }
061:
062:                return item;
063:            }
064:
065:            /**
066:             * Delete a item.
067:             *
068:             * @param itemId the item id
069:             * @param agentId the agent id
070:             */
071:            public void deleteItem(Long itemId, String agentId) {
072:                try {
073:                    ItemService service = new ItemService();
074:                    service.deleteItem(itemId, agentId);
075:                } catch (Exception e) {
076:                    throw new AssessmentServiceException(e);
077:                }
078:            }
079:
080:            /**
081:             * Delete itemtextset for an item, used for modify
082:             *
083:             * @param itemId the item id
084:             * @param agentId the agent id
085:             */
086:            public void deleteItemContent(Long itemId, String agentId) {
087:                try {
088:                    ItemService service = new ItemService();
089:                    service.deleteItemContent(itemId, agentId);
090:                } catch (Exception e) {
091:                    throw new AssessmentServiceException(e);
092:                }
093:            }
094:
095:            /**
096:             * Delete metadata for an item, used for modify.
097:             * param:  itemid, label, agentId
098:             *
099:             * @param itemId the item id
100:             * @param label the metadata label
101:             * @param agentId the agent id
102:             */
103:            public void deleteItemMetaData(Long itemId, String label,
104:                    String agentId) {
105:                try {
106:                    ItemService service = new ItemService();
107:                    service.deleteItemMetaData(itemId, label, agentId);
108:                } catch (Exception e) {
109:                    throw new AssessmentServiceException(e);
110:                }
111:            }
112:
113:            /**
114:             * Add metadata for an item, used for modify
115:             * param:  itemid, label, value, agentId
116:             *
117:             * @param itemId the item id
118:             * @param label the metadata label
119:             * @param value  the value for the label
120:             * @param agentId the agent id
121:             */
122:            public void addItemMetaData(Long itemId, String label,
123:                    String value, String agentId) {
124:                try {
125:                    ItemService service = new ItemService();
126:                    service.addItemMetaData(itemId, label, value, agentId);
127:                } catch (Exception e) {
128:                    throw new AssessmentServiceException(e);
129:                }
130:            }
131:
132:            /**
133:             * Save item.
134:             * @param item interface
135:             * @return item interface
136:             */
137:            public ItemDataIfc saveItem(ItemDataIfc item) {
138:                try {
139:                    String itemId = item.getItemIdString();
140:                    ItemService service = new ItemService();
141:                    item = service.saveItem(service.getItem(itemId));
142:                } catch (Exception e) {
143:                    throw new AssessmentServiceException(e);
144:                }
145:
146:                return item;
147:            }
148:
149:            /**
150:             * Get item.
151:             * @param itemId the item id
152:             * @return item interface
153:             */
154:            public ItemDataIfc getItem(String itemId) {
155:                ItemFacade item = null;
156:                try {
157:                    ItemService service = new ItemService();
158:                    item = service.getItem(itemId);
159:                } catch (Exception e) {
160:                    throw new AssessmentServiceException(e);
161:                }
162:
163:                return item;
164:            }
165:
166:            /**
167:             * Search for items.
168:             * @param keyword the keyword to search by.
169:             * @return Map of ItemDataIfcs with item id strings as keys.
170:             */
171:
172:            public Map getItemsByKeyword(String keyword) {
173:                Map itemKeywordMap = new HashMap();
174:                try {
175:                    ItemService service = new ItemService();
176:                    itemKeywordMap = service.getItemsByKeyword(keyword);
177:                } catch (Exception e) {
178:                    throw new AssessmentServiceException(e);
179:                }
180:
181:                return itemKeywordMap;
182:            }
183:        }
w___w___w.__j___a__v___a__2_s__._c___om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.