Package org.apache.slide.projector.descriptor

Examples of org.apache.slide.projector.descriptor.ParameterDescriptor


                parameterDescriptors[counter] = parentParameterDescriptors[i];
                counter++;
            }
        }
        parameterDescriptors[parentParameterDescriptors.length - 1] =
                new ParameterDescriptor(ACTION, new ParameterMessage("trigger/action"), new URIValueDescriptor());
        parameterDescriptors[parentParameterDescriptors.length ] =
            new ParameterDescriptor(Process.STEP, new ParameterMessage("trigger/step"), new StringValueDescriptor());
        parameterDescriptors[parentParameterDescriptors.length + 1] =
            new ParameterDescriptor(VALIDATE, new ParameterMessage("trigger/validate"), new BooleanValueDescriptor(), BooleanValue.TRUE);
        parameterDescriptors[parentParameterDescriptors.length + 2] =
            new ParameterDescriptor(INVOLVED_PARAMETERS, new ParameterMessage("trigger/involvedParameters"), new ArrayValueDescriptor(new StringValueDescriptor()));
        parameterDescriptors[parentParameterDescriptors.length + 3] =
            new ParameterDescriptor(WIZARD, new ParameterMessage("trigger/wizard"), new BooleanValueDescriptor(), BooleanValue.FALSE);
    }
View Full Code Here


    }

    public void configure(StreamableValue config) throws ConfigurationException {
        super.configure(config);
        parameterDescriptors = new ParameterDescriptor[] {
            new ParameterDescriptor(ACTION, new ParameterMessage("formGenerator/action"), new URIValueDescriptor()),
            new ParameterDescriptor(LOCALE, new ParameterMessage("formGenerator/locale"), new LocaleValueDescriptor(), new LocaleValue(Locale.getDefault())),
            new ParameterDescriptor(TARGET_STEP, new ParameterMessage("formGenerator/targetStep"), new StringValueDescriptor())
        };
        try {
            defaultTemplate = getRequiredFragment(DEFAULT_FORM);
        } catch ( ProcessException exception ) {
            throw new ConfigurationException(new ErrorMessage("form/defaultFragmentMissing"));
View Full Code Here

                parameterDescriptors[counter] = parentParameterDescriptors[i];
                counter++;
            }
        }
        parameterDescriptors[parentParameterDescriptors.length - 3] =
                new ParameterDescriptor(CONTROL, new ParameterMessage("controlContainer/control"), new StringValueDescriptor());
    }
View Full Code Here

        super.configure(config);
        ParameterDescriptor[] parentParameterDescriptors = super.getParameterDescriptors();
        parameterDescriptors = new ParameterDescriptor[parentParameterDescriptors.length + 5];
        System.arraycopy(parentParameterDescriptors, 0, parameterDescriptors, 0, parentParameterDescriptors.length);
        parameterDescriptors[parentParameterDescriptors.length] =
          new ParameterDescriptor(CONTROL_DESCRIPTIONS, new ParameterMessage("controlComposer/controlDescriptions"), new ArrayValueDescriptor(
              new MapValueDescriptor(new ParameterDescriptor[] {
                  new ParameterDescriptor(Control.ACTION, new ParameterMessage("controlComposer/controlDescriptions/action"), new URIValueDescriptor(), NullValue.NULL),
                  new ParameterDescriptor(CONTROL, new ParameterMessage("controlComposer/controlDescriptions/control"), new URIValueDescriptor()),
                  new ParameterDescriptor(CONTROL_CONTAINER, new ParameterMessage("controlComposer/controlDescriptions/controlContainer"), new URIValueDescriptor(), NullValue.NULL),
              })));
        parameterDescriptors[parentParameterDescriptors.length+1] =
          new ParameterDescriptor(TRIGGER_DESCRIPTIONS, new ParameterMessage("controlComposer/triggerDescriptions"), new ArrayValueDescriptor(
              new MapValueDescriptor(new ParameterDescriptor[] {
                  new ParameterDescriptor(Trigger.ACTION, new ParameterMessage("controlComposer/triggerDescriptions/action"), new URIValueDescriptor(), NullValue.NULL),
                  new ParameterDescriptor(Trigger.VALIDATE, new ParameterMessage("controlComposer/triggerDescriptions/validate"), new BooleanValueDescriptor(), BooleanValue.TRUE),
              new ParameterDescriptor(Trigger.INVOLVED_PARAMETERS, new ParameterMessage("trigger/involvedParameters"), new ArrayValueDescriptor(new StringValueDescriptor()), NullValue.NULL),
                  new ParameterDescriptor(Process.STEP, new ParameterMessage("controlComposer/triggerDescriptions/step"), new StringValueDescriptor()),
                  new ParameterDescriptor(TRIGGER, new ParameterMessage("controlComposer/triggerDescriptions/trigger"), new URIValueDescriptor()),
                  new ParameterDescriptor(TRIGGER_CONTAINER, new ParameterMessage("controlComposer/triggerDescriptions/triggerContainer"), new URIValueDescriptor(), NullValue.NULL)
              })));
        parameterDescriptors[parentParameterDescriptors.length+2] =
          new ParameterDescriptor(LOCALE, new ParameterMessage("controlComposer/locale"), new LocaleValueDescriptor());
        parameterDescriptors[parentParameterDescriptors.length+3] =
          new ParameterDescriptor(ACTION, new ParameterMessage("controlComposer/action"), new URIValueDescriptor());
        parameterDescriptors[parentParameterDescriptors.length+4] =
          new ParameterDescriptor(ERRORS_PROCESSOR, new ParameterMessage("controlComposer/errorsProcessor"), new URIValueDescriptor(), NullValue.NULL);

        try {
            defaultTemplate = getRequiredFragment(DEFAULT_FORM);
        } catch ( ProcessException exception ) {
            throw new ConfigurationException(new ErrorMessage("form/defaultFragmentMissing"));
View Full Code Here

            ProcessorManager.prepareValues(control.getParameterDescriptors(), controlParameters, context);
          } catch ( ValidationException exception ) {
            throw new ValidationException(new ErrorMessage("controlComposer/controlParameterInvalid", new Object[] { controlUri }), exception);
          }
            Value controlContainerUri = (Value)controlParameters.get(CONTROL_CONTAINER);
            ParameterDescriptor parameterDescriptor = Control.getParameterDescriptor(controlParameters, context);
            String parameterName = parameterDescriptor.getName();
            involvedParameters.add(new StringValue(parameterName));
            ParameterMessage description = (ParameterMessage)parameterDescriptor.getDescription();
            boolean required = parameterDescriptor.isRequired();
            String controlState = Control.OPTIONAL_CONTROL;
            if ( required ) {
              controlState = Control.REQUIRED_CONTROL;
            }
            Object controlValue = null;
View Full Code Here

        ParameterDescriptor[] parentParameterDescriptors = super.getParameterDescriptors();
        int counter = 0;
        List parameterList = new ArrayList();
        for (int i = 0; i < parentParameterDescriptors.length; i++) {
            if (parentParameterDescriptors[i].getName().startsWith(CONTROL_IDENTIFIER)) {
                parameterList.add(new ParameterDescriptor(parentParameterDescriptors[i].getName(),
                        new ParameterMessage("form/control"),
                        new MapValueDescriptor(new ParameterDescriptor[] {
                            new ParameterDescriptor(CONTROL, new ParameterMessage("form/control"), new URIValueDescriptor()),
                            new ParameterDescriptor(CONTROL_CONTAINER, new ParameterMessage("form/controlContainer")new URIValueDescriptor(), NullValue.NULL),
                            new ParameterDescriptor(Control.ACTION, new ParameterMessage("control/action"), new URIValueDescriptor(), NullValue.NULL),
                            new ParameterDescriptor(Control.PARAMETER, new ParameterMessage("control/parameter"), new StringValueDescriptor())
                        })));
            } else if (parentParameterDescriptors[i].getName().startsWith(TRIGGER_IDENTIFIER)) {
                    parameterList.add(new ParameterDescriptor(parentParameterDescriptors[i].getName(),
                            new ParameterMessage("form/trigger"),
                            new MapValueDescriptor(new ParameterDescriptor[] {
                                new ParameterDescriptor(TRIGGER, new ParameterMessage("form/trigger"), new URIValueDescriptor()),
                                new ParameterDescriptor(TRIGGER_CONTAINER, new ParameterMessage("form/triggerContainer")new URIValueDescriptor(), NullValue.NULL),
                                new ParameterDescriptor(Trigger.ACTION, new ParameterMessage("trigger/action"), new URIValueDescriptor(), NullValue.NULL),
                    new ParameterDescriptor(Trigger.VALIDATE, new ParameterMessage("trigger/validate"), new BooleanValueDescriptor(), BooleanValue.TRUE),
                                new ParameterDescriptor(Process.STEP, new ParameterMessage("trigger/step")new AnyValueDescriptor(), NullValue.NULL)
                            })));
            } else if (!parentParameterDescriptors[i].getName().equals(FRAGMENT)
                && !parentParameterDescriptors[i].getName().equals(CONTROL_DESCRIPTIONS)
                && !parentParameterDescriptors[i].getName().equals(TRIGGER_DESCRIPTIONS)
          && !parentParameterDescriptors[i].getName().equals(RENDERED_ERRORS)
          && !parentParameterDescriptors[i].getName().equals(HANDLER)
          && !parentParameterDescriptors[i].getName().equals(METHOD)) {
                parameterList.add(parentParameterDescriptors[i]);
            }
        }
        parameterList.add(new ParameterDescriptor(HANDLER, new ParameterMessage("form/handler"), new URIValueDescriptor(), Constants.DEFAULT_FORM_HANDLER));
        parameterList.add(new ParameterDescriptor(METHOD, new ParameterMessage("form/method"), new StringValueDescriptor(methods), new StringValue(POST)));
        parameterList.add(new ParameterDescriptor(LOCALE, new ParameterMessage("form/locale"), new LocaleValueDescriptor()));
        parameterList.add(new ParameterDescriptor(ACTION, new ParameterMessage("form/action"), new URIValueDescriptor()));
        parameterDescriptors = (ParameterDescriptor[])parameterList.toArray(new ParameterDescriptor[parameterList.size()]);
    }
View Full Code Here

      List parameterDescriptors = new ArrayList();
      for ( Iterator i = inputParamters.iterator(); i.hasNext(); ) {
        Element inputParameter = (Element)i.next();
        String name = inputParameter.getAttributeValue("name");
        String description = inputParameter.getAttributeValue("description");
        ParameterDescriptor parameterDescriptor;
        if ( description != null ) {
          parameterDescriptor = new ParameterDescriptor(name, new ParameterMessage(description), null);
        } else {
          parameterDescriptor = new ParameterDescriptor(name, new ParameterMessage(ParameterMessage.NO_MESSAGE_AVAILABLE, new String[] {name}), null);
        }
        parameterDescriptors.add(parameterDescriptor);
        Element valueDescriptorElement = (Element)inputParameter.getChildren().iterator().next();
        ValueDescriptor valueDescriptor = ValueFactoryManager.getInstance().loadValueDescriptor(valueDescriptorElement);
        parameterDescriptor.setValueDescriptor(valueDescriptor);
      }
      this.parameterDescriptors = (ParameterDescriptor [])parameterDescriptors.toArray(new ParameterDescriptor[parameterDescriptors.size()]);
      List outputResults = XPath.newInstance("/process/description/output/result").selectNodes(rootElement);
      List resultEntryDescriptors = new ArrayList();
      for ( Iterator i = outputResults.iterator(); i.hasNext(); ) {
View Full Code Here

    public void configure(StreamableValue config) throws ConfigurationException {
        super.configure(config);
        List validMapEntries = new ArrayList();
        for ( Iterator i = parameterDescriptions.iterator(); i.hasNext(); ) {
            ParameterDescriptor parentParameter = (ParameterDescriptor)i.next();
            if ( !parentParameter.getName().equals(FRAGMENT) ) {
                validMapEntries.add(parentParameter);
            }
        }
        parameterDescriptors = new ParameterDescriptor[] {
            new ParameterDescriptor(ID, new ParameterMessage("treeRenderer/id"), new TreeValueDescriptor(new StringValueDescriptor())),
            new ParameterDescriptor(SimpleProcessor.INPUT, new ParameterMessage("treeRenderer/input"), new TreeValueDescriptor(new MapValueDescriptor(validMapEntries)))
        };
    }
View Full Code Here

        List parameterDescriptorList = new ArrayList();
        for ( int i = 0; i < parentParameterDescriptors.length; i++ ) {
            parameterDescriptorList.add(parentParameterDescriptors[i]);
        }
        List headerParameterDescriptors = getTemplateParameterDescriptor(new String[] { HEADER_COLUMN_FRAGMENT, COLLAPSED_HEADER_COLUMN_FRAGMENT });
        headerParameterDescriptors.add(new ParameterDescriptor(HEADER, new ParameterMessage("tableGenerator/parameter/columns/header"), new StringValueDescriptor(), StringValue.EMPTY));
        headerParameterDescriptors.add(new ParameterDescriptor(VALUE, new ParameterMessage("tableGenerator/parameter/columns/value"), new AnyValueDescriptor(), NullValue.NULL));
        headerParameterDescriptors.add(new ParameterDescriptor(KEY, new ParameterMessage("tableGenerator/parameter/columns/key"), new StringValueDescriptor()));
        headerParameterDescriptors.add(new ParameterDescriptor(NAME, new ParameterMessage("tableGenerator/parameter/columns/name"), new StringValueDescriptor(), new StringValue(VALUE)));
        headerParameterDescriptors.add(new ParameterDescriptor(REPLACE_COLUMN, new ParameterMessage("tableGenerator/parameter/columns/replaceColumn"), new BooleanValueDescriptor(), BooleanValue.FALSE));
        headerParameterDescriptors.add(new ParameterDescriptor(RESIZABLE, new ParameterMessage("tableGenerator/parameter/columns/resizable"), new BooleanValueDescriptor(), BooleanValue.FALSE));
        headerParameterDescriptors.add(new ParameterDescriptor(SORTABLE, new ParameterMessage("tableGenerator/parameter/columns/sortable"), new BooleanValueDescriptor(), BooleanValue.FALSE));
        headerParameterDescriptors.add(new ParameterDescriptor(PROCESSOR, new ParameterMessage("tableGenerator/parameter/columns/processor"), new URIValueDescriptor(), NullValue.NULL));
        headerParameterDescriptors.add(new ParameterDescriptor(PARAMETERS, new ParameterMessage("tableGenerator/parameter/columns/parameters"), MapValueDescriptor.ANY, NullValue.NULL));
        headerParameterDescriptors.add(new ParameterDescriptor(RESULT, new ParameterMessage("tableGenerator/parameter/columns/result"), new StringValueDescriptor(), NullValue.NULL));
        parameterDescriptorList.add(new ParameterDescriptor(COLUMNS_PARAMETER, new ParameterMessage("tableGenerator/parameter/columns"),
            new ArrayValueDescriptor(new MapValueDescriptor((ParameterDescriptor [])headerParameterDescriptors.toArray(new ParameterDescriptor[headerParameterDescriptors.size()])))));
        parameterDescriptorList.add(new ParameterDescriptor(PARAMETER, new ParameterMessage("tableGenerator/parameter/parameter"), MapValueDescriptor.ANY, new MapValue(new HashMap())));
        parameterDescriptors = (ParameterDescriptor[] )parameterDescriptorList.toArray(new ParameterDescriptor[parameterDescriptorList.size()]);
        collapsedColumnTemplate = getOptionalFragment(COLLAPSED_COLUMN_FRAGMENT);
        collapsedHeaderColumnTemplate = getOptionalFragment(COLLAPSED_HEADER_COLUMN_FRAGMENT);
        ascendingHeaderColumnTemplate = getOptionalFragment(ASCENDING_HEADER_COLUMN_FRAGMENT);
        descendingHeaderColumnTemplate = getOptionalFragment(DESCENDING_HEADER_COLUMN_FRAGMENT);
View Full Code Here

        }
        return output;
    }

    public ParameterDescriptor getParameterDescriptor() {
        return new ParameterDescriptor(INPUT, new ParameterMessage("url/parameter/input"), new StringValueDescriptor());
    }
View Full Code Here

TOP

Related Classes of org.apache.slide.projector.descriptor.ParameterDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.