0001: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
0002: * This code is licensed under the GPL 2.0 license, availible at the root
0003: * application directory.
0004: */
0005: package org.vfny.geoserver.form.data;
0006:
0007: import org.apache.struts.Globals;
0008: import org.apache.struts.action.ActionError;
0009: import org.apache.struts.action.ActionErrors;
0010: import org.apache.struts.action.ActionForm;
0011: import org.apache.struts.action.ActionMapping;
0012: import org.apache.struts.config.ControllerConfig;
0013: import org.apache.struts.upload.CommonsMultipartRequestHandler;
0014: import org.apache.struts.upload.MultipartRequestHandler;
0015: import org.apache.struts.util.MessageResources;
0016: import org.geotools.coverage.grid.io.AbstractGridFormat;
0017: import org.geotools.geometry.GeneralEnvelope;
0018: import org.geotools.referencing.CRS;
0019: import org.opengis.coverage.grid.Format;
0020: import org.opengis.parameter.ParameterValue;
0021: import org.opengis.parameter.ParameterValueGroup;
0022: import org.vfny.geoserver.action.HTMLEncoder;
0023: import org.vfny.geoserver.config.ConfigRequests;
0024: import org.vfny.geoserver.config.CoverageConfig;
0025: import org.vfny.geoserver.config.CoverageStoreConfig;
0026: import org.vfny.geoserver.config.DataConfig;
0027: import org.vfny.geoserver.config.StyleConfig;
0028: import org.vfny.geoserver.global.UserContainer;
0029: import org.vfny.geoserver.util.CoverageStoreUtils;
0030: import org.vfny.geoserver.util.CoverageUtils;
0031: import org.vfny.geoserver.util.Requests;
0032: import java.util.ArrayList;
0033: import java.util.HashMap;
0034: import java.util.Iterator;
0035: import java.util.List;
0036: import java.util.Locale;
0037: import java.util.Map;
0038: import java.util.SortedSet;
0039: import java.util.TreeSet;
0040: import javax.servlet.http.HttpServletRequest;
0041:
0042: /**
0043: * DOCUMENT ME!
0044: *
0045: * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last
0046: * modification)
0047: * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last
0048: * modification)
0049: */
0050: public final class CoveragesEditorForm extends ActionForm {
0051: /**
0052: *
0053: */
0054: private static final long serialVersionUID = 1831907046971087321L;
0055:
0056: /**
0057: *
0058: */
0059: private String formatId;
0060:
0061: /**
0062: * Identify Style used to render this feature type
0063: */
0064: private String styleId;
0065:
0066: /** Sorted Set of available styles */
0067: private SortedSet panelStyleIds;
0068: private SortedSet typeStyles;
0069: private String[] otherSelectedStyles;
0070:
0071: /**
0072: *
0073: */
0074: private String name;
0075:
0076: /**
0077: *
0078: */
0079: private String wmsPath;
0080:
0081: /**
0082: *
0083: */
0084: private String label;
0085:
0086: /**
0087: *
0088: */
0089: private String description;
0090:
0091: /**
0092: *
0093: */
0094: private String metadataLink;
0095: private String boundingBoxMinX;
0096: private String boundingBoxMinY;
0097: private String boundingBoxMaxX;
0098: private String boundingBoxMaxY;
0099:
0100: /**
0101: *
0102: */
0103: private String keywords;
0104:
0105: /**
0106: * Sorted Set of available styles
0107: */
0108: private SortedSet styles;
0109:
0110: /**
0111: *
0112: */
0113: private String srsName;
0114:
0115: /**
0116: *
0117: */
0118: private String nativeCRS;
0119:
0120: /**
0121: *
0122: */
0123: private String WKTString;
0124:
0125: /**
0126: *
0127: */
0128: private String requestCRSs;
0129:
0130: /**
0131: *
0132: */
0133: private String responseCRSs;
0134:
0135: /**
0136: *
0137: */
0138: private String nativeFormat;
0139:
0140: /**
0141: *
0142: */
0143: private String supportedFormats;
0144:
0145: /**
0146: *
0147: */
0148: private String defaultInterpolationMethod;
0149:
0150: /**
0151: *
0152: */
0153: private String interpolationMethods;
0154:
0155: /**
0156: * Action requested by user
0157: */
0158: private String action;
0159:
0160: /**
0161: *
0162: */
0163: private String newCoverage;
0164: private List paramHelp;
0165: private List paramKeys;
0166: private List paramValues;
0167:
0168: /**
0169: * Set up CoverageEditor from from Web Container.
0170: *
0171: * <p>
0172: * The key DataConfig.SELECTED_COVERAGE is used to look up the selected from
0173: * the web container.
0174: * </p>
0175: *
0176: * @param mapping
0177: * @param request
0178: */
0179: public void reset(ActionMapping mapping, HttpServletRequest request) {
0180: super .reset(mapping, request);
0181:
0182: // //
0183: //
0184: //
0185: //
0186: // //
0187: action = "";
0188: newCoverage = "";
0189:
0190: final DataConfig config = ConfigRequests.getDataConfig(request);
0191: final UserContainer user = Requests.getUserContainer(request);
0192: final CoverageConfig type = user.getCoverageConfig();
0193:
0194: if (type == null) {
0195: // TODO Not sure what to do, user must have bookmarked?
0196: return; // Action should redirect to Select screen?
0197: }
0198:
0199: this .formatId = type.getFormatId();
0200: this .styleId = type.getDefaultStyle();
0201:
0202: // //
0203: //
0204: //
0205: //
0206: // //
0207: final CoverageConfig cvConfig = (CoverageConfig) request
0208: .getSession()
0209: .getAttribute(DataConfig.SELECTED_COVERAGE);
0210: final GeneralEnvelope bounds = cvConfig.getEnvelope();
0211:
0212: if (bounds.isNull()) {
0213: boundingBoxMinX = "";
0214: } else {
0215: boundingBoxMinX = Double.toString(bounds.getLowerCorner()
0216: .getOrdinate(0));
0217: boundingBoxMinY = Double.toString(bounds.getLowerCorner()
0218: .getOrdinate(1));
0219: boundingBoxMaxX = Double.toString(bounds.getUpperCorner()
0220: .getOrdinate(0));
0221: boundingBoxMaxY = Double.toString(bounds.getUpperCorner()
0222: .getOrdinate(1));
0223: }
0224:
0225: // //
0226: //
0227: //
0228: //
0229: // //
0230: srsName = cvConfig.getSrsName();
0231: WKTString = cvConfig.getSrsWKT();
0232:
0233: // //
0234: //
0235: //
0236: //
0237: // //
0238: name = cvConfig.getName();
0239: wmsPath = cvConfig.getWmsPath();
0240: label = cvConfig.getLabel();
0241: description = cvConfig.getDescription();
0242: metadataLink = ((cvConfig.getMetadataLink() != null) ? cvConfig
0243: .getMetadataLink().getAbout() : null);
0244: nativeFormat = cvConfig.getNativeFormat();
0245: defaultInterpolationMethod = cvConfig
0246: .getDefaultInterpolationMethod();
0247:
0248: // //
0249: //
0250: //
0251: //
0252: // //
0253: StringBuffer buf = new StringBuffer();
0254:
0255: // Keywords
0256: if (cvConfig.getKeywords() != null) {
0257: String keyword;
0258:
0259: for (Iterator i = cvConfig.getKeywords().iterator(); i
0260: .hasNext();) {
0261: keyword = (String) i.next();
0262: buf.append(keyword);
0263:
0264: if (i.hasNext()) {
0265: buf.append(" ");
0266: }
0267: }
0268:
0269: this .keywords = buf.toString();
0270: }
0271:
0272: // //
0273: //
0274: //
0275: //
0276: // //
0277: if (cvConfig.getRequestCRSs() != null) {
0278: buf = new StringBuffer();
0279:
0280: // RequestCRSs
0281: String CRS;
0282:
0283: for (Iterator i = cvConfig.getRequestCRSs().iterator(); i
0284: .hasNext();) {
0285: CRS = (String) i.next();
0286: buf.append(CRS.toUpperCase());
0287:
0288: if (i.hasNext()) {
0289: buf.append(",");
0290: }
0291: }
0292:
0293: this .requestCRSs = buf.toString();
0294: }
0295:
0296: // //
0297: //
0298: //
0299: //
0300: // //
0301: if (cvConfig.getResponseCRSs() != null) {
0302: buf = new StringBuffer();
0303:
0304: // ResponseCRSs
0305: String CRS;
0306:
0307: for (Iterator i = cvConfig.getResponseCRSs().iterator(); i
0308: .hasNext();) {
0309: CRS = (String) i.next();
0310: buf.append(CRS.toUpperCase());
0311:
0312: if (i.hasNext()) {
0313: buf.append(",");
0314: }
0315: }
0316:
0317: this .responseCRSs = buf.toString();
0318: }
0319:
0320: // //
0321: //
0322: //
0323: //
0324: // //
0325: if (cvConfig.getSupportedFormats() != null) {
0326: buf = new StringBuffer();
0327:
0328: // SupportedFormats
0329: String format;
0330:
0331: for (Iterator i = cvConfig.getSupportedFormats().iterator(); i
0332: .hasNext();) {
0333: format = (String) i.next();
0334: buf.append(format.toUpperCase());
0335:
0336: if (i.hasNext()) {
0337: buf.append(",");
0338: }
0339: }
0340:
0341: this .supportedFormats = buf.toString();
0342: }
0343:
0344: // //
0345: //
0346: //
0347: //
0348: // //
0349: if (cvConfig.getInterpolationMethods() != null) {
0350: buf = new StringBuffer();
0351:
0352: // InterpolationMethods
0353: String intMethod;
0354:
0355: for (Iterator i = cvConfig.getInterpolationMethods()
0356: .iterator(); i.hasNext();) {
0357: intMethod = (String) i.next();
0358: buf.append(intMethod.toLowerCase());
0359:
0360: if (i.hasNext()) {
0361: buf.append(",");
0362: }
0363: }
0364:
0365: this .interpolationMethods = buf.toString();
0366: }
0367:
0368: // //
0369: //
0370: //
0371: //
0372: // //
0373: styles = new TreeSet();
0374:
0375: StyleConfig sc;
0376:
0377: for (Iterator i = config.getStyles().values().iterator(); i
0378: .hasNext();) {
0379: sc = (StyleConfig) i.next();
0380: styles.add(sc.getId());
0381:
0382: if (sc.isDefault()) {
0383: if ((styleId == null) || "".equals(styleId)) {
0384: styleId.equals(sc.getId());
0385: }
0386: }
0387: }
0388:
0389: typeStyles = new TreeSet();
0390:
0391: for (Iterator i = type.getStyles().iterator(); i.hasNext();) {
0392: String styleName = (String) i.next();
0393: typeStyles.add(styleName);
0394: }
0395:
0396: if (styles instanceof org.vfny.geoserver.form.data.AttributeDisplay) {
0397: // TODO why I am here?
0398: }
0399:
0400: /**
0401: * Sync params
0402: */
0403: Iterator it = type.getParameters().keySet().iterator();
0404: String paramKey;
0405: String paramValue;
0406: List paramHelp = new ArrayList();
0407: List paramKeys = new ArrayList();
0408: List paramValues = new ArrayList();
0409:
0410: while (it.hasNext()) {
0411: paramKey = (String) it.next();
0412: paramValue = (String) type.getParameters().get(paramKey);
0413: paramHelp.add(paramKey);
0414: paramKeys.add(paramKey);
0415: paramValues.add(paramValue);
0416: }
0417:
0418: this .paramHelp = paramHelp;
0419: this .paramKeys = paramKeys;
0420: this .paramValues = paramValues;
0421: }
0422:
0423: public ActionErrors validate(ActionMapping mapping,
0424: HttpServletRequest request) {
0425: ActionErrors errors = new ActionErrors();
0426:
0427: Locale locale = (Locale) request.getLocale();
0428: MessageResources messages = (MessageResources) request
0429: .getAttribute(Globals.MESSAGES_KEY);
0430: final String ENVELOPE = HTMLEncoder.decode(messages.getMessage(
0431: locale, "config.data.calculateBoundingBox.label"));
0432: final String LOOKUP_SRS = HTMLEncoder.decode(messages
0433: .getMessage(locale, "config.data.lookupSRS.label"));
0434:
0435: // Pass Attribute Management Actions through without
0436: // much validation.
0437: if (action.startsWith("Up") || action.startsWith("Down")
0438: || action.startsWith("Remove")
0439: || ENVELOPE.equals(action)) {
0440: return errors;
0441: }
0442:
0443: DataConfig data = ConfigRequests.getDataConfig(request);
0444:
0445: // Check selected style exists
0446: if (!(data.getStyles().containsKey(styleId) || ""
0447: .equals(styleId))) {
0448: errors.add("styleId", new ActionError(
0449: "error.styleId.notFound", styleId));
0450: }
0451:
0452: // //
0453: //
0454: //
0455: //
0456: // //
0457: if (!LOOKUP_SRS.equals(action)) {
0458: if (!srsName.toUpperCase().startsWith("EPSG:")) {
0459: srsName = "EPSG:" + srsName;
0460: }
0461: try {
0462: CRS.decode(srsName);
0463: } catch (Exception e) {
0464: errors.add("envelope", new ActionError(
0465: "config.data.coverage.srs", srsName));
0466: }
0467:
0468: }
0469:
0470: // //
0471: //
0472: //
0473: //
0474: // //
0475: if ("".equals(boundingBoxMinX) || "".equals(boundingBoxMinY)
0476: || "".equals(boundingBoxMaxX)
0477: || "".equals(boundingBoxMaxY)) {
0478: errors.add("envelope", new ActionError(
0479: "error.envelope.required"));
0480: } else {
0481: try {
0482: Double.parseDouble(boundingBoxMinX);
0483: Double.parseDouble(boundingBoxMinY);
0484: Double.parseDouble(boundingBoxMaxX);
0485: Double.parseDouble(boundingBoxMaxY);
0486: } catch (NumberFormatException badNumber) {
0487: errors.add("envelope", new ActionError(
0488: "error.envelope.invalid", badNumber));
0489: }
0490: }
0491:
0492: // //
0493: //
0494: //
0495: //
0496: // //
0497: if ("".equals(name)) {
0498: errors.add("name", new ActionError(
0499: "error.coverage.name.required"));
0500: } else if (name.indexOf(" ") > 0) {
0501: errors.add("name", new ActionError(
0502: "error.coverage.name.invalid"));
0503: }
0504:
0505: // //
0506: //
0507: //
0508: //
0509: // //
0510: final DataConfig dataConfig = getDataConfig(request);
0511: final CoverageStoreConfig cvConfig = dataConfig
0512: .getDataFormat(formatId);
0513:
0514: if (cvConfig == null) {
0515: // something is horribly wrong no FormatID selected!
0516: // The JSP needs to not include us if there is no
0517: // selected Format
0518: //
0519: throw new RuntimeException(
0520: "selectedDataFormatId required in Session");
0521: }
0522:
0523: // Retrieve connection params
0524: final Format factory = cvConfig.getFactory();
0525: final ParameterValueGroup info = factory.getReadParameters();
0526: final Map connectionParams = new HashMap();
0527:
0528: // Convert Params into the kind of Map we actually need
0529: //
0530: if (paramKeys != null) {
0531: Boolean maxSize;
0532: String size = null;
0533: ControllerConfig cc;
0534: Object value;
0535: String key;
0536: ParameterValue param;
0537: final int length = paramKeys.size();
0538: final String readGeometryKey = AbstractGridFormat.READ_GRIDGEOMETRY2D
0539: .getName().toString();
0540:
0541: for (int i = 0; i < length; i++) {
0542: key = (String) getParamKey(i);
0543:
0544: // //
0545: //
0546: // Ignore the parameters used for decimation at run time
0547: //
0548: // //
0549: if (key.equalsIgnoreCase(readGeometryKey)) {
0550: continue;
0551: }
0552:
0553: param = CoverageStoreUtils.find(info, key);
0554:
0555: if (param == null) {
0556: errors
0557: .add(
0558: "paramValue[" + i + "]",
0559: new ActionError(
0560: "error.dataFormatEditor.param.missing",
0561: key, factory
0562: .getDescription()));
0563:
0564: continue;
0565: }
0566:
0567: maxSize = (Boolean) request
0568: .getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
0569:
0570: if ((maxSize != null) && (maxSize.booleanValue())) {
0571: size = null;
0572: cc = mapping.getModuleConfig()
0573: .getControllerConfig();
0574:
0575: if (cc == null) {
0576: size = Long
0577: .toString(CommonsMultipartRequestHandler.DEFAULT_SIZE_MAX);
0578: } else {
0579: size = cc.getMaxFileSize(); // struts-config :
0580: // <controller
0581: // maxFileSize="nK" />
0582: }
0583:
0584: errors.add("styleID", new ActionError(
0585: "error.file.maxLengthExceeded", size));
0586:
0587: return errors;
0588: }
0589:
0590: value = CoverageUtils.getCvParamValue(key, param,
0591: paramValues, i);
0592:
0593: if (value != null) {
0594: connectionParams.put(key, value);
0595: }
0596: }
0597: }
0598:
0599: return errors;
0600: }
0601:
0602: /**
0603: * Access Catalog Configuration Model from the WebContainer.
0604: *
0605: * @param request
0606: *
0607: * @return Configuration model for Catalog information.
0608: */
0609: protected DataConfig getDataConfig(HttpServletRequest request) {
0610: return (DataConfig) request.getSession().getServletContext()
0611: .getAttribute(DataConfig.CONFIG_KEY);
0612: }
0613:
0614: /**
0615: * @return Returns the defaultInterpolationMethod.
0616: */
0617: public String getDefaultInterpolationMethod() {
0618: return defaultInterpolationMethod;
0619: }
0620:
0621: /**
0622: * @param defaultInterpolationMethod
0623: * The defaultInterpolationMethod to set.
0624: */
0625: public void setDefaultInterpolationMethod(
0626: String defaultInterpolationMethod) {
0627: this .defaultInterpolationMethod = defaultInterpolationMethod;
0628: }
0629:
0630: /**
0631: * @return Returns the description.
0632: */
0633: public String getDescription() {
0634: return description;
0635: }
0636:
0637: /**
0638: * @param description
0639: * The description to set.
0640: */
0641: public void setDescription(String description) {
0642: this .description = description;
0643: }
0644:
0645: /**
0646: * @return Returns the keywords.
0647: */
0648: public String getKeywords() {
0649: return keywords;
0650: }
0651:
0652: /**
0653: * @param keywords
0654: * The keywords to set.
0655: */
0656: public void setKeywords(String keywords) {
0657: this .keywords = keywords;
0658: }
0659:
0660: /**
0661: * @return Returns the label.
0662: */
0663: public String getLabel() {
0664: return label;
0665: }
0666:
0667: /**
0668: * @param label
0669: * The label to set.
0670: */
0671: public void setLabel(String label) {
0672: this .label = label;
0673: }
0674:
0675: /**
0676: * @return Returns the boundingBoxMaxX.
0677: */
0678: public String getMaxX() {
0679: return boundingBoxMaxX;
0680: }
0681:
0682: /**
0683: * @param boundingBoxMaxX
0684: * The boundingBoxMaxX to set.
0685: */
0686: public void setMaxX(String boundingBoxMaxX) {
0687: this .boundingBoxMaxX = boundingBoxMaxX;
0688: }
0689:
0690: /**
0691: * @return Returns the boundingBoxMaxY.
0692: */
0693: public String getMaxY() {
0694: return boundingBoxMaxY;
0695: }
0696:
0697: /**
0698: * @param boundingBoxMaxY
0699: * The boundingBoxMaxY to set.
0700: */
0701: public void setMaxY(String boundingBoxMaxY) {
0702: this .boundingBoxMaxY = boundingBoxMaxY;
0703: }
0704:
0705: /**
0706: * @return Returns the boundingBoxMinX.
0707: */
0708: public String getMinX() {
0709: return boundingBoxMinX;
0710: }
0711:
0712: /**
0713: * @param boundingBoxMinX
0714: * The boundingBoxMinX to set.
0715: */
0716: public void setMinX(String boundingBoxMinX) {
0717: this .boundingBoxMinX = boundingBoxMinX;
0718: }
0719:
0720: /**
0721: * @return Returns the boundingBoxMinY.
0722: */
0723: public String getMinY() {
0724: return boundingBoxMinY;
0725: }
0726:
0727: /**
0728: * @param boundingBoxMinY
0729: * The boundingBoxMinY to set.
0730: */
0731: public void setMinY(String boundingBoxMinY) {
0732: this .boundingBoxMinY = boundingBoxMinY;
0733: }
0734:
0735: /**
0736: * @return Returns the name.
0737: */
0738: public String getName() {
0739: return name;
0740: }
0741:
0742: /**
0743: * @param name
0744: * The name to set.
0745: */
0746: public void setName(String name) {
0747: this .name = name;
0748: }
0749:
0750: /**
0751: * @return Returns the nativeFormat.
0752: */
0753: public String getNativeFormat() {
0754: return nativeFormat;
0755: }
0756:
0757: /**
0758: * @param nativeFormat
0759: * The nativeFormat to set.
0760: */
0761: public void setNativeFormat(String nativeFormat) {
0762: this .nativeFormat = nativeFormat;
0763: }
0764:
0765: /**
0766: * @return Returns the srsName.
0767: */
0768: public String getSrsName() {
0769: return srsName;
0770: }
0771:
0772: /**
0773: * @param srsName
0774: * The srsName to set.
0775: */
0776: public void setSrsName(String srsName) {
0777: this .srsName = srsName;
0778: }
0779:
0780: /**
0781: * @return Returns the metadataLink.
0782: */
0783: public String getMetadataLink() {
0784: return metadataLink;
0785: }
0786:
0787: /**
0788: * @param metadataLink
0789: * The metadataLink to set.
0790: */
0791: public void setMetadataLink(String metadataLink) {
0792: this .metadataLink = metadataLink;
0793: }
0794:
0795: /**
0796: * @return Returns the interpolationMethods.
0797: */
0798: public String getInterpolationMethods() {
0799: return interpolationMethods;
0800: }
0801:
0802: /**
0803: * @param interpolationMethods
0804: * The interpolationMethods to set.
0805: */
0806: public void setInterpolationMethods(String interpolationMethods) {
0807: this .interpolationMethods = interpolationMethods;
0808: }
0809:
0810: /**
0811: * @return Returns the requestCRSs.
0812: */
0813: public String getRequestCRSs() {
0814: return requestCRSs;
0815: }
0816:
0817: /**
0818: * @param requestCRSs
0819: * The requestCRSs to set.
0820: */
0821: public void setRequestCRSs(String requestCRSs) {
0822: this .requestCRSs = requestCRSs;
0823: }
0824:
0825: /**
0826: * @return Returns the responseCRSs.
0827: */
0828: public String getResponseCRSs() {
0829: return responseCRSs;
0830: }
0831:
0832: /**
0833: * @param responseCRSs
0834: * The responseCRSs to set.
0835: */
0836: public void setResponseCRSs(String responseCRSs) {
0837: this .responseCRSs = responseCRSs;
0838: }
0839:
0840: /**
0841: * @return Returns the supportedFormats.
0842: */
0843: public String getSupportedFormats() {
0844: return supportedFormats;
0845: }
0846:
0847: /**
0848: * @param supportedFormats
0849: * The supportedFormats to set.
0850: */
0851: public void setSupportedFormats(String supportedFormats) {
0852: this .supportedFormats = supportedFormats;
0853: }
0854:
0855: /**
0856: * @return Returns the action.
0857: */
0858: public String getAction() {
0859: return action;
0860: }
0861:
0862: /**
0863: * @param action
0864: * The action to set.
0865: */
0866: public void setAction(String action) {
0867: this .action = action;
0868: }
0869:
0870: /**
0871: * @return Returns the formatId.
0872: */
0873: public String getFormatId() {
0874: return formatId;
0875: }
0876:
0877: /**
0878: * @param formatId
0879: * The formatId to set.
0880: */
0881: public void setFormatId(String formatId) {
0882: this .formatId = formatId;
0883: }
0884:
0885: /**
0886: * @return Returns the newCoverage.
0887: */
0888: public String getNewCoverage() {
0889: return newCoverage;
0890: }
0891:
0892: /**
0893: * @param newCoverage
0894: * The newCoverage to set.
0895: */
0896: public void setNewCoverage(String newCoverage) {
0897: this .newCoverage = newCoverage;
0898: }
0899:
0900: public SortedSet getStyles() {
0901: return styles;
0902: }
0903:
0904: public void setStyles(SortedSet styles) {
0905: this .styles = styles;
0906: }
0907:
0908: public String getStyleId() {
0909: return styleId;
0910: }
0911:
0912: public void setStyleId(String styleId) {
0913: this .styleId = styleId;
0914: }
0915:
0916: public String getWKTString() {
0917: return WKTString;
0918: }
0919:
0920: public void setWKTString(String string) {
0921: WKTString = string;
0922: }
0923:
0924: public String getWmsPath() {
0925: return wmsPath;
0926: }
0927:
0928: public void setWmsPath(String wmsPath) {
0929: this .wmsPath = wmsPath;
0930: }
0931:
0932: /**
0933: * @param paramHelp
0934: * The paramHelp to set.
0935: */
0936: public void setParamHelp(ArrayList paramHelp) {
0937: this .paramHelp = paramHelp;
0938: }
0939:
0940: /**
0941: * @return Returns the paramKeys.
0942: */
0943: public List getParamKeys() {
0944: return paramKeys;
0945: }
0946:
0947: /**
0948: * @param paramKeys
0949: * The paramKeys to set.
0950: */
0951: public void setParamKeys(List paramKeys) {
0952: this .paramKeys = paramKeys;
0953: }
0954:
0955: /**
0956: * @return Returns the paramValues.
0957: */
0958: public List getParamValues() {
0959: return paramValues;
0960: }
0961:
0962: /**
0963: * @param paramValues
0964: * The paramValues to set.
0965: */
0966: public void setParamValues(List paramValues) {
0967: this .paramValues = paramValues;
0968: }
0969:
0970: public Map getParams() {
0971: final Map map = new HashMap();
0972:
0973: if (paramKeys != null) {
0974: final int size = paramKeys.size();
0975:
0976: for (int i = 0; i < size; i++) {
0977: map.put(paramKeys.get(i), paramValues.get(i));
0978: }
0979: }
0980:
0981: return map;
0982: }
0983:
0984: /**
0985: * DOCUMENT ME!
0986: *
0987: * @param index
0988: * DOCUMENT ME!
0989: *
0990: * @return
0991: */
0992: public String getParamKey(int index) {
0993: return (String) paramKeys.get(index).toString();
0994: }
0995:
0996: /**
0997: * DOCUMENT ME!
0998: *
0999: * @param index
1000: * DOCUMENT ME!
1001: *
1002: * @return
1003: */
1004: public String getParamValue(int index) {
1005: return (String) paramValues.get(index).toString();
1006: }
1007:
1008: /**
1009: * @param paramKey
1010: * The paramHelp to set.
1011: */
1012:
1013: /*public void setParamKey(int index, String value) {
1014: this.paramKeys.set(index, value);
1015: }*/
1016:
1017: /**
1018: * @param paramValue
1019: * The paramHelp to set.
1020: */
1021: public void setParamValue(int index, String value) {
1022: this .paramValues.set(index, value);
1023: }
1024:
1025: /**
1026: * DOCUMENT ME!
1027: *
1028: * @param index
1029: * @param value
1030: * DOCUMENT ME!
1031: */
1032: public void setParamValues(int index, String value) {
1033: paramValues.set(index, value);
1034: }
1035:
1036: /**
1037: * Index property paramHelp
1038: *
1039: * @return DOCUMENT ME!
1040: */
1041: public String[] getParamHelp() {
1042: return (String[]) paramHelp
1043: .toArray(new String[paramHelp.size()]);
1044: }
1045:
1046: /**
1047: * Index property paramHelp
1048: *
1049: * @param index
1050: * DOCUMENT ME!
1051: *
1052: * @return DOCUMENT ME!
1053: */
1054: public String getParamHelp(int index) {
1055: return (String) paramHelp.get(index).toString();
1056: }
1057:
1058: public String[] getOtherSelectedStyles() {
1059: return otherSelectedStyles;
1060: }
1061:
1062: public void setOtherSelectedStyles(String[] otherSelectedStyles) {
1063: this .otherSelectedStyles = otherSelectedStyles;
1064: }
1065:
1066: public SortedSet getPanelStyleIds() {
1067: return panelStyleIds;
1068: }
1069:
1070: public SortedSet getTypeStyles() {
1071: return typeStyles;
1072: }
1073: }
|