Package ca.carleton.gcrc.couch.app

Examples of ca.carleton.gcrc.couch.app.Document


    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/mobile document...
    Document doc = null;
    {
      File installDir = gs.getInstallDir();

      List<FSEntry> entries = new Vector<FSEntry>();
     
View Full Code Here


    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/submission document...
    Document doc = null;
    {
      File installDir = gs.getInstallDir();

      List<FSEntry> entries = new Vector<FSEntry>();
     
View Full Code Here

      String[] subDirNames = docsDir.list( gs.getFilenameFilter() );
      for(String subDirName : subDirNames){
        File subDir = new File(docsDir, subDirName);
        if( subDir.exists() && subDir.isDirectory() ) {
          // OK, let's create a document based on this
          Document doc = null;
          try {
            FSEntryFile entry = new FSEntryFile(subDir);
            doc = DocumentFile.createDocument(entry);
          } catch(Exception e){
            throw new Exception("Unable to read document at: "+subDir.getName(), e);
View Full Code Here

    try {
      DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(couchDb);
      updateProcess.setListener(UpdateListener._singleton);
     
      FSEntry fileEntry = new FSEntryFile(ddDir);
      Document doc = DocumentFile.createDocument(fileEntry);

      updateProcess.update(
          doc
          ,DocumentUpdateProcess.Schedule.UPDATE_EVEN_IF_MODIFIED
          );
View Full Code Here

      CouchDb userDb = couchClient.getDatabase("_users");
      DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(userDb);
      updateProcess.setListener(UpdateListener._singleton);
     
      FSEntry fileEntry = new FSEntryFile(ddDir);
      Document doc = DocumentFile.createDocument(fileEntry);

      updateProcess.update(
          doc
          ,DocumentUpdateProcess.Schedule.UPDATE_EVEN_IF_MODIFIED
          );
View Full Code Here

        for(String fileName : fileNames) {
          File file = new File(documentsDir, fileName);
   
          try {
            FSEntry fileEntry = new FSEntryFile(file);
            Document doc = DocumentFile.createDocument(fileEntry);

            updateProcess.update(doc);

          } catch(Exception e) {
            throw new ServletException("Problem pushing document: "+file.getAbsolutePath(), e);
          }
        }
      }
    }
   
    // Find root directory for updating documents
    {
      File documentsDir = null;
      {
        documentsDir = new File(webInfDirectory, "updateDocs");
        if( false == documentsDir.exists() || false == documentsDir.isDirectory() ) {
          documentsDir = null;
        }
      }
     
      if( null == documentsDir ) {
        logger.error("Unable to find document directory for updating");
      } else {
        String[] fileNames = documentsDir.list();
        for(String fileName : fileNames) {
          File file = new File(documentsDir, fileName);
   
          try {
            FSEntry fileEntry = new FSEntryFile(file);
            Document doc = DocumentFile.createDocument(fileEntry);

            updateProcess.update(
              doc
              ,DocumentUpdateProcess.Schedule.UPDATE_EVEN_IF_MODIFIED
              );
View Full Code Here

  static public void updateDesignDocument(CouchDb couchDb) throws Exception {
   
    try {
      // Get document from resources
      FSEntryResource resourceFile = FSEntryResource.create(UserDesignDocument.class.getClassLoader(), "userDesignDocument");
      Document doc = DocumentFile.createDocument(resourceFile, resourceFile);
     
      // Get current version of document
      int diskVersion = 0;
      {
        JSONObject jsonDoc = doc.getJSONObject();
        diskVersion = jsonDoc.optInt(PROP_NAME_VERSION, 0);
      }

      // Get document from the database, if it exists, and figure out if
      // the disk version is newer than that found in the database
View Full Code Here

    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/site document...
    Document doc = null;
    {
      List<FSEntry> mergedEntries = new Vector<FSEntry>();
     
      // htdocs from atlas project
      {
View Full Code Here

        cssProcess.generate(nunaliitDir);
      }
    }
   
    // Create _design/atlas document...
    Document doc = null;
    {
      File installDir = gs.getInstallDir();

      List<FSEntry> entries = new Vector<FSEntry>();
     
View Full Code Here

    ,AtlasProperties atlasProperties
    ,DocumentUpdateProcess updateProcess
    ) throws Exception {
   
    // Create _design/mobile document...
    Document doc = null;
    {
      File installDir = gs.getInstallDir();

      List<FSEntry> entries = new Vector<FSEntry>();
     
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.app.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.