01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/matrix/api/src/java/org/theospi/portfolio/matrix/model/EvaluationContentWrapperForMatrixCell.java $
03: * $Id: EvaluationContentWrapperForMatrixCell.java 18220 2006-11-17 21:57:46Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 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.theospi.portfolio.matrix.model;
21:
22: import java.util.Date;
23: import java.util.HashSet;
24: import java.util.Set;
25:
26: import org.sakaiproject.metaobj.shared.model.Agent;
27: import org.sakaiproject.metaobj.shared.model.Id;
28: import org.sakaiproject.user.api.UserNotDefinedException;
29: import org.sakaiproject.user.cover.UserDirectoryService;
30: import org.theospi.portfolio.shared.model.EvaluationContentWrapper;
31:
32: /**
33: * This class is created when looking up cells to evaluate. Hibernate calls the constructor.
34: * This is used in the listEvaluationItem
35: * @author andersjb
36: *
37: */
38: public class EvaluationContentWrapperForMatrixCell extends
39: EvaluationContentWrapper {
40:
41: public EvaluationContentWrapperForMatrixCell(Id id, String title,
42: Agent owner, Date submittedDate, String siteId)
43: throws UserNotDefinedException {
44:
45: Set params = new HashSet();
46:
47: setId(id);
48: setTitle(title);
49: setSubmittedDate(submittedDate);
50: setSiteTitle(super .fetchSiteName(siteId));
51:
52: if (owner != null) {
53: setOwner(UserDirectoryService.getUser(owner.getId()
54: .getValue()));
55: params.add(new ParamBean("view_user", owner.getId()
56: .getValue()));
57: setUrl("openEvaluationCellRedirect");
58: }
59:
60: setEvalType(Cell.TYPE);
61:
62: params.add(new ParamBean("page_id", getId().getValue()));
63: params.add(new ParamBean("readOnlyMatrix", "true"));
64:
65: setUrlParams(params);
66: }
67: }
|