01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/sam/tags/sakai_2-4-1/samigo-app/src/java/test/org/sakaiproject/tool/assessment/jsf/TestWSBean.java $
03: * $Id: TestWSBean.java 14180 2006-08-31 23:09:00Z ktsao@stanford.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005 The Regents of the University of Michigan, Trustees of Indiana University,
07: * Board of Trustees of the Leland Stanford, Jr., University, and The MIT Corporation
08: *
09: * Licensed under the Educational Community License Version 1.0 (the "License");
10: * By obtaining, using and/or copying this Original Work, you agree that you have read,
11: * understand, and will comply with the terms and conditions of the Educational Community License.
12: * You may obtain a copy of the License at:
13: *
14: * http://cvs.sakaiproject.org/licenses/license_1_0.html
15: *
16: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17: * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
18: * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21: *
22: **********************************************************************************/package test.org.sakaiproject.tool.assessment.jsf;
23:
24: import java.io.Serializable;
25:
26: import javax.faces.context.FacesContext;
27:
28: import org.apache.commons.logging.Log;
29: import org.apache.commons.logging.LogFactory;
30:
31: import org.sakaiproject.tool.assessment.facade.ItemFacade;
32: import org.sakaiproject.tool.assessment.services.ItemService;
33: import org.sakaiproject.tool.assessment.ui.bean.delivery.ItemContentsBean;
34: import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil;
35:
36: /**
37: * <p>Description: Test Bean with some properties</p>
38: */
39:
40: public class TestWSBean implements Serializable {
41: private static Log log = LogFactory.getLog(TestWSBean.class);
42: private String itemid;
43: private String itembankxml;
44:
45: public TestWSBean() {
46: itemid = "itemid";
47: }
48:
49: public String getItemid() {
50: ItemContentsBean itemContentsBean = (ItemContentsBean) ContextUtil
51: .lookupBean("itemContents");
52: String itemId = (String) FacesContext.getCurrentInstance()
53: .getExternalContext().getRequestParameterMap().get(
54: "itemid");
55: log.debug("Getting Item Id= " + itemId);
56: if (itemId != null && !itemId.equals("")) {
57: ItemService itemService = new ItemService();
58: ItemFacade item = itemService.getItem(itemId);
59: itemContentsBean.setItemData(item.getData());
60: }
61: return itemid;
62: }
63:
64: public void setItemid(String p) {
65: itemid = p;
66: }
67:
68: public void setItembankxml(String p) {
69: itembankxml = p;
70: }
71:
72: }
|