01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/facade/ItemFacadeQueriesAPI.java $
03: * $Id: ItemFacadeQueriesAPI.java 9273 2006-05-10 22:34:28Z daisyf@stanford.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2004, 2005, 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.tool.assessment.facade;
21:
22: import java.util.HashMap;
23: import java.util.List;
24:
25: import org.sakaiproject.tool.assessment.osid.shared.impl.IdImpl;
26:
27: public interface ItemFacadeQueriesAPI {
28:
29: public IdImpl getItemId(String id);
30:
31: public IdImpl getItemId(Long id);
32:
33: public IdImpl getItemId(long id);
34:
35: public Long add();
36:
37: public List getQPItems(Long questionPoolId);
38:
39: public List list();
40:
41: public void show(Long itemId);
42:
43: public ItemFacade getItem(Long itemId, String agent);
44:
45: public void showType(Long typeId);
46:
47: public void listType();
48:
49: // DELETEME
50: public void remove(Long itemId);
51:
52: public void deleteItem(Long itemId, String agent);
53:
54: public void deleteItemContent(Long itemId, String agent);
55:
56: public void deleteItemMetaData(Long itemId, String label);
57:
58: public void addItemMetaData(Long itemId, String label, String value);
59:
60: public Long facadeAdd() throws DataFacadeException;
61:
62: public void ifcShow(Long itemId);
63:
64: public ItemFacade saveItem(ItemFacade item)
65: throws DataFacadeException;
66:
67: /**
68: private void exportXml(ItemDataIfc item) {
69: XStream xstream = new XStream();
70: xstream = new XStream(new DomDriver());
71: xstream.alias("item", ItemData.class);
72: xstream.alias("itemText", ItemText.class);
73: xstream.alias("itemFeedback", ItemFeedback.class);
74: xstream.alias("itemMetaData", ItemMetaData.class);
75: xstream.alias("answer", Answer.class);
76: xstream.alias("answerFeedback", AnswerFeedback.class);
77: String xml = xstream.toXML(item);
78: byte[] b = xml.getBytes();
79: try {
80: FileOutputStream out = new FileOutputStream("out");
81: out.write(b);
82: }
83: catch (FileNotFoundException ex) {
84: }
85: catch (IOException ex1) {
86: }
87: }
88: */
89:
90: public ItemFacade getItem(Long itemId);
91:
92: public HashMap getItemsByKeyword(String keyword);
93:
94: public Long getItemTextId(Long publishedItemId);
95: }
|