[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/sword s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sat Oct 9 14:45:07 MST 2004


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword
In directory www.crosswire.org:/tmp/cvs-serv30045/java/jsword/org/crosswire/jsword/book/sword

Modified Files:
	SwordBookDriver.java SwordBookMetaData.java 
Log Message:
indexing updates

Index: SwordBookDriver.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/SwordBookDriver.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** SwordBookDriver.java	6 Oct 2004 22:52:22 -0000	1.34
--- SwordBookDriver.java	9 Oct 2004 21:45:05 -0000	1.35
***************
*** 16,20 ****
--- 16,23 ----
  import org.crosswire.jsword.book.BookMetaData;
  import org.crosswire.jsword.book.Books;
+ import org.crosswire.jsword.book.IndexStatus;
  import org.crosswire.jsword.book.basic.AbstractBookDriver;
+ import org.crosswire.jsword.book.search.IndexManager;
+ import org.crosswire.jsword.book.search.IndexManagerFactory;
  import org.crosswire.jsword.util.Project;
  
***************
*** 89,92 ****
--- 92,105 ----
                              Book book = createBook(sbmd, dirs[j]);
                              valid.add(book.getBookMetaData());
+ 
+                             IndexManager imanager = IndexManagerFactory.getIndexManager();
+                             if (imanager.isIndexed(book))
+                             {
+                                 sbmd.setIndexStatus(IndexStatus.DONE);
+                             }
+                             else
+                             {
+                                 sbmd.setIndexStatus(IndexStatus.UNDONE);
+                             }
                          }
                          else

Index: SwordBookMetaData.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/SwordBookMetaData.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** SwordBookMetaData.java	5 Oct 2004 22:03:09 -0000	1.32
--- SwordBookMetaData.java	9 Oct 2004 21:45:05 -0000	1.33
***************
*** 30,33 ****
--- 30,35 ----
  import org.crosswire.jsword.book.BookMetaData;
  import org.crosswire.jsword.book.BookType;
+ import org.crosswire.jsword.book.IndexStatus;
+ import org.crosswire.jsword.book.basic.AbstractBookMetaData;
  import org.crosswire.jsword.book.filter.Filter;
  import org.crosswire.jsword.book.filter.FilterFactory;
***************
*** 67,71 ****
   * @version $Id$
   */
! public class SwordBookMetaData implements BookMetaData
  {
      /**
--- 69,73 ----
   * @version $Id$
   */
! public class SwordBookMetaData extends AbstractBookMetaData
  {
      /**
***************
*** 152,158 ****
          // set the key property file entries
          prop.put(KEY_INITIALS, initials);
!         
          validate();
!         
          if (!isSupported())
          {
--- 154,160 ----
          // set the key property file entries
          prop.put(KEY_INITIALS, initials);
! 
          validate();
! 
          if (!isSupported())
          {
***************
*** 323,327 ****
          prop = orderedMap;
      }
!     
      private void organize(Map result, Object[] category)
      {
--- 325,332 ----
          prop = orderedMap;
      }
! 
!     /**
!      * 
!      */
      private void organize(Map result, Object[] category)
      {
***************
*** 337,340 ****
--- 342,348 ----
      }
  
+     /**
+      * 
+      */
      public void validate()
      {
***************
*** 391,397 ****
              log.debug("Book not supported: " + internal + " because ModuleType (" + modTypeName + ") is not supported."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
              supported = false;
! 	        return;
          }
!         
          // report on unknown config entries
          for (Iterator kit = getKeys(); kit.hasNext();)
--- 399,405 ----
              log.debug("Book not supported: " + internal + " because ModuleType (" + modTypeName + ") is not supported."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
              supported = false;
!             return;
          }
! 
          // report on unknown config entries
          for (Iterator kit = getKeys(); kit.hasNext();)
***************
*** 403,413 ****
              }
          }
!         
          // output collected warnings
!         for (Iterator kit = warnings.iterator(); kit.hasNext(); )
          {
              log.warn((String) kit.next());
          }
- 
      }
  
--- 411,420 ----
              }
          }
! 
          // output collected warnings
!         for (Iterator kit = warnings.iterator(); kit.hasNext();)
          {
              log.warn((String) kit.next());
          }
      }
  
***************
*** 516,520 ****
          // strip { and } which are found in {\i text }
          copy = copy.replaceAll("[{}]", ""); //$NON-NLS-1$ //$NON-NLS-2$
!         
          if (!allowsRTF.contains(key))
          {
--- 523,527 ----
          // strip { and } which are found in {\i text }
          copy = copy.replaceAll("[{}]", ""); //$NON-NLS-1$ //$NON-NLS-2$
! 
          if (!allowsRTF.contains(key))
          {
***************
*** 739,742 ****
--- 746,768 ----
      }
  
+     /* (non-Javadoc)
+      * @see org.crosswire.jsword.book.BookMetaData#getIndexStatus()
+      */
+     public IndexStatus getIndexStatus()
+     {
+         return indexStatus;
+     }
+ 
+     /* (non-Javadoc)
+      * @see org.crosswire.jsword.book.BookMetaData#setIndexStatus(java.lang.String)
+      */
+     public void setIndexStatus(IndexStatus newValue)
+     {
+         IndexStatus oldValue = this.indexStatus;
+         this.indexStatus = newValue;
+         prop.put(KEY_INDEXSTATUS, newValue);
+         firePropertyChange(KEY_INDEXSTATUS, oldValue, newValue);
+     }
+ 
      /**
       * Get the string value for the property or null if it is not defined.
***************
*** 783,786 ****
--- 809,815 ----
      }
  
+     /**
+      * 
+      */
      private String computeFullName()
      {
***************
*** 862,866 ****
          }
  
- 
          // The real bit ...
          BookMetaData that = (BookMetaData) obj;
--- 891,894 ----
***************
*** 930,1004 ****
      private static final Object[] BASIC_INFO =
      {
!                     KEY_INITIALS,
!                     ConfigEntry.DESCRIPTION,
!                     KEY_TYPE,
!                     ConfigEntry.LCSH,
!                     ConfigEntry.CATEGORY,
!                     ConfigEntry.VERSION,
!                     ConfigEntry.SWORD_VERSION_DATE,
      };
  
      private static final Object[] LANG_INFO =
      {
!                     KEY_LANGUAGE,
!                     ConfigEntry.LANG,
!                     ConfigEntry.GLOSSARY_FROM,
!                     ConfigEntry.GLOSSARY_TO,
!                     ConfigEntry.LEXICON_FROM,
!                     ConfigEntry.LEXICON_TO,
      };
  
      private static final Object[] HISTORY_INFO =
      {
!                     ConfigEntry.HISTORY_2_5,
!                     ConfigEntry.HISTORY_2_2,
!                     ConfigEntry.HISTORY_2_1,
!                     ConfigEntry.HISTORY_2_0,
!                     ConfigEntry.HISTORY_1_9,
!                     ConfigEntry.HISTORY_1_8,
!                     ConfigEntry.HISTORY_1_7,
!                     ConfigEntry.HISTORY_1_6,
!                     ConfigEntry.HISTORY_1_5,
!                     ConfigEntry.HISTORY_1_4,
!                     ConfigEntry.HISTORY_1_3,
!                     ConfigEntry.HISTORY_1_2,
!                     ConfigEntry.HISTORY_1_1,
!                     ConfigEntry.HISTORY_1_0,
!                     ConfigEntry.HISTORY_0_92,
!                     ConfigEntry.HISTORY_0_91,
!                     ConfigEntry.HISTORY_0_9,
!                     ConfigEntry.HISTORY_0_3,
!                     ConfigEntry.HISTORY_0_2,
!                     ConfigEntry.HISTORY_0_1
      };
  
      private static final Object[] SYSTEM_INFO =
      {
!                     ConfigEntry.DATA_PATH,
!                     ConfigEntry.MOD_DRV,
!                     ConfigEntry.SOURCE_TYPE,
!                     ConfigEntry.BLOCK_TYPE,
!                     ConfigEntry.COMPRESS_TYPE,
!                     ConfigEntry.ENCODING,
!                     ConfigEntry.MINIMUM_VERSION,
!                     ConfigEntry.MINIMUM_SWORD_VERSION,
!                     ConfigEntry.DIRECTION
      };
  
      private static final Object[] COPYRIGHT_INFO =
      {
!                     ConfigEntry.ABOUT,
!                     ConfigEntry.DISTRIBUTION,
!                     ConfigEntry.DISTRIBUTION_LICENSE,
!                     ConfigEntry.DISTRIBUTION_NOTES,
!                     ConfigEntry.DISTRIBUTION_SOURCE,
!                     ConfigEntry.COPYRIGHT,
!                     ConfigEntry.COPYRIGHT_DATE,
!                     ConfigEntry.COPYRIGHT_HOLDER,
!                     ConfigEntry.COPYRIGHT_CONTACT_NAME,
!                     ConfigEntry.COPYRIGHT_CONTACT_ADDRESS,
!                     ConfigEntry.COPYRIGHT_CONTACT_EMAIL,
!                     ConfigEntry.COPYRIGHT_NOTES,
!                     ConfigEntry.TEXT_SOURCE,
      };
  
--- 958,1032 ----
      private static final Object[] BASIC_INFO =
      {
!         KEY_INITIALS,
!         ConfigEntry.DESCRIPTION,
!         KEY_TYPE,
!         ConfigEntry.LCSH,
!         ConfigEntry.CATEGORY,
!         ConfigEntry.VERSION,
!         ConfigEntry.SWORD_VERSION_DATE,
      };
  
      private static final Object[] LANG_INFO =
      {
!         KEY_LANGUAGE,
!         ConfigEntry.LANG,
!         ConfigEntry.GLOSSARY_FROM,
!         ConfigEntry.GLOSSARY_TO,
!         ConfigEntry.LEXICON_FROM,
!         ConfigEntry.LEXICON_TO,
      };
  
      private static final Object[] HISTORY_INFO =
      {
!         ConfigEntry.HISTORY_2_5,
!         ConfigEntry.HISTORY_2_2,
!         ConfigEntry.HISTORY_2_1,
!         ConfigEntry.HISTORY_2_0,
!         ConfigEntry.HISTORY_1_9,
!         ConfigEntry.HISTORY_1_8,
!         ConfigEntry.HISTORY_1_7,
!         ConfigEntry.HISTORY_1_6,
!         ConfigEntry.HISTORY_1_5,
!         ConfigEntry.HISTORY_1_4,
!         ConfigEntry.HISTORY_1_3,
!         ConfigEntry.HISTORY_1_2,
!         ConfigEntry.HISTORY_1_1,
!         ConfigEntry.HISTORY_1_0,
!         ConfigEntry.HISTORY_0_92,
!         ConfigEntry.HISTORY_0_91,
!         ConfigEntry.HISTORY_0_9,
!         ConfigEntry.HISTORY_0_3,
!         ConfigEntry.HISTORY_0_2,
!         ConfigEntry.HISTORY_0_1
      };
  
      private static final Object[] SYSTEM_INFO =
      {
!         ConfigEntry.DATA_PATH,
!         ConfigEntry.MOD_DRV,
!         ConfigEntry.SOURCE_TYPE,
!         ConfigEntry.BLOCK_TYPE,
!         ConfigEntry.COMPRESS_TYPE,
!         ConfigEntry.ENCODING,
!         ConfigEntry.MINIMUM_VERSION,
!         ConfigEntry.MINIMUM_SWORD_VERSION,
!         ConfigEntry.DIRECTION
      };
  
      private static final Object[] COPYRIGHT_INFO =
      {
!         ConfigEntry.ABOUT,
!         ConfigEntry.DISTRIBUTION,
!         ConfigEntry.DISTRIBUTION_LICENSE,
!         ConfigEntry.DISTRIBUTION_NOTES,
!         ConfigEntry.DISTRIBUTION_SOURCE,
!         ConfigEntry.COPYRIGHT,
!         ConfigEntry.COPYRIGHT_DATE,
!         ConfigEntry.COPYRIGHT_HOLDER,
!         ConfigEntry.COPYRIGHT_CONTACT_NAME,
!         ConfigEntry.COPYRIGHT_CONTACT_ADDRESS,
!         ConfigEntry.COPYRIGHT_CONTACT_EMAIL,
!         ConfigEntry.COPYRIGHT_NOTES,
!         ConfigEntry.TEXT_SOURCE,
      };
  
***************
*** 1038,1042 ****
      }
  
- 
      /**
       * A map of lists of known keys. Keys are presented in insertion order
--- 1066,1069 ----
***************
*** 1066,1069 ****
      private static Histogram histogram = new Histogram();
      private List warnings = new ArrayList();
! 
! }
\ No newline at end of file
--- 1093,1096 ----
      private static Histogram histogram = new Histogram();
      private List warnings = new ArrayList();
!     private IndexStatus indexStatus = IndexStatus.UNDONE;
! }



More information about the jsword-svn mailing list