01: // Copyright %G% Sun Microsystems, Inc. All Rights Reserved.
02: // "%W% %E% Sun Microsystems"
03:
04: package com.sun.portal.wireless.taglibs.cal.socs;
05:
06: import java.util.*;
07: import javax.servlet.jsp.*;
08: import javax.servlet.jsp.tagext.*;
09:
10: import com.sun.portal.wireless.taglibs.base.CollectionTag;
11: import com.sun.portal.wireless.taglibs.cal.*;
12:
13: /**
14: * CalIdsTag - tag that represents the collection of CalIds
15: *
16: */
17:
18: public class CalIdsTag extends CollectionTag {
19: /**
20: * the default constructor
21: */
22: public CalIdsTag() {
23: super ();
24: }
25:
26: /**
27: * Return the current calId list as a collection
28: * @return the calId list
29: */
30: public Collection findCollection() throws Exception {
31: SOCSContext cal = (SOCSContext) CalContext
32: .getContext(pageContext);
33: String[] calIds = cal.getCalIds();
34: CalIdBean[] calIdArr = new CalIdBean[calIds.length];
35: for (int i = 0; i < calIds.length; i++) {
36: calIdArr[i] = new CalIdBean(calIds[i]);
37: }
38: return (calIdArr != null) ? Arrays.asList(calIdArr) : null;
39: }
40: }
|