Esempio n. 1
0
  /**
   * This method stores an xml document given as a String to the database giving it an indentifier.
   * If the identifier provided is null, then the database generates a unique identifier on its own.
   *
   * @param doc The String representation of the document to be stored.
   * @param resourceId The resourceId to give to the document as a unique identifier within the
   *     database. If null a unique identifier is automatically generated.
   * @param collection The name of the collection to store the document under. If it does not exist,
   *     it is created.
   * @param username The identifier of the user calling the method used for authentication.
   * @param password The password of the user calling the method used for authentication.
   */
  public void storeXmlStringDocument(
      String doc, String resourceId, String collection, String username, String password) {

    Document dom = InputOutputHandler.parseXMLStringAsDOM(doc);
    this.storeDomDocument(dom, resourceId, collection, username, password);
  }