001: /**********************************************************************************
002: * $URL$
003: * $Id$
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 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.api.assessment;
021:
022: import java.util.Map;
023:
024: import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc;
025:
026: /**
027: * The ItemServiceAPI declares a shared interface to get/set item
028: * information.
029: */
030: public interface ItemServiceAPI {
031: /**
032: * Get a particular item from the backend, with all questions.
033: *
034: * @param itemId
035: * @param agentId
036: * @return
037: */
038: public ItemDataIfc getItem(Long itemId, String agentId);
039:
040: /**
041: * Delete a item
042: *
043: * @param itemId
044: * @param agentId
045: */
046: public void deleteItem(Long itemId, String agentId);
047:
048: /**
049: * Delete itemtextset for an item, used for modify
050: *
051: * @param itemId
052: * @param agentId
053: */
054: public void deleteItemContent(Long itemId, String agentId);
055:
056: /**
057: * Delete metadata for an item, used for modify
058: * param: itemid, label, agentId
059: *
060: * @param itemId
061: * @param label
062: * @param agentId
063: */
064: public void deleteItemMetaData(Long itemId, String label,
065: String agentId);
066:
067: /**
068: * Add metadata for an item, used for modify
069: * param: itemid, label, value, agentId
070: *
071: * @param itemId
072: * @param label
073: * @param value
074: * @param agentId
075: */
076: public void addItemMetaData(Long itemId, String label,
077: String value, String agentId);
078:
079: /**
080: * Save item.
081: * @param item interface
082: * @return item interface
083: */
084: public ItemDataIfc saveItem(ItemDataIfc item);
085:
086: /**
087: * Get item.
088: * @param itemId
089: * @return item interface
090: */
091: public ItemDataIfc getItem(String itemId);
092:
093: /**
094: * Search for items.
095: * @param keyword
096: * @return Map of ItemDataIfcs with item idstrings as keys
097: */
098: public Map getItemsByKeyword(String keyword);
099:
100: }
|