Package org.dbwiki.data.database

Examples of org.dbwiki.data.database.Update


      // targetElement should be nonnull
      assert(targetElement != null);
      if (!targetElement.isAttribute()) {
        throw new WikiDataException(WikiDataException.InvalidPasteTarget, target.toParameterString());
      }
      Update update = new Update();
      update.add(new NodeUpdate(targetElement.identifier(), ((PasteTextNode)pasteNode).getValue()));
      updateNodeWrapped(targetElement, update, _versionIndex.getNextVersion(new ProvenanceCopy(user, targetElement.identifier(), sourceURL)));
    }
  }
View Full Code Here


   * @param request
   * @return
   * @throws org.dbwiki.exception.WikiException
   */
  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

          // page after the update.
          isGetRequest = !request.isRootRequest();
          isIndexRequest = !isGetRequest;
        } else {
          // Updating a data object
          Update update = this.getNodeUpdates(request);
          if (update != null) {
            database().update(request.wri().resourceIdentifier(),
                update, request.user());
            if (request.node().isText()) {
              page = new RedirectPage(request,
View Full Code Here

TOP

Related Classes of org.dbwiki.data.database.Update

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.