Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/journal
In directory sc8-pr-cvs1:/tmp/cvs-serv10506/core/src/com/babeldoc/core/journal
Modified Files:
IJournal.java Journal.java JournalFactory.java
JournalType.java
Added Files:
JournalConfigInfo.java
Log Message:
LARGE, EXTENSIVE UPDATE.
1. All journal classes are now IConfigurable
2. J2ee journal classes using IConfigurable and are consistent
3. Somewhat of a cleanup around the journal code.
--- NEW FILE: JournalConfigInfo.java ---
package com.babeldoc.core.journal;
import com.babeldoc.core.option.ConfigInfo;
import com.babeldoc.core.option.ServiceTypeConfigOptionType;
import java.util.Collection;
import java.util.ArrayList;
/**
* Journal configuration information class
*
* @author bmcdonald
* @version 1.1
*/
abstract public class JournalConfigInfo
extends ConfigInfo {
/** Service type for pipeline stages */
public static final ServiceTypeConfigOptionType JOURNAL_TYPE =
new ServiceTypeConfigOptionType(JournalType.SERVICE_PREFIX);
/**
* This method returns options that are general to all components
*
* @return comments
*/
public Collection getGeneralOptions() {
return new ArrayList();
}
/**
* Return an xmlized version of the of the config info
*
* @return String of configuration information.
*/
public String toXml() {
return null;
}
}
Index: IJournal.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/journal/IJournal.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** IJournal.java 18 Aug 2003 19:18:29 -0000 1.7
--- IJournal.java 3 Sep 2003 03:25:30 -0000 1.8
***************
*** 69,72 ****
--- 69,73 ----
import com.babeldoc.core.journal.query.QueryTicket;
import com.babeldoc.core.pipeline.PipelineDocument;
+ import com.babeldoc.core.option.IConfigurable;
***************
*** 78,82 ****
* @version 1.0
*/
! public interface IJournal {
/**
* getChildrenTickets. Get all the tickets which are children of this ticket
--- 79,84 ----
* @version 1.0
*/
! public interface IJournal
! extends IConfigurable {
/**
* getChildrenTickets. Get all the tickets which are children of this ticket
***************
*** 158,163 ****
/**
* Log a message into the log file
! * @param stage the stage to log
! * @param String The message to log
*/
public void logMessage(IJournalTicket ticket, String stage, String message)
--- 160,168 ----
/**
* Log a message into the log file
! *
! * @param ticket track the document
! * @param stage log message at this pipeline stage
! * @param message The message to log
! * @throws JournalException
*/
public void logMessage(IJournalTicket ticket, String stage, String message)
Index: Journal.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/journal/Journal.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Journal.java 18 Aug 2003 19:18:29 -0000 1.7
--- Journal.java 3 Sep 2003 03:25:30 -0000 1.8
***************
*** 158,163 ****
/**
* Log a message into the log file
! * @param stage the stage to log
! * @param String The message to log
*/
public void logMessage(IJournalTicket ticket, String stage, String message)
--- 158,166 ----
/**
* Log a message into the log file
! *
! * @param ticket track the document
! * @param stage log message at this pipeline stage
! * @param message The message to log
! * @throws JournalException
*/
public void logMessage(IJournalTicket ticket, String stage, String message)
Index: JournalFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/journal/JournalFactory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** JournalFactory.java 27 Jun 2003 02:19:57 -0000 1.6
--- JournalFactory.java 3 Sep 2003 03:25:30 -0000 1.7
***************
*** 68,72 ****
--- 68,75 ----
import com.babeldoc.core.I18n;
import com.babeldoc.core.LogService;
+ import com.babeldoc.core.option.ConfigData;
+ import com.babeldoc.core.option.IConfigData;
import com.babeldoc.core.config.ConfigService;
+ import com.babeldoc.core.config.IConfig;
***************
*** 84,88 ****
/** constant: journal type */
! public static final String JOURNAL_TYPE = "journal";
/** static: holds singleton reference */
--- 87,91 ----
/** constant: journal type */
! public static final String JOURNAL_TYPE = "journalType";
/** static: holds singleton reference */
***************
*** 97,118 ****
private JournalFactory() {
try {
! String journalType = ConfigService.getString(CONFIG_NAME, JOURNAL_TYPE);
LogService.getInstance().logDebug(I18n.get("016001", journalType));
! if (journalType != null) {
! Class journalClass = JournalType.getJournalType(journalType)
! .getTypeClass();
!
! if (journalClass != null) {
! try {
! journal = (IJournal) (journalClass.newInstance());
! } catch (Exception configx) {
! throw new JournalException(I18n.get("016002", JOURNAL_TYPE), configx);
! }
! } else {
! throw new JournalException(I18n.get("016003", journalType));
! }
! } else {
! throw new JournalException(I18n.get("016004"));
}
} catch (JournalException e) {
--- 100,112 ----
private JournalFactory() {
try {
! IConfigData data = ConfigData.getConfigData("root", CONFIG_NAME);
! String journalType = data.getValue(JOURNAL_TYPE);
LogService.getInstance().logDebug(I18n.get("016001", journalType));
! try {
! journal = (IJournal) JournalType.getJournalType(journalType).getTypeInstance();
! journal.getInfo().applyConfigData(data);
! } catch (Exception configx) {
! throw new JournalException(I18n.get("016002", JOURNAL_TYPE), configx);
}
} catch (JournalException e) {
***************
*** 125,132 ****
*
* @return trackerfactory object
- *
- * @throws JournalException DOCUMENT ME!
*/
! public static JournalFactory getInstance() throws JournalException {
return instance;
}
--- 119,124 ----
*
* @return trackerfactory object
*/
! public static JournalFactory getInstance() {
return instance;
}
***************
*** 136,143 ****
*
* @return the journal object
- *
- * @throws JournalException DOCUMENT ME!
*/
! public static IJournal getJournal() throws JournalException {
return JournalFactory.getInstance().journal;
}
--- 128,133 ----
*
* @return the journal object
*/
! public static IJournal getJournal() {
return JournalFactory.getInstance().journal;
}
Index: JournalType.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/journal/JournalType.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** JournalType.java 27 Jun 2003 02:19:57 -0000 1.4
--- JournalType.java 3 Sep 2003 03:25:30 -0000 1.5
***************
*** 77,80 ****
--- 77,83 ----
*/
public class JournalType extends Type {
+ /** Name prefix in the service/config.properties files */
+ public static final String SERVICE_PREFIX = "Journal";
+
/**
* Private constructor - do not use this - use the constants above.
***************
*** 103,107 ****
*/
public String getServicePrefix() {
! return "Journal";
}
}
--- 106,110 ----
*/
public String getServicePrefix() {
! return SERVICE_PREFIX;
}
}
|