[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/sword s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Sun Jan 1 20:40:10 MST 2006
Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword
In directory www.crosswire.org:/tmp/cvs-serv25586/java/jsword/org/crosswire/jsword/book/sword
Modified Files:
ConfigEntryTable.java SwordBookMetaData.java
ConfigEntryType.java
Log Message:
A mostly complete implementation of daily devotion as a separate book type.
Index: SwordBookMetaData.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/SwordBookMetaData.java,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** SwordBookMetaData.java 27 Jul 2005 23:25:45 -0000 1.46
--- SwordBookMetaData.java 2 Jan 2006 03:40:08 -0000 1.47
***************
*** 153,157 ****
// files name, not a directory name.
// Lots of paths end with '/'
! if (getType() == BookCategory.DICTIONARY
|| dataPath.charAt(dataPath.length() - 1) == '/')
{
--- 153,160 ----
// files name, not a directory name.
// Lots of paths end with '/'
! BookCategory bc = getBookCategory();
! if (bc == BookCategory.DICTIONARY
! || bc == BookCategory.GLOSSARY
! || bc == BookCategory.DAILY_DEVOTIONS
|| dataPath.charAt(dataPath.length() - 1) == '/')
{
***************
*** 164,170 ****
* @see org.crosswire.jsword.book.BookMetaData#getType()
*/
! public BookCategory getType()
{
! return getBookType().getBookCategory();
}
--- 167,181 ----
* @see org.crosswire.jsword.book.BookMetaData#getType()
*/
! public BookCategory getBookCategory()
{
! if (type == null)
! {
! type = BookCategory.fromString(getProperty(ConfigEntryType.CATEGORY));
! if (type == BookCategory.OTHER)
! {
! type = getBookType().getBookCategory();
! }
! }
! return type;
}
***************
*** 261,264 ****
private ConfigEntryTable cet;
!
}
--- 272,275 ----
private ConfigEntryTable cet;
! private BookCategory type;
}
Index: ConfigEntryType.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/ConfigEntryType.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ConfigEntryType.java 27 Jul 2005 23:25:45 -0000 1.10
--- ConfigEntryType.java 2 Jan 2006 03:40:08 -0000 1.11
***************
*** 28,32 ****
import java.util.regex.Pattern;
- import org.crosswire.jsword.book.BookCategory;
import org.crosswire.jsword.book.basic.AbstractBookMetaData;
--- 28,31 ----
***************
*** 221,224 ****
--- 220,231 ----
}
+ /* (non-Javadoc)
+ * @see org.crosswire.jsword.book.sword.ConfigEntryType#getDefault()
+ */
+ public Object getDefault()
+ {
+ return "Other"; //$NON-NLS-1$
+ }
+
/**
* The set of choices.
***************
*** 230,233 ****
--- 237,245 ----
"Cults / Unorthodox / Questionable Material", //$NON-NLS-1$
"Essays", //$NON-NLS-1$
+ // The following are not actually in the conf,
+ // but are deduced from other fields
+ "Bible", //$NON-NLS-1$
+ "Dictionary", //$NON-NLS-1$
+ "Commentary", //$NON-NLS-1$
}));
***************
*** 1152,1183 ****
/**
- * The key is used to subdivide the books into their types.
- * TODO(DMS): Change Key to something more descriptive.
- */
- public static final ConfigEntryType KEY = new ConfigEntryType("Key") //$NON-NLS-1$
- {
- /* (non-Javadoc)
- * @see org.crosswire.jsword.book.sword.ConfigEntryType#isSynthetic()
- */
- public boolean isSynthetic()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.crosswire.jsword.book.sword.ConfigEntryType#getDefault()
- */
- public Object getDefault()
- {
- return BookCategory.OTHER.toString(); //$NON-NLS-1$
- }
-
- /**
- * Serialization ID
- */
- private static final long serialVersionUID = 3544671776240908087L;
- };
-
- /**
* single value string, unknown use
* While Lang is an IS0-639 or ethnolog value, this is a friendly representation
--- 1164,1167 ----
***************
*** 1483,1487 ****
OSIS_Q_TO_TICK,
INITIALS,
- KEY,
LANGUAGE,
LANGUAGE_FROM,
--- 1467,1470 ----
Index: ConfigEntryTable.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/ConfigEntryTable.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ConfigEntryTable.java 27 Jul 2005 23:25:45 -0000 1.10
--- ConfigEntryTable.java 2 Jan 2006 03:40:08 -0000 1.11
***************
*** 494,499 ****
}
! BookCategory type = getBookType().getBookCategory();
! if (type == null)
{
// We plan to add RawGenBook at a later time. So we don't need to be reminded all the time.
--- 494,499 ----
}
! BookCategory basicCategory = getBookType().getBookCategory();
! if (basicCategory == null)
{
// We plan to add RawGenBook at a later time. So we don't need to be reminded all the time.
***************
*** 506,510 ****
}
! add(ConfigEntryType.KEY, type.toString());
}
--- 506,518 ----
}
! // The book type represents the underlying category of book.
! // Fine tune it here.
! BookCategory focusedCategory = BookCategory.fromString(getValue(ConfigEntryType.CATEGORY).toString());
! if (focusedCategory == BookCategory.OTHER)
! {
! focusedCategory = getBookType().getBookCategory();
! }
!
! add(ConfigEntryType.CATEGORY, focusedCategory.toString());
}
***************
*** 574,578 ****
ConfigEntryType.INITIALS,
ConfigEntryType.DESCRIPTION,
! ConfigEntryType.KEY,
ConfigEntryType.DATA_PATH,
ConfigEntryType.MOD_DRV,
--- 582,586 ----
ConfigEntryType.INITIALS,
ConfigEntryType.DESCRIPTION,
! ConfigEntryType.CATEGORY, // may not be present in conf
ConfigEntryType.DATA_PATH,
ConfigEntryType.MOD_DRV,
***************
*** 583,589 ****
ConfigEntryType.INITIALS,
ConfigEntryType.DESCRIPTION,
- ConfigEntryType.KEY,
- ConfigEntryType.LCSH,
ConfigEntryType.CATEGORY,
ConfigEntryType.VERSION,
ConfigEntryType.SWORD_VERSION_DATE,
--- 591,596 ----
ConfigEntryType.INITIALS,
ConfigEntryType.DESCRIPTION,
ConfigEntryType.CATEGORY,
+ ConfigEntryType.LCSH,
ConfigEntryType.VERSION,
ConfigEntryType.SWORD_VERSION_DATE,
More information about the jsword-svn
mailing list