01: /**********************************************************************************
02: * $URL:https://source.sakaiproject.org/svn/osp/trunk/common/tool-lib/src/java/org/theospi/portfolio/shared/control/tag/DateSelectPopupTag.java $
03: * $Id:DateSelectPopupTag.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 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.theospi.portfolio.shared.control.tag;
21:
22: import java.io.IOException;
23:
24: import javax.servlet.jsp.JspException;
25: import javax.servlet.jsp.tagext.BodyTagSupport;
26:
27: import org.apache.commons.logging.Log;
28: import org.apache.commons.logging.LogFactory;
29: import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;
30: import org.sakaiproject.component.cover.ComponentManager;
31: import org.sakaiproject.metaobj.shared.mgt.PortalParamManager;
32:
33: public class DateSelectPopupTag extends BodyTagSupport {
34: protected final transient Log logger = LogFactory
35: .getLog(getClass());
36:
37: private String yearSelectId;
38: private String daySelectId;
39: private String monthSelectId;
40:
41: public int doStartTag() throws JspException {
42: try {
43:
44: pageContext
45: .getOut()
46: .write(
47: "<script type=\"text/javascript\" src=\"/library/calendar/sakai-calendar.js\"></script>\n"
48: + "<script type=\"text/javascript\" src=\"/osp-common-tool/js/eport.js\"></script>\n"
49: + "<script type=\"text/javascript\">osp_dateselectionwidgetpopup('"
50: + getYearSelectId()
51: + "', '"
52: + getMonthSelectId()
53: + "', '"
54: + getDaySelectId()
55: + "');</script>\n");
56: } catch (IOException e) {
57: logger.error("", e);
58: throw new JspException(e);
59: }
60:
61: return EVAL_BODY_INCLUDE;
62: }
63:
64: protected PortalParamManager getPortalParamManager() {
65: return (PortalParamManager) ComponentManager.getInstance().get(
66: PortalParamManager.class.getName());
67: }
68:
69: public String getYearSelectId() {
70: return yearSelectId;
71: }
72:
73: public void setYearSelectId(String yearSelectId) {
74: this .yearSelectId = yearSelectId;
75: }
76:
77: public String getDaySelectId() {
78: return daySelectId;
79: }
80:
81: public void setDaySelectId(String daySelectId) {
82: this .daySelectId = daySelectId;
83: }
84:
85: public String getMonthSelectId() {
86: return monthSelectId;
87: }
88:
89: public void setMonthSelectId(String monthSelectId) {
90: this.monthSelectId = monthSelectId;
91: }
92: }
|