Examples of RequestParameter


Examples of org.dbwiki.web.request.parameter.RequestParameter

   * @param key
   * @return
   * @throws org.dbwiki.exception.WikiException
   */
  protected DatabaseWiki getRequestWiki(HttpRequest request, String key) throws org.dbwiki.exception.WikiException {
    RequestParameter parameter = request.parameters().get(key);
    if (parameter.hasValue()) {
      try {
        int wikiID = Integer.parseInt(parameter.value());
        for (int iWiki = 0; iWiki < this.size(); iWiki++) {
          if (this.get(iWiki).id() == wikiID) {
            return this.get(iWiki);
          }
        }
      } catch (NumberFormatException exception) {
        for (int iWiki = 0; iWiki < this.size(); iWiki++) {
          if (this.get(iWiki).name().equalsIgnoreCase(parameter.value())) {
            return this.get(iWiki);
          }
        }
      }
    }
View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

   * Public Methods
   */
 
  public void print(HtmlLinePrinter body) throws org.dbwiki.exception.WikiException {
    if (_request.parameters().hasParameter(RequestParameter.ParameterCreate)) {
      RequestParameter parameter = _request.parameters().get(RequestParameter.ParameterCreate);
      SchemaNode schema = null;
      if (parameter.hasValue()) {
        try {
          schema = _request.wiki().database().schema().get(Integer.parseInt(parameter.value()));
        } catch (NumberFormatException excpt) {
          throw new WikiRequestException(WikiRequestException.InvalidParameterValue, parameter.toString());
        }
      } else {
        schema = _request.wiki().database().schema().root();
      }
      body.paragraph(_layouter.get(schema).getName(), CSS.CSSHeadline);
View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

      }
    }
   
    body.add("</ul>");
   
    RequestParameter parameterVersion = request.parameters().get(RequestParameter.ParameterVersion);
   
    if (outputCount > 0) {
      String navigationLine = "";
      if (startIndex > 1) {
        navigationLine = "<a CLASS=\"" + CSS.CSSIndexNavbar + "\" HREF=\"" + databaseIdentifier.databaseHomepage() + "?" + RequestParameter.ParameterIndexPosition + "=" + Math.max(1, (startIndex - _entriesPerPage));
        if (parameterVersion != null) {
          navigationLine = navigationLine + "&" + parameterVersion.toURLString();
        }
        navigationLine = navigationLine + "\">&lt;&lt; prev&nbsp;&nbsp;&nbsp;</a>";
      }
      navigationLine = navigationLine + "[" + startIndex + "-" + (startIndex + outputCount - 1) + "]";
      if (iterator.next() != null) {
        navigationLine = navigationLine + "<a CLASS=\"" + CSS.CSSIndexNavbar + "\" HREF=\"" + databaseIdentifier.databaseHomepage() + "?" + RequestParameter.ParameterIndexPosition + "=" + (startIndex + outputCount);
        if (parameterVersion != null) {
          navigationLine = navigationLine + "&" + parameterVersion.toURLString();
        }
        navigationLine = navigationLine + "\">&nbsp;&nbsp;&nbsp;next &gt;&gt;</a>";
      }
      body.add("<p CLASS=\"" + CSS.CSSIndexNavbar + "\">" + navigationLine + "</p>");
    }
View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

  }
  @Override
  public void print(HtmlLinePrinter printer) throws WikiException {
    String searchParameters = "";
    if (_parameters.hasParameter(RequestParameter.ParameterSearch)) {
      RequestParameter searchParameter = _parameters.get(RequestParameter.ParameterSearch);
      if (searchParameter.hasValue()) {
        searchParameters = searchParameters + searchParameter.value();
      }
    }
   
    printer.openFORM("frmSearch", "GET", _dbIdentifier.databaseHomepage());
    printer.addTEXTBOX("search", searchParameters, CSS.CSSSearch);
View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

  protected DocumentNode getInsertNode(WikiDataRequest  request) throws org.dbwiki.exception.WikiException {
    SchemaNode schemaNode = database().schema().get(Integer.parseInt(request.parameters().get(RequestParameter.ActionValueSchemaNode).value()));
    if (schemaNode.isAttribute()) {
      AttributeSchemaNode attributeSchemaNode = (AttributeSchemaNode)schemaNode;
      DocumentAttributeNode attribute = new DocumentAttributeNode(attributeSchemaNode);
      RequestParameter parameter = request.parameters().get(RequestParameter.TextFieldIndicator + attributeSchemaNode.id());
      if (parameter.hasValue()) {
        if (!parameter.value().equals("")) {
          attribute.setValue(parameter.value());
        }
      }
      return attribute;
    } else {
      Hashtable<Integer, DocumentGroupNode> groupIndex = new Hashtable<Integer, DocumentGroupNode>();
      DocumentGroupNode root = SchemaNode.createGroupNode((GroupSchemaNode)schemaNode, groupIndex);
      for (int iParameter = 0; iParameter < request.parameters().size(); iParameter++) {
        RequestParameter parameter = request.parameters().get(iParameter);
        if ((parameter.name().startsWith(RequestParameter.TextFieldIndicator)) && (parameter.hasValue())) {
          if (!parameter.value().equals("")) {
            SchemaNode child = database().schema().get(Integer.parseInt(parameter.name().substring(RequestParameter.TextFieldIndicator.length())));
            if (child.isAttribute()) {
              DocumentAttributeNode attribute = new DocumentAttributeNode((AttributeSchemaNode)child);
              attribute.setValue(parameter.value());
              groupIndex.get(new Integer(attribute.schema().parent().id())).children().add(attribute);
            }
          }
        }
      }
View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

   */
  protected Update getNodeUpdates(WikiDataRequest  request) throws org.dbwiki.exception.WikiException {
    Update updates = new Update();
   
    for (int iParameter = 0; iParameter < request.parameters().size(); iParameter++) {
      RequestParameter parameter = request.parameters().get(iParameter);
      if (parameter.name().startsWith(RequestParameter.TextFieldIndicator)) {
        if (parameter.hasValue()) {
          if (!parameter.value().equals("")) {
            updates.add(new NodeUpdate(database().getIdentifierForParameterString(parameter.name().substring(RequestParameter.TextFieldIndicator.length())), parameter.value()));
          }
        }
      }
    }

View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

    if (request.type().isAction()) {
      RequestParameterAction action = RequestParameter
          .actionParameter(request.parameters().get(
              RequestParameter.ParameterAction));
      if (action.actionAnnotate()) {
        RequestParameter parameter = request.parameters().get(
            RequestParameter.ActionValueAnnotation);
        if (parameter.hasValue()) {
          if (!parameter.value().trim().equals("")) {
            database().annotate(
                request.wri().resourceIdentifier(),
                new Annotation(parameter.value(),
                    new SimpleDateFormat(
                        "d MMM yyyy HH:mm:ss")
                        .format(new Date()), request
                        .user()));
          }
View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

    String value = null;
   
    if (fileType == WikiServerConstants.RelConfigFileColFileTypeValLayout) {
      Properties properties = new Properties();
      for (int iParameter = 0; iParameter < request.parameters().size(); iParameter++) {
        RequestParameter parameter = request.parameters().get(iParameter);
        if (DatabaseLayouter.isLayoutParameter(parameter.name())) {
          if (parameter.hasValue()) {
            properties.setProperty(parameter.name(), parameter.value());
          } else {
            properties.setProperty(parameter.name(), "(null)");
          }
        }
      }
      StringWriter writer = new StringWriter();
      try {
View Full Code Here

Examples of org.dbwiki.web.request.parameter.RequestParameter

    DatabaseIdentifier wikiIdentifier = new DatabaseIdentifier(wiki.identifier().databaseHomepage() + "/" + RequestURL.WikiPageRequestPrefix);
    if (url.size() == 0) {
      _wri = new WRI(wikiIdentifier, new PageIdentifier());
    } else if (url.size() == 1) {
      long timestamp = -1;
      RequestParameter timestampParameter =
        url.parameters().get(RequestParameter.ParameterVersion);
      if(timestampParameter != null) {
        timestamp = Long.parseLong(timestampParameter.value());
      }
      _wri = new WRI(wikiIdentifier, new PageIdentifier(url.get(0).encodedText(), timestamp));
    } else {
      throw new WikiNodeException(WikiNodeException.InvalidIdentifierFormat, url.toString());
    }
View Full Code Here

Examples of org.jboss.seam.annotations.RequestParameter

                  init.addObserverMethod( eventType, method, this, observer.create() );
               }
            }
            if ( method.isAnnotationPresent(RequestParameter.class) )
            {
               RequestParameter rp = method.getAnnotation(RequestParameter.class);
               String name = toName( rp.value(), method );
               parameterSetters.add( new BijectedMethod(name, method, rp) );
            }
            if ( method.isAnnotationPresent(PRE_PASSIVATE) )
            {
               prePassivateMethod = method;
               lifecycleMethods.add(method);
            }
            if ( method.isAnnotationPresent(POST_ACTIVATE) )
            {
               postActivateMethod = method;
               lifecycleMethods.add(method);
            }
            if ( method.isAnnotationPresent(POST_CONSTRUCT) )
            {
               postConstructMethod = method;
               lifecycleMethods.add(method);
            }
            if ( method.isAnnotationPresent(PRE_DESTROY) )
            {
               preDestroyMethod = method;
               lifecycleMethods.add(method);
            }
            if ( method.isAnnotationPresent(PERSISTENCE_CONTEXT) )
            {
               if ( !type.isSessionBean() && type!=MESSAGE_DRIVEN_BEAN )
               {
                  throw new IllegalArgumentException("@PersistenceContext may only be used on session bean or message driven bean components: " + name);
               }
               pcAttributes.add( new BijectedMethod( toName(null, method), method, null ) );
            }
            if ( method.isAnnotationPresent(Begin.class) ||
                 method.isAnnotationPresent(End.class) ||
                 method.isAnnotationPresent(StartTask.class) ||
                 method.isAnnotationPresent(BeginTask.class) ||
                 method.isAnnotationPresent(EndTask.class) )
            {
               conversationManagementMethods.add(method);
            }
           
            for ( Annotation ann: method.getAnnotations() )
            {
               if ( ann.annotationType().isAnnotationPresent(DataBinderClass.class) )
               {
                  String name = toName( createWrapper(ann).getVariableName(ann), method );
                  dataModelGetters.add( new BijectedMethod(name, method, ann) );
                  dataModelNames.add(name);
               }
               if ( ann.annotationType().isAnnotationPresent(DataSelectorClass.class) )
               {
                  selectionSetters.put(method, ann);
               }
            }

            if ( !method.isAccessible() )
            {
               method.setAccessible(true);
            }

         }

         for ( Field field: clazz.getDeclaredFields() )
         {

            if ( !field.isAccessible() )
            {
               field.setAccessible(true);
            }

            if ( field.isAnnotationPresent(In.class) )
            {
               In in = field.getAnnotation(In.class);
               String name = toName( in.value(), field );
               inAttributes.add( new BijectedField(name, field, in) );
            }
            if ( field.isAnnotationPresent(Out.class) )
            {
               Out out = field.getAnnotation(Out.class);
               String name = toName( out.value(), field );
               outAttributes.add(new BijectedField(name, field, out) );
            }
            if ( field.isAnnotationPresent(DataModel.class) ) //TODO: generalize
            {
               checkDataModelScope( field.getAnnotation(DataModel.class) );
            }
            if ( field.isAnnotationPresent(RequestParameter.class) )
            {
               RequestParameter rp = field.getAnnotation(RequestParameter.class);
               String name = toName( rp.value(), field );
               parameterSetters.add( new BijectedField(name, field, rp) );
            }
            if ( field.isAnnotationPresent(org.jboss.seam.annotations.Logger.class) )
            {
               String category = field.getAnnotation(org.jboss.seam.annotations.Logger.class).value();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.