01: /*
02: * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.taskadmin.taglib.channel;
06:
07: import java.util.Set;
08:
09: import javax.servlet.http.HttpServletRequest;
10:
11: import javax.servlet.jsp.JspException;
12:
13: import com.sun.portal.taskadmin.TaskAdminException;
14:
15: import com.sun.portal.taskadmin.ChannelTaskAdmin;
16:
17: import com.sun.portal.taskadmin.taglib.BaseTaskAdminTagSupport;
18: import com.sun.portal.taskadmin.taglib.TaskAdminTaglibException;
19:
20: public class GetPropertyTypeTag extends BaseTaskAdminTagSupport {
21: private String m_channel_name = null;
22: private String m_property_name = null;
23:
24: public void setChannel(String channelName)
25: throws TaskAdminTaglibException {
26: m_channel_name = resolveParameter(channelName).toString();
27: }
28:
29: public void setProperty(String propertyName)
30: throws TaskAdminTaglibException {
31: m_property_name = propertyName;
32: }
33:
34: public int doStartTag() throws JspException {
35: ObtainChannelAdminTag parent = (ObtainChannelAdminTag) findAncestorWithClass(
36: this , ObtainChannelAdminTag.class);
37: if (parent == null) {
38: throw new TaskAdminTaglibException(
39: TaskAdminTaglibException.INVALID_TAG_SEQUENCE,
40: "GetPropertyTypeTag not inside obtainChannelAdminTag");
41: }
42: ChannelTaskAdmin channelTaskAdmin = parent
43: .getChannelTaskAdmin();
44: short propertyType = 0;
45: try {
46: propertyType = channelTaskAdmin.getPropertyType(
47: m_channel_name, m_property_name);
48: } catch (TaskAdminException tae) {
49: throw new TaskAdminTaglibException(tae,
50: "Cannot get the list of channel properties");
51: }
52: processResult(new Short(propertyType));
53: return SKIP_BODY;
54: }
55:
56: }
|