Package lotus.domino

Examples of lotus.domino.Document


  /** {@inheritDoc} */
  @Override
  public NotesDocument getDocumentByKey(Object key, boolean exact)
      throws NotesConnectorExceptionImpl {
    try {
      Document doc = getNotesObject().getDocumentByKey(key, exact);
      if (doc == null) {
        return null;
      }
      return new NotesDocumentImpl(doc);
    } catch (NotesException e) {
View Full Code Here


  /** {@inheritDoc} */
  @Override
  public NotesDocument getDocumentByKey(Vector key, boolean exact)
      throws NotesConnectorExceptionImpl {
    try {
      Document doc = getNotesObject().getDocumentByKey(
          (Vector) TypeConverter.toNotesItemValue(key), exact);
      if (doc == null) {
        return null;
      }
      return new NotesDocumentImpl(doc);
View Full Code Here

    String[] products = StringUtil.splitString(snippet.getProperty("runtimes"),',');
    saveAsset(node.getUnid(), node.getCategory(), node.getName(), source.getName(), snippet.getJson(), products, snippet.getPropertiesAsString());
  }

  protected void saveAsset(String id, String category, String name, String source, String json, String[] products, String properties) throws Exception {
    Document doc = getDatabase().createDocument();
    try {
      setItemValue(doc,"Form", FORM);
      setItemValue(doc,"Author", doc.getParentDatabase().getParent().getEffectiveUserName()); // Should we make this private (reader field)?
      setItemValue(doc,"Id", id);
      setItemValue(doc,"Category", category);
      setItemValue(doc,"Name", name);
      setItemValue(doc,"ImportSource", source);
      setItemValueRichText(doc,"Json", json);
      setItemValueRichText(doc,"Properties", properties);
     
      if(products!=null && products.length>0) {
        setItemValue(doc,"FilterRuntimes", StringUtil.concatStrings(products, ',', true));
      }
     
      doc.save();
    } finally {
      doc.recycle();
    }
  }
View Full Code Here

    View v = db.getView("AllImportSourcesByType");
    try {
      Vector<Object> keys = new Vector<Object>();
      keys.add(type);
      keys.add(srcName);
      Document doc = v.getDocumentByKey(keys);
      try {
        if(doc!=null) {
          return loadSource(doc);
        }
        return null;
      } finally {
        doc.recycle();
      }
    } finally {
      v.recycle();
    }
  }
View Full Code Here

      EnvParameterProvider prov = new EnvParameterProvider(env);
 
      // Load the jsp document
      String jsp = null;
      try {
        Document doc = DominoUtils.getDocumentById(DominoUtils.getCurrentDatabase(), unid);
        jsp = doc.getItemValueString("Jsp");
        jsp = ParameterProcessor.process(jsp, prov);
      } catch(NotesException ex) {
        throw new ServletException(ex);
      }
     
View Full Code Here

  }

  @Override
  protected void saveAsset(ImportSource source, VFSFile root, AssetNode node, Asset asset) throws Exception {
    JavaSnippet snippet = (JavaSnippet)asset;
    Document doc = getDatabase().createDocument();
    try {
      setItemValue(doc,"Form", FORM);
      setItemValue(doc,"Author", doc.getParentDatabase().getParent().getEffectiveUserName()); // Should we make this private (reader field)?
      setItemValue(doc,"Id", node.getUnid());
      setItemValue(doc,"Category", node.getCategory());
      setItemValue(doc,"Name", node.getName());
      setItemValue(doc,"Description", snippet.getProperty("description"));
      setItemValue(doc,"FilterRuntimes", snippet.getProperty("runtimes"));
      setItemValues(doc,"Tags", snippet.getProperty("tags"));
      setItemValue(doc,"ImportSource", source.getName());
      setItemValueRichText(doc,"Jsp", snippet.getJsp());
      snippet.getProperties().remove("endpoints");
      snippet.getProperties().remove("description");
      setItemValueRichText(doc,"Properties", snippet.getPropertiesAsString());
      setItemValueRichText(doc,"Documentation", snippet.getDocHtml());
     
      doc.save();
    } finally {
      doc.recycle();
    }
  }
View Full Code Here

  }

  @Override
  protected void saveAsset(ImportSource source, VFSFile root, AssetNode node, Asset asset) throws Exception {
    GadgetSnippet snippet = (GadgetSnippet)asset;
    Document doc = getDatabase().createDocument();
    try {
      // The gadget are actually imported with their directory
      // We adapt the category & unid consequently
      String name = snippet.getTitle();
      if(StringUtil.isEmpty(name)) {
        name = createPrettyName(node.getParent().getName());
      }
      String cat = createPrettyName(node.getParent().getCategory());
      String unid = PathUtil.concat(cat,node.getUnid(),Node.SEPARATOR);
      unid = Node.encodeUnid(unid);
     
      setItemValue(doc,"Form", FORM);
      setItemValue(doc,"Author", doc.getParentDatabase().getParent().getEffectiveUserName()); // Should we make this private (reader field)?
      setItemValue(doc,"Id", unid);
      setItemValue(doc,"Category", cat);
      setItemValue(doc,"Name", name);
      setItemValue(doc,"FilterRuntimes", snippet.getProperty("runtimes"));
      setItemValue(doc,"Description", snippet.getProperty("description"));
      setItemValues(doc,"Tags", snippet.getProperty("tags"));
      setItemValue(doc,"ImportSource", source.getName());
      setItemValueRichText(doc,"Gadget", snippet.getGadgetXml());
      setItemValueRichText(doc,"Html", snippet.getHtml());
      setItemValueRichText(doc,"Css", snippet.getCss());
      setItemValueRichText(doc,"JavaScript", snippet.getJs());
      setItemValueRichText(doc,"Json", snippet.getJson());
      snippet.getProperties().remove("endpoints");
      snippet.getProperties().remove("description");
      setItemValueRichText(doc,"Properties", snippet.getPropertiesAsString());
      setItemValueRichText(doc,"Documentation", snippet.getDocHtml());

      doc.save();
    } finally {
      doc.recycle();
    }
  }
View Full Code Here

  }

  @Override
  protected void saveAsset(ImportSource source, VFSFile root, AssetNode node, Asset asset) throws Exception {
    JSSnippet snippet = (JSSnippet)asset;
    Document doc = getDatabase().createDocument();
    try {
      setItemValue(doc,"Form", FORM);
      setItemValue(doc,"Author", doc.getParentDatabase().getParent().getEffectiveUserName()); // Should we make this private (reader field)?
      setItemValue(doc,"Id", node.getUnid());
      setItemValue(doc,"Category", node.getCategory());
      setItemValue(doc,"Name", node.getName());
      setItemValue(doc,"FilterRuntimes", snippet.getProperty("runtimes"));
      setItemValue(doc,"FilterLibraries", snippet.getProperty("jslibs"));
      setItemValues(doc,"Tags", snippet.getProperty("tags"));
      setItemValue(doc,"Description", snippet.getProperty("description"));
      setItemValue(doc,"ImportSource", source.getName());
      setItemValueRichText(doc,"Html", snippet.getHtml());
      setItemValueRichText(doc,"Css", snippet.getCss());
      setItemValueRichText(doc,"JavaScript", snippet.getJs());
      snippet.getProperties().remove("endpoints");
      snippet.getProperties().remove("jslibs");
      snippet.getProperties().remove("description");
      setItemValueRichText(doc,"Properties", snippet.getPropertiesAsString());
      setItemValueRichText(doc,"Documentation", snippet.getDocHtml());
     
      doc.save();
    } finally {
      doc.recycle();
    }
  }
View Full Code Here

  }

  @Override
  protected void saveAsset(ImportSource source, VFSFile root, AssetNode node, Asset asset) throws Exception {
    XPagesSnippet snippet = (XPagesSnippet)asset;
    Document doc = getDatabase().createDocument();
    try {
      setItemValue(doc,"Form", FORM);
      setItemValue(doc,"Author", doc.getParentDatabase().getParent().getEffectiveUserName()); // Should we make this private (reader field)?
      setItemValue(doc,"Id", node.getUnid());
      setItemValue(doc,"Category", node.getCategory());
      setItemValue(doc,"Name", node.getName());
      setItemValue(doc,"Description", snippet.getProperty("description"));
      setItemValue(doc,"FilterRuntimes", snippet.getProperty("runtimes"));
      setItemValues(doc,"Tags", snippet.getProperty("tags"));
      setItemValue(doc,"ImportSource", source.getName());
      setItemValueRichText(doc,"XPages", snippet.getXsp());
      snippet.getProperties().remove("endpoints");
      snippet.getProperties().remove("description");
      setItemValueRichText(doc,"Properties", snippet.getPropertiesAsString());
      setItemValueRichText(doc,"Documentation", snippet.getDocHtml());
     
      doc.save();
    } finally {
      doc.recycle();
    }
  }
View Full Code Here

     
      // Getting a collection of all documents from the database.
      DocumentCollection documentcollection = database.getAllDocuments();
     
      // Getting the first document from the database
      Document document = documentcollection.getFirstDocument();
     
      // Start to write to cells at this row.
      int intRowToStart = 0;
     
      // The current row.
      int intRow = intRowToStart;
     
      // The current column.
      int intColumn = 0;
     
      // Process all documents
      while ( document != null ) {
        // Getting the name of the stock.
        String stringName = document.getItemValueString( "Name" );
       
        // Inserting the name to a specified cell.
        insertIntoCell( intColumn, intRow, stringName, xspreadsheet, "" );
       
        // Getting the number of stocks.
        double intNumber = document.getItemValueInteger( "Number" );
       
        // Inserting the number of stocks to a specified cell.
        insertIntoCell( intColumn + 1, intRow, String.valueOf( intNumber ),
        xspreadsheet, "V" );
       
        // Getting current share price.
        double doubleSharePrice = document.getItemValueDouble( "SharePrice" );
       
        // Inserting the current share price to a specified cell.
        insertIntoCell( intColumn + 2, intRow, String.valueOf( doubleSharePrice ),
        xspreadsheet, "V" );
       
View Full Code Here

TOP

Related Classes of lotus.domino.Document

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.