();
static {
diff --git a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/DbCitationService.java b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/DbCitationService.java
index 58807c5c0753..3fb5706bf54c 100644
--- a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/DbCitationService.java
+++ b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/DbCitationService.java
@@ -28,8 +28,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.citation.api.*;
import org.sakaiproject.citation.api.Schema.Field;
import org.sakaiproject.db.api.SqlReader;
@@ -1800,7 +1800,7 @@ public Object readSqlResultRecord(ResultSet result)
/* Connection management: Original auto-commit state (unknown, on, off) */
private static final int AUTO_UNKNOWN = 1;
/** Our logger. */
- private static Log M_log = LogFactory.getLog(DbCitationService.class);
+ private static Logger M_log = LoggerFactory.getLogger(DbCitationService.class);
protected static final Pattern MULTIVALUED_PATTERN = Pattern.compile("^(.*)\\t(\\d+)$");
protected static final String PROP_SORT_ORDER = "sakai:sort_order";
diff --git a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SakaiOsidLoader.java b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SakaiOsidLoader.java
index 15a7350d4e1a..66f7e6a00876 100644
--- a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SakaiOsidLoader.java
+++ b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SakaiOsidLoader.java
@@ -21,8 +21,8 @@
package org.sakaiproject.citation.impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* OsidLoader loads a specific implementation of an Open Service Interface
@@ -89,7 +89,7 @@
*/
public class SakaiOsidLoader implements java.io.Serializable
{
- private static Log M_log = LogFactory.getLog(SakaiOsidLoader.class);
+ private static Logger M_log = LoggerFactory.getLogger(SakaiOsidLoader.class);
/**
* Get an InputStream for a particular file name - first check the sakai.home area and then
diff --git a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SampleSiteOsidConfiguration.java b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SampleSiteOsidConfiguration.java
index 0b5f4f192f0f..f6bdf12cd084 100644
--- a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SampleSiteOsidConfiguration.java
+++ b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/SampleSiteOsidConfiguration.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * $URL:
- * $Id:
- * **********************************************************************************
- *
+/*******************************************************************************
+ * $URL:
+ * $Id:
+ * **********************************************************************************
+ *
* Copyright (c) 2006, 2007, 2008 The Sakai Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
@@ -16,100 +16,100 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- ******************************************************************************/
-package org.sakaiproject.citation.impl;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.sakaiproject.citation.util.api.OsidConfigurationException;
-import org.sakaiproject.citation.api.SiteOsidConfiguration;
-
-/**
- * Sample Repository OSID configuration
- */
-public class SampleSiteOsidConfiguration implements SiteOsidConfiguration
-{
- private static Log _log = LogFactory.getLog(SampleSiteOsidConfiguration.class);
-
- /*
- * Citation Helper XML database and configuration file names
- *
- * Set to null to force the use of values from components.xml
- */
- public static final String CATEGORIES_XML = "categories.xml";
- public static final String CONFIGURATION_XML = "config.xml";
-
- /*
- * Group membership
- */
- public static final String FULL_ACCESS_GROUP = "all";
- public static final String GUEST_ACCESS_GROUP = "free";
-
- /**
- * Simple public constructor
- */
- public SampleSiteOsidConfiguration()
- {
- }
-
- /*
- * Interface methods
- */
-
- /**
- * Initialization - do whatever is appropriate here
- */
- public void init() throws OsidConfigurationException
- {
- }
-
- /**
- * Fetch the appropriate XML configuration document for this user. Typically,
- * this will be a path relative to the root folder for citations configurations
- * ( e.g. samples/config.xml)
- *
- * Return null to force the use of the siteConfigXml property from
- * components.xml
- *
- * @return Configuration XML (eg config.xml or samples/config.xml)
- */
- public String getConfigurationXml() throws OsidConfigurationException
- {
- return CONFIGURATION_XML;
- }
-
- /**
- /**
- * Fetch the appropriate XML database document for this user. Typically,
- * this will be a path relative to the root folder for citations configurations
- * ( e.g. samples/categories.xml)
- *
- * Return null to force the use of the databaseXml property from
- * components.xml
- *
- * @return Hierarchy XML (eg categories.xml or samples/categories.xml)
- */
- public String getDatabaseHierarchyXml() throws OsidConfigurationException
- {
- return CATEGORIES_XML;
- }
-
- /**
- * Fetch this user's group affiliations (ALL in this example)
- * @return A list of group ID strings (empty if no IDs exist)
- */
- public List getGroupIds() throws OsidConfigurationException
- {
- ArrayList groupList = new ArrayList();
-
- groupList.add(FULL_ACCESS_GROUP);
- groupList.add(GUEST_ACCESS_GROUP);
-
- return groupList;
- }
-}
\ No newline at end of file
+ *
+ ******************************************************************************/
+package org.sakaiproject.citation.impl;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.sakaiproject.citation.util.api.OsidConfigurationException;
+import org.sakaiproject.citation.api.SiteOsidConfiguration;
+
+/**
+ * Sample Repository OSID configuration
+ */
+public class SampleSiteOsidConfiguration implements SiteOsidConfiguration
+{
+ private static Logger _log = LoggerFactory.getLogger(SampleSiteOsidConfiguration.class);
+
+ /*
+ * Citation Helper XML database and configuration file names
+ *
+ * Set to null to force the use of values from components.xml
+ */
+ public static final String CATEGORIES_XML = "categories.xml";
+ public static final String CONFIGURATION_XML = "config.xml";
+
+ /*
+ * Group membership
+ */
+ public static final String FULL_ACCESS_GROUP = "all";
+ public static final String GUEST_ACCESS_GROUP = "free";
+
+ /**
+ * Simple public constructor
+ */
+ public SampleSiteOsidConfiguration()
+ {
+ }
+
+ /*
+ * Interface methods
+ */
+
+ /**
+ * Initialization - do whatever is appropriate here
+ */
+ public void init() throws OsidConfigurationException
+ {
+ }
+
+ /**
+ * Fetch the appropriate XML configuration document for this user. Typically,
+ * this will be a path relative to the root folder for citations configurations
+ * ( e.g. samples/config.xml)
+ *
+ * Return null to force the use of the siteConfigXml property from
+ * components.xml
+ *
+ * @return Configuration XML (eg config.xml or samples/config.xml)
+ */
+ public String getConfigurationXml() throws OsidConfigurationException
+ {
+ return CONFIGURATION_XML;
+ }
+
+ /**
+ /**
+ * Fetch the appropriate XML database document for this user. Typically,
+ * this will be a path relative to the root folder for citations configurations
+ * ( e.g. samples/categories.xml)
+ *
+ * Return null to force the use of the databaseXml property from
+ * components.xml
+ *
+ * @return Hierarchy XML (eg categories.xml or samples/categories.xml)
+ */
+ public String getDatabaseHierarchyXml() throws OsidConfigurationException
+ {
+ return CATEGORIES_XML;
+ }
+
+ /**
+ * Fetch this user's group affiliations (ALL in this example)
+ * @return A list of group ID strings (empty if no IDs exist)
+ */
+ public List getGroupIds() throws OsidConfigurationException
+ {
+ ArrayList groupList = new ArrayList();
+
+ groupList.add(FULL_ACCESS_GROUP);
+ groupList.add(GUEST_ACCESS_GROUP);
+
+ return groupList;
+ }
+}
diff --git a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/BookConverter.java b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/BookConverter.java
index 4f5bce155158..f94eeee35d4b 100644
--- a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/BookConverter.java
+++ b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/BookConverter.java
@@ -5,8 +5,8 @@
import org.apache.commons.collections.BidiMap;
import org.apache.commons.collections.bidimap.TreeBidiMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.citation.api.Citation;
import org.sakaiproject.citation.api.CitationService;
@@ -17,7 +17,7 @@
*/
public class BookConverter extends AbstractConverter implements Converter {
- final static Log log = LogFactory.getLog(BookConverter.class);
+ final static Logger log = LoggerFactory.getLogger(BookConverter.class);
public final static String ID = "info:ofi/fmt:kev:mtx:book";
diff --git a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/JournalConverter.java b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/JournalConverter.java
index 0aed79e240f1..dccfdf72be29 100644
--- a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/JournalConverter.java
+++ b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/JournalConverter.java
@@ -6,8 +6,8 @@
import org.apache.commons.collections.BidiMap;
import org.apache.commons.collections.bidimap.TreeBidiMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.citation.api.Citation;
import org.sakaiproject.citation.api.CitationService;
@@ -18,7 +18,7 @@
*/
public class JournalConverter extends AbstractConverter {
- private final static Log log = LogFactory.getLog(JournalConverter.class);
+ private final static Logger log = LoggerFactory.getLogger(JournalConverter.class);
public final static String ID = "info:ofi/fmt:kev:mtx:journal";
diff --git a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/KEVFormat.java b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/KEVFormat.java
index 79b2172de6d6..f48b419592b2 100644
--- a/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/KEVFormat.java
+++ b/citations/citations-impl/impl/src/java/org/sakaiproject/citation/impl/openurl/KEVFormat.java
@@ -7,8 +7,8 @@
import java.util.Map;
import java.util.Map.Entry;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.citation.impl.openurl.ContextObject.Entity;
/**
@@ -17,7 +17,7 @@
*/
public class KEVFormat implements Format {
- private static final Log log = LogFactory.getLog(KEVFormat.class);
+ private static final Logger log = LoggerFactory.getLogger(KEVFormat.class);
private static List entityFormatters = new ArrayList();
public static String FORMAT_ID = "info:ofi/fmt:kev:mtx:ctx";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/loader/OsidLoader.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/loader/OsidLoader.java
index 17451feee832..04104c7df6fa 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/loader/OsidLoader.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/loader/OsidLoader.java
@@ -63,8 +63,6 @@
*
*/
public class OsidLoader implements java.io.Serializable {
-
-private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(OsidLoader.class);
/**
* Returns an instance of the org.osid.OsidManager of the OSID specified by the OSID
* package org.osid.OsidManager interface name and the implementation package name.
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Asset.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Asset.java
index 8fbcc124b7dc..258f8ce73bfe 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Asset.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Asset.java
@@ -20,14 +20,16 @@
* limitations under the License.
*
**********************************************************************************/
+
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class Asset extends edu.indiana.lib.osid.base.repository.Asset
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Asset.class);
-
private org.osid.shared.Type assetType = new Type("mit.edu", "asset", "library_content");
private org.osid.shared.Type recordStructureType = new Type("mit.edu", "recordStructure", "library_content");
private org.osid.shared.Type dcRecordStructureType = new Type("mit.edu", "recordStructure", "dublinCore");
@@ -61,7 +63,7 @@ protected Asset(String displayName
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
}
}
@@ -133,7 +135,7 @@ public org.osid.repository.Record createRecord(org.osid.shared.Id recordStructur
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -160,7 +162,7 @@ public void deleteRecord(org.osid.shared.Id recordId)
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -184,7 +186,7 @@ public org.osid.repository.RecordIterator getRecordsByRecordStructure(org.osid.s
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -230,7 +232,7 @@ public org.osid.repository.Record getRecord(org.osid.shared.Id recordId)
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -261,7 +263,7 @@ public org.osid.repository.Part getPart(org.osid.shared.Id partId)
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -300,7 +302,7 @@ public org.osid.repository.PartIterator getPartByPart(org.osid.shared.Id partStr
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -320,7 +322,7 @@ public org.osid.shared.ObjectIterator getPartValueByPart(org.osid.shared.Id part
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -345,7 +347,7 @@ public org.osid.shared.ObjectIterator getPartValuesByPartStructure(org.osid.shar
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -378,7 +380,7 @@ public org.osid.repository.PartIterator getPartsByPartStructure(org.osid.shared.
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/AssetIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/AssetIterator.java
index b57ff5fad586..26b2d19d3c36 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/AssetIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/AssetIterator.java
@@ -3,6 +3,7 @@
import edu.indiana.lib.twinpeaks.net.*;
import edu.indiana.lib.twinpeaks.search.*;
import edu.indiana.lib.twinpeaks.util.*;
+import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.net.*;
@@ -33,10 +34,9 @@
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class AssetIterator extends edu.indiana.lib.osid.base.repository.AssetIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(AssetIterator.class);
-
private org.osid.shared.Properties searchProperties;
private org.osid.shared.Id repositoryId;
/*
@@ -96,7 +96,7 @@ protected AssetIterator(String database,
}
catch (Throwable throwable)
{
- _log.error("AssetIterator() " + throwable);
+ log.error("AssetIterator() ", throwable);
throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.OPERATION_FAILED);
}
}
@@ -120,11 +120,11 @@ protected void initialize(org.osid.shared.Properties searchProperties) throws or
this.searchProperties = searchProperties;
- _log.debug("AssetIterator max = " + getMaximumRecords() + ", page = " + pageSize + ", start = " + startRecord);
+ log.debug("AssetIterator max = " + getMaximumRecords() + ", page = " + pageSize + ", start = " + startRecord);
}
catch (Throwable throwable)
{
- _log.error("initialize() " + throwable);
+ log.error("initialize() " + throwable);
throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.OPERATION_FAILED);
}
}
@@ -140,7 +140,7 @@ public boolean hasNextAsset()
{
boolean moreRecords;
- _log.debug("hasNextAsset: index=" + index
+ log.debug("hasNextAsset: index=" + index
+ ", maximum records=" + getMaximumRecords()
+ ", async init=" + StatusUtils.doingAsyncInit(sessionContext));
/*
@@ -154,7 +154,7 @@ public boolean hasNextAsset()
* Normal use, are there any more assets?
*/
moreRecords = (index < getMaximumRecords());
- _log.debug("AssetIterator.hasNext() = " + moreRecords);
+ log.debug("AssetIterator.hasNext() = " + moreRecords);
if (!moreRecords)
{
@@ -164,7 +164,7 @@ public boolean hasNextAsset()
}
catch (Throwable throwable)
{
- _log.error("hasNextAsset() " + throwable);
+ log.error("hasNextAsset() " + throwable);
throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.OPERATION_FAILED);
}
}
@@ -192,7 +192,7 @@ public org.osid.repository.Asset nextAsset()
/*
* Additional assets should be available from the server
*/
- _log.debug("nextAsset: index=" + index
+ log.debug("nextAsset: index=" + index
+ ", populated=" + populated
+ ", async init=" + StatusUtils.doingAsyncInit(sessionContext));
@@ -218,7 +218,7 @@ public org.osid.repository.Asset nextAsset()
}
catch (SessionTimeoutException sessionTimeoutException)
{
- _log.error("nextAsset() session timeout: " + sessionTimeoutException);
+ log.error("nextAsset() session timeout: " + sessionTimeoutException);
throw new MetasearchException(MetasearchException.SESSION_TIMED_OUT);
}
catch (SearchException searchException)
@@ -232,12 +232,12 @@ public org.osid.repository.Asset nextAsset()
/*
* Unexpected error
*/
- _log.error("nextAsset() search exception: " + searchException);
+ log.error("nextAsset() search exception: " + searchException);
throw new MetasearchException(MetasearchException.METASEARCH_ERROR);
}
catch (Throwable throwable)
{
- _log.error("nextAsset() general: ", throwable);
+ log.error("nextAsset() general: ", throwable);
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -245,7 +245,7 @@ public org.osid.repository.Asset nextAsset()
* Finally, return the next Asset from the queue
*/
asset = getAsset();
- _log.debug("AssetIterator.nextAsset() returns asset at index " + index + ", vector size = " + assetVectorSize());
+ log.debug("AssetIterator.nextAsset() returns asset at index " + index + ", vector size = " + assetVectorSize());
return asset;
}
@@ -390,7 +390,7 @@ record = asset.createRecord(RecordStructure.getInstance().getId());
addAsset(asset);
assetsAdded++;
-// _log.debug("populate() Added " + asset
+// log.debug("populate() Added " + asset
// + ", vector size = " + assetVectorSize()
// + ", populated = " + populated);
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ContributorPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ContributorPartStructure.java
index 08b03e9e524f..413565307c87 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ContributorPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ContributorPartStructure.java
@@ -25,13 +25,10 @@
* @version
*/
-
+
public class ContributorPartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
-
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(ContributorPartStructure.class);
-
private org.osid.shared.Id CONTRIBUTOR_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","contributor","Contributor");
private String displayName = "Contributor";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CoveragePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CoveragePartStructure.java
index 59e5c4441d5c..d1f59ccbd2cc 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CoveragePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CoveragePartStructure.java
@@ -26,8 +26,6 @@
*/
public class CoveragePartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(CoveragePartStructure.class);
-
private org.osid.shared.Id COVERAGE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","coverage","Coverage");
private String displayName = "Coverage";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CreatorPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CreatorPartStructure.java
index 2e94a5ee9ab3..88f2a7e30540 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CreatorPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/CreatorPartStructure.java
@@ -26,8 +26,6 @@
*/
public class CreatorPartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(CreatorPartStructure.class);
-
private org.osid.shared.Id CREATOR_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","creator","creator");
private String displayName = "Creator";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DOIPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DOIPartStructure.java
index 96762390ed6f..f353de2b0ec0 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DOIPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DOIPartStructure.java
@@ -19,8 +19,6 @@
public class DOIPartStructure implements org.osid.repository.PartStructure {
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(DOIPartStructure.class);
-
private org.osid.shared.Id DOI_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"doi", "Digital Object Identifier" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DatePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DatePartStructure.java
index 5ff5f7ab198c..3350d9560351 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DatePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DatePartStructure.java
@@ -26,9 +26,6 @@
*/
public class DatePartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(DatePartStructure.class);
-
-
private org.osid.shared.Id DATE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","date","Date");
private String displayName = "Date";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DateRetrievedPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DateRetrievedPartStructure.java
index ab5064fd4a6a..f7caaf82b6a5 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DateRetrievedPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/DateRetrievedPartStructure.java
@@ -3,10 +3,6 @@
public class DateRetrievedPartStructure
implements org.osid.repository.PartStructure
{
-
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(DateRetrievedPartStructure.class);
-
-
private org.osid.shared.Id DATE_RETRIEVED_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"dateRetrieved", "Date Retrieved" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EditionPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EditionPartStructure.java
index 94ef76ee19f6..5203783ca92a 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EditionPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EditionPartStructure.java
@@ -1,10 +1,10 @@
package edu.indiana.lib.osid.base.repository.http;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class EditionPartStructure implements org.osid.repository.PartStructure
{
-
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(EditionPartStructure.class);
-
private org.osid.shared.Id EDITION_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"edition", "Edition of resource container (i.e. book, 2nd edition)" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EndPagePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EndPagePartStructure.java
index 2d0e9fabac58..69ed5e3f95cb 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EndPagePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/EndPagePartStructure.java
@@ -19,8 +19,6 @@
public class EndPagePartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(EndPagePartStructure.class);
-
private org.osid.shared.Id END_PAGE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"endPage", "Page number that the resource content ends on" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/FormatPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/FormatPartStructure.java
index 47574fd454b7..1cabbf8a7dff 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/FormatPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/FormatPartStructure.java
@@ -26,8 +26,6 @@
*/
public class FormatPartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(FormatPartStructure.class);
-
private org.osid.shared.Id FORMAT_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","format");
private String displayName = "Format";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/InLineCitationPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/InLineCitationPartStructure.java
index 5a8cf01de3fe..2baa1fd7f8ab 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/InLineCitationPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/InLineCitationPartStructure.java
@@ -3,8 +3,6 @@
public class InLineCitationPartStructure
implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(InLineCitationPartStructure.class);
-
private org.osid.shared.Id INLINE_CITATION_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"inLineCitation", "In-line Citation from resource metadata" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IsnIdentifierPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IsnIdentifierPartStructure.java
index 5bf2689756bc..b2202e1be753 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IsnIdentifierPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IsnIdentifierPartStructure.java
@@ -20,8 +20,6 @@
public class IsnIdentifierPartStructure
implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(IsnIdentifierPartStructure.class);
-
private org.osid.shared.Id ISN_IDENTIFIER_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"isnIdentifier", "International Standard Number" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IssuePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IssuePartStructure.java
index 4a72c555f566..e3223374e53b 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IssuePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/IssuePartStructure.java
@@ -19,8 +19,6 @@
public class IssuePartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(IssuePartStructure.class);
-
private org.osid.shared.Id ISSUE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"issue", "Issue of resource container (i.e. Journal title, issue " +
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LanguagePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LanguagePartStructure.java
index 2312d6c34ddc..e1771ad56d30 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LanguagePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LanguagePartStructure.java
@@ -26,8 +26,6 @@
*/
public class LanguagePartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(LanguagePartStructure.class);
-
private org.osid.shared.Id LANGUAGE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","language","Language");
private String displayName = "Language";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Logger.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Logger.java
index fdcea17f8463..967f2f00c0de 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Logger.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Logger.java
@@ -36,7 +36,7 @@ public void initialize(org.osid.logging.WritableLog log)
}
/**
- * Log a message
+ * Logger a message
*/
public void log(String entry)
throws org.osid.repository.RepositoryException
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LongValueIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LongValueIterator.java
index e52ce91230b4..402a1e788765 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LongValueIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/LongValueIterator.java
@@ -26,8 +26,6 @@
*/
public class LongValueIterator extends edu.indiana.lib.osid.base.repository.LongValueIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(LongValueIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Managers.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Managers.java
index f112afd3d681..e60c8194b4fd 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Managers.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Managers.java
@@ -27,8 +27,6 @@
public class Managers extends edu.indiana.lib.osid.base.repository.Managers
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Managers.class);
-
private static Managers managers = new Managers();
private static org.osid.id.IdManager idManager = null;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/MetasearchException.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/MetasearchException.java
index bde5cc9028f7..c2ad90c8d87e 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/MetasearchException.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/MetasearchException.java
@@ -2,8 +2,6 @@
public class MetasearchException extends org.osid.repository.RepositoryException
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(MetasearchException.class);
-
public static final String SESSION_TIMED_OUT = "Metasearch session has " +
"timed out. Please restart your search session.";
public static final String METASEARCH_ERROR = "Metasearch error has occured. Please contact your site's support team.";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/NotePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/NotePartStructure.java
index 6b18b08c0646..d9fadc204656 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/NotePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/NotePartStructure.java
@@ -2,7 +2,6 @@
public class NotePartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(NotePartStructure.class);
private org.osid.shared.Id NOTE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"note", "Note attached to resource metadata" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ObjectIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ObjectIterator.java
index c768813a8067..0a053c9c382b 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ObjectIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/ObjectIterator.java
@@ -26,8 +26,6 @@
*/
public class ObjectIterator extends edu.indiana.lib.osid.base.repository.ObjectIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(ObjectIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/OpenUrlPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/OpenUrlPartStructure.java
index 4fccd6ecefb7..b65ea1300751 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/OpenUrlPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/OpenUrlPartStructure.java
@@ -19,8 +19,6 @@
public class OpenUrlPartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(OpenUrlPartStructure.class);
-
private org.osid.shared.Id OPENURL_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"openUrl", "OpenURL" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PagesPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PagesPartStructure.java
index d7f9c62db2e2..9905a9ff5a61 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PagesPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PagesPartStructure.java
@@ -2,8 +2,6 @@
public class PagesPartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(PagesPartStructure.class);
-
private org.osid.shared.Id PAGES_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"pages", "Pages" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Part.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Part.java
index 8cc542f8d8f1..72ee9570541a 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Part.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Part.java
@@ -20,14 +20,16 @@
* limitations under the License.
*
**********************************************************************************/
+
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class Part extends edu.indiana.lib.osid.base.repository.Part
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Part.class);
-
private org.osid.repository.PartStructure partStructure = null;
private org.osid.shared.Id partStructureId = null;
private java.io.Serializable value = null;
@@ -153,7 +155,7 @@ protected Part(org.osid.shared.Id partStructureId
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.repository.RepositoryException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartIterator.java
index f11100c596b4..c968e8b37dff 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartIterator.java
@@ -26,8 +26,6 @@
*/
public class PartIterator extends edu.indiana.lib.osid.base.repository.PartIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(PartIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartStructureIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartStructureIterator.java
index f3193056fec9..a9175c2d7aff 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartStructureIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PartStructureIterator.java
@@ -27,8 +27,6 @@
public class PartStructureIterator
implements org.osid.repository.PartStructureIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(PartStructureIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PreferredUrlPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PreferredUrlPartStructure.java
index f0bb65fbf9fd..c3ef1017ef12 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PreferredUrlPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PreferredUrlPartStructure.java
@@ -19,8 +19,6 @@
public class PreferredUrlPartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(PreferredUrlPartStructure.class);
-
private org.osid.shared.Id PREFERREDURL_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Properties.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Properties.java
index 5ccf12db6e2b..df8579894ca9 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Properties.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Properties.java
@@ -26,8 +26,6 @@
*/
public class Properties extends edu.indiana.lib.osid.base.repository.Properties
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Properties.class);
-
public org.osid.shared.ObjectIterator getKeys()
throws org.osid.shared.SharedException
{
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PropertiesIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PropertiesIterator.java
index 2f4e9d12a0a3..e80895e1ff46 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PropertiesIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PropertiesIterator.java
@@ -26,8 +26,6 @@
*/
public class PropertiesIterator extends edu.indiana.lib.osid.base.repository.PropertiesIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(PropertiesIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublicationLocationPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublicationLocationPartStructure.java
index de3b967a3fe3..248644d25e2d 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublicationLocationPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublicationLocationPartStructure.java
@@ -3,8 +3,6 @@
public class PublicationLocationPartStructure
implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(PublicationLocationPartStructure.class);
-
private org.osid.shared.Id PUBLICATION_LOCATION_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"publicationLocation", "Publication Location" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublisherPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublisherPartStructure.java
index 202f75f22306..5be3b5fb5bc6 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublisherPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/PublisherPartStructure.java
@@ -26,8 +26,6 @@
*/
public class PublisherPartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(PublisherPartStructure.class);
-
private org.osid.shared.Id PUBLISHER_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","publisher","Publisher");
private String displayName = "Publisher";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Record.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Record.java
index aff34f3d560f..0defdbea4ff3 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Record.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Record.java
@@ -20,14 +20,16 @@
* limitations under the License.
*
**********************************************************************************/
+
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class Record extends edu.indiana.lib.osid.base.repository.Record
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Record.class);
-
private java.util.Vector partVector = new java.util.Vector();
private org.osid.id.IdManager idManager = null;
private org.osid.shared.Id recordStructureId = null;
@@ -59,7 +61,7 @@ protected Record(org.osid.shared.Id recordStructureId
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -76,7 +78,7 @@ public org.osid.repository.Part createPart(org.osid.shared.Id partStructureId
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -99,7 +101,7 @@ public void deletePart(org.osid.shared.Id partId)
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -126,7 +128,7 @@ public org.osid.repository.RecordStructure getRecordStructure()
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordIterator.java
index 36e07286c693..33725c3ecccf 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordIterator.java
@@ -27,8 +27,6 @@
*/
public class RecordIterator extends edu.indiana.lib.osid.base.repository.RecordIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(RecordIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructure.java
index a8c41d423566..5092a466fdfc 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructure.java
@@ -20,14 +20,16 @@
* limitations under the License.
*
**********************************************************************************/
+
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class RecordStructure extends edu.indiana.lib.osid.base.repository.RecordStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(RecordStructure.class);
-
private String idString = "af106d4f201080006d751920168000100";
private String displayName = "Library Content";
private String description = "Holds metadata for an asset of no particular kind";
@@ -51,7 +53,7 @@ protected RecordStructure()
}
catch (Throwable t)
{
- _log.warn(t.getMessage());
+ log.warn(t.getMessage());
}
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructureIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructureIterator.java
index ad69eb873fc1..3ef52a92b235 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructureIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RecordStructureIterator.java
@@ -20,14 +20,16 @@
* limitations under the License.
*
**********************************************************************************/
+
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class RecordStructureIterator extends edu.indiana.lib.osid.base.repository.RecordStructureIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(RecordStructureIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RelationPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RelationPartStructure.java
index 6c1388549119..7b76e32c1541 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RelationPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RelationPartStructure.java
@@ -26,8 +26,6 @@
*/
public class RelationPartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(RelationPartStructure.class);
-
private org.osid.shared.Id RELATION_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","relation","Relation");
private String displayName = "Relation";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Repository.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Repository.java
index 65bee56085ae..24e5587fcdf3 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Repository.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Repository.java
@@ -13,15 +13,14 @@
import javax.xml.parsers.*;
+import lombok.extern.slf4j.Slf4j;
import org.w3c.dom.*;
import org.w3c.dom.html.*;
import org.xml.sax.*;
-
+@Slf4j
public class Repository extends edu.indiana.lib.osid.base.repository.Repository
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Repository.class);
-
private java.util.Vector assetVector = new java.util.Vector();
private org.osid.id.IdManager idManager = null;
@@ -75,20 +74,20 @@ protected Repository(String displayName,
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
}
if (this.id == null)
{
- _log.debug("Could not set HTTP Repository() " + displayName);
+ log.debug("Could not set HTTP Repository() " + displayName);
return;
}
- _log.debug("new HTTP Repository(): " + displayName + ", id: " + this.id);
+ log.debug("new HTTP Repository(): " + displayName + ", id: " + this.id);
try
{
- _log.debug(" HTTP Repository(): " + this.id.getIdString() + ", is equal? " + this.id.isEqual(idManager.getId(this.idString)));
+ log.debug(" HTTP Repository(): " + this.id.getIdString() + ", is equal? " + this.id.isEqual(idManager.getId(this.idString)));
}
catch (Throwable ignore) { }
}
@@ -128,7 +127,7 @@ public org.osid.shared.TypeIterator getAssetTypes()
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -167,7 +166,7 @@ public org.osid.shared.TypeIterator getSearchTypes()
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -183,7 +182,7 @@ public org.osid.shared.TypeIterator getStatusTypes()
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -281,7 +280,7 @@ public boolean validateAsset(org.osid.shared.Id assetId)
catch (Throwable throwable)
{
throwable.printStackTrace();
- _log.error(throwable.getMessage());
+ log.error(throwable.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
@@ -325,7 +324,7 @@ public org.osid.shared.PropertiesIterator getProperties()
}
catch (Throwable throwable)
{
- _log.error(throwable.getMessage());
+ log.error(throwable.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -373,7 +372,7 @@ public org.osid.shared.TypeIterator getPropertyTypes()
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -452,7 +451,7 @@ private org.osid.shared.Properties getStatusProperties(String sessionId)
statusMap.put(entry.getKey(), singleMap);
}
- _log.debug(this.getDisplayName() + ": " + active + " searches active");
+ log.debug(this.getDisplayName() + ": " + active + " searches active");
statusMap.put("databaseNames", dbList);
@@ -469,7 +468,7 @@ private org.osid.shared.Properties getStatusProperties(String sessionId)
}
catch (Throwable throwable)
{
- _log.error(throwable.getMessage());
+ log.error(throwable.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryIterator.java
index cc4f1a0707ea..694491114276 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryIterator.java
@@ -26,8 +26,6 @@
*/
public class RepositoryIterator extends edu.indiana.lib.osid.base.repository.RepositoryIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(RepositoryIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryManager.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryManager.java
index cf9a7d1ac96c..7964ff270d1e 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryManager.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RepositoryManager.java
@@ -5,6 +5,7 @@
import edu.indiana.lib.twinpeaks.search.*;
import edu.indiana.lib.twinpeaks.util.*;
+import lombok.extern.slf4j.Slf4j;
/**********************************************************************************
@@ -31,10 +32,9 @@
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class RepositoryManager extends edu.indiana.lib.osid.base.repository.RepositoryManager
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(RepositoryManager.class);
-
private org.osid.repository.Repository repository = null;
private org.osid.id.IdManager idManager = null;
private org.osid.OsidContext context = null;
@@ -85,7 +85,7 @@ public void assignConfiguration(java.util.Properties configuration)
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
finally
@@ -133,15 +133,15 @@ public void assignConfiguration(java.util.Properties configuration)
continue;
}
- _log.debug("name = " + ss.getName());
- _log.debug("description = " + ss.getDescription());
- _log.debug("id = " + ss.getId());
- _log.debug("authority = " + ss.getAuthority());
- _log.debug("domain = " + ss.getDomain());
- _log.debug("searchType = " + ss.getSearchType());
- _log.debug("query handler = " + ss.getQueryHandlerClassName());
- _log.debug("result handler = " + ss.getSearchResultHandlerClassName());
- _log.debug("osid context = " + this.context);
+ log.debug("name = " + ss.getName());
+ log.debug("description = " + ss.getDescription());
+ log.debug("id = " + ss.getId());
+ log.debug("authority = " + ss.getAuthority());
+ log.debug("domain = " + ss.getDomain());
+ log.debug("searchType = " + ss.getSearchType());
+ log.debug("query handler = " + ss.getQueryHandlerClassName());
+ log.debug("result handler = " + ss.getSearchResultHandlerClassName());
+ log.debug("osid context = " + this.context);
/*
* Set up the search-type and add the new Repository
*/
@@ -158,7 +158,7 @@ public void assignConfiguration(java.util.Properties configuration)
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
if (t instanceof org.osid.repository.RepositoryException)
{
@@ -222,7 +222,7 @@ public org.osid.repository.Repository getRepository(org.osid.shared.Id repositor
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -250,7 +250,7 @@ public org.osid.repository.Asset getAsset(org.osid.shared.Id assetId)
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID);
@@ -280,7 +280,7 @@ public org.osid.repository.Asset getAssetByDate(org.osid.shared.Id assetId
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID);
@@ -310,7 +310,7 @@ public org.osid.shared.LongValueIterator getAssetDates(org.osid.shared.Id assetI
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -343,14 +343,14 @@ public org.osid.repository.AssetIterator getAssetsBySearch(org.osid.repository.R
}
catch (Throwable t)
{
- _log.warn(t.getMessage());
+ log.warn(t.getMessage());
}
}
return new AssetIterator(results);
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -377,7 +377,7 @@ public org.osid.shared.TypeIterator getRepositoryTypes()
}
catch (Throwable t)
{
- _log.error(t.getMessage());
+ log.error(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RightsPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RightsPartStructure.java
index ccf1dc772e8e..0f0668db3909 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RightsPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/RightsPartStructure.java
@@ -18,9 +18,6 @@
*******************************************************************************/
public class RightsPartStructure implements org.osid.repository.PartStructure {
-
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(RightsPartStructure.class);
-
private org.osid.shared.Id RIGHTS_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "mit.edu", "partStructure",
"rights", "Rights" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SharedProperties.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SharedProperties.java
index 69986047288e..3036d2951321 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SharedProperties.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SharedProperties.java
@@ -3,8 +3,6 @@
public class SharedProperties
implements org.osid.shared.Properties
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(SharedProperties.class);
-
private java.util.Map map = new java.util.HashMap();
private org.osid.shared.Type type = new Type("edu.mit","shared","empty");
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourcePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourcePartStructure.java
index d7e82066fe4b..9757459f231c 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourcePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourcePartStructure.java
@@ -26,8 +26,6 @@
*/
public class SourcePartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(SourcePartStructure.class);
-
private org.osid.shared.Id SOURCE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","source");
private String displayName = "Source";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourceTitlePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourceTitlePartStructure.java
index fd03b9ebcea9..dfd9b74a6846 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourceTitlePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SourceTitlePartStructure.java
@@ -20,8 +20,6 @@
public class SourceTitlePartStructure
implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(SourceTitlePartStructure.class);
-
private org.osid.shared.Id SOURCE_TITLE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("sakaibrary", "partStructure",
"sourceTitle", "Source Title" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/StartPagePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/StartPagePartStructure.java
index 1056a4702406..944f993d94fd 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/StartPagePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/StartPagePartStructure.java
@@ -19,8 +19,6 @@
public class StartPagePartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(StartPagePartStructure.class);
-
private org.osid.shared.Id START_PAGE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"startPage", "Page number that resource content begins on" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SubjectPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SubjectPartStructure.java
index e45107652da5..19094dfe54aa 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SubjectPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/SubjectPartStructure.java
@@ -26,8 +26,6 @@
*/
public class SubjectPartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(SubjectPartStructure.class);
-
private org.osid.shared.Id SUBJECT_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","subject","Subject");
private String displayName = "Subject";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Type.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Type.java
index dc373c1614e7..e55e1dd4d55d 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Type.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/Type.java
@@ -26,8 +26,6 @@
*/
public class Type extends edu.indiana.lib.osid.base.repository.Type
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Type.class);
-
protected Type(String authority
, String domain
, String keyword
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypeIterator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypeIterator.java
index 967d06623774..ecbe6cbf8059 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypeIterator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypeIterator.java
@@ -26,8 +26,6 @@
*/
public class TypeIterator extends edu.indiana.lib.osid.base.repository.TypeIterator
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(TypeIterator.class);
-
private java.util.Vector vector = new java.util.Vector();
private int i = 0;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypePartStructure.java
index ddcd5fb3190b..ec8ae45d522e 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/TypePartStructure.java
@@ -26,8 +26,6 @@
*/
public class TypePartStructure extends edu.indiana.lib.osid.base.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(TypePartStructure.class);
-
private org.osid.shared.Id TYPE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","type","Type");
private String displayName = "Type";
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/URLPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/URLPartStructure.java
index e3611bd463ea..f0984e9b1d0d 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/URLPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/URLPartStructure.java
@@ -3,8 +3,6 @@
public class URLPartStructure
implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(URLPartStructure.class);
-
private org.osid.shared.Id URL_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "mit.edu", "partStructure",
"url", "URL associated with resource" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/VolumePartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/VolumePartStructure.java
index 128d76adf189..6fa13a2d9737 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/VolumePartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/VolumePartStructure.java
@@ -2,8 +2,6 @@
public class VolumePartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(VolumePartStructure.class);
-
private org.osid.shared.Id VOLUME_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"volume", "Volume number of source" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/YearPartStructure.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/YearPartStructure.java
index 3b8c7b0b69e8..2d994e0f147b 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/YearPartStructure.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/base/repository/http/YearPartStructure.java
@@ -2,8 +2,6 @@
public class YearPartStructure implements org.osid.repository.PartStructure
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(YearPartStructure.class);
-
private org.osid.shared.Id YEAR_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"year", "Year resource was created" );
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/component/id/Id.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/component/id/Id.java
index 7b7b5612f42e..6fcc651cdf7a 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/component/id/Id.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/osid/component/id/Id.java
@@ -21,15 +21,16 @@
package edu.indiana.lib.osid.component.id;
+import lombok.extern.slf4j.Slf4j;
+
import java.util.Random;
/**
* @inheritDoc
*/
+@Slf4j
public class Id implements org.osid.shared.Id
{
- private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils.getLog(Id.class);
-
private static long idBase = System.currentTimeMillis();
private String idString = null;
@@ -41,7 +42,7 @@ private synchronized long getIdBase()
private void log(String entry) throws org.osid.shared.SharedException
{
- _log.debug("Id: " + entry);
+ log.debug("Id: " + entry);
}
protected Id() throws org.osid.shared.SharedException
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpAuthenticator.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpAuthenticator.java
index 926c508731c0..956638ce0031 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpAuthenticator.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpAuthenticator.java
@@ -18,6 +18,7 @@
package edu.indiana.lib.twinpeaks.net;
import edu.indiana.lib.twinpeaks.util.*;
+import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.net.*;
@@ -36,10 +37,9 @@
* This only occurs until we successfully "log in" - after that, we are
* not invoked again for the site in question.
*/
+@Slf4j
public class HttpAuthenticator extends java.net.Authenticator {
-private static org.apache.commons.logging.Log _log = LogUtils.getLog(HttpAuthenticator.class);
-
private HashMap credentialMap = new HashMap();
/**
@@ -61,7 +61,7 @@ protected synchronized PasswordAuthentication getPasswordAuthentication() {
Credentials credential;
int attempts;
- _log.debug("Authorization requested for \""
+ log.debug("Authorization requested for \""
+ getRequestingPrompt()
+ "\", scheme: \""
+ getRequestingScheme()
@@ -71,7 +71,7 @@ protected synchronized PasswordAuthentication getPasswordAuthentication() {
credential = (Credentials) credentialMap.get(getRequestingPrompt());
if (credential == null) {
- _log.warn("No credentials configured");
+ log.warn("No credentials configured");
return null;
}
@@ -87,10 +87,10 @@ protected synchronized PasswordAuthentication getPasswordAuthentication() {
if ((attempts % 3) == 0) {
credential.setAuthorizationAttempts(0);
}
- _log.warn("Authorization refused");
+ log.warn("Authorization refused");
return null;
}
- _log.warn("Returning credentials for authorization");
+ log.warn("Returning credentials for authorization");
return new PasswordAuthentication(credential.getUsername(),
credential.getPassword());
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpTransaction.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpTransaction.java
index f5b09cf35574..b7b0923fd750 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpTransaction.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/net/HttpTransaction.java
@@ -18,16 +18,12 @@
package edu.indiana.lib.twinpeaks.net;
import edu.indiana.lib.twinpeaks.util.*;
+import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.net.*;
import java.util.*;
-import javax.xml.parsers.*;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
/**
* Handle HTTP based search operations. Send (POST or GET) a query to the
* server, read up the response.
@@ -35,10 +31,8 @@
* The response text and HTTP details (status, character set, etc) are made
* available to caller.
*/
+@Slf4j
public class HttpTransaction {
-
-private static org.apache.commons.logging.Log _log = LogUtils.getLog(HttpTransaction.class);
-
/**
* Agent identification, HTTP form submission types
*/
@@ -316,12 +310,12 @@ private String getResponseCharacterSet(boolean verify) {
}
contentType = connection.getContentType();
- _log.debug("ContentType = " + contentType);
+ log.debug("ContentType = " + contentType);
index = (contentType == null) ? -1 : contentType.toLowerCase().indexOf(CHARSETEQ);
if (index == -1) {
- _log.debug("return default character set: "
+ log.debug("return default character set: "
+ getDefaultCharacterSet());
return getDefaultCharacterSet();
}
@@ -340,7 +334,7 @@ private String getResponseCharacterSet(boolean verify) {
break;
}
}
- _log.debug("character set = "
+ log.debug("character set = "
+ ((buffer.length() == 0) ? getDefaultCharacterSet()
: buffer.toString()));
return (buffer.length() == 0) ? getDefaultCharacterSet() : buffer.toString();
@@ -573,7 +567,7 @@ public int doTransaction() throws IOException, DomException {
/*
* Get connection, set transaction characteristics
*/
- _log.debug("*** CONNECTING to URL: " + this.url.toString());
+ log.debug("*** CONNECTING to URL: " + this.url.toString());
reset();
connection = getConnection();
@@ -586,7 +580,7 @@ public int doTransaction() throws IOException, DomException {
*/
clientCookie = setRequestCookies();
if (clientCookie.length() > 0) {
- _log.debug("Cookie: " + clientCookie);
+ log.debug("Cookie: " + clientCookie);
connection.setRequestProperty("Cookie", clientCookie);
}
/*
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/HttpTransactionQueryBase.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/HttpTransactionQueryBase.java
index 1939367d673c..d5b06371b9fb 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/HttpTransactionQueryBase.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/HttpTransactionQueryBase.java
@@ -20,26 +20,19 @@
import edu.indiana.lib.twinpeaks.net.*;
import edu.indiana.lib.twinpeaks.util.*;
-import java.io.*;
import java.net.*;
import java.util.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.xml.parsers.*;
-
+import lombok.extern.slf4j.Slf4j;
import org.w3c.dom.*;
-import org.xml.sax.*;
/**
* Base class for HTTP search activities
*/
+@Slf4j
public abstract class HttpTransactionQueryBase
extends QueryBase
implements HttpTransactionQueryInterface {
-
- private static org.apache.commons.logging.Log _log = LogUtils.getLog(HttpTransactionQueryBase.class);
-
/**
* Name of the cookie List (stored with session context)
*/
@@ -434,7 +427,7 @@ public int submit() throws SearchException {
return status;
} catch (Exception exception) {
- _log.error("Exception seen, the current URL is \"" + getUrl() + "\"");
+ log.error("Exception seen, the current URL is \"" + getUrl() + "\"");
exception.printStackTrace(System.out);
throw new SearchException(exception.toString());
}
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/MatchItem.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/MatchItem.java
index 9dfb62f0c32e..88cc04d03099 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/MatchItem.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/MatchItem.java
@@ -22,6 +22,7 @@
import java.io.*;
import java.util.*;
+import lombok.extern.slf4j.Slf4j;
import org.osid.repository.Asset;
import org.osid.repository.AssetIterator;
import org.osid.repository.Record;
@@ -33,11 +34,9 @@
/**
* Encapsulate one matching search item
*/
+@Slf4j
public class MatchItem
{
-
-private static org.apache.commons.logging.Log _log = LogUtils.getLog(MatchItem.class);
-
private String _database;
private String _displayName;
private String _description;
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/PreferredUrlHandler.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/PreferredUrlHandler.java
index 5328c652df13..58f87c1acb3d 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/PreferredUrlHandler.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/PreferredUrlHandler.java
@@ -39,7 +39,6 @@
*/
public class PreferredUrlHandler
{
- private static org.apache.commons.logging.Log _log = LogUtils.getLog(PreferredUrlHandler.class);
/**
* American Social History Online
*/
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/QueryBase.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/QueryBase.java
index ed239c338b80..70bb839ca934 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/QueryBase.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/QueryBase.java
@@ -23,6 +23,7 @@
import javax.servlet.*;
import javax.servlet.http.*;
+import lombok.extern.slf4j.Slf4j;
import org.w3c.dom.*;
/**
@@ -33,9 +34,8 @@
* and implement appropriate methods. See HttpTransactionQueryBase.java
* for an example.
*/
+@Slf4j
public abstract class QueryBase implements QueryInterface {
-
- private static org.apache.commons.logging.Log _log = LogUtils.getLog(QueryBase.class);
/*
* Request parameters
*/
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchResultBase.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchResultBase.java
index 996e92879387..dabbc9bc953b 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchResultBase.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchResultBase.java
@@ -19,25 +19,20 @@
import edu.indiana.lib.twinpeaks.util.*;
+import lombok.extern.slf4j.Slf4j;
import org.osid.repository.AssetIterator;
-import java.io.*;
import java.net.*;
import java.util.*;
-import javax.xml.parsers.*;
-
import org.w3c.dom.*;
-import org.w3c.dom.html.*;
-import org.xml.sax.*;
/**
* Result rendering - base class and helpers
*/
+@Slf4j
public abstract class SearchResultBase implements SearchResultInterface
{
- private static org.apache.commons.logging.Log _log = LogUtils.getLog(SearchResultBase.class);
-
/**
* Parse the search engine response and expose pertinent results
*/
@@ -128,7 +123,7 @@ public void setSearchStart(String start) {
try {
_start = Integer.parseInt(start);
} catch (NumberFormatException exception) {
- _log.warn("Invalid number format: " + start);
+ log.warn("Invalid number format: " + start);
return;
}
}
@@ -286,7 +281,7 @@ public String getFullUrl(String urlFragment) {
public String prependProxy(String url, String proxy) {
StringBuilder fullUrl;
- _log.debug("prependProxy: proxy [" + proxy + "] vs. [" + url + "]");
+ log.debug("prependProxy: proxy [" + proxy + "] vs. [" + url + "]");
if (StringUtils.isNull(proxy)) {
return url;
@@ -322,7 +317,7 @@ public boolean expectedNodeCount(NodeList nodeList, int expected) {
tag = nodeList.item(0).getNodeName();
}
- _log.debug("Unexpected "
+ log.debug("Unexpected "
+ tag
+ " count: "
+ length
diff --git a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchSource.java b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchSource.java
index 1884a52a57b4..8f4f4c33bb5a 100644
--- a/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchSource.java
+++ b/citations/citations-osid/web2bridge/src/java/edu/indiana/lib/twinpeaks/search/SearchSource.java
@@ -17,21 +17,16 @@
**********************************************************************************/
package edu.indiana.lib.twinpeaks.search;
-import edu.indiana.lib.twinpeaks.search.*;
import edu.indiana.lib.twinpeaks.util.*;
import java.io.*;
-import java.net.*;
import java.util.*;
-import java.text.*;
+import lombok.extern.slf4j.Slf4j;
import org.w3c.dom.*;
-
+@Slf4j
public class SearchSource {
-
- private static org.apache.commons.logging.Log _log = LogUtils.getLog(SearchSource.class);
-
/**
* This source is enabled (available for use)
*/
@@ -110,7 +105,7 @@ private SearchSource(String name,
_parameterMap = parameterMap;
_flags = flags;
- _log.debug("*************** name + parameters = " + _parameterMap);
+ log.debug("*************** name + parameters = {}", _parameterMap);
}
/**
@@ -373,28 +368,28 @@ public static void populate(InputStream xmlStream) throws DomException, SearchEx
/*
* Only set the configuration once
*/
- _log.debug("SearchSource.populate() starts --------------------------");
+ log.debug("SearchSource.populate() starts --------------------------");
synchronized (_sourceSync)
{
if (_sourceList != null)
{
- _log.debug("No action required");
+ log.debug("No action required");
return;
}
_sourceList = new ArrayList();
- _log.debug("Populating configuration");
+ log.debug("Populating configuration");
/*
* Parse the configuration file
*/
try
{
document = DomUtils.parseXmlStream(xmlStream);
- _log.info(DomUtils.serialize(document));
+ log.info(DomUtils.serialize(document));
}
catch (Exception exception)
{
- _log.error("DOM parse exception");
+ log.error("DOM parse exception");
exception.printStackTrace();
throw new RuntimeException("DOM error");
}
@@ -424,53 +419,53 @@ public static void populate(InputStream xmlStream) throws DomException, SearchEx
sourceName = sourceElement.getAttribute("name");
if (StringUtils.isNull(sourceName)) {
- _log.warn("Skipping un-named
*/
-
+@Slf4j
public class OsidLoader implements java.io.Serializable {
private static final long serialVersionUID = 1L;
-
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.loader.OsidLoader" );
/**
* Returns an instance of the org.osid.OsidManager of the OSID specified by the OSID
@@ -160,11 +159,11 @@ public static org.osid.OsidManager getManager(
String managerClassName = makeFullyQualifiedClassName(implPackageName,
className);
- LOG.debug( "osid interface name: " + osidInterfaceName);
+ log.debug( "osid interface name: " + osidInterfaceName);
Class osidInterface = Class.forName(osidInterfaceName);
if (null != osidInterface) {
- LOG.debug("osid manager class name: " + managerClassName);
+ log.debug("osid manager class name: " + managerClassName);
Class managerClass = Class.forName(managerClassName);
if (null != managerClass) {
@@ -208,7 +207,7 @@ public static org.osid.OsidManager getManager(
}
manager.assignConfiguration( configuration );
- LOG.debug( "configuration has been assigned done." );
+ log.debug( "configuration has been assigned done." );
return manager;
} catch (Exception ex) {
@@ -230,10 +229,10 @@ public static org.osid.OsidManager getManager(
throw new org.osid.OsidException(org.osid.OsidException.NULL_ARGUMENT);
} catch (org.osid.OsidException oex) {
- LOG.error( oex.getMessage() );
+ log.error( oex.getMessage() );
throw new org.osid.OsidException(oex.getMessage());
} catch (java.lang.Throwable ex) {
- LOG.error( ex.getMessage() );
+ log.error( ex.getMessage() );
throw new org.osid.OsidException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -345,9 +344,9 @@ private static java.util.Properties getConfiguration(
properties.load(is);
}
- LOG.debug( "Read osid manager properties from: " + propertyName );
+ log.debug( "Read osid manager properties from: " + propertyName );
} catch (Throwable ex) {
- LOG.error( "Error reading " + propertyName + " property file --" +
+ log.error( "Error reading " + propertyName + " property file --" +
ex.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Asset.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Asset.java
index 191fbe27f66b..cc2a515fdbee 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Asset.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Asset.java
@@ -21,15 +21,14 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class Asset implements org.osid.repository.Asset
{
-
private static final long serialVersionUID = 1L;
private org.osid.id.IdManager idManager = Managers.getIdManager();
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.Asset" );
// Types
private org.osid.shared.Type assetType = new Type( "sakaibrary", "asset",
@@ -61,7 +60,7 @@ protected Asset(String displayName
}
catch (Throwable t)
{
- LOG.warn( t.getMessage() );
+ log.warn( t.getMessage() );
}
}
@@ -158,7 +157,7 @@ public org.osid.repository.Record createRecord(org.osid.shared.Id recordStructur
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -199,7 +198,7 @@ public void deleteRecord(org.osid.shared.Id recordId)
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -223,7 +222,7 @@ public org.osid.repository.RecordIterator getRecordsByRecordStructure(org.osid.s
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -269,7 +268,7 @@ public org.osid.repository.Record getRecord(org.osid.shared.Id recordId)
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -300,7 +299,7 @@ public org.osid.repository.Part getPart(org.osid.shared.Id partId)
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -339,7 +338,7 @@ public org.osid.repository.PartIterator getPartByPart(org.osid.shared.Id partStr
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -359,7 +358,7 @@ public org.osid.shared.ObjectIterator getPartValueByPart(org.osid.shared.Id part
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -408,7 +407,7 @@ public org.osid.shared.ObjectIterator getPartValuesByPartStructure(org.osid.shar
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -441,7 +440,7 @@ public org.osid.repository.PartIterator getPartsByPartStructure(org.osid.shared.
}
catch (Throwable t)
{
- LOG.warn( t.getMessage() );
+ log.warn( t.getMessage() );
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetIterator.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetIterator.java
index 24b8f00ef11c..7a30d9584424 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetIterator.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetIterator.java
@@ -27,6 +27,7 @@
import javax.xml.parsers.ParserConfigurationException;
+import lombok.extern.slf4j.Slf4j;
import org.sakaibrary.xserver.session.MetasearchSession;
import org.sakaibrary.xserver.session.MetasearchSessionManager;
import org.xml.sax.SAXException;
@@ -36,6 +37,7 @@
* @author gbhatnag
* @version
*/
+@Slf4j
public class AssetIterator extends org.xml.sax.helpers.DefaultHandler
implements org.osid.repository.AssetIterator {
/*
@@ -46,9 +48,6 @@ public class AssetIterator extends org.xml.sax.helpers.DefaultHandler
private static final long serialVersionUID = 1L;
private static final String REGULAR_EXPRESSION_FILE = "/data/citationRegex.txt";
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.AssetIterator" );
private java.util.LinkedList assetQueue;
private java.util.ArrayList regexArray;
@@ -93,7 +92,7 @@ protected AssetIterator( String guid )
try {
regexArray = loadCitationRegularExpressions( REGULAR_EXPRESSION_FILE );
} catch( java.io.IOException ioe ) {
- LOG.warn( "AssetIterator() failed reading citation regular " +
+ log.warn( "AssetIterator() failed reading citation regular " +
"expressions - regex file: " + REGULAR_EXPRESSION_FILE, ioe );
}
}
@@ -140,7 +139,7 @@ public boolean hasNextAsset()
xserver.updateSearchStatusProperties();
statusProperties = xserver.getSearchStatusProperties();
} catch( org.sakaibrary.xserver.XServerException xse ) {
- LOG.warn( "X-Server error: " + xse.getErrorCode() +
+ log.warn( "X-Server error: " + xse.getErrorCode() +
" - " + xse.getErrorText() );
// throw exception now that status has been updated
@@ -155,7 +154,7 @@ public boolean hasNextAsset()
try {
status = ( String ) statusProperties.getProperty( "status" );
} catch( org.osid.shared.SharedException se ) {
- LOG.warn( "hasNextAsset() failed getting status " +
+ log.warn( "hasNextAsset() failed getting status " +
"property", se );
}
@@ -174,7 +173,7 @@ public boolean hasNextAsset()
return false;
}
} else {
- LOG.warn( "hasNextAsset() - status property is null" );
+ log.warn( "hasNextAsset() - status property is null" );
}
// get updated metasearchSession
@@ -200,7 +199,7 @@ public boolean hasNextAsset()
public org.osid.repository.Asset nextAsset()
throws org.osid.repository.RepositoryException {
- LOG.debug( "nextAsset() [entry] - returned: " + numRecordsReturned + "; total: " +
+ log.debug( "nextAsset() [entry] - returned: " + numRecordsReturned + "; total: " +
totalRecordsCursor + "; in queue: " + assetQueue.size() );
// return Asset, if ready
@@ -218,7 +217,7 @@ public org.osid.repository.Asset nextAsset()
try {
status = ( String ) statusProperties.getProperty( "status" );
} catch( org.osid.shared.SharedException se ) {
- LOG.warn( "nextAsset() failed getting status property", se );
+ log.warn( "nextAsset() failed getting status property", se );
}
if( status == null || !status.equals( "ready" ) ) {
@@ -236,12 +235,12 @@ public org.osid.repository.Asset nextAsset()
org.sakaibrary.xserver.XServer xserver =
new org.sakaibrary.xserver.XServer( guid );
- LOG.debug( "nextAsset() calling XServer.getRecordsXML() - assets in " +
+ log.debug( "nextAsset() calling XServer.getRecordsXML() - assets in " +
"queue: " + assetQueue.size() );
createAssets( xserver.getRecordsXML( totalRecordsCursor ),
repositoryId );
} catch( org.sakaibrary.xserver.XServerException xse ) {
- LOG.warn( "X-Server error: " + xse.getErrorCode() + " - " +
+ log.warn( "X-Server error: " + xse.getErrorCode() + " - " +
xse.getErrorText() );
//
// Have all (or too many) records been merged? If so, indicate
@@ -250,7 +249,7 @@ public org.osid.repository.Asset nextAsset()
if ((xse.getErrorCodeIntValue() == XSERVER_ERROR_MERGE_LIMIT) ||
(xse.getErrorCodeIntValue() == XSERVER_ERROR_ALL_MERGED))
{
- LOG.debug("nextAsset(), Xserver Error "
+ log.debug("nextAsset(), Xserver Error "
+ xse.getErrorCodeIntValue()
+ ", throwing NO_MORE_ITERATOR_ELEMENTS");
@@ -264,7 +263,7 @@ public org.osid.repository.Asset nextAsset()
org.sakaibrary.osid.repository.xserver.MetasearchException.
METASEARCH_ERROR );
}
- LOG.debug( "nextAsset(), XServer.getRecordsXML() returns - assets in " +
+ log.debug( "nextAsset(), XServer.getRecordsXML() returns - assets in " +
"queue: " + assetQueue.size() );
//
// Make sure there really is an asset available - if not, signal "end-of-file"
@@ -274,7 +273,7 @@ public org.osid.repository.Asset nextAsset()
//
if (assetQueue.size() == 0)
{
- LOG.debug("nextAsset(), An asset is expected, but the asset queue is enpty");
+ log.debug("nextAsset(), An asset is expected, but the asset queue is enpty");
throw new org.osid.repository.RepositoryException(
org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
@@ -332,7 +331,7 @@ private void createAssets( java.io.ByteArrayInputStream xml,
}
// Error generated by the parser
- LOG.warn("createAssets() parsing exception: " +
+ log.warn("createAssets() parsing exception: " +
spe.getMessage() + " - xml line " + spe.getLineNumber() +
", uri " + spe.getSystemId(), x );
} catch (SAXException sxe) {
@@ -344,14 +343,14 @@ private void createAssets( java.io.ByteArrayInputStream xml,
x = sxe.getException();
}
- LOG.warn( "createAssets() SAX exception: " + sxe.getMessage(), x );
+ log.warn( "createAssets() SAX exception: " + sxe.getMessage(), x );
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
- LOG.warn( "createAssets() SAX parser cannot be built with " +
+ log.warn( "createAssets() SAX parser cannot be built with " +
"specified options" );
} catch (IOException ioe) {
// I/O error
- LOG.warn( "createAssets() IO exception", ioe );
+ log.warn( "createAssets() IO exception", ioe );
}
}
@@ -414,7 +413,7 @@ private void populateAssetFromText( String elementName ) {
// create a new record
record = asset.createRecord( recordStructureId );
} catch( org.osid.repository.RepositoryException re ) {
- LOG.warn( "populateAssetFromText() failed to " +
+ log.warn( "populateAssetFromText() failed to " +
"create new Asset/Record pair.", re );
}
} else if( elementName.equals( "record" ) ) {
@@ -432,7 +431,7 @@ record = asset.createRecord( recordStructureId );
doRegexParse( ( String )inLineCitation.getValue() );
}
} catch( org.osid.repository.RepositoryException re ) {
- LOG.warn( "populateAssetFromText() failed to " +
+ log.warn( "populateAssetFromText() failed to " +
"gracefully process inLineCitation value.", re );
}
@@ -444,7 +443,7 @@ record = asset.createRecord( recordStructureId );
if ((preferredUrlFormat != null) &&
!(preferredUrlFormat.equalsIgnoreCase("HTML")))
{
- LOG.debug("Unexpected URL format: " + preferredUrlFormat);
+ log.debug("Unexpected URL format: " + preferredUrlFormat);
}
if ((preferredUrlFormat == null) ||
@@ -457,7 +456,7 @@ record = asset.createRecord( recordStructureId );
}
catch( org.osid.repository.RepositoryException exception)
{
- LOG.warn("Failed to create preferred URL Part", exception);
+ log.warn("Failed to create preferred URL Part", exception);
}
finally
{
@@ -551,7 +550,7 @@ record = asset.createRecord( recordStructureId );
text );
}
} catch( org.osid.repository.RepositoryException re ) {
- LOG.warn( "populateAssetFromText() failed to " +
+ log.warn( "populateAssetFromText() failed to " +
"create new Part.", re );
}
@@ -582,7 +581,7 @@ private void setDateRetrieved() {
record.createPart( DateRetrievedPartStructure.getInstance().getId(),
dateRetrieved );
} catch( org.osid.repository.RepositoryException re ) {
- LOG.warn( "setDateRetrieved() failed " +
+ log.warn( "setDateRetrieved() failed " +
"creating new dateRetrieved Part.", re );
}
}
@@ -607,7 +606,7 @@ private org.osid.repository.Part recordHasPart(
}
}
} catch( org.osid.repository.RepositoryException re ) {
- LOG.warn( "recordHasPart() failed getting Parts.", re );
+ log.warn( "recordHasPart() failed getting Parts.", re );
}
// did not find the Part
@@ -980,7 +979,7 @@ private void doRegexParse( String citation ) {
}
}
} catch( org.osid.repository.RepositoryException re ) {
- LOG.warn( "doRegexParse() failed getting " +
+ log.warn( "doRegexParse() failed getting " +
"PartStructure Types.", re );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetPresentationBean.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetPresentationBean.java
index 82462103ef5f..24f78e9e988a 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetPresentationBean.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/AssetPresentationBean.java
@@ -21,6 +21,7 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
import org.sakaibrary.osid.repository.xserver.CreatorPartStructure;
import org.sakaibrary.osid.repository.xserver.DatePartStructure;
import org.sakaibrary.osid.repository.xserver.PagesPartStructure;
@@ -33,12 +34,10 @@
*
* @author gbhatnag
*/
+@Slf4j
public class AssetPresentationBean implements java.io.Serializable {
private static final long serialVersionUID = 1L;
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.AssetPresentationBean" );
private org.osid.repository.Asset asset;
private String assetId;
@@ -70,7 +69,7 @@ public AssetPresentationBean( org.osid.repository.Asset asset ) {
}
}
} catch( Throwable t ) {
- LOG.warn( "AssetPresentationBean() failed to loop through Asset, " +
+ log.warn( "AssetPresentationBean() failed to loop through Asset, " +
"Record, Parts: " + t.getMessage(), t );
}
@@ -141,4 +140,4 @@ public String getUrl() throws org.osid.repository.RepositoryException,
public java.util.ArrayList getParts() {
return parts;
}
-}
\ No newline at end of file
+}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/CreatorPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/CreatorPartStructure.java
index 09760e7ef35b..9352db8564db 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/CreatorPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/CreatorPartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class CreatorPartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.CreatorPartStructure" );
-
private org.osid.shared.Id CREATOR_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "mit.edu", "partStructure",
"creator", "Creator" );
@@ -46,7 +45,7 @@ private CreatorPartStructure()
this.CREATOR_PART_STRUCTURE_ID = Managers.getIdManager().getId(
"b197541f201080006d751920168000100");
} catch (Throwable t) {
- LOG.warn( "CreatorPartStructure() failed to get partStructure id: "
+ log.warn( "CreatorPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DOIPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DOIPartStructure.java
index 44464c29b219..0fadb26e49f5 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DOIPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DOIPartStructure.java
@@ -21,10 +21,10 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class DOIPartStructure implements org.osid.repository.PartStructure {
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.DOIPartStructure" );
private org.osid.shared.Id DOI_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
@@ -43,7 +43,7 @@ private DOIPartStructure()
this.DOI_PART_STRUCTURE_ID = Managers.getIdManager().getId(
"8na2340898wna345f5467ks72hk0001ff");
} catch (Throwable t) {
- LOG.warn( "DOIPartStructure() failed to get partStructure id: "
+ log.warn( "DOIPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DatePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DatePartStructure.java
index 93403b23a742..7d45c6436a7f 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DatePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DatePartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class DatePartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.DatePartStructure" );
-
private org.osid.shared.Id DATE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "mit.edu", "partStructure",
"date", "Date" );
@@ -45,7 +44,7 @@ private DatePartStructure()
this.DATE_PART_STRUCTURE_ID = Managers.getIdManager().getId(
"983287r98y32lala02387923gf470appl");
} catch (Throwable t) {
- LOG.warn( "DatePartStructure() failed to get partStructure id: "
+ log.warn( "DatePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DateRetrievedPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DateRetrievedPartStructure.java
index aaeca7b7a95a..cd41c1458ac6 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DateRetrievedPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/DateRetrievedPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class DateRetrievedPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.DateRetrievedPartStructure" );
-
private org.osid.shared.Id DATE_RETRIEVED_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"dateRetrieved", "Date Retrieved" );
@@ -46,7 +45,7 @@ private DateRetrievedPartStructure()
this.DATE_RETRIEVED_PART_STRUCTURE_ID = Managers.getIdManager().getId(
"b1asbd8f09s3450909751910168500100");
} catch (Throwable t) {
- LOG.warn( "DateRetrievedPartStructure() failed to get partStructure id: "
+ log.warn( "DateRetrievedPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EditionPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EditionPartStructure.java
index cd573d1a181a..13830cf13274 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EditionPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EditionPartStructure.java
@@ -21,11 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class EditionPartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.EditionPartStructure" );
private org.osid.shared.Id EDITION_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
@@ -45,7 +45,7 @@ private EditionPartStructure()
this.EDITION_PART_STRUCTURE_ID = Managers.getIdManager().getId(
"09dfgljk2398dfknj98ewh34268000100");
} catch (Throwable t) {
- LOG.warn( "EditionPartStructure() failed to get partStructure id: "
+ log.warn( "EditionPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EndPagePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EndPagePartStructure.java
index affdabd9707a..4fa808a6e666 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EndPagePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/EndPagePartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class EndPagePartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.EndPagePartStructure" );
-
private org.osid.shared.Id END_PAGE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"endPage", "Page number that the resource content ends on" );
@@ -44,7 +43,7 @@ private EndPagePartStructure()
this.END_PAGE_PART_STRUCTURE_ID = Managers.getIdManager().getId(
"x323sd84h8kr98239823h543tg0982340");
} catch (Throwable t) {
- LOG.warn( "EndPagePartStructure() failed to get partStructure id: "
+ log.warn( "EndPagePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/InLineCitationPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/InLineCitationPartStructure.java
index ecd972926f0e..d2820786f5a7 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/InLineCitationPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/InLineCitationPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class InLineCitationPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.InLineCitationPartStructure" );
-
private org.osid.shared.Id INLINE_CITATION_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"inLineCitation", "In-line Citation from resource metadata" );
@@ -48,7 +47,7 @@ private InLineCitationPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "InLineCitationPartStructure() failed to get partStructure id: "
+ log.warn( "InLineCitationPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IsnIdentifierPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IsnIdentifierPartStructure.java
index bb3aa9d77630..29bf524b4070 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IsnIdentifierPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IsnIdentifierPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class IsnIdentifierPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.IsnIdentifierPartStructure" );
-
private org.osid.shared.Id ISN_IDENTIFIER_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"isnIdentifier", "International Standard Number" );
@@ -49,7 +48,7 @@ private IsnIdentifierPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "IsnIdentifierPartStructure() failed to get partStructure id: "
+ log.warn( "IsnIdentifierPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IssuePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IssuePartStructure.java
index b3083aaded54..66591fe7f407 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IssuePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/IssuePartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class IssuePartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.IssuePartStructure" );
-
private org.osid.shared.Id ISSUE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"issue", "Issue of resource container (i.e. Journal title, issue " +
@@ -49,7 +48,7 @@ private IssuePartStructure()
}
catch (Throwable t)
{
- LOG.warn( "IssuePartStructure() failed to get partStructure id: "
+ log.warn( "IssuePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LanguagePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LanguagePartStructure.java
index 7bfd5ca840c9..466d74b19235 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LanguagePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LanguagePartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class LanguagePartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.LanguagePartStructure" );
-
private org.osid.shared.Id LANGUAGE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","language","Language");
private String displayName = "Language";
@@ -46,7 +45,7 @@ private LanguagePartStructure()
}
catch (Throwable t)
{
- LOG.warn( "LanguagePartStructure() failed to get partStructure id: "
+ log.warn( "LanguagePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LocIdentifierPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LocIdentifierPartStructure.java
index 74249d7f4961..59709613d4f6 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LocIdentifierPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/LocIdentifierPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class LocIdentifierPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.LocIdentifierPartStructure" );
-
private org.osid.shared.Id LOC_IDENTIFIER_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"locIdentifier", "Library of Congress call number" );
@@ -48,7 +47,7 @@ private LocIdentifierPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "LocIdentifierPartStructure() failed to get partStructure id: "
+ log.warn( "LocIdentifierPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/NotePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/NotePartStructure.java
index be858694c2e8..8fd868f9d45f 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/NotePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/NotePartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class NotePartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.NotePartStructure" );
-
private org.osid.shared.Id NOTE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"note", "Note attached to resource metadata" );
@@ -48,7 +47,7 @@ private NotePartStructure()
}
catch (Throwable t)
{
- LOG.warn( "NotePartStructure() failed to get partStructure id: "
+ log.warn( "NotePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/OpenUrlPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/OpenUrlPartStructure.java
index f3f0440ff065..c5ab4ad78e2f 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/OpenUrlPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/OpenUrlPartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class OpenUrlPartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.OpenUrlPartStructure" );
-
private org.osid.shared.Id OPENURL_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"openUrl", "OpenURL" );
@@ -49,7 +48,7 @@ private OpenUrlPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "OpenUrlPartStructure() failed to get partStructure id: "
+ log.warn( "OpenUrlPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PagesPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PagesPartStructure.java
index 5222e4704dc8..adb01cde8b6c 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PagesPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PagesPartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class PagesPartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.PagesPartStructure" );
-
private org.osid.shared.Id PAGES_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"pages", "Pages" );
@@ -44,7 +43,7 @@ private PagesPartStructure()
this.PAGES_PART_STRUCTURE_ID = Managers.getIdManager().getId(
"9jkds919283123b9sp6578909654sa88x" );
} catch( Throwable t ) {
- LOG.warn( "PagesPartStructure() failed to get partStructure id: "
+ log.warn( "PagesPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Part.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Part.java
index 1308001164d4..3dce371e9dd6 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Part.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Part.java
@@ -21,17 +21,16 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class Part
implements org.osid.repository.Part
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.Part" );
-
private org.osid.repository.PartStructure partStructure = null;
private org.osid.shared.Id partStructureId = null;
private java.io.Serializable value = null;
@@ -126,7 +125,7 @@ protected Part(org.osid.shared.Id partStructureId
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.repository.RepositoryException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PreferredUrlPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PreferredUrlPartStructure.java
index a40a2e3575a5..02de253a4bee 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PreferredUrlPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PreferredUrlPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class PreferredUrlPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.PreferredUrlPartStructure" );
-
private org.osid.shared.Id URL_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"preferredUrl", "PreferredURL" );
@@ -49,7 +48,7 @@ private PreferredUrlPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "PreferredUrlPartStructure() failed to get partStructure id: "
+ log.warn( "PreferredUrlPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublicationLocationPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublicationLocationPartStructure.java
index 2da66f00fe35..faeab146ee6c 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublicationLocationPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublicationLocationPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class PublicationLocationPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.PublicationLocationPartStructure" );
-
private org.osid.shared.Id PUBLICATION_LOCATION_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"publicationLocation", "Publication Location" );
@@ -50,7 +49,7 @@ private PublicationLocationPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "PublicationLocationPartStructure() failed to get partStructure id: "
+ log.warn( "PublicationLocationPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublisherPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublisherPartStructure.java
index 39c0bee8bf3e..484a16f60fe9 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublisherPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/PublisherPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class PublisherPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.PublisherPartStructure" );
-
private org.osid.shared.Id PUBLISHER_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu","partStructure","publisher","Publisher");
private String displayName = "Publisher";
@@ -46,7 +45,7 @@ private PublisherPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "PublisherPartStructure() failed to get partStructure id: "
+ log.warn( "PublisherPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Record.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Record.java
index 66a12641e497..65247049835d 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Record.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Record.java
@@ -21,17 +21,16 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development Team
* @version
*/
+@Slf4j
public class Record
implements org.osid.repository.Record
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.Record" );
-
private java.util.Vector partVector = new java.util.Vector();
private org.osid.id.IdManager idManager = null;
private org.osid.shared.Id recordStructureId = null;
@@ -62,7 +61,7 @@ protected Record(org.osid.shared.Id recordStructureId
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -79,7 +78,7 @@ public org.osid.repository.Part createPart(org.osid.shared.Id partStructureId
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -102,7 +101,7 @@ public void deletePart(org.osid.shared.Id partId)
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -135,7 +134,7 @@ public org.osid.repository.RecordStructure getRecordStructure()
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RecordStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RecordStructure.java
index adeeac8de2de..8d36f2023a89 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RecordStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RecordStructure.java
@@ -21,19 +21,17 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
/**
* @author Massachusetts Institute of Techbology, Sakai Software Development
* Team
* @version
*/
+@Slf4j
public class RecordStructure
implements org.osid.repository.RecordStructure
{
-
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.RecordStructure" );
-
private org.osid.shared.Id id = null;
private String idString = "af106d4f201080006d751920168000100";
private String displayName = "Citation";
@@ -60,7 +58,7 @@ protected RecordStructure()
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Repository.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Repository.java
index 1f1e05c07a23..1a9f0dfc98c5 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Repository.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/Repository.java
@@ -21,6 +21,7 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
import org.sakaibrary.xserver.XServerException;
import org.sakaibrary.xserver.XServer;
import org.sakaiproject.citation.util.impl.CQL2XServerFindCommand;
@@ -29,14 +30,11 @@
*
* @author gbhatnag
*/
+@Slf4j
public class Repository implements org.osid.repository.Repository
{
private static final long serialVersionUID = 1L;
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.Repository" );
-
private org.osid.shared.Id id = null;
private String idString = null;
private String displayName = null;
@@ -90,7 +88,7 @@ protected Repository( String displayName
try {
this.id = idManager.getId(this.idString);
} catch (Throwable t) {
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
}
}
@@ -197,7 +195,7 @@ public org.osid.shared.TypeIterator getAssetTypes()
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED);
}
@@ -239,7 +237,7 @@ public org.osid.shared.TypeIterator getSearchTypes()
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED);
}
@@ -347,7 +345,7 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
}
if( !( searchCriteria instanceof String ) ) {
- LOG.warn( "getAssetsBySearch() invalid search criteria: " + searchCriteria );
+ log.warn( "getAssetsBySearch() invalid search criteria: " + searchCriteria );
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED );
}
@@ -362,10 +360,10 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
knownPropertiesType = searchProperties.getType().isEqual(
searchPropertiesType );
} catch( org.osid.shared.SharedException se ) {
- LOG.warn( "Unable to check searchProperties Type" );
+ log.warn( "Unable to check searchProperties Type" );
}
if( !knownPropertiesType ) {
- LOG.warn( "searchProperties are of unknown type" );
+ log.warn( "searchProperties are of unknown type" );
throw new org.osid.repository.RepositoryException(
org.osid.shared.SharedException.UNKNOWN_TYPE );
}
@@ -379,7 +377,7 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
username = ( String ) searchProperties.getProperty( "username" );
password = ( String ) searchProperties.getProperty( "password" );
} catch( org.osid.shared.SharedException se ) {
- LOG.warn( "Problem getting guid from org.osid.shared.Properties " +
+ log.warn( "Problem getting guid from org.osid.shared.Properties " +
"object passed to getAssetsBySearch().", se );
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED );
@@ -389,7 +387,7 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
baseUrl == null || baseUrl.trim().equals( "" ) ||
username == null || username.trim().equals( "" ) ||
password == null || password.trim().equals( "" ) ) {
- LOG.warn( "required search property is null or empty:" +
+ log.warn( "required search property is null or empty:" +
"\n guid: " + guid +
"\n baseUrl: " + baseUrl +
"\n username: " + username +
@@ -399,7 +397,7 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
}
if( databaseIds == null || databaseIds.size() == 0 ) {
- LOG.warn( "ERROR: databaseIds from org.osid.shared.Properties is " +
+ log.warn( "ERROR: databaseIds from org.osid.shared.Properties is " +
"null or empty" );
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED );
@@ -412,7 +410,7 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
( searchTypeVector.elementAt( i ) );
if( !type.isEqual( searchType ) ) {
- LOG.warn( "searchType is of unknown type" );
+ log.warn( "searchType is of unknown type" );
throw new org.osid.repository.RepositoryException(
org.osid.shared.SharedException.UNKNOWN_TYPE );
}
@@ -472,12 +470,12 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
} catch( XServerException xse ) {
if( xse.getErrorCode() != null && !xse.getErrorCode().trim().equals("") )
{
- LOG.warn( "X-Server error " + xse.getErrorCode() + " - " +
+ log.warn( "X-Server error " + xse.getErrorCode() + " - " +
xse.getErrorText() );
}
else
{
- LOG.warn( "X-Server error - " + xse.getErrorText() );
+ log.warn( "X-Server error - " + xse.getErrorText() );
}
throw new org.osid.repository.RepositoryException(
org.sakaibrary.osid.repository.xserver.
@@ -490,12 +488,12 @@ public org.osid.repository.AssetIterator getAssetsBySearch(
} catch( XServerException xse ) {
if( xse.getErrorCode() != null && !xse.getErrorCode().trim().equals("") )
{
- LOG.warn( "X-Server error " + xse.getErrorCode() + " - " +
+ log.warn( "X-Server error " + xse.getErrorCode() + " - " +
xse.getErrorText() );
}
else
{
- LOG.warn( "X-Server error - " + xse.getErrorText() );
+ log.warn( "X-Server error - " + xse.getErrorText() );
}
throw new org.osid.repository.RepositoryException(
org.sakaibrary.osid.repository.xserver.
@@ -542,7 +540,7 @@ public org.osid.shared.PropertiesIterator getProperties()
try {
guid = ( String ) searchProperties.getProperty( "guid" );
} catch( org.osid.shared.SharedException se ) {
- LOG.warn( "getProperties() could not get guid: " +
+ log.warn( "getProperties() could not get guid: " +
se.getMessage(), se );
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED);
@@ -566,7 +564,7 @@ public org.osid.shared.PropertiesIterator getProperties()
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED);
}
@@ -617,7 +615,7 @@ public org.osid.shared.TypeIterator getPropertyTypes()
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED);
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RepositoryManager.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RepositoryManager.java
index 0f4d4e139bae..cb54296f29d8 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RepositoryManager.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RepositoryManager.java
@@ -21,12 +21,15 @@
package org.sakaibrary.osid.repository.xserver;
-/**
+import lombok.extern.slf4j.Slf4j;
+
+/**
* RepositoryManager manages Repositories.
*
* @author Gaurav Bhatnagar (gbhatnag@umich.edu)
* @version
*/
+@Slf4j
public class RepositoryManager implements org.osid.repository.RepositoryManager
{
// constants
@@ -35,10 +38,6 @@ public class RepositoryManager implements org.osid.repository.RepositoryManager
public static final String REPOSITORY_DESCRIPTION = "UM metasearch engine for searching library licensed digital content";
public static final String REPOSITORY_ID = "XSERVER01";
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.RepositoryManager" );
-
private org.osid.id.IdManager idManager = null;
private org.osid.OsidContext context = null;
private java.util.Vector repositoryVector = new java.util.Vector();
@@ -80,7 +79,7 @@ public void assignConfiguration(java.util.Properties configuration)
}
catch (Throwable t)
{
- LOG.warn( "RepositoryManager.assignConfiguration() failed in reading " +
+ log.warn( "RepositoryManager.assignConfiguration() failed in reading " +
"configuration properties or creating a new Repository: " +
t.getMessage(), t );
@@ -161,7 +160,7 @@ public org.osid.repository.Repository getRepository(org.osid.shared.Id repositor
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -189,7 +188,7 @@ public org.osid.repository.Asset getAsset(org.osid.shared.Id assetId)
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID);
@@ -219,7 +218,7 @@ public org.osid.repository.Asset getAssetByDate(org.osid.shared.Id assetId
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID);
@@ -249,7 +248,7 @@ public org.osid.shared.LongValueIterator getAssetDates(org.osid.shared.Id assetI
}
catch (Throwable t)
{
- LOG.warn(t.getMessage());
+ log.warn(t.getMessage());
throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
}
}
@@ -291,7 +290,7 @@ public org.osid.shared.TypeIterator getRepositoryTypes()
}
catch( Throwable t )
{
- LOG.warn( t.getMessage() );
+ log.warn( t.getMessage() );
throw new org.osid.repository.RepositoryException(
org.osid.OsidException.OPERATION_FAILED );
}
@@ -300,6 +299,6 @@ public org.osid.shared.TypeIterator getRepositoryTypes()
public void osidVersion_2_0()
throws org.osid.repository.RepositoryException
{
- LOG.debug( "osidVersion_2_0() called" );
+ log.debug( "osidVersion_2_0() called" );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RightsPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RightsPartStructure.java
index fa7be12b96f1..25bfd8ad9d3f 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RightsPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/RightsPartStructure.java
@@ -21,10 +21,10 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class RightsPartStructure implements org.osid.repository.PartStructure {
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.RightsPartStructure" );
private org.osid.shared.Id RIGHTS_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "mit.edu", "partStructure",
@@ -51,7 +51,7 @@ private RightsPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "RightsPartStructure() failed to get partStructure id: "
+ log.warn( "RightsPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SourceTitlePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SourceTitlePartStructure.java
index 9e7b1568b533..7606128c6630 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SourceTitlePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SourceTitlePartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class SourceTitlePartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.SourceTitlePartStructure" );
-
private org.osid.shared.Id SOURCE_TITLE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("sakaibrary", "partStructure",
"sourceTitle", "Source Title" );
@@ -49,7 +48,7 @@ private SourceTitlePartStructure()
}
catch (Throwable t)
{
- LOG.warn( "SourceTitlePartStructure() failed to get partStructure id: "
+ log.warn( "SourceTitlePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/StartPagePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/StartPagePartStructure.java
index aa53f5adf71f..8a3e85f5025c 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/StartPagePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/StartPagePartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class StartPagePartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.StartPagePartStructure" );
-
private org.osid.shared.Id START_PAGE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"startPage", "Page number that resource content begins on" );
@@ -47,7 +46,7 @@ private StartPagePartStructure()
}
catch (Throwable t)
{
- LOG.warn( "StartPagePartStructure() failed to get partStructure id: "
+ log.warn( "StartPagePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SubjectPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SubjectPartStructure.java
index 33f4df3a9a28..89ed45be8e51 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SubjectPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/SubjectPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class SubjectPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.SubjectPartStructure" );
-
private org.osid.shared.Id SUBJECT_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type("mit.edu", "partStructure",
"subject", "Subject");
@@ -48,7 +47,7 @@ private SubjectPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "SubjectPartStructure() failed to get partStructure id: "
+ log.warn( "SubjectPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/TypePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/TypePartStructure.java
index bdd1ddf4cdfb..94102b08591c 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/TypePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/TypePartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class TypePartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.TypePartStructure" );
-
private org.osid.shared.Id TYPE_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "mit.edu", "partStructure",
"type","Type" );
@@ -48,7 +47,7 @@ private TypePartStructure()
}
catch (Throwable t)
{
- LOG.warn( "TypePartStructure() failed to get partStructure id: "
+ log.warn( "TypePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLFormatPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLFormatPartStructure.java
index b4ed8b148e0f..710148d445ba 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLFormatPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLFormatPartStructure.java
@@ -21,11 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class URLFormatPartStructure
implements org.osid.repository.PartStructure {
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.URLFormatPartStructure" );
private org.osid.shared.Id URL_FORMAT_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
@@ -48,7 +48,7 @@ private URLFormatPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "URLFormatPartStructure() failed to get partStructure id: "
+ log.warn( "URLFormatPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLLabelPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLLabelPartStructure.java
index 435a52dc83b8..9b49e04b69c3 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLLabelPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLLabelPartStructure.java
@@ -21,11 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class URLLabelPartStructure
implements org.osid.repository.PartStructure {
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.URLLabelPartStructure" );
private org.osid.shared.Id URL_LABEL_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
@@ -47,7 +47,7 @@ private URLLabelPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "URLLabelPartStructure() failed to get partStructure id: "
+ log.warn( "URLLabelPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLPartStructure.java
index 66dab9da8a16..44199b851649 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/URLPartStructure.java
@@ -21,13 +21,12 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class URLPartStructure
implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.URLPartStructure" );
-
private org.osid.shared.Id URL_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "mit.edu", "partStructure",
"URL", "URL associated with resource" );
@@ -49,7 +48,7 @@ private URLPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "URLPartStructure() failed to get partStructure id: "
+ log.warn( "URLPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/VolumePartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/VolumePartStructure.java
index 1e3adc7e3bfb..ce4127763a9d 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/VolumePartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/VolumePartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class VolumePartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.VolumePartStructure" );
-
private org.osid.shared.Id VOLUME_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"volume", "Volume number of source" );
@@ -48,7 +47,7 @@ private VolumePartStructure()
}
catch (Throwable t)
{
- LOG.warn( "VolumePartStructure() failed to get partStructure id: "
+ log.warn( "VolumePartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/YearPartStructure.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/YearPartStructure.java
index f37c4b673e8a..35d42189b3ed 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/YearPartStructure.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/osid/repository/xserver/YearPartStructure.java
@@ -21,12 +21,11 @@
package org.sakaibrary.osid.repository.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class YearPartStructure implements org.osid.repository.PartStructure
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.YearPartStructure" );
-
private org.osid.shared.Id YEAR_PART_STRUCTURE_ID = null;
private org.osid.shared.Type type = new Type( "sakaibrary", "partStructure",
"year", "Year resource was created" );
@@ -47,7 +46,7 @@ private YearPartStructure()
}
catch (Throwable t)
{
- LOG.warn( "YearPartStructure() failed to get partStructure id: "
+ log.warn( "YearPartStructure() failed to get partStructure id: "
+ t.getMessage() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/FindResultSetBean.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/FindResultSetBean.java
index 8104e6643244..0857d8009613 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/FindResultSetBean.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/FindResultSetBean.java
@@ -21,11 +21,10 @@
package org.sakaibrary.xserver;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class FindResultSetBean {
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.xserver.FindResultSetBean" );
-
private String baseName;
private String sourceId;
private String setNumber;
@@ -99,12 +98,12 @@ public String getNumDocs() {
}
public void printInfo() {
- LOG.debug( "\nFIND RESULT SET INFO" );
- LOG.debug( "source id: " + getSourceId() );
- LOG.debug( "full name: " + getFullName() );
- LOG.debug( "set number: " + getSetNumber() );
- LOG.debug( "status: " + getStatus() );
- LOG.debug( "error text: " + getFindErrorText() );
- LOG.debug( "docs found: " + getNumDocs() );
+ log.debug( "\nFIND RESULT SET INFO" );
+ log.debug( "source id: " + getSourceId() );
+ log.debug( "full name: " + getFullName() );
+ log.debug( "set number: " + getSetNumber() );
+ log.debug( "status: " + getStatus() );
+ log.debug( "error text: " + getFindErrorText() );
+ log.debug( "docs found: " + getNumDocs() );
}
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLCleanup.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLCleanup.java
index 5021f5de0b94..dd9ee0a53da0 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLCleanup.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLCleanup.java
@@ -23,17 +23,15 @@
import java.io.*;
+import lombok.extern.slf4j.Slf4j;
import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
+@Slf4j
public class XMLCleanup extends DefaultHandler {
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.xserver.XMLCleanup" );
-
private ByteArrayOutputStream bytes;
private Writer out;
private InputStream inputXml;
@@ -54,7 +52,7 @@ public XMLCleanup() {
try {
out = new OutputStreamWriter( bytes, "UTF8" );
} catch( UnsupportedEncodingException e ) {
- LOG.warn( "XMLCleanup() unsupported encoding: " + e.getMessage() );
+ log.warn( "XMLCleanup() unsupported encoding: " + e.getMessage() );
}
}
@@ -80,7 +78,7 @@ public ByteArrayOutputStream cleanup( InputStream xml) throws XServerException {
}
// Error generated by the parser
- LOG.warn("XMLCleanup.cleanup() parsing exception: " + spe.getMessage() +
+ log.warn("XMLCleanup.cleanup() parsing exception: " + spe.getMessage() +
" - xml line " + spe.getLineNumber() + ", uri " +
spe.getSystemId(), x );
} catch (SAXException sxe) {
@@ -92,17 +90,17 @@ public ByteArrayOutputStream cleanup( InputStream xml) throws XServerException {
x = sxe.getException();
}
- LOG.warn( "XMLCleanup.cleanup() SAX exception: " + sxe.getMessage(),
+ log.warn( "XMLCleanup.cleanup() SAX exception: " + sxe.getMessage(),
x );
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
- LOG.warn( "XMLCleanup.cleanup() SAX parser cannot be built with " +
+ log.warn( "XMLCleanup.cleanup() SAX parser cannot be built with " +
"specified options" );
} catch (IOException ioe) {
// I/O error
- LOG.warn( "XMLCleanup.cleanup() IO exception", ioe );
+ log.warn( "XMLCleanup.cleanup() IO exception", ioe );
} catch (Throwable t) {
- LOG.warn( "XMLCleanup.cleanup() exception", t );
+ log.warn( "XMLCleanup.cleanup() exception", t );
}
if( error ) {
@@ -237,9 +235,9 @@ public void error(SAXParseException e) throws SAXParseException {
// dump warnings too
public void warning(SAXParseException err) throws SAXParseException {
- LOG.warn("SAXParser warning" + ", xml line " + err.getLineNumber() +
+ log.warn("SAXParser warning" + ", xml line " + err.getLineNumber() +
", uri " + err.getSystemId());
- LOG.warn(" " + err.getMessage());
+ log.warn(" " + err.getMessage());
}
//===========================================================
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLTransform.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLTransform.java
index 0825e799a9c9..6fd92b90fde3 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLTransform.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XMLTransform.java
@@ -24,6 +24,8 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+
+import lombok.extern.slf4j.Slf4j;
import org.xml.sax.SAXException;
import org.w3c.dom.Document;
@@ -37,11 +39,8 @@
import javax.xml.transform.stream.StreamResult;
import java.io.*;
+@Slf4j
public class XMLTransform {
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.xserver.XMLTransform" );
-
private Document document;
private String xslFileName;
private ByteArrayOutputStream xml;
@@ -74,11 +73,11 @@ public ByteArrayOutputStream transform() {
transformer.transform( source, result );
} catch ( TransformerConfigurationException tce ) {
// Error generated by the parser
- LOG.warn( "XMLTransform.transform() - TransformerFactory error: "
+ log.warn( "XMLTransform.transform() - TransformerFactory error: "
+ tce.getMessage() );
} catch( TransformerException te ) {
// Error generated by the parser
- LOG.warn( "XMLTransform.transform() - Transformation error: "
+ log.warn( "XMLTransform.transform() - Transformation error: "
+ te.getMessage() );
} catch( SAXException sxe ) {
// Error generated by this application
@@ -89,15 +88,15 @@ public ByteArrayOutputStream transform() {
x = sxe.getException();
}
- LOG.warn( "XMLTransform.transform() SAX exception: " + sxe.getMessage(),
+ log.warn( "XMLTransform.transform() SAX exception: " + sxe.getMessage(),
x );
} catch( ParserConfigurationException pce ) {
// Parser with specified options can't be built
- LOG.warn( "XMLTransform.transform() SAX parser cannot be built with " +
+ log.warn( "XMLTransform.transform() SAX parser cannot be built with " +
"specified options" );
} catch( IOException ioe ) {
// I/O error
- LOG.warn( "XMLCleanup.cleanup() IO exception", ioe );
+ log.warn( "XMLCleanup.cleanup() IO exception", ioe );
}
return transformedXml;
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XServer.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XServer.java
index 0afdfd8e46d3..974a6d486289 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XServer.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/XServer.java
@@ -36,6 +36,7 @@
import java.net.HttpURLConnection;
//SAX XML parsing imports
+import lombok.extern.slf4j.Slf4j;
import org.sakaibrary.osid.repository.xserver.SearchStatusProperties;
import org.sakaibrary.xserver.session.MetasearchSession;
import org.sakaibrary.xserver.session.MetasearchSessionManager;
@@ -45,6 +46,7 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.ParserConfigurationException;
+@Slf4j
public class XServer extends DefaultHandler {
//
// Number of records the Xserver should fetch at one time
@@ -57,9 +59,6 @@ public class XServer extends DefaultHandler {
boolean printXML = false;
/* constants */
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.xserver.XServer" );
private static final String XSLT_FILE = "/xsl/xserver2sakaibrary.xsl";
/* fields coming from searchProperties */
@@ -125,12 +124,12 @@ public XServer( String guid )
x = sxe.getException();
}
- LOG.warn( "XServer() SAX exception in trying to get a new SAXParser " +
+ log.warn( "XServer() SAX exception in trying to get a new SAXParser " +
"from SAXParserFactory: " + sxe.getMessage(), x );
throw new RuntimeException( "XServer() SAX exception: " + sxe.getMessage(), x );
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
- LOG.warn( "XServer() SAX parser cannot be built with specified options" );
+ log.warn( "XServer() SAX parser cannot be built with specified options" );
throw new RuntimeException( "XServer() SAX parser cannot be built with " +
"specified options: " + pce.getMessage(), pce );
}
@@ -175,7 +174,7 @@ public XServer( String guid )
pageSize = ( Integer ) searchProperties.getProperty( "pageSize" );
startRecord = ( Integer ) searchProperties.getProperty( "startRecord" );
} catch( org.osid.shared.SharedException se ) {
- LOG.warn( "XServer() failed to get search properties - will assign " +
+ log.warn( "XServer() failed to get search properties - will assign " +
"defaults", se );
}
@@ -195,7 +194,7 @@ public XServer( String guid )
// check args
if( startRecord.intValue() <= 0 ) {
- LOG.warn( "XServer() - startRecord must be set to 1 or higher." );
+ log.warn( "XServer() - startRecord must be set to 1 or higher." );
startRecord = null;
startRecord = new Integer( 1 );
}
@@ -232,7 +231,7 @@ private boolean loginURL( String username, String password )
if( printXML ) {
// print xml
- LOG.debug( xml.toString() );
+ log.debug( xml.toString() );
}
// run SAX Parser
@@ -247,11 +246,11 @@ private boolean loginURL( String username, String password )
x = sxe.getException();
}
- LOG.warn( "loginURL() SAX exception: " + sxe.getMessage(),
+ log.warn( "loginURL() SAX exception: " + sxe.getMessage(),
x );
} catch (IOException ioe) {
// I/O error
- LOG.warn( "loginURL() IO exception", ioe );
+ log.warn( "loginURL() IO exception", ioe );
}
// return whether or not the login was successful
@@ -301,7 +300,7 @@ private void findURL( String findCommand, String waitFlag )
if( printXML ) {
// print xml
- LOG.debug( xml.toString() );
+ log.debug( xml.toString() );
}
// run SAX Parser
@@ -316,10 +315,10 @@ private void findURL( String findCommand, String waitFlag )
x = sxe.getException();
}
- LOG.warn( "findURL() SAX exception: " + sxe.getMessage(), x );
+ log.warn( "findURL() SAX exception: " + sxe.getMessage(), x );
} catch (IOException ioe) {
// I/O error
- LOG.warn( "findURL() IO exception", ioe );
+ log.warn( "findURL() IO exception", ioe );
}
}
@@ -342,7 +341,7 @@ private void findGroupInfoURL() throws XServerException {
if( printXML ) {
// print xml
- LOG.debug( xml.toString() );
+ log.debug( xml.toString() );
}
// run SAX Parser
@@ -357,10 +356,10 @@ private void findGroupInfoURL() throws XServerException {
x = sxe.getException();
}
- LOG.warn( "findGroupInfoURL() SAX exception: " + sxe.getMessage(), x );
+ log.warn( "findGroupInfoURL() SAX exception: " + sxe.getMessage(), x );
} catch (IOException ioe) {
// I/O error
- LOG.warn( "findGroupInfoURL() IO exception", ioe );
+ log.warn( "findGroupInfoURL() IO exception", ioe );
}
}
@@ -400,7 +399,7 @@ private void mergeSortURL( String action, String primarySortKey )
if( printXML ) {
// print xml
- LOG.debug( xml.toString() );
+ log.debug( xml.toString() );
}
// run SAX Parser
@@ -415,10 +414,10 @@ private void mergeSortURL( String action, String primarySortKey )
x = sxe.getException();
}
- LOG.warn( "mergeSortURL() SAX exception: " + sxe.getMessage(), x );
+ log.warn( "mergeSortURL() SAX exception: " + sxe.getMessage(), x );
} catch (IOException ioe) {
// I/O error
- LOG.warn( "mergeSortURL() IO exception", ioe );
+ log.warn( "mergeSortURL() IO exception", ioe );
}
}
@@ -464,7 +463,7 @@ private ByteArrayOutputStream presentURL( String setNumber, String setEntry )
if( printXML ) {
// print xml
- LOG.debug( xml.toString() );
+ log.debug( xml.toString() );
}
return xml;
@@ -493,7 +492,7 @@ public ByteArrayInputStream getRecordsXML( int numAssets )
throws XServerException, org.osid.repository.RepositoryException {
// check args
if( numAssets < 0 ) {
- LOG.warn( "getRecordsXML() - numAssets below zero." );
+ log.warn( "getRecordsXML() - numAssets below zero." );
numAssets = 0;
}
@@ -511,7 +510,7 @@ public ByteArrayInputStream getRecordsXML( int numAssets )
if( setNumber == null ) {
// null setNumber indicates multiple search sources, do a merge
- LOG.debug( "getRecordsXML() - doing merge, set number is null" );
+ log.debug( "getRecordsXML() - doing merge, set number is null" );
mergeSortURL( "merge", sortBy );
// we'll be getting a new setNumber for the merged set, store it
@@ -523,7 +522,7 @@ public ByteArrayInputStream getRecordsXML( int numAssets )
} else {
if( !singleSearchSource ) {
// do a merge_more if we're working with multiple search sources
- LOG.debug( "getRecordsXML() - doing merge_more, set number " +
+ log.debug( "getRecordsXML() - doing merge_more, set number " +
"is " + setNumber );
mergeSortURL( "merge_more", sortBy );
}
@@ -586,7 +585,7 @@ public ByteArrayInputStream getRecordsXML( int numAssets )
** **** end original code ********/
setEntryEnd = df.format( setEntryEndValue );
- LOG.debug( "getRecordsXML() - presenting records: " +
+ log.debug( "getRecordsXML() - presenting records: " +
setEntryStart + "-" + setEntryEnd );
// run the present X-Service
@@ -606,7 +605,7 @@ public void initAsynchSearch( String criteria,
throws XServerException {
this.searchSourceIds = sourceIds;
- LOG.debug( "initAsynchSearch() - searchSourceIds: " + searchSourceIds.size() );
+ log.debug( "initAsynchSearch() - searchSourceIds: " + searchSourceIds.size() );
if( searchSourceIds.size() == 1 ) {
// only one search source - do not need to merge
singleSearchSource = true;
@@ -614,7 +613,7 @@ public void initAsynchSearch( String criteria,
singleSearchSource = false;
}
- LOG.debug( "initAsynchSearch() - find_command: " + criteria );
+ log.debug( "initAsynchSearch() - find_command: " + criteria );
// run the find X-Service in non-blocking mode
findURL( criteria, "N" );
@@ -977,11 +976,11 @@ private boolean checkSessionState() {
metasearchSession.getFoundGroupNumber() == null ||
metasearchSession.getSearchProperties() == null ) {
if( metasearchSession == null ) {
- LOG.error( "checkSessionState() - session state out of sync:" +
+ log.error( "checkSessionState() - session state out of sync:" +
"\n guid: " + guid +
"\n MetasearchSession: null" );
} else {
- LOG.error( "checkSessionState() - session state out of sync:" +
+ log.error( "checkSessionState() - session state out of sync:" +
"\n guid: " + guid +
"\n MetasearchSession: " + metasearchSession +
"\n logged in: " + metasearchSession.isLoggedIn() +
@@ -1022,13 +1021,13 @@ private ByteArrayOutputStream doURLConnection( String urlQuery )
// disconnect
urlConn.disconnect();
} catch( MalformedURLException mue ) {
- LOG.warn( "doURLConnection() malformed URL" );
+ log.warn( "doURLConnection() malformed URL" );
wrapXServerException( null, "Error in connecting to X-Server. Please contact Citations Helper Administrator." );
} catch( IOException ioe ) {
- LOG.warn( "doURLConnection() IOException, connection failed" );
+ log.warn( "doURLConnection() IOException, connection failed" );
wrapXServerException( null, "Error in connecting to X-Server. Please contact Citations Helper Administrator." );
} catch( XServerException xse ) {
- LOG.warn( "doURLConnection() - XServerException: " +
+ log.warn( "doURLConnection() - XServerException: " +
xse.getErrorCode() + " - " + xse.getErrorText() );
wrapXServerException( xse.getErrorCode(), xse.getErrorText() + "Please contact Citations Helper Administrator." );
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/session/MetasearchSessionManager.java b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/session/MetasearchSessionManager.java
index 4f2d2528982a..ed21eda55e70 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/session/MetasearchSessionManager.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaibrary/xserver/session/MetasearchSessionManager.java
@@ -21,6 +21,7 @@
package org.sakaibrary.xserver.session;
+import lombok.extern.slf4j.Slf4j;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.memory.api.Cache;
import org.sakaiproject.memory.api.MemoryService;
@@ -33,12 +34,10 @@
*
* @author gbhatnag
*/
+@Slf4j
public class MetasearchSessionManager implements java.io.Serializable {
/* constants */
private static final String CACHE_NAME = "org.sakaibrary.xserver.session.MetasearchSession";
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.osid.repository.xserver.session.MetasearchSessionManager" );
/* private static variables */
private static MemoryService memoryService = (MemoryService)ComponentManager.get(MemoryService.class);
@@ -54,7 +53,7 @@ private MetasearchSessionManager() {
if ( cache == null ) {
cache = memoryService.getCache(CACHE_NAME);
- LOG.info( "MetasearchSessionManager cache session initiated properly." );
+ log.info( "MetasearchSessionManager cache session initiated properly." );
}
}
@@ -84,7 +83,7 @@ public void putMetasearchSession( String guid,
MetasearchSession ms ) {
// given guid and ms.getGuid() should match -- TODO new Exception Type?
if( !ms.getGuid().equals( guid ) ) {
- LOG.warn( "putMetasearchSession(): putting MetasearchSession into " +
+ log.warn( "putMetasearchSession(): putting MetasearchSession into " +
"cache with mismatched guids..." );
}
@@ -105,7 +104,7 @@ public MetasearchSession getMetasearchSession( String guid ) {
MetasearchSession ms = (MetasearchSession) cache.get( guid );
return ms;
} catch( Exception ce ) {
- LOG.warn( "MetasearchSessionManager.getMetasearchSession()" +
+ log.warn( "MetasearchSessionManager.getMetasearchSession()" +
" cannot get cache with guid: " + guid, ce );
}
diff --git a/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/Id.java b/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/Id.java
index a33668b8b6d4..e78159cd3a70 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/Id.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/Id.java
@@ -21,17 +21,16 @@
package org.sakaiproject.component.osid.id;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class Id implements org.osid.shared.Id
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaiproject.component.osid.id.Id" );
-
private String idString = null;
private void log(String entry) throws org.osid.shared.SharedException
{
- LOG.debug("Id.log() entry: " + entry);
+ log.debug("Id.log() entry: " + entry);
}
protected Id() throws org.osid.shared.SharedException
diff --git a/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/IdManager.java b/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/IdManager.java
index 27eed06b98fc..428168b7f6c9 100644
--- a/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/IdManager.java
+++ b/citations/citations-osid/xserver/src/java/org/sakaiproject/component/osid/id/IdManager.java
@@ -21,12 +21,11 @@
package org.sakaiproject.component.osid.id;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
public class IdManager implements org.osid.id.IdManager
{
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaiproject.component.osid.id.IdManager" );
-
org.osid.OsidContext context = null;
java.util.Properties configuration = null;
@@ -48,7 +47,7 @@ public void assignConfiguration(java.util.Properties configuration) throws org.o
private void log(String entry) throws org.osid.id.IdException
{
- LOG.debug("IdManager.log() entry: " + entry);
+ log.debug("IdManager.log() entry: " + entry);
}
public org.osid.shared.Id createId() throws org.osid.id.IdException
diff --git a/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/BatchCitationServlet.java b/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/BatchCitationServlet.java
index 8c094321f5a3..743f96e2f021 100644
--- a/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/BatchCitationServlet.java
+++ b/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/BatchCitationServlet.java
@@ -38,8 +38,8 @@
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.citation.api.Citation;
import org.sakaiproject.citation.api.Schema;
import org.sakaiproject.content.api.ContentResource;
@@ -56,7 +56,7 @@
public class BatchCitationServlet extends CitationServlet
{
- private static Log log = LogFactory.getLog(BatchCitationServlet.class);
+ private static Logger log = LoggerFactory.getLogger(BatchCitationServlet.class);
/**
* respond to an HTTP GET request
diff --git a/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/CitationServlet.java b/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/CitationServlet.java
index c7c81ff437c3..7daba9e858de 100644
--- a/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/CitationServlet.java
+++ b/citations/citations-servlet/servlet/src/java/org/sakaiproject/citation/servlet/CitationServlet.java
@@ -21,30 +21,12 @@
package org.sakaiproject.citation.servlet;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.logging.Logger;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import org.sakaiproject.cheftool.VmServlet;
import org.sakaiproject.citation.api.*;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.content.api.ContentHostingService;
import org.sakaiproject.content.api.ContentResource;
import org.sakaiproject.entity.api.ResourceProperties;
-import org.sakaiproject.entity.api.Reference;
-import org.sakaiproject.entity.cover.EntityManager;
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.exception.PermissionException;
import org.sakaiproject.exception.ServerOverloadException;
@@ -55,12 +37,19 @@
import org.sakaiproject.tool.api.ToolException;
import org.sakaiproject.tool.cover.ActiveToolManager;
import org.sakaiproject.tool.cover.SessionManager;
-import org.sakaiproject.user.cover.UserDirectoryService;
-import org.sakaiproject.util.BasicAuth;
-import org.sakaiproject.util.ParameterParser;
-import org.sakaiproject.util.ResourceLoader;
-import org.sakaiproject.util.Validator;
-import org.sakaiproject.util.Web;
+import org.sakaiproject.util.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
/**
*
@@ -76,8 +65,7 @@ public class CitationServlet extends VmServlet
public static final String COMPACT_TEMPLATE = "/vm/compact.vm";
// private String collectionTitle = null;
- /** Our log (commons). */
- private static Log M_log = LogFactory.getLog(CitationServlet.class);
+ private static final Logger M_log = LoggerFactory.getLogger(CitationServlet.class);
/** Resource bundle using current language locale */
protected static ResourceLoader rb = new ResourceLoader("citations");
@@ -173,9 +161,7 @@ public void init( ServletConfig config ) throws ServletException
*/
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
- if(M_log.isDebugEnabled()) {
- M_log.debug("doGet() " + req.getMethod());
- }
+ M_log.debug("doGet() {}", req.getMethod());
// process any login that might be present
basicAuth.doLogin(req);
diff --git a/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/CitationHelperAction.java b/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/CitationHelperAction.java
index 16b06aada183..70fad117bdac 100644
--- a/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/CitationHelperAction.java
+++ b/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/CitationHelperAction.java
@@ -53,8 +53,8 @@
import net.sf.json.JSONObject;
import org.apache.commons.io.input.BOMInputStream;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.type.TypeFactory;
import org.sakaiproject.antivirus.api.VirusFoundException;
@@ -451,7 +451,7 @@ public static void clearAdvancedFormState( SessionState state )
}
}
- protected final static Log logger = LogFactory.getLog(CitationHelperAction.class);
+ protected final static Logger logger = LoggerFactory.getLogger(CitationHelperAction.class);
public static ResourceLoader rb = new ResourceLoader("citations");
@@ -672,7 +672,7 @@ protected void toolModeDispatch(String methodBase, String methodExt, HttpServlet
catch (IOException e)
{
logger.warn("IOException", e);
- // Log.warn("chef", this + " : ", e);
+ // Logger.warn("chef", this + " : ", e);
}
return;
}
diff --git a/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/EditorIntegrationHelperAction.java b/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/EditorIntegrationHelperAction.java
index 8452f4809a9e..55f765ec6ada 100644
--- a/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/EditorIntegrationHelperAction.java
+++ b/citations/citations-tool/tool/src/java/org/sakaiproject/citation/tool/EditorIntegrationHelperAction.java
@@ -42,8 +42,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.SecurityAdvisor;
import org.sakaiproject.authz.cover.SecurityService;
import org.sakaiproject.cheftool.Context;
@@ -112,7 +112,7 @@
*/
public class EditorIntegrationHelperAction extends CitationHelperAction
{
- protected final static Log m_log = LogFactory.getLog(EditorIntegrationHelperAction.class);
+ protected final static Logger m_log = LoggerFactory.getLogger(EditorIntegrationHelperAction.class);
/**
* Editor Integration Library Resources Search
@@ -301,4 +301,4 @@ private boolean isNull(String string)
{
return (string == null) || (string.trim().length() == 0);
}
-}
\ No newline at end of file
+}
diff --git a/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQL2XServerFindCommand.java b/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQL2XServerFindCommand.java
index ba7c1172a148..6052a5fa3789 100644
--- a/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQL2XServerFindCommand.java
+++ b/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQL2XServerFindCommand.java
@@ -4,17 +4,14 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import lombok.extern.slf4j.Slf4j;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+@Slf4j
public class CQL2XServerFindCommand extends org.xml.sax.helpers.DefaultHandler
implements org.sakaiproject.citation.util.api.CQL2MetasearchCommand {
- // logger
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.common.search.impl.CQL2XServerFindCommand" );
-
// index mappings
private static final java.util.Map INDEX_MAP = new java.util.HashMap();
static {
@@ -59,11 +56,11 @@ public CQL2XServerFindCommand() {
x = sxe.getException();
}
- LOG.warn( "CQL2XServerFindCommand() SAX exception: " + sxe.getMessage(),
+ log.warn( "CQL2XServerFindCommand() SAX exception: " + sxe.getMessage(),
x );
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
- LOG.warn( "CQL2XServerFindCommand() SAX parser cannot be built with " +
+ log.warn( "CQL2XServerFindCommand() SAX parser cannot be built with " +
"specified options" );
}
}
@@ -88,10 +85,10 @@ public String doCQL2MetasearchCommand( String cqlSearchQuery ) {
// parse the criteria
root = parser.parse( cqlSearchQuery );
} catch( java.io.IOException ioe ) {
- LOG.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() IO " +
+ log.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() IO " +
"exception while parsing: " + ioe.getMessage() );
} catch( org.z3950.zing.cql.CQLParseException e ) {
- LOG.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() CQL " +
+ log.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() CQL " +
"parsing exception while parsing: " + e.getMessage() );
}
@@ -108,7 +105,7 @@ public String doCQL2MetasearchCommand( String cqlSearchQuery ) {
byteInputStream = new java.io.ByteArrayInputStream(
cqlXml.getBytes( "UTF8" ) );
} catch( java.io.UnsupportedEncodingException uee ) {
- LOG.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() " +
+ log.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() " +
"unsupported encoding: " + uee.getMessage() );
}
@@ -125,7 +122,7 @@ public String doCQL2MetasearchCommand( String cqlSearchQuery ) {
saxParser.parse( byteInputStream, this );
byteInputStream.close();
} catch( java.io.IOException ioe ) {
- LOG.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() " +
+ log.warn( "CQL2XServerFindCommand.doCQL2MetasearchCommand() " +
"unable to close byteStream: " + ioe.getMessage() );
} catch( org.xml.sax.SAXException sxe ) {
// Error generated by this application
@@ -136,7 +133,7 @@ public String doCQL2MetasearchCommand( String cqlSearchQuery ) {
x = sxe.getException();
}
- LOG.warn( "CQL2XServerFindCommand() SAX exception: " +
+ log.warn( "CQL2XServerFindCommand() SAX exception: " +
sxe.getMessage(), x );
}
@@ -249,7 +246,7 @@ private String translateIndex( String cqlIndex ) {
String xserverIndex = ( String ) INDEX_MAP.get( cqlIndex );
if( xserverIndex == null || xserverIndex.equals( "" ) ) {
- LOG.warn( "CQL2XServerFindCommand.translateIndex() - null/empty index" );
+ log.warn( "CQL2XServerFindCommand.translateIndex() - null/empty index" );
// default to keyword
xserverIndex = "WRD";
}
@@ -261,7 +258,7 @@ private String translateBooleanRelation( String booleanRelation ) {
String xserverBoolean = ( String ) BOOL_RELATION_MAP.get( booleanRelation );
if( xserverBoolean == null || xserverBoolean.equals( "" ) ) {
- LOG.warn( "CQL2XServerFindCommand.translateIndex() - null/empty boolean relation" );
+ log.warn( "CQL2XServerFindCommand.translateIndex() - null/empty boolean relation" );
// default to and
xserverBoolean = "%20AND%20";
}
diff --git a/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQLSearchQuery.java b/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQLSearchQuery.java
index e5cc04e80b96..758c0d52547d 100644
--- a/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQLSearchQuery.java
+++ b/citations/citations-util/util/src/java/org/sakaiproject/citation/util/impl/CQLSearchQuery.java
@@ -1,13 +1,10 @@
package org.sakaiproject.citation.util.impl;
-import org.sakaiproject.citation.util.api.SearchQuery;
+import lombok.extern.slf4j.Slf4j;
+@Slf4j
public class CQLSearchQuery
implements org.sakaiproject.citation.util.api.CQLSearchQuery {
-
- private static final org.apache.commons.logging.Log LOG =
- org.apache.commons.logging.LogFactory.getLog(
- "org.sakaibrary.common.search.impl.CQLSearchQuery" );
private org.sakaiproject.citation.util.api.SearchQuery searchQuery;
private String cqlQuery;
@@ -35,7 +32,7 @@ public String getCQLSearchQueryString(
String yearString = getYearString();
// debugging
- LOG.debug( "going to parse - keyword: " + keywordString +
+ log.debug( "going to parse - keyword: " + keywordString +
"; title: " + titleString + "; author: " + authorString + "; subject: "
+ subjectString + "; year: " + yearString );
@@ -64,7 +61,7 @@ public String getCQLSearchQueryString(
searchString = searchString.replaceAll( "\\s", " and " );
// debugging
- LOG.debug( "full search string to parse: " + searchString );
+ log.debug( "full search string to parse: " + searchString );
// convert the searchString to CQL
org.z3950.zing.cql.CQLParser parser = new org.z3950.zing.cql.CQLParser();
@@ -74,10 +71,10 @@ public String getCQLSearchQueryString(
// parse the criteria
root = parser.parse( searchString );
} catch( java.io.IOException ioe ) {
- LOG.warn( "CQLSearchQuery.getCQLSearchQueryString() IO " +
+ log.warn( "CQLSearchQuery.getCQLSearchQueryString() IO " +
"exception while parsing: " + ioe.getMessage() );
} catch( org.z3950.zing.cql.CQLParseException e ) {
- LOG.warn( "CQLSearchQuery.getCQLSearchQueryString() CQL " +
+ log.warn( "CQLSearchQuery.getCQLSearchQueryString() CQL " +
"parsing exception while parsing: " + e.getMessage() );
}
diff --git a/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/Logger.java b/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/CommonLogger.java
similarity index 97%
rename from cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/Logger.java
rename to cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/CommonLogger.java
index 9397fec921e1..b34c4ec1adbc 100644
--- a/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/Logger.java
+++ b/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/CommonLogger.java
@@ -6,7 +6,7 @@
*
* @author OpenCollab
*/
-public interface Logger {
+public interface CommonLogger {
/**
* Called if the space used on the account has reached a warning limit.
diff --git a/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/SwiftFileSystemHandler.java b/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/SwiftFileSystemHandler.java
index 69cf660e7693..ba89bcf47cbd 100644
--- a/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/SwiftFileSystemHandler.java
+++ b/cloud-content/impl/src/main/java/coza/opencollab/sakai/cloudcontent/SwiftFileSystemHandler.java
@@ -1,7 +1,7 @@
package coza.opencollab.sakai.cloudcontent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.Closeables;
@@ -94,21 +94,21 @@ public class SwiftFileSystemHandler implements FileSystemHandler {
/**
* The logger for warnings and errors.
*/
- private Logger logger = new DefaultLogger();
+ private CommonLogger logger = new DefaultLogger();
/**
- * The limit where a error will be made using the Logger.
+ * The limit where a error will be made using the CommonLogger.
*/
private long errorLimitForAccountSizeInBytes = -1L;
/**
- * The limit where a warning will be made using the Logger.
+ * The limit where a warning will be made using the CommonLogger.
*/
private long warningLimitForAccountSizeInBytes = -1L;
/**
- * The limit where a error will be made using the Logger.
+ * The limit where a error will be made using the CommonLogger.
*/
private long errorLimitForContainerSizeInBytes = -1L;
/**
- * The limit where a warning will be made using the Logger.
+ * The limit where a warning will be made using the CommonLogger.
*/
private long warningLimitForContainerSizeInBytes = -1L;
// private boolean retrieveContainerFromIdWithRegex = false;
@@ -188,11 +188,11 @@ public void setInvalidCharactersRegex(String invalidCharactersRegex) {
}
/**
- * The limit where a error will be made using the Logger.
+ * The limit where a error will be made using the CommonLogger.
* If the value (default) is negative this will not be tested.
* If positive then a exception will be thrown before a new resource is saved
* and the bytes used in the account is already over this value.
- * A error will also be logged to the Logger.
+ * A error will also be logged to the CommonLogger.
*
* Note that this test is run before the save, thus it is possible that
* the value can be exceeded after the save with no exception.
@@ -202,9 +202,9 @@ public void setErrorLimitForAccountSizeInBytes(long errorLimitForAccountSizeInBy
}
/**
- * The limit where a warning will be made using the Logger.
+ * The limit where a warning will be made using the CommonLogger.
* If the value (default) is negative this will not be tested.
- * If positive then a warning will be logged to the Logger.
+ * If positive then a warning will be logged to the CommonLogger.
*
* Note that this test is run before the save, thus it is possible that
* the value can be exceeded after the save with no warning.
@@ -214,11 +214,11 @@ public void setWarningLimitForAccountSizeInBytes(long warningLimitForAccountSize
}
/**
- * The limit where a error will be made using the Logger.
+ * The limit where a error will be made using the CommonLogger.
* If the value (default) is negative this will not be tested.
* If positive then a exception will be thrown before a new resource is saved
* and the bytes used in the container is already over this value.
- * A error will also be logged to the Logger.
+ * A error will also be logged to the CommonLogger.
*
* Note that this test is run before the save, thus it is possible that
* the value can be exceeded after the save with no exception.
@@ -230,7 +230,7 @@ public void setErrorLimitForContainerSizeInBytes(long errorLimitForContainerSize
/**
* The limit where a warning will be made using the WarningLogger.
* If the value (default) is negative this will not be tested.
- * If positive then a warning will be logged to the Logger.
+ * If positive then a warning will be logged to the CommonLogger.
*
* Note that this test is run before the save, thus it is possible that
* the value can be exceeded after the save with no warning.
@@ -242,7 +242,7 @@ public void setWarningLimitForContainerSizeInBytes(long warningLimitForContainer
/**
* The logger for warnings and errors.
*/
- public void setLogger(Logger logger) {
+ public void setLogger(CommonLogger logger) {
this.logger = logger;
}
@@ -349,7 +349,7 @@ public boolean delete(String id, String root, String filePath) {
/**
* Checks the space used for the account against the space available.
- * Will call the Logger to report any warning or error.
+ * Will call the CommonLogger to report any warning or error.
*/
private void checkAccountSpace() throws IOException{
if(warningLimitForAccountSizeInBytes <= 0L && errorLimitForAccountSizeInBytes <= 0L){
@@ -368,7 +368,7 @@ private void checkAccountSpace() throws IOException{
/**
* Checks the space used for the container against the space available.
- * Will call the Logger to report any warning or error.
+ * Will call the CommonLogger to report any warning or error.
*/
private void checkContainerSpace(String container) throws IOException{
if(warningLimitForContainerSizeInBytes <= 0L && errorLimitForContainerSizeInBytes <= 0L){
@@ -457,28 +457,28 @@ class ContainerAndName {
/**
* A simple implementation that uses typical commons-logging.
*/
- class DefaultLogger implements Logger {
+ class DefaultLogger implements CommonLogger {
- private Log log = LogFactory.getLog(SwiftFileSystemHandler.class);
+ private final Logger log = LoggerFactory.getLogger(SwiftFileSystemHandler.class);
@Override
public void warningOnAccountSize(long warningLimitInBytes, long bytesUsed) {
- log.warn("Warning on Swift account size -- warningLimit: " + warningLimitInBytes + ", bytesUsed: " + bytesUsed);
+ log.warn("Warning on Swift account size -- warningLimit: {}, bytesUsed: {}", warningLimitInBytes, bytesUsed);
}
@Override
public void errorOnAccountSize(long maxSizeInBytes, long bytesUsed) {
- log.error("Error on Swift account size -- maxSize: " + maxSizeInBytes + ", bytesUsed: " + bytesUsed);
+ log.error("Error on Swift account size -- maxSize: {}, bytesUsed: {}", maxSizeInBytes, bytesUsed);
}
@Override
public void warningOnContainerSize(long warningLimitInBytes, long bytesUsed) {
- log.warn("Warning on Swift container size -- warningLimit: " + warningLimitInBytes + ", bytesUsed: " + bytesUsed);
+ log.warn("Warning on Swift container size -- warningLimit: {}, bytesUsed: {}", warningLimitInBytes, bytesUsed);
}
@Override
public void errorOnContainerSize(long maxSizeInBytes, long bytesUsed) {
- log.error("Error on Swift container size -- maxSize: " + maxSizeInBytes + ", bytesUsed: " + bytesUsed);
+ log.error("Error on Swift container size -- maxSize: {}, bytesUsed: {}", maxSizeInBytes, bytesUsed);
}
};
}
diff --git a/cmprovider/src/java/org/sakaiproject/cmprovider/AbstractCmEntityProvider.java b/cmprovider/src/java/org/sakaiproject/cmprovider/AbstractCmEntityProvider.java
index 448905856e2d..b8d5ba1e31c9 100644
--- a/cmprovider/src/java/org/sakaiproject/cmprovider/AbstractCmEntityProvider.java
+++ b/cmprovider/src/java/org/sakaiproject/cmprovider/AbstractCmEntityProvider.java
@@ -9,8 +9,8 @@
import javax.validation.Validator;
import javax.validation.Validation;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.AuthzGroupService;
import org.sakaiproject.cmprovider.data.CmEntityData;
@@ -105,7 +105,7 @@ public abstract class AbstractCmEntityProvider implements RESTful, CoreEntityPro
protected SessionManager sessionManager;
public void setSessionManager(SessionManager manager) { sessionManager = manager; }
- private static final Log LOG = LogFactory.getLog(AbstractCmEntityProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractCmEntityProvider.class);
public String[] getHandledOutputFormats() {
return new String[] { Formats.JSON };
diff --git a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ArchiveService2Impl.java b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ArchiveService2Impl.java
index 7896a5b773be..bbdc9071087a 100644
--- a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ArchiveService2Impl.java
+++ b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ArchiveService2Impl.java
@@ -21,8 +21,8 @@
import java.io.IOException;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.archive.api.ArchiveService;
import org.sakaiproject.component.api.ServerConfigurationService;
import org.sakaiproject.entity.api.EntityManager;
@@ -30,7 +30,7 @@
public class ArchiveService2Impl implements ArchiveService
{
/** Our logger. */
- private static Log M_log = LogFactory.getLog(ArchiveService2Impl.class);
+ private static Logger M_log = LoggerFactory.getLogger(ArchiveService2Impl.class);
/*******************************************************************************
* Dependencies and their setter methods
diff --git a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataImpl.java b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataImpl.java
index f6b62f387149..8284822a22ea 100644
--- a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataImpl.java
+++ b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataImpl.java
@@ -21,8 +21,8 @@
package org.sakaiproject.archive.impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.archive.api.ImportMetadata;
/**
@@ -32,7 +32,7 @@
*/
public class ImportMetadataImpl implements ImportMetadata
{
- private static final Log LOG = LogFactory.getLog(ImportMetadataImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ImportMetadataImpl.class);
private String id;
private String legacyTool;
@@ -151,4 +151,4 @@ public void setSakaiTool(String sakaiTool)
this.sakaiTool = sakaiTool;
}
-}
\ No newline at end of file
+}
diff --git a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataServiceImpl.java b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataServiceImpl.java
index a06295a6c394..122c6bf7a6d8 100644
--- a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataServiceImpl.java
+++ b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/ImportMetadataServiceImpl.java
@@ -24,8 +24,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.archive.api.ImportMetadata;
import org.sakaiproject.archive.api.ImportMetadataService;
import org.w3c.dom.Document;
@@ -41,7 +41,7 @@
public class ImportMetadataServiceImpl implements ImportMetadataService
{
- private static final Log LOG = LogFactory.getLog(ImportMetadataImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ImportMetadataImpl.class);
private static final String ROOT = "importConfiguration";
private static final String MAPPINGS = "mappings";
@@ -330,4 +330,4 @@ public boolean hasMaintainRole(String username, Document siteDoc)
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteArchiver.java b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteArchiver.java
index 6d985b975de9..3dfeef0c0f45 100644
--- a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteArchiver.java
+++ b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteArchiver.java
@@ -29,8 +29,8 @@
import java.util.regex.Pattern;
import java.util.regex.Matcher;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.archive.api.ArchiveService;
import org.sakaiproject.authz.api.AuthzGroup;
import org.sakaiproject.authz.api.GroupNotDefinedException;
@@ -58,7 +58,7 @@
public class SiteArchiver {
- private static Log M_log = LogFactory.getLog(SiteArchiver.class);
+ private static Logger M_log = LoggerFactory.getLogger(SiteArchiver.class);
/** Dependency: ServerConfigurationService. */
protected ServerConfigurationService m_serverConfigurationService = null;
@@ -105,8 +105,7 @@ public String archive(String siteId, String m_storagePath, String fromSystem)
{
StringBuilder results = new StringBuilder();
- if (M_log.isDebugEnabled())
- M_log.debug("archive(): site: " + siteId);
+ M_log.debug("archive(): site: {}", siteId);
Site theSite = null;
try
@@ -323,7 +322,7 @@ protected String archiveSite(Site site, Document doc, Stack stack, String fromSy
}
catch(Exception any)
{
- M_log.warn("archve: exception archiving site: "+ site.getId() + ": ", any);
+ M_log.warn("archve: exception archiving site: {}: {}", site.getId(), any);
}
stack.pop();
@@ -363,16 +362,16 @@ protected String archiveUsers(Site site, Document doc, Stack stack)
}
catch (GroupNotDefinedException e)
{
- M_log.warn(e, e);
+ M_log.warn(e.getMessage(), e);
}
catch (Exception any) {
- M_log.warn(any,any);
+ M_log.warn(any.getMessage(), any);
}
}
catch (Exception any)
{
- M_log.warn(any,any);
+ M_log.warn(any.getMessage(), any);
}
stack.pop();
diff --git a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteMerger.java b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteMerger.java
index 0969c0caa5c9..82bb9fb3a8e3 100644
--- a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteMerger.java
+++ b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteMerger.java
@@ -27,8 +27,8 @@
import java.util.Vector;
import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.archive.api.ArchiveService;
import org.sakaiproject.authz.api.AuthzGroup;
import org.sakaiproject.authz.api.AuthzGroupService;
@@ -52,7 +52,7 @@
import org.w3c.dom.NodeList;
public class SiteMerger {
- private static Log M_log = LogFactory.getLog(SiteMerger.class);
+ private static Logger M_log = LoggerFactory.getLogger(SiteMerger.class);
protected static HashMap userIdTrans = new HashMap();
@@ -388,7 +388,7 @@ protected void mergeSite(String siteId, String fromSiteId, Element element, Hash
}
catch(Exception any)
{
- M_log.warn(any,any);
+ M_log.warn(any.getMessage(), any);
}
Site site = null;
@@ -417,7 +417,7 @@ protected void mergeSite(String siteId, String fromSiteId, Element element, Hash
mergeSiteRoles(element3, siteId, useIdTrans, filterSakaiRoles, filteredSakaiRoles);
}
catch (PermissionException e1) {
- M_log.warn(e1,e1);
+ M_log.warn(e1.getMessage(), e1);
}
}
}
diff --git a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteZipper.java b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteZipper.java
index 89e583d2c216..4da5c5907951 100644
--- a/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteZipper.java
+++ b/common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteZipper.java
@@ -37,14 +37,14 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.api.ServerConfigurationService;
public class SiteZipper {
- private static Log log = LogFactory.getLog(SiteZipper.class);
+ private static Logger log = LoggerFactory.getLogger(SiteZipper.class);
protected ServerConfigurationService serverConfigurationService = null;
public void setServerConfigurationService(ServerConfigurationService service) {
diff --git a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/FileSystemPhotoService.java b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/FileSystemPhotoService.java
index 219aa6fcaf8f..9a62c9b7d852 100644
--- a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/FileSystemPhotoService.java
+++ b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/FileSystemPhotoService.java
@@ -6,15 +6,15 @@
import java.io.FileOutputStream;
import java.io.IOException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.edu.person.BasePhotoService;
import org.sakaiproject.component.api.ServerConfigurationService;
import org.sakaiproject.user.api.UserDirectoryService;
import org.sakaiproject.user.api.UserNotDefinedException;
public class FileSystemPhotoService extends BasePhotoService {
- private static final Log LOG = LogFactory.getLog(FileSystemPhotoService.class);
+ private static final Logger LOG = LoggerFactory.getLogger(FileSystemPhotoService.class);
private String photoRepositoryPath = null;
diff --git a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonManagerImpl.java b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonManagerImpl.java
index 871fb36cede5..4f17da0da856 100644
--- a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonManagerImpl.java
+++ b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonManagerImpl.java
@@ -45,8 +45,8 @@
import org.hibernate.criterion.Order;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.edu.person.PhotoService;
import org.sakaiproject.api.common.edu.person.SakaiPerson;
import org.sakaiproject.api.common.edu.person.SakaiPersonManager;
@@ -71,7 +71,7 @@
*/
public class SakaiPersonManagerImpl extends HibernateDaoSupport implements SakaiPersonManager
{
- private static final Log LOG = LogFactory.getLog(SakaiPersonManagerImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(SakaiPersonManagerImpl.class);
private static final String PERCENT_SIGN = "%";
diff --git a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonObserver.java b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonObserver.java
index 21ae70a49ef3..245a41110e8a 100644
--- a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonObserver.java
+++ b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonObserver.java
@@ -24,8 +24,8 @@
import java.util.Observable;
import java.util.Observer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.edu.person.SakaiPerson;
import org.sakaiproject.api.common.edu.person.SakaiPersonManager;
import org.sakaiproject.component.api.ServerConfigurationService;
@@ -42,7 +42,7 @@
*/
public class SakaiPersonObserver implements Observer {
- private static Log log = LogFactory.getLog(SakaiPersonObserver.class);
+ private static Logger log = LoggerFactory.getLogger(SakaiPersonObserver.class);
private EventTrackingService eventTrackingService;
public void setEventTrackingService(EventTrackingService eventTrackingService) {
diff --git a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonPhotoService.java b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonPhotoService.java
index f45475d7b01b..343ec034ceac 100644
--- a/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonPhotoService.java
+++ b/common/common-composite-component/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonPhotoService.java
@@ -22,8 +22,8 @@
package org.sakaiproject.component.common.edu.person;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.edu.person.PhotoService;
import org.sakaiproject.api.common.edu.person.SakaiPersonManager;
@@ -32,7 +32,7 @@
* By default, roster photos come from the Profile service.
*/
public class SakaiPersonPhotoService implements PhotoService {
- private static final Log log = LogFactory.getLog(SakaiPersonPhotoService.class);
+ private static final Logger log = LoggerFactory.getLogger(SakaiPersonPhotoService.class);
private SakaiPersonManager sakaiPersonManager;
diff --git a/common/common-composite-component/src/java/org/sakaiproject/component/common/manager/PersistableHelper.java b/common/common-composite-component/src/java/org/sakaiproject/component/common/manager/PersistableHelper.java
index 422ac29d0474..b36f04f37179 100644
--- a/common/common-composite-component/src/java/org/sakaiproject/component/common/manager/PersistableHelper.java
+++ b/common/common-composite-component/src/java/org/sakaiproject/component/common/manager/PersistableHelper.java
@@ -25,8 +25,8 @@
import java.util.Date;
import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.manager.Persistable;
import org.sakaiproject.tool.api.Session;
import org.sakaiproject.tool.api.SessionManager;
@@ -38,7 +38,7 @@ public class PersistableHelper
{
private static final String SYSTEM = "SYSTEM";
- private static final Log LOG = LogFactory.getLog(PersistableHelper.class);
+ private static final Logger LOG = LoggerFactory.getLogger(PersistableHelper.class);
private static final String LASTMODIFIEDDATE = "lastModifiedDate";
@@ -66,15 +66,9 @@ public void modifyPersistableFields(Persistable persistable)
PropertyUtils.setProperty(persistable, LASTMODIFIEDBY, actor);
PropertyUtils.setProperty(persistable, LASTMODIFIEDDATE, now);
}
- catch (NoSuchMethodException e)
+ catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e)
{
- LOG.error(e);
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- LOG.error(e);
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- LOG.error(e);
+ LOG.error(e.getMessage());
throw new RuntimeException(e);
}
}
@@ -97,15 +91,9 @@ public void createPersistableFields(Persistable persistable)
PropertyUtils.setProperty(persistable, CREATEDBY, actor);
PropertyUtils.setProperty(persistable, CREATEDDATE, now);
}
- catch (NoSuchMethodException e)
+ catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e)
{
- LOG.error(e);
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- LOG.error(e);
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- LOG.error(e);
+ LOG.error(e.getMessage());
throw new RuntimeException(e);
}
}
diff --git a/common/common-composite-component/src/java/org/sakaiproject/component/common/type/TypeManagerImpl.java b/common/common-composite-component/src/java/org/sakaiproject/component/common/type/TypeManagerImpl.java
index f84099eea160..6bacebeb1376 100644
--- a/common/common-composite-component/src/java/org/sakaiproject/component/common/type/TypeManagerImpl.java
+++ b/common/common-composite-component/src/java/org/sakaiproject/component/common/type/TypeManagerImpl.java
@@ -27,8 +27,8 @@
import org.hibernate.Query;
import org.hibernate.Session;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.type.Type;
import org.sakaiproject.api.common.type.TypeManager;
import org.sakaiproject.component.common.manager.PersistableHelper;
@@ -41,7 +41,7 @@
*/
public class TypeManagerImpl extends HibernateDaoSupport implements TypeManager
{
- private static final Log LOG = LogFactory.getLog(TypeManagerImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(TypeManagerImpl.class);
private static final String ID = "id";
diff --git a/common/impl/src/java/org/sakaiproject/component/common/edu/person/InetOrgPersonImpl.java b/common/impl/src/java/org/sakaiproject/component/common/edu/person/InetOrgPersonImpl.java
index 680a02149af6..3bac9535fbf5 100644
--- a/common/impl/src/java/org/sakaiproject/component/common/edu/person/InetOrgPersonImpl.java
+++ b/common/impl/src/java/org/sakaiproject/component/common/edu/person/InetOrgPersonImpl.java
@@ -31,8 +31,8 @@
import org.hibernate.Hibernate;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.edu.person.InetOrgPerson;
import org.sakaiproject.api.common.edu.person.OrganizationalPerson;
import org.sakaiproject.api.common.edu.person.Person;
@@ -43,7 +43,7 @@
*/
public class InetOrgPersonImpl extends OrganizationalPersonImpl implements Person, OrganizationalPerson, InetOrgPerson
{
- private static final Log LOG = LogFactory.getLog(InetOrgPersonImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(InetOrgPersonImpl.class);
/**
* @see org.sakaiproject.service.profile.InetOrgPerson#getAudio()
diff --git a/common/impl/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonImpl.java b/common/impl/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonImpl.java
index ada32e636087..3c24d22712dd 100644
--- a/common/impl/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonImpl.java
+++ b/common/impl/src/java/org/sakaiproject/component/common/edu/person/SakaiPersonImpl.java
@@ -21,8 +21,8 @@
package org.sakaiproject.component.common.edu.person;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.edu.person.InetOrgPerson;
import org.sakaiproject.api.common.edu.person.OrganizationalPerson;
import org.sakaiproject.api.common.edu.person.Person;
@@ -34,7 +34,7 @@
*/
public class SakaiPersonImpl extends EduPersonImpl implements Person, OrganizationalPerson, InetOrgPerson, SakaiPerson
{
- private static final Log LOG = LogFactory.getLog(SakaiPersonImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(SakaiPersonImpl.class);
/**
* Empty constuctor for hibernate
diff --git a/common/impl/src/java/org/sakaiproject/component/common/manager/PersistableImpl.java b/common/impl/src/java/org/sakaiproject/component/common/manager/PersistableImpl.java
index 369c5367cacc..3c14bfd4e02b 100644
--- a/common/impl/src/java/org/sakaiproject/component/common/manager/PersistableImpl.java
+++ b/common/impl/src/java/org/sakaiproject/component/common/manager/PersistableImpl.java
@@ -23,8 +23,8 @@
import java.util.Date;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.manager.Persistable;
/**
@@ -32,7 +32,7 @@
*/
public abstract class PersistableImpl implements Persistable
{
- private static final Log LOG = LogFactory.getLog(PersistableImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(PersistableImpl.class);
protected Long id;
diff --git a/common/impl/src/java/org/sakaiproject/component/common/manager/TypeablePersistableImpl.java b/common/impl/src/java/org/sakaiproject/component/common/manager/TypeablePersistableImpl.java
index f0de8b74d8b1..9a4b9897403d 100644
--- a/common/impl/src/java/org/sakaiproject/component/common/manager/TypeablePersistableImpl.java
+++ b/common/impl/src/java/org/sakaiproject/component/common/manager/TypeablePersistableImpl.java
@@ -21,8 +21,8 @@
package org.sakaiproject.component.common.manager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.type.Type;
import org.sakaiproject.api.common.type.Typeable;
@@ -31,7 +31,7 @@
*/
public abstract class TypeablePersistableImpl extends PersistableImpl implements Typeable
{
- private static final Log LOG = LogFactory.getLog(TypeablePersistableImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(TypeablePersistableImpl.class);
private static final String NULL = "null";
diff --git a/common/impl/src/java/org/sakaiproject/component/common/type/TypeImpl.java b/common/impl/src/java/org/sakaiproject/component/common/type/TypeImpl.java
index bdc20328db14..d376608f2c4d 100644
--- a/common/impl/src/java/org/sakaiproject/component/common/type/TypeImpl.java
+++ b/common/impl/src/java/org/sakaiproject/component/common/type/TypeImpl.java
@@ -21,8 +21,8 @@
package org.sakaiproject.component.common.type;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.common.type.Type;
import org.sakaiproject.component.common.manager.PersistableImpl;
@@ -31,7 +31,7 @@
*/
public class TypeImpl extends PersistableImpl implements Type
{
- private static final Log LOG = LogFactory.getLog(TypeImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(TypeImpl.class);
private String authority;
diff --git a/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/LBCCHandler.java b/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/LBCCHandler.java
index d959e6184d97..a1e04a8f62a3 100644
--- a/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/LBCCHandler.java
+++ b/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/LBCCHandler.java
@@ -71,12 +71,12 @@
import javax.activation.MimetypesFileTypeMap;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
public class LBCCHandler implements HandlesImportable {
- private Log m_log = LogFactory.getLog(org.sakaiproject.importer.impl.handlers.LBCCHandler.class);
+ private Logger m_log = LoggerFactory.getLogger(org.sakaiproject.importer.impl.handlers.LBCCHandler.class);
public boolean canHandleType(String typeName) {
return "lessonbuilder-cc-file".equals(typeName);
diff --git a/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/ResourcesHandler.java b/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/ResourcesHandler.java
index d853393737f4..73492ae30eda 100644
--- a/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/ResourcesHandler.java
+++ b/common/import-handlers/content-handlers/src/java/org/sakaiproject/importer/impl/handlers/ResourcesHandler.java
@@ -68,8 +68,8 @@
import javax.activation.MimetypesFileTypeMap;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
public class ResourcesHandler implements HandlesImportable {
private static final String COPYRIGHT = "(c) 2007";
@@ -80,7 +80,7 @@ public class ResourcesHandler implements HandlesImportable {
private SecurityService securityService;
private ServerConfigurationService serverConfigurationService;
- private Log m_log = LogFactory.getLog(org.sakaiproject.importer.impl.handlers.ResourcesHandler.class);
+ private Logger m_log = LoggerFactory.getLogger(org.sakaiproject.importer.impl.handlers.ResourcesHandler.class);
public boolean canHandleType(String typeName) {
return (("sakai-file-resource".equals(typeName) || ("sakai-folder".equals(typeName)) ||
diff --git a/common/import-parsers/blackboard_5-5/src/java/org/sakaiproject/importer/impl/translators/Bb55AnnouncementTranslator.java b/common/import-parsers/blackboard_5-5/src/java/org/sakaiproject/importer/impl/translators/Bb55AnnouncementTranslator.java
index cc87117bee30..2b623cf2cbd7 100644
--- a/common/import-parsers/blackboard_5-5/src/java/org/sakaiproject/importer/impl/translators/Bb55AnnouncementTranslator.java
+++ b/common/import-parsers/blackboard_5-5/src/java/org/sakaiproject/importer/impl/translators/Bb55AnnouncementTranslator.java
@@ -5,8 +5,8 @@
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.importer.api.Importable;
import org.sakaiproject.importer.api.IMSResourceTranslator;
import org.sakaiproject.importer.impl.Blackboard55FileParser;
@@ -17,7 +17,7 @@
public class Bb55AnnouncementTranslator implements IMSResourceTranslator {
- private static Log log = LogFactory.getLog(Bb55AnnouncementTranslator.class);
+ private static Logger log = LoggerFactory.getLogger(Bb55AnnouncementTranslator.class);
public String getTypeName() {
// TODO Auto-generated method stub
diff --git a/common/import-parsers/blackboard_6/impl/src/java/org/sakaiproject/importer/impl/translators/Bb6AnnouncementTranslator.java b/common/import-parsers/blackboard_6/impl/src/java/org/sakaiproject/importer/impl/translators/Bb6AnnouncementTranslator.java
index 313a1278f674..f9096f7dc6e8 100644
--- a/common/import-parsers/blackboard_6/impl/src/java/org/sakaiproject/importer/impl/translators/Bb6AnnouncementTranslator.java
+++ b/common/import-parsers/blackboard_6/impl/src/java/org/sakaiproject/importer/impl/translators/Bb6AnnouncementTranslator.java
@@ -19,8 +19,8 @@
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.importer.impl.importables.Announcement;
@@ -38,7 +38,7 @@
*/
public class Bb6AnnouncementTranslator implements IMSResourceTranslator {
- private static Log log = LogFactory.getLog(Bb6AnnouncementTranslator.class);
+ private static Logger log = LoggerFactory.getLogger(Bb6AnnouncementTranslator.class);
public String getTypeName() {
return "resource/x-bb-announcement";
diff --git a/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/CommonCartridgeFileParser.java b/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/CommonCartridgeFileParser.java
index 585739c0504f..ac1a67881306 100644
--- a/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/CommonCartridgeFileParser.java
+++ b/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/CommonCartridgeFileParser.java
@@ -36,8 +36,8 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.archive.api.ImportMetadata;
import org.sakaiproject.importer.api.ImportFileParser;
import org.sakaiproject.importer.api.Importable;
@@ -55,7 +55,7 @@ public class CommonCartridgeFileParser extends IMSFileParser {
private static final String CC_NAMESPACE_URI = "http://www.imsglobal.org/xsd/imscc/imscp_v1p1";
/** Our logger. */
- private static Log M_log = LogFactory.getLog(CommonCartridgeFileParser.class);
+ private static Logger M_log = LoggerFactory.getLogger(CommonCartridgeFileParser.class);
public CommonCartridgeFileParser() {
// add resource translators here
diff --git a/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/LBCommonCartridgeFileParser.java b/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/LBCommonCartridgeFileParser.java
index 019241a27e0b..5e586ad8efa0 100644
--- a/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/LBCommonCartridgeFileParser.java
+++ b/common/import-parsers/common-cartridge/src/java/org/sakaiproject/importer/impl/LBCommonCartridgeFileParser.java
@@ -36,8 +36,8 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.archive.api.ImportMetadata;
import org.sakaiproject.importer.api.ImportFileParser;
import org.sakaiproject.importer.api.ImportDataSource;
@@ -62,7 +62,7 @@ public class LBCommonCartridgeFileParser extends IMSFileParser {
"http://www.imsglobal.org/xsd/imsccv1p3/imscp_v1p1"};
/** Our logger. */
- private static Log M_log = LogFactory.getLog(LBCommonCartridgeFileParser.class);
+ private static Logger M_log = LoggerFactory.getLogger(LBCommonCartridgeFileParser.class);
public LBCommonCartridgeFileParser() {
}
diff --git a/common/privacy-comp-impl/src/java/org/sakaiproject/component/privacy/PrivacyManagerImpl.java b/common/privacy-comp-impl/src/java/org/sakaiproject/component/privacy/PrivacyManagerImpl.java
index 723d57075e9f..92310ec8ac12 100644
--- a/common/privacy-comp-impl/src/java/org/sakaiproject/component/privacy/PrivacyManagerImpl.java
+++ b/common/privacy-comp-impl/src/java/org/sakaiproject/component/privacy/PrivacyManagerImpl.java
@@ -21,8 +21,8 @@
package org.sakaiproject.component.privacy;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.Query;
@@ -53,7 +53,7 @@
public class PrivacyManagerImpl extends HibernateDaoSupport implements PrivacyManager, AuthzGroupAdvisor
{
- private static Log log = LogFactory.getLog(PrivacyManagerImpl.class);
+ private static Logger log = LoggerFactory.getLogger(PrivacyManagerImpl.class);
private static final String QUERY_BY_USERID_CONTEXTID_TYPEID = "findPrivacyByUserIdContextIdType";
private static final String QUERY_BY_DISABLED_USERID_CONTEXTID = "findDisabledPrivacyUserIdContextIdType";
diff --git a/common/privacy-integration-test/src/test/org/sakaiproject/component/test/privacy/PrivacyTest.java b/common/privacy-integration-test/src/test/org/sakaiproject/component/test/privacy/PrivacyTest.java
index d364c43e85ef..b968fd4007c1 100644
--- a/common/privacy-integration-test/src/test/org/sakaiproject/component/test/privacy/PrivacyTest.java
+++ b/common/privacy-integration-test/src/test/org/sakaiproject/component/test/privacy/PrivacyTest.java
@@ -26,15 +26,15 @@
import junit.framework.TestSuite;
import java.util.*;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.privacy.PrivacyManager;
import org.sakaiproject.test.SakaiTestBase;
public class PrivacyTest extends SakaiTestBase
{
- private static Log log = LogFactory.getLog(PrivacyTest.class);
+ private static Logger log = LoggerFactory.getLogger(PrivacyTest.class);
private PrivacyManager privacyManager;
public static Test suite()
diff --git a/content-review/impl/turnitin/src/main/java/org/sakaiproject/contentreview/turnitin/util/TurnitinAPIUtil.java b/content-review/impl/turnitin/src/main/java/org/sakaiproject/contentreview/turnitin/util/TurnitinAPIUtil.java
index 9d49b05426e9..98db45a5984b 100644
--- a/content-review/impl/turnitin/src/main/java/org/sakaiproject/contentreview/turnitin/util/TurnitinAPIUtil.java
+++ b/content-review/impl/turnitin/src/main/java/org/sakaiproject/contentreview/turnitin/util/TurnitinAPIUtil.java
@@ -49,8 +49,8 @@
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.azeckoski.reflectutils.transcoders.XMLTranscoder;
import org.sakaiproject.content.api.ContentResource;
import org.sakaiproject.contentreview.exception.SubmissionException;
@@ -71,7 +71,7 @@
@CommonsLog
public class TurnitinAPIUtil {
- private static final Log apiTraceLog = LogFactory.getLog("org.sakaiproject.turnitin.util.TurnitinAPIUtil.apicalltrace");
+ private static final Logger apiTraceLog = LoggerFactory.getLogger("org.sakaiproject.turnitin.util.TurnitinAPIUtil.apicalltrace");
private static String encodeSakaiTitles(String assignTitle) {
String assignEnc = assignTitle;
diff --git a/content/content-cleanup/content-cleanup-impl/src/java/org/sakaiproject/content/CleanupDeletedContent.java b/content/content-cleanup/content-cleanup-impl/src/java/org/sakaiproject/content/CleanupDeletedContent.java
index 778aa7d7ad88..bf1e00a3e326 100644
--- a/content/content-cleanup/content-cleanup-impl/src/java/org/sakaiproject/content/CleanupDeletedContent.java
+++ b/content/content-cleanup/content-cleanup-impl/src/java/org/sakaiproject/content/CleanupDeletedContent.java
@@ -21,8 +21,8 @@
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -48,8 +48,7 @@
*/
public class CleanupDeletedContent implements Job {
- private static final Log log = LogFactory
- .getLog(CleanupDeletedContent.class);
+ private static final Logger log = LoggerFactory.getLogger(CleanupDeletedContent.class);
private ContentHostingService chs;
private ServerConfigurationService scs;
@@ -117,19 +116,16 @@ public void execute(JobExecutionContext context)
}
}
else {
- if (log.isDebugEnabled()) {
- log.debug("Resource " + resource.getId() + " is still too new, skipping.");
- }
+ log.debug("Resource {} is still too new, skipping.", resource.getId());
}
}
else {
- log.warn("No modified date set for file with id " + resource.getId() + ". Cannot process for deletion.");
+ log.warn("No modified date set for file with id {}. Cannot process for deletion.", resource.getId());
}
}
int failed = attempted - removed;
- log.info("Out of " + deleted.size() + "(~"+ formatSize(totalSize)+ ") "
- + "deleted resources, successfully removed " + removed + "(~"+ formatSize(removedSize)+ ")"
- + ((failed > 0) ? ", failed on " + failed + " resources": ""));
+ log.info("Out of {}(~{}) deleted resources, successfully removed {}(~{}), failed resources: {}",
+ deleted.size(), formatSize(totalSize), removed, formatSize(removedSize), failed);
}
static String formatSize(long size) {
diff --git a/content/content-copyright/impl/src/java/org/sakaiproject/content/copyright/CopyrightManager.java b/content/content-copyright/impl/src/java/org/sakaiproject/content/copyright/CopyrightManager.java
index 01e1c4c6b873..7672e9a8e1b1 100644
--- a/content/content-copyright/impl/src/java/org/sakaiproject/content/copyright/CopyrightManager.java
+++ b/content/content-copyright/impl/src/java/org/sakaiproject/content/copyright/CopyrightManager.java
@@ -24,13 +24,13 @@
import java.util.Locale;
import java.util.ResourceBundle;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.api.ServerConfigurationService;
public class CopyrightManager implements org.sakaiproject.content.copyright.api.CopyrightManager {
- static final Log logger = LogFactory.getLog(CopyrightManager.class);
+ static final Logger logger = LoggerFactory.getLogger(CopyrightManager.class);
protected boolean active = true;
@@ -96,4 +96,4 @@ private boolean existsFile(String file,String baseURL) {
return f.exists();
}
-}
\ No newline at end of file
+}
diff --git a/content/content-impl-providers/impl/src/java/org/sakaiproject/content/providers/BaseEventDelayHandler.java b/content/content-impl-providers/impl/src/java/org/sakaiproject/content/providers/BaseEventDelayHandler.java
index a47521472dd1..c35d239c3965 100644
--- a/content/content-impl-providers/impl/src/java/org/sakaiproject/content/providers/BaseEventDelayHandler.java
+++ b/content/content-impl-providers/impl/src/java/org/sakaiproject/content/providers/BaseEventDelayHandler.java
@@ -6,8 +6,8 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.app.scheduler.DelayedInvocation;
import org.sakaiproject.api.app.scheduler.ScheduledInvocationCommand;
import org.sakaiproject.api.app.scheduler.ScheduledInvocationManager;
@@ -28,7 +28,7 @@ public class BaseEventDelayHandler implements EventDelayHandler, ScheduledInvoca
{
private boolean autoDdl;
- private static final Log LOG = LogFactory.getLog(BaseEventDelayHandler.class);
+ private static final Logger LOG = LoggerFactory.getLogger(BaseEventDelayHandler.class);
private SqlService sqlService;
private ScheduledInvocationManager schedInvocMgr;
diff --git a/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/logic/MetadataServiceFromContent.java b/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/logic/MetadataServiceFromContent.java
index 8945f1feaa31..b3d9eb440f06 100644
--- a/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/logic/MetadataServiceFromContent.java
+++ b/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/logic/MetadataServiceFromContent.java
@@ -26,8 +26,8 @@
import java.util.Collections;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.SecurityAdvisor;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.content.api.ContentHostingService;
@@ -45,7 +45,7 @@
public class MetadataServiceFromContent implements MetadataService
{
- private static Log logger = LogFactory.getLog(MetadataServiceFromContent.class);
+ private static Logger logger = LoggerFactory.getLogger(MetadataServiceFromContent.class);
protected final ContentHostingService contentHostingService;
protected final SecurityService securityService;
diff --git a/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/model/ListMetadataType.java b/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/model/ListMetadataType.java
index d6e24672bc58..99ad27d2d371 100644
--- a/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/model/ListMetadataType.java
+++ b/content/content-metadata/impl/src/java/org/sakaiproject/content/metadata/model/ListMetadataType.java
@@ -27,7 +27,7 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
+import org.slf4j.Logger;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.sakaiproject.content.metadata.model.MetadataConverter;
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/AttachmentAction.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/AttachmentAction.java
index 4b11dada586b..687af47e5b49 100644
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/AttachmentAction.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/AttachmentAction.java
@@ -26,8 +26,8 @@
import java.util.Vector;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.cheftool.Context;
import org.sakaiproject.cheftool.JetspeedRunData;
import org.sakaiproject.cheftool.RunData;
@@ -64,7 +64,7 @@
public class AttachmentAction
{
/** Our logger. */
- private static Log M_log = LogFactory.getLog(AttachmentAction.class);
+ private static Logger M_log = LoggerFactory.getLogger(AttachmentAction.class);
/** Resource bundle using current language locale */
private static ResourceLoader rb = new ResourceLoader("helper");
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java
index 484e5ae2c9a5..49606ab253c4 100755
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java
@@ -48,8 +48,8 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequestWrapper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.myfaces.webapp.filter.MultipartRequestWrapper;
@@ -144,7 +144,7 @@ public class FilePickerAction extends PagedResourceHelperAction
private String resourceBundle = ServerConfigurationService.getString(RESOURCEBUNDLE, DEFAULT_RESOURCEBUNDLE);
private ResourceLoader srb = new Resource().getLoader(resourceClass, resourceBundle);
- private static final Log logger = LogFactory.getLog(FilePickerAction.class);
+ private static final Logger logger = LoggerFactory.getLogger(FilePickerAction.class);
protected static final String PREFIX = "filepicker.";
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ListItem.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ListItem.java
index d110842db1f7..87b7e924d656 100644
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ListItem.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ListItem.java
@@ -42,8 +42,8 @@
import java.util.TreeSet;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.antivirus.api.VirusFoundException;
import org.sakaiproject.authz.api.AuthzGroupService;
import org.sakaiproject.authz.cover.SecurityService;
@@ -115,7 +115,7 @@ public class ListItem
/** Resource bundle using current language locale */
private static ResourceLoader trb = new ResourceLoader("types");
- private static final Log logger = LogFactory.getLog(ListItem.class);
+ private static final Logger logger = LoggerFactory.getLogger(ListItem.class);
protected static final Comparator DEFAULT_COMPARATOR = ContentHostingService.newContentHostingComparator(ResourceProperties.PROP_DISPLAY_NAME, true);
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourceConditionsHelper.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourceConditionsHelper.java
index 9263f0590dd7..0845b485b8f6 100644
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourceConditionsHelper.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourceConditionsHelper.java
@@ -25,8 +25,8 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.cheftool.Context;
import org.sakaiproject.cheftool.VelocityPortletPaneledAction;
import org.sakaiproject.component.cover.ComponentManager;
@@ -54,7 +54,7 @@ public class ResourceConditionsHelper {
*/
private static final long serialVersionUID = -3875833398687224551L;
- static final Log logger = LogFactory.getLog(ResourceConditionsHelper.class);
+ static final Logger logger = LoggerFactory.getLogger(ResourceConditionsHelper.class);
static final ConditionService conditionService = (ConditionService)ComponentManager.get("org.sakaiproject.conditions.api.ConditionService");
@@ -264,4 +264,4 @@ static void notifyCondition(Entity entity) {
}
-}
\ No newline at end of file
+}
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java
index ec131c94d578..fa0aa3cb08f6 100644
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java
@@ -53,8 +53,8 @@
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.alias.api.AliasEdit;
import org.sakaiproject.alias.api.AliasService;
import org.sakaiproject.antivirus.api.VirusFoundException;
@@ -424,7 +424,7 @@ public void setParent(String parent)
private String resourceBundle = ServerConfigurationService.getString(RESOURCEBUNDLE, DEFAULT_RESOURCEBUNDLE);
private ResourceLoader srb = new Resource().getLoader(resourceClass, resourceBundle);
- static final Log logger = LogFactory.getLog(ResourcesAction.class);
+ static final Logger logger = LoggerFactory.getLogger(ResourcesAction.class);
static final ResourceConditionsHelper conditionsHelper = new ResourceConditionsHelper();
@@ -7711,7 +7711,7 @@ public void doRestore( RunData data)
} catch (Exception e) {
String[] args = { e.getClass().getName(), selectedItem, e.getMessage()};
addAlert(state, trb.getFormattedMessage("action.exception", args));
- logger.fatal("Unable to restore recourse with ID " + selectedItem ,e);
+ logger.error("Unable to restore recourse with ID {}", selectedItem, e);
}
}
}
@@ -7724,7 +7724,7 @@ else if ("remove".equalsIgnoreCase(flow))
} catch (Exception ex) {
String[] args = {ex.getClass().getName(),selectedItem, ex.getMessage() };
addAlert(state, trb.getFormattedMessage("action.exception", args));
- logger.fatal("Unable to permanently remove recourse with ID " + selectedItem ,ex);
+ logger.error("Unable to permanently remove recourse with ID {}", selectedItem, ex);
}
}
}
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesHelperAction.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesHelperAction.java
index 18239b58132c..79c464afe311 100644
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesHelperAction.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesHelperAction.java
@@ -48,8 +48,8 @@
import org.apache.commons.fileupload.disk.DiskFileItem;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.cheftool.Context;
import org.sakaiproject.cheftool.JetspeedRunData;
import org.sakaiproject.cheftool.RunData;
@@ -92,7 +92,7 @@
public class ResourcesHelperAction extends VelocityPortletPaneledAction
{
/** the logger for this class */
- private static final Log logger = LogFactory.getLog(ResourcesHelperAction.class);
+ private static final Logger logger = LoggerFactory.getLogger(ResourcesHelperAction.class);
private static final ResourceConditionsHelper conditionsHelper = new ResourceConditionsHelper();
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesMetadata.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesMetadata.java
index c37479a606f9..22f44447ac88 100644
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesMetadata.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesMetadata.java
@@ -30,8 +30,8 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.content.api.ContentHostingHandlerResolver;
import org.sakaiproject.util.ResourceLoader;
import org.sakaiproject.util.Validator;
@@ -44,7 +44,7 @@ public class ResourcesMetadata
/** Resource bundle using current language locale */
private ResourceLoader rb = new ResourceLoader("content");
- static final Log logger = LogFactory.getLog(ResourcesMetadata.class);
+ static final Logger logger = LoggerFactory.getLogger(ResourcesMetadata.class);
public static final String WIDGET_STRING = "string";
public static final String WIDGET_TEXTAREA = "textarea";
diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/SiteEmailNotificationDragAndDrop.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/SiteEmailNotificationDragAndDrop.java
index 15d39abbba3c..ea784d7364bc 100644
--- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/SiteEmailNotificationDragAndDrop.java
+++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/SiteEmailNotificationDragAndDrop.java
@@ -34,14 +34,14 @@
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.exception.PermissionException;
import org.sakaiproject.exception.TypeException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
//import org.sakaiproject.content.cover.ComponentManager;
public class SiteEmailNotificationDragAndDrop extends SiteEmailNotification
{
- static final Log logger = LogFactory.getLog(SiteEmailNotificationDragAndDrop.class);
+ static final Logger logger = LoggerFactory.getLogger(SiteEmailNotificationDragAndDrop.class);
/* property bundles */
private static final String DEFAULT_RESOURCECLASS = "org.sakaiproject.localization.util.SiteemaconProperties";
diff --git a/content/content-types/src/java/org/sakaiproject/content/types/ContentTypeRegistryBean.java b/content/content-types/src/java/org/sakaiproject/content/types/ContentTypeRegistryBean.java
index 07d941a3c91c..a6430679587d 100644
--- a/content/content-types/src/java/org/sakaiproject/content/types/ContentTypeRegistryBean.java
+++ b/content/content-types/src/java/org/sakaiproject/content/types/ContentTypeRegistryBean.java
@@ -1,12 +1,12 @@
package org.sakaiproject.content.types;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.content.api.ResourceTypeRegistry;
public class ContentTypeRegistryBean {
- private static Log log = LogFactory.getLog(ContentTypeRegistryBean.class);
+ private static Logger log = LoggerFactory.getLogger(ContentTypeRegistryBean.class);
private boolean useContentTypeRegistry;
private ResourceTypeRegistry resourceTypeRegistry;
diff --git a/content/content-types/src/java/org/sakaiproject/content/types/FileUploadType.java b/content/content-types/src/java/org/sakaiproject/content/types/FileUploadType.java
index 2dc6fd532ca1..306f5705b4dc 100644
--- a/content/content-types/src/java/org/sakaiproject/content/types/FileUploadType.java
+++ b/content/content-types/src/java/org/sakaiproject/content/types/FileUploadType.java
@@ -55,15 +55,15 @@
import org.sakaiproject.util.Resource;
import org.sakaiproject.util.ResourceLoader;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class FileUploadType extends BaseResourceType
{
protected String typeId = ResourceType.TYPE_UPLOAD;
protected String helperId = "sakai.resource.type.helper";
- private static final Log LOG = LogFactory.getLog(FileUploadType.class);
+ private static final Logger LOG = LoggerFactory.getLogger(FileUploadType.class);
/** localized tool properties **/
diff --git a/courier/courier-impl/impl/src/java/org/sakaiproject/courier/impl/BasicCourierService.java b/courier/courier-impl/impl/src/java/org/sakaiproject/courier/impl/BasicCourierService.java
index 32a5bc408c3d..a2395cd87f62 100644
--- a/courier/courier-impl/impl/src/java/org/sakaiproject/courier/impl/BasicCourierService.java
+++ b/courier/courier-impl/impl/src/java/org/sakaiproject/courier/impl/BasicCourierService.java
@@ -31,8 +31,8 @@
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.courier.api.CourierService;
@@ -55,7 +55,7 @@
public class BasicCourierService implements CourierService
{
/** Our logger. */
- private static final Log M_log = LogFactory.getLog(BasicCourierService.class);
+ private static final Logger M_log = LoggerFactory.getLogger(BasicCourierService.class);
protected static final int nLocks = 100;
diff --git a/courier/courier-tool/tool/src/java/org/sakaiproject/courier/tool/CourierTool.java b/courier/courier-tool/tool/src/java/org/sakaiproject/courier/tool/CourierTool.java
index 28385d60e37d..117d470d8ff6 100644
--- a/courier/courier-tool/tool/src/java/org/sakaiproject/courier/tool/CourierTool.java
+++ b/courier/courier-tool/tool/src/java/org/sakaiproject/courier/tool/CourierTool.java
@@ -34,8 +34,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.courier.api.Delivery;
@@ -54,7 +54,7 @@
public class CourierTool extends HttpServlet
{
/** Our log (commons). */
- private static Log M_log = LogFactory.getLog(CourierTool.class);
+ private static Logger M_log = LoggerFactory.getLogger(CourierTool.class);
private SessionManager sessionManager = (SessionManager)
ComponentManager.get(SessionManager.class);
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/dao/DashHibernateDao.java b/dashboard/impl/src/java/org/sakaiproject/dash/dao/DashHibernateDao.java
index 2e562abf95b7..fe64e5319725 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/dao/DashHibernateDao.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/dao/DashHibernateDao.java
@@ -5,8 +5,8 @@
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
@@ -37,7 +37,7 @@
public class DashHibernateDao extends HibernateDaoSupport {
- private Log LOG = LogFactory.getLog(DashHibernateDao.class);
+ private Logger LOG = LoggerFactory.getLogger(DashHibernateDao.class);
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/dao/mapper/CalendarItemMapper.java b/dashboard/impl/src/java/org/sakaiproject/dash/dao/mapper/CalendarItemMapper.java
index a3f3b6629861..1a9629ae2c9c 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/dao/mapper/CalendarItemMapper.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/dao/mapper/CalendarItemMapper.java
@@ -24,8 +24,8 @@
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.dash.model.CalendarItem;
import org.sakaiproject.dash.model.Context;
import org.sakaiproject.dash.model.RepeatingCalendarItem;
@@ -38,7 +38,7 @@
*/
public class CalendarItemMapper implements RowMapper {
- private static Log logger = LogFactory.getLog(CalendarItemMapper.class);
+ private static Logger logger = LoggerFactory.getLogger(CalendarItemMapper.class);
/* (non-Javadoc)
* @see org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet, int)
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/entity/AnnouncementSupport.java b/dashboard/impl/src/java/org/sakaiproject/dash/entity/AnnouncementSupport.java
index 906e0c5738b3..906068fbc78f 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/entity/AnnouncementSupport.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/entity/AnnouncementSupport.java
@@ -30,8 +30,8 @@
import java.util.SortedSet;
import java.util.TreeSet;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.announcement.api.AnnouncementChannel;
import org.sakaiproject.announcement.api.AnnouncementMessage;
import org.sakaiproject.announcement.api.AnnouncementMessageHeader;
@@ -68,7 +68,7 @@
*/
public class AnnouncementSupport{
- private Log logger = LogFactory.getLog(AnnouncementSupport.class);
+ private Logger logger = LoggerFactory.getLogger(AnnouncementSupport.class);
private String ANNOUNCEMENT_TOOL_ID ="sakai.announcements";
@@ -501,14 +501,10 @@ public String getEventIdentifer() {
*/
public void processEvent(Event event) {
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement new: create news links and news item for " + event.getResource());
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("Announcement new: create news links and news item for {}", event.getResource());
+
String eventId = event.getEvent();
Entity entity = sakaiProxy.getEntity(event.getResource());
@@ -517,12 +513,7 @@ public void processEvent(Event event) {
createUpdateDashboardItemLinks(event, annc);
} else {
- // for now, let's log the error
- StringBuilder buf = new StringBuilder();
- buf.append(eventId);
- buf.append(" is not processed for entityReference ");
- buf.append(event.getResource());
- logger.info(buf);
+ logger.info("{} is not processed for entityReference {}", eventId, event.getResource());
}
}
}
@@ -545,19 +536,12 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement remove any: removing news links and news item for " + event.getResource());
- }
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("Announcement remove any: removing news links and news item for {}", event.getResource());
dashboardLogic.removeNewsItem(event.getResource());
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement remove any: removing calendar links and news item for " + event.getResource());
- }
+ logger.debug("Announcement remove any: removing calendar links and news item for {}", event.getResource());
dashboardLogic.removeCalendarItems(event.getResource());
}
}
@@ -579,19 +563,12 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement remove own: removing news links and news item for " + event.getResource());
- }
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("Announcement remove own: removing news links and news item for {}", event.getResource());
dashboardLogic.removeNewsItem(event.getResource());
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement remove own: removing calendar links and news item for " + event.getResource());
- }
+ logger.debug("Announcement remove own: removing calendar links and news item for {}", event.getResource());
dashboardLogic.removeCalendarItems(event.getResource());
}
}
@@ -613,14 +590,9 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("removing calendar links and calendar item for " + event.getResource());
- }
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("removing calendar links and calendar item for {}", event.getResource());
// clean the threadlocal cache
m_threadLocalManager.set(event.getResource(), null);
Entity entity = sakaiProxy.getEntity(event.getResource());
@@ -644,10 +616,7 @@ public void processEvent(Event event) {
dashboardLogic.reviseCalendarItemsTitle(annc.getReference(), title);
}
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement update title: update news links and news item for " + event.getResource());
- }
-
+ logger.debug("Announcement update title: update news links and news item for {}", event.getResource());
}
}
@@ -669,14 +638,9 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("removing calendar links and calendar item for " + event.getResource());
- }
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("removing calendar links and calendar item for {}", event.getResource());
// clean the threadlocal cache
m_threadLocalManager.set(event.getResource(), null);
Entity entity = sakaiProxy.getEntity(event.getResource());
@@ -691,12 +655,8 @@ public void processEvent(Event event) {
dashboardLogic.updateCalendarLinks(anncReference);
}
- if(logger.isDebugEnabled()) {
- logger.debug("removing news links and news item for " + event.getResource());
- }
-
+ logger.debug("removing news links and news item for {}", event.getResource());
}
-
}
/**
@@ -716,16 +676,10 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("removing calendar links and calendar item for {}", event.getResource());
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
-
- if(logger.isDebugEnabled()) {
- logger.debug("removing calendar links and calendar item for " + event.getResource());
- }
-
String entityReference = event.getResource();
m_threadLocalManager.set(entityReference, null);
Entity entity = sakaiProxy.getEntity(entityReference);
@@ -740,10 +694,7 @@ public void processEvent(Event event) {
createUpdateDashboardItemLinks(event, annc);
}
}
-
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement update availability: update news links and news item for " + entityReference);
- }
+ logger.debug("Announcement update availability: update news links and news item for {}", entityReference);
}
}
@@ -764,15 +715,10 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement update own:" + event.getResource());
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("Announcement update own: {}", event.getResource());
+
// update NewsItem Title and title
EntitySupportUtil.updateNewsItemTimeTitle(event);
}
@@ -795,11 +741,8 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("Announcement update any:" + event.getResource());
- }
-
+ logger.debug("Announcement update any: {}", event.getResource());
+
// update NewsItem Title and title
EntitySupportUtil.updateNewsItemTimeTitle(event);
}
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/entity/EntitySupportUtil.java b/dashboard/impl/src/java/org/sakaiproject/dash/entity/EntitySupportUtil.java
index 8770dc68d4bb..015bf5bb2774 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/entity/EntitySupportUtil.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/entity/EntitySupportUtil.java
@@ -23,8 +23,8 @@
import java.util.Date;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.dash.logic.DashboardLogic;
import org.sakaiproject.dash.model.NewsItem;
import org.sakaiproject.event.api.Event;
@@ -36,7 +36,7 @@
*/
public class EntitySupportUtil{
- private Log logger = LogFactory.getLog(EntitySupportUtil.class);
+ private Logger logger = LoggerFactory.getLogger(EntitySupportUtil.class);
static ResourceLoader rl = new ResourceLoader("dash_entity");
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/entity/ResourceSupport.java b/dashboard/impl/src/java/org/sakaiproject/dash/entity/ResourceSupport.java
index c4cdf5ac9865..8f2564ec023c 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/entity/ResourceSupport.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/entity/ResourceSupport.java
@@ -32,8 +32,8 @@
import java.util.SortedSet;
import java.util.TreeSet;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.content.api.ContentCollection;
import org.sakaiproject.content.api.ContentHostingService;
import org.sakaiproject.content.api.ContentResource;
@@ -63,7 +63,7 @@ public class ResourceSupport {
- private static Log logger = LogFactory.getLog(ResourceEntityType.class);
+ private static Logger logger = LoggerFactory.getLogger(ResourceEntityType.class);
ResourceLoader rl = new ResourceLoader("dash_entity");
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/entity/ScheduleSupport.java b/dashboard/impl/src/java/org/sakaiproject/dash/entity/ScheduleSupport.java
index 4c8b020fd248..e488b9318ccc 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/entity/ScheduleSupport.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/entity/ScheduleSupport.java
@@ -34,8 +34,8 @@
import java.util.TimeZone;
import java.util.TreeSet;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.announcement.api.AnnouncementMessage;
import org.sakaiproject.calendar.api.Calendar;
import org.sakaiproject.calendar.api.CalendarEvent;
@@ -71,7 +71,7 @@
*/
public class ScheduleSupport{
- private Log logger = LogFactory.getLog(ScheduleSupport.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleSupport.class);
ResourceLoader rl = new ResourceLoader("dash_entity");
@@ -445,7 +445,7 @@ public List getUsersWithAccess(String entityReference) {
*/
public class ScheduleNewEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleNewEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleNewEventProcessor.class);
/* (non-Javadoc)
* @see org.sakaiproject.dash.listener.EventProcessor#getEventIdentifer()
@@ -459,18 +459,13 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("removing links and item for " + event.getResource());
- }
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("removing links and item for {}", event.getResource());
+
String eventId = event.getEvent();
-
String eventContextString = event.getContext();
-
+
Entity entity = sakaiProxy.getEntity(event.getResource());
// handle add events
if(entity != null && entity instanceof CalendarEvent) {
@@ -537,7 +532,7 @@ public void processEvent(Event event) {
RepeatingCalendarItem repeatingCalendarItem = dashboardLogic.createRepeatingCalendarItem(cEvent.getDisplayName(), new Date(cEvent.getRange().firstTime().getTime()),
lastDate, key, cEventReference, context, sourceType, frequency, maxCount);
- logger.debug(repeatingCalendarItem);
+ logger.debug(repeatingCalendarItem.toString());
}
}
}
@@ -545,7 +540,7 @@ public void processEvent(Event event) {
} else {
// for now, let's log the error.
// this event is posted for creation of a calendar as well as for creation of calendar events, so this is not necessarily an error.
- logger.debug(eventId + " is not processed for entityReference " + event.getResource());
+ logger.debug("{} is not processed for entityReference {}", eventId, event.getResource());
}
}
@@ -556,7 +551,7 @@ public void processEvent(Event event) {
*/
public class ScheduleRemoveEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleRemoveEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleRemoveEventProcessor.class);
/* (non-Javadoc)
* @see org.sakaiproject.dash.listener.EventProcessor#getEventIdentifer()
@@ -570,17 +565,10 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("removing news links and news item for " + event.getResource());
- }
- if(logger.isDebugEnabled()) {
- logger.debug("removing calendar links and news item for " + event.getResource());
- }
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("removing news links and news item for {}", event.getResource());
+ logger.debug("removing calendar links and news item for {}", event.getResource());
// remove all links and CalendarItem itself
dashboardLogic.removeCalendarItems(event.getResource());
}
@@ -592,7 +580,7 @@ public void processEvent(Event event) {
*/
public class ScheduleUpdateTitleEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleUpdateTitleEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleUpdateTitleEventProcessor.class);
/* (non-Javadoc)
* @see org.sakaiproject.dash.listener.EventProcessor#getEventIdentifer()
@@ -606,14 +594,9 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("updating title of calendar item for " + event.getResource());
- }
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("updating title of calendar item for {}", event.getResource());
Entity entity = sakaiProxy.getEntity(event.getResource());
if(entity != null && entity instanceof CalendarEvent) {
@@ -663,7 +646,7 @@ public void processEvent(Event event) {
*/
public class ScheduleUpdateTimeEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleUpdateTimeEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleUpdateTimeEventProcessor.class);
/* (non-Javadoc)
* @see org.sakaiproject.dash.listener.EventProcessor#getEventIdentifer()
@@ -677,15 +660,10 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("updating time of calendar item for " + event.getResource());
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("updating time of calendar item for {}", event.getResource());
+
String entityReference = event.getResource();
Entity entity = sakaiProxy.getEntity(entityReference );
@@ -731,7 +709,7 @@ public void processEvent(Event event) {
}
if(logger.isDebugEnabled()) {
- logger.debug("removing news links and news item for " + event.getResource());
+ logger.debug("removing news links and news item for {}", event.getResource());
}
}
@@ -742,7 +720,7 @@ public void processEvent(Event event) {
*/
public class ScheduleUpdateTypeEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleUpdateTypeEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleUpdateTypeEventProcessor.class);
/* (non-Javadoc)
* @see org.sakaiproject.dash.listener.EventProcessor#getEventIdentifer()
@@ -756,15 +734,10 @@ public String getEventIdentifer() {
* @see org.sakaiproject.dash.listener.EventProcessor#processEvent(org.sakaiproject.event.api.Event)
*/
public void processEvent(Event event) {
-
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("updating type of calendar item for " + event.getResource());
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("updating type of calendar item for {}", event.getResource());
+
String[] parts = event.getResource().split("::");
if(parts.length > 2) {
String entityReference = parts[0];
@@ -780,9 +753,7 @@ public void processEvent(Event event) {
// get the assignment entity and its new time
CalendarEvent cEvent = (CalendarEvent) entity;
- if(logger.isDebugEnabled()) {
- logger.debug("removing news links and news item for " + entityReference);
- }
+ logger.debug("removing news links and news item for {}", entityReference);
if(cEvent.getRecurrenceRule() != null) {
// update the label key for the repeating calendar item
dashboardLogic.reviseRepeatingCalendarItemsLabelKey(entityReference, oldLabelKey, newLabelKey);
@@ -804,28 +775,22 @@ public void processEvent(Event event) {
public class ScheduleReviseEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleReviseEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleReviseEventProcessor.class);
public String getEventIdentifer() {
return SakaiProxy.EVENT_SCHEDULE_REVISE_EVENT;
}
public void processEvent(Event event) {
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("revising calendar item for " + event.getResource());
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("revising calendar item for {}", event.getResource());
}
-
}
public class ScheduleUpdateAccessEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleUpdateAccessEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleUpdateAccessEventProcessor.class);
public String getEventIdentifer() {
@@ -833,14 +798,10 @@ public String getEventIdentifer() {
}
public void processEvent(Event event) {
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("revising calendar item for " + event.getResource());
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("revising calendar item for {}", event.getResource());
+
Entity entity = sakaiProxy.getEntity(event.getResource());
if(entity != null && entity instanceof AnnouncementMessage) {
@@ -853,18 +814,13 @@ public void processEvent(Event event) {
dashboardLogic.updateCalendarLinks(cReference);
}
- if(logger.isDebugEnabled()) {
- logger.debug("removing news links and news item for " + event.getResource());
- }
-
-
+ logger.debug("removing news links and news item for {}", event.getResource());
}
-
}
public class ScheduleUpdateFrequencyEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleUpdateFrequencyEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleUpdateFrequencyEventProcessor.class);
public String getEventIdentifer() {
@@ -872,14 +828,10 @@ public String getEventIdentifer() {
}
public void processEvent(Event event) {
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("revising calendar item for " + event.getResource());
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+ logger.debug("revising calendar item for {}", event.getResource());
+
String entityReference = event.getResource();
Entity entity = sakaiProxy.getEntity(entityReference );
@@ -954,7 +906,7 @@ public void processEvent(Event event) {
public class ScheduleUpdateExcludedEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleUpdateExcludedEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleUpdateExcludedEventProcessor.class);
public String getEventIdentifer() {
@@ -962,11 +914,9 @@ public String getEventIdentifer() {
}
public void processEvent(Event event) {
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+
// This is a case of a revision to one instance of a repeating event. If effect,
// a new calendar-event entity has been created to represent the instance that
// was excluded from the recurring event.
@@ -1007,7 +957,7 @@ public void processEvent(Event event) {
dashboardLogic.createCalendarLinks(calendarItem);
} else {
// for now, let's log the error
- logger.info(eventId + " is not processed for entityReference " + event.getResource());
+ logger.info("{} is not processed for entityReference {}",eventId, event.getResource());
}
}
@@ -1015,7 +965,7 @@ public void processEvent(Event event) {
public class ScheduleUpdateExclusionsEventProcessor implements EventProcessor {
- private Log logger = LogFactory.getLog(ScheduleUpdateExclusionsEventProcessor.class);
+ private Logger logger = LoggerFactory.getLogger(ScheduleUpdateExclusionsEventProcessor.class);
public String getEventIdentifer() {
@@ -1023,11 +973,9 @@ public String getEventIdentifer() {
}
public void processEvent(Event event) {
- if(logger.isDebugEnabled()) {
- logger.debug("\n\n\n=============================================================\n" + event
- + "\n=============================================================\n\n\n");
- }
-
+ logger.debug("\n\n\n============================================================\n{}\n=============================================================\n\n\n",
+ event.toString());
+
// This is a case of a revision to one instance of a repeating event, which is
// then no longer an instance of the repeating event. This event processor handles
// the change to the repeating event: exclusion of one instance from the sequence.
@@ -1062,10 +1010,8 @@ public void processEvent(Event event) {
}
entityReference = buf.toString();
}
- if(logger.isDebugEnabled()) {
- logger.info("processEvent() " + entityReference + " " + sequenceNumber);
- }
-
+ logger.info("processEvent() {} {}", entityReference, sequenceNumber);
+
if(entityReference != null && sequenceNumber >= -1) {
String calendarTimeLabelKey = null;
CalendarItem calendarItem = dashboardLogic.getCalendarItem(entityReference, calendarTimeLabelKey, sequenceNumber);
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashAggregateJob.java b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashAggregateJob.java
index 4c94ab2f6403..e6ad3511e7f8 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashAggregateJob.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashAggregateJob.java
@@ -28,8 +28,8 @@
import java.util.Date;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;
@@ -49,7 +49,7 @@
//TODO: Find all statsUpdateManager and replace with this dashboard job
public class DashAggregateJob implements StatefulJob {
- private Log LOG = LogFactory.getLog(DashAggregateJob.class);
+ private Logger LOG = LoggerFactory.getLogger(DashAggregateJob.class);
// Spring fields
private int maxEventsPerRun = 0;
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAdminChangesJob.java b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAdminChangesJob.java
index d7705fb4c4da..7216ce2ef9f7 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAdminChangesJob.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAdminChangesJob.java
@@ -18,15 +18,15 @@
*/
package org.sakaiproject.dash.jobs;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
//TODO: Find all statsUpdateManager and replace with this dashboard job
public class DashCheckAdminChangesJob extends DashQuartzJob {
- private Log logger = LogFactory.getLog(DashCheckAdminChangesJob.class);
+ private Logger logger = LoggerFactory.getLogger(DashCheckAdminChangesJob.class);
//Matches the bean id
final static String beanId = "dashCheckAdminChangesJob";
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAvailabilityJob.java b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAvailabilityJob.java
index 8b2bc10f42f1..dd0e430927e4 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAvailabilityJob.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashCheckAvailabilityJob.java
@@ -18,14 +18,14 @@
*/
package org.sakaiproject.dash.jobs;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
//TODO: Find all statsUpdateManager and replace with this dashboard job
public class DashCheckAvailabilityJob extends DashQuartzJob {
- private Log logger = LogFactory.getLog(DashCheckAvailabilityJob.class);
+ private Logger logger = LoggerFactory.getLogger(DashCheckAvailabilityJob.class);
//Matches the bean id
final static String beanId = "dashCheckAvailabilityJob";
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashExpirePurgeJob.java b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashExpirePurgeJob.java
index b0091934a36e..1d1373303a08 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashExpirePurgeJob.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashExpirePurgeJob.java
@@ -18,15 +18,15 @@
*/
package org.sakaiproject.dash.jobs;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
//TODO: Find all statsUpdateManager and replace with this dashboard job
public class DashExpirePurgeJob extends DashQuartzJob {
- private Log logger = LogFactory.getLog(DashExpirePurgeJob.class);
+ private Logger logger = LoggerFactory.getLogger(DashExpirePurgeJob.class);
//Matches the bean id
final static String beanId = "dashExpirePurgeJob";
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashQuartzJob.java b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashQuartzJob.java
index 98006bfebcb2..355a2786f3bb 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashQuartzJob.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashQuartzJob.java
@@ -18,8 +18,8 @@
*/
package org.sakaiproject.dash.jobs;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -30,7 +30,7 @@
//TODO: Find all statsUpdateManager and replace with this dashboard job
public class DashQuartzJob implements Job {
- private Log logger = LogFactory.getLog(DashQuartzJob.class);
+ private Logger logger = LoggerFactory.getLogger(DashQuartzJob.class);
private String configMessage;
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashRepeatEventJob.java b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashRepeatEventJob.java
index 79dcbeac22c6..3140beb4c611 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashRepeatEventJob.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashRepeatEventJob.java
@@ -19,14 +19,14 @@
package org.sakaiproject.dash.jobs;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
//TODO: Find all statsUpdateManager and replace with this dashboard job
public class DashRepeatEventJob extends DashQuartzJob {
- private Log logger = LogFactory.getLog(DashRepeatEventJob.class);
+ private Logger logger = LoggerFactory.getLogger(DashRepeatEventJob.class);
//Matches the bean id
final static String beanId = "dashRepeatEventJob";
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashSyncUserSitesJob.java b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashSyncUserSitesJob.java
index 5dfdc16aa850..110182f213b2 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashSyncUserSitesJob.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/jobs/DashSyncUserSitesJob.java
@@ -19,8 +19,8 @@
package org.sakaiproject.dash.jobs;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -34,7 +34,7 @@
*
*/
public class DashSyncUserSitesJob extends DashQuartzJob {
- private Log logger = LogFactory.getLog(DashSyncUserSitesJob.class);
+ private Logger logger = LoggerFactory.getLogger(DashSyncUserSitesJob.class);
//Matches the bean id
final static String beanId = "dashSyncUserSitesJob";
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardConfigImpl.java b/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardConfigImpl.java
index c0745b591cfa..eba4305c2806 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardConfigImpl.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardConfigImpl.java
@@ -27,15 +27,15 @@
import net.sf.ehcache.Cache;
import net.sf.ehcache.Element;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.dash.app.DashboardConfig;
import org.sakaiproject.dash.dao.DashboardDao;
import org.springframework.transaction.annotation.Transactional;
public class DashboardConfigImpl implements DashboardConfig {
- private static Log logger = LogFactory.getLog(DashboardConfigImpl.class);
+ private static Logger logger = LoggerFactory.getLogger(DashboardConfigImpl.class);
public static final String DASHBOARD_CACHE_PREFIX = "org.sakaiproject.dash.app.DashboardConfig.";
diff --git a/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardLogicImpl.java b/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardLogicImpl.java
index 806267d7cef3..2cd86c6d1b8a 100644
--- a/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardLogicImpl.java
+++ b/dashboard/impl/src/java/org/sakaiproject/dash/logic/DashboardLogicImpl.java
@@ -1187,7 +1187,7 @@ public void updateCalendarLinks(String entityReference) {
if(calendarLinks.size() > 0) {
count = dao.addCalendarLinks(calendarLinks);
}
- // TODO: Log count
+ // TODO: Logger count
}
if(logger.isDebugEnabled()) {
StringBuilder buf = new StringBuilder("updateCalendarLinks(");
diff --git a/dashboard/tool/src/java/org/sakaiproject/dash/tool/util/JsonHelper.java b/dashboard/tool/src/java/org/sakaiproject/dash/tool/util/JsonHelper.java
index 1de983e16dc0..c77e64a4a072 100644
--- a/dashboard/tool/src/java/org/sakaiproject/dash/tool/util/JsonHelper.java
+++ b/dashboard/tool/src/java/org/sakaiproject/dash/tool/util/JsonHelper.java
@@ -27,8 +27,8 @@
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.dash.app.DashboardCommonLogic;
import org.sakaiproject.dash.app.DashboardConfig;
import org.sakaiproject.dash.model.CalendarItem;
@@ -43,7 +43,7 @@
*/
public class JsonHelper {
- private static Log logger = LogFactory.getLog(JsonHelper.class);
+ private static Logger logger = LoggerFactory.getLogger(JsonHelper.class);
protected DashboardCommonLogic dashboardCommonLogic;
protected DashboardConfig dashboardConfig;
diff --git a/dav/dav-server/src/java/org/sakaiproject/dav/DavRealm.java b/dav/dav-server/src/java/org/sakaiproject/dav/DavRealm.java
index 1590ec3876c4..3ccb33ee0910 100644
--- a/dav/dav-server/src/java/org/sakaiproject/dav/DavRealm.java
+++ b/dav/dav-server/src/java/org/sakaiproject/dav/DavRealm.java
@@ -26,8 +26,8 @@
import org.apache.catalina.LifecycleException;
import org.apache.catalina.realm.RealmBase;
import org.apache.catalina.Wrapper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Simple implementation of Realm that consults the Sakai user directory service to provide container security equivalent to then application security in CHEF.
@@ -37,7 +37,7 @@
public final class DavRealm extends RealmBase
{
- private static Log M_log = LogFactory.getLog(DavRealm.class);
+ private static Logger M_log = LoggerFactory.getLogger(DavRealm.class);
/** Descriptive information about this Realm implementation. */
protected static final String info = "org.sakaiproject.realm.DavRealm/1.0";
diff --git a/dav/dav/src/java/org/sakaiproject/dav/DavServlet.java b/dav/dav/src/java/org/sakaiproject/dav/DavServlet.java
index 54139ae03e23..d831b0344025 100644
--- a/dav/dav/src/java/org/sakaiproject/dav/DavServlet.java
+++ b/dav/dav/src/java/org/sakaiproject/dav/DavServlet.java
@@ -120,8 +120,8 @@
import org.apache.tomcat.util.buf.UDecoder;
import org.sakaiproject.dav.MD5Encoder;
import org.apache.catalina.util.XMLWriter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.alias.api.AliasService;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.component.cover.ServerConfigurationService;
@@ -181,7 +181,7 @@ public class DavServlet extends HttpServlet
private static final long serialVersionUID = 1L;
/** Our logger. */
- private static Log M_log = LogFactory.getLog(DavServlet.class);
+ private static Logger M_log = LoggerFactory.getLogger(DavServlet.class);
protected static ResourceLoader rb = new ResourceLoader("org.sakaiproject.tool.dav.bundle.Messages");
// -------------------------------------------------------------- Constants
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementAdministrationHibernateImpl.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementAdministrationHibernateImpl.java
index fad12a87af41..6c3ed06b2d76 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementAdministrationHibernateImpl.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementAdministrationHibernateImpl.java
@@ -27,8 +27,8 @@
import java.util.List;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.Query;
@@ -60,7 +60,7 @@
public class CourseManagementAdministrationHibernateImpl extends
HibernateDaoSupport implements CourseManagementAdministration {
- private static final Log log = LogFactory.getLog(CourseManagementAdministrationHibernateImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseManagementAdministrationHibernateImpl.class);
protected Authentication authn;
public void setAuthn(Authentication authn) {
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceFederatedImpl.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceFederatedImpl.java
index b0721a8a97e2..63ed5acaf9ca 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceFederatedImpl.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceFederatedImpl.java
@@ -32,8 +32,8 @@
import java.util.Set;
import java.util.Map.Entry;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.coursemanagement.api.AcademicSession;
import org.sakaiproject.coursemanagement.api.CanonicalCourse;
import org.sakaiproject.coursemanagement.api.CourseManagementService;
@@ -75,7 +75,7 @@
public class CourseManagementServiceFederatedImpl implements
CourseManagementService {
- private static final Log log = LogFactory.getLog(CourseManagementServiceFederatedImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseManagementServiceFederatedImpl.class);
private List implList;
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceHibernateImpl.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceHibernateImpl.java
index 2d2cc871706c..e9d30e8ba76f 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceHibernateImpl.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseManagementServiceHibernateImpl.java
@@ -36,8 +36,8 @@
import org.hibernate.Session;
import org.hibernate.criterion.DetachedCriteria;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.coursemanagement.api.AcademicSession;
import org.sakaiproject.coursemanagement.api.CanonicalCourse;
import org.sakaiproject.coursemanagement.api.CourseManagementService;
@@ -59,7 +59,7 @@
*
*/
public class CourseManagementServiceHibernateImpl extends HibernateDaoSupport implements CourseManagementService {
- private static final Log log = LogFactory.getLog(CourseManagementServiceHibernateImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseManagementServiceHibernateImpl.class);
public void init() {
log.info("Initializing " + getClass().getName());
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSitePublishServiceImpl.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSitePublishServiceImpl.java
index b7289840e8ea..b45e38a96a93 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSitePublishServiceImpl.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSitePublishServiceImpl.java
@@ -15,8 +15,8 @@
*/
package org.sakaiproject.coursemanagement.impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.FunctionManager;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.coursemanagement.api.AcademicSession;
@@ -40,7 +40,7 @@
*/
public class CourseSitePublishServiceImpl extends HibernateDaoSupport implements CourseSitePublishService {
// logger
- private final transient Log logger = LogFactory.getLog(getClass());
+ private final transient Logger logger = LoggerFactory.getLogger(getClass());
// class members
private static final long ONE_DAY_IN_MS = 1000L * 60L * 60L * 24L; // one day in ms = 1000ms/s · 60s/m · 60m/h · 24h/day
@@ -226,7 +226,7 @@ public int publishCourseSites(int numDaysBeforeTermStarts) {
}
}
} catch (Exception ex) {
- logger.error(ex);
+ logger.error(ex.getMessage(), ex);
}
return numSitesPublished;
}
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSiteRemovalServiceImpl.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSiteRemovalServiceImpl.java
index 761f701e27ea..71dc699deee2 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSiteRemovalServiceImpl.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/CourseSiteRemovalServiceImpl.java
@@ -15,8 +15,8 @@
*/
package org.sakaiproject.coursemanagement.impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.FunctionManager;
import org.sakaiproject.authz.api.Member;
import org.sakaiproject.authz.api.SecurityService;
@@ -42,7 +42,7 @@
public class CourseSiteRemovalServiceImpl extends HibernateDaoSupport implements CourseSiteRemovalService {
// logger
- private final transient Log logger = LogFactory.getLog(getClass());
+ private final transient Logger logger = LoggerFactory.getLogger(getClass());
// class members
private static final long ONE_DAY_IN_MS = 1000L * 60L * 60L * 24L; // one day in ms = 1000ms/s · 60s/m · 60m/h · 24h/day
@@ -208,7 +208,7 @@ public int removeCourseSites(CourseSiteRemovalService.Action action, int numDays
}
}
} catch (Exception ex) {
- logger.error(ex);
+ logger.error(ex.getMessage(), ex);
}
return numSitesRemoved;
}
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/IndexGenerator.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/IndexGenerator.java
index 4933b61fb127..4374cc481d25 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/IndexGenerator.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/IndexGenerator.java
@@ -20,8 +20,8 @@
**********************************************************************************/
package org.sakaiproject.coursemanagement.impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.api.ServerConfigurationService;
import org.sakaiproject.db.api.SqlService;
@@ -33,7 +33,7 @@
*
*/
public abstract class IndexGenerator {
- private static final Log log = LogFactory.getLog(IndexGenerator.class);
+ private static final Logger log = LoggerFactory.getLogger(IndexGenerator.class);
public abstract SqlService sqlService();
public abstract ServerConfigurationService scs();
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SampleDataLoader.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SampleDataLoader.java
index eb8fddee975e..801bc97c73dc 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SampleDataLoader.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SampleDataLoader.java
@@ -37,8 +37,8 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.AuthzGroupService;
import org.sakaiproject.coursemanagement.api.AcademicSession;
import org.sakaiproject.coursemanagement.api.CanonicalCourse;
@@ -62,7 +62,7 @@
import org.springframework.transaction.support.DefaultTransactionDefinition;
public class SampleDataLoader implements BeanFactoryAware {
- private static final Log log = LogFactory.getLog(SampleDataLoader.class);
+ private static final Logger log = LoggerFactory.getLogger(SampleDataLoader.class);
protected static final int ACADEMIC_SESSION_YEAR;
protected static final String[] ACADEMIC_SESSION_EIDS = new String[4];
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SiteTitleAdvisorCMS.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SiteTitleAdvisorCMS.java
index 7703d99d910b..41b3d19b7528 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SiteTitleAdvisorCMS.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/SiteTitleAdvisorCMS.java
@@ -27,8 +27,8 @@
import lombok.Setter;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.AuthzGroupService;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.component.api.ServerConfigurationService;
@@ -50,7 +50,7 @@
public class SiteTitleAdvisorCMS implements SiteTitleAdvisor
{
// Services
- private final transient Log log = LogFactory.getLog( getClass() );
+ private final transient Logger log = LoggerFactory.getLogger( getClass() );
@Getter @Setter private static UserDirectoryService uds;
@Getter @Setter private static SecurityService ss;
@Getter @Setter private static CourseManagementService cms;
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/aop/CourseManagementAdministrationAuthzAdvisor.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/aop/CourseManagementAdministrationAuthzAdvisor.java
index b1da4b67f037..515dc4ce1078 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/aop/CourseManagementAdministrationAuthzAdvisor.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/aop/CourseManagementAdministrationAuthzAdvisor.java
@@ -22,14 +22,14 @@
import java.lang.reflect.Method;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.coursemanagement.impl.exception.PermissionException;
import org.springframework.aop.MethodBeforeAdvice;
public class CourseManagementAdministrationAuthzAdvisor implements MethodBeforeAdvice {
- private static final Log log = LogFactory.getLog(CourseManagementAdministrationAuthzAdvisor.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseManagementAdministrationAuthzAdvisor.class);
SecurityService securityService;
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/ClassPathCMSyncJob.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/ClassPathCMSyncJob.java
index f1dbc9a8e583..c6024913ff29 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/ClassPathCMSyncJob.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/ClassPathCMSyncJob.java
@@ -22,8 +22,8 @@
import java.io.InputStream;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -41,7 +41,7 @@
*
*/
public class ClassPathCMSyncJob extends CmSynchronizer implements Job {
- private static final Log log = LogFactory.getLog(ClassPathCMSyncJob.class);
+ private static final Logger log = LoggerFactory.getLogger(ClassPathCMSyncJob.class);
protected String classPathToXml;
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/CmSynchronizer.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/CmSynchronizer.java
index 5da0eb36b8a1..490c3174a333 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/CmSynchronizer.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/java/org/sakaiproject/coursemanagement/impl/job/CmSynchronizer.java
@@ -33,8 +33,8 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
@@ -60,7 +60,7 @@
*
*/
public abstract class CmSynchronizer {
- private static final Log log = LogFactory.getLog(CmSynchronizer.class);
+ private static final Logger log = LoggerFactory.getLogger(CmSynchronizer.class);
protected CourseManagementService cmService;
protected CourseManagementAdministration cmAdmin;
@@ -142,7 +142,7 @@ protected void reconcileAcademicSessions(Document doc) {
}
}
} catch (JDOMException jde) {
- log.error(jde);
+ log.error(jde.getMessage());
}
if(log.isInfoEnabled()) log.info("Finished reconciling AcademicSessions in " + (System.currentTimeMillis()-start) + " ms");
@@ -159,7 +159,7 @@ protected void reconcileCurrentAcademicSessions(Document doc) {
if(log.isDebugEnabled()) log.debug("Found current academic sessions to reconcile: " + academicSessionEids);
cmAdmin.setCurrentAcademicSessions(academicSessionEids);
} catch (JDOMException jde) {
- log.error(jde);
+ log.error(jde.getMessage());
}
}
@@ -204,7 +204,7 @@ protected void reconcileCanonicalCourses(Document doc) {
}
}
} catch (JDOMException jde) {
- log.error(jde);
+ log.error(jde.getMessage());
}
if(log.isInfoEnabled()) log.info("Finished reconciling CanonicalCourses in " + (System.currentTimeMillis()-start) + " ms");
@@ -255,7 +255,7 @@ protected void reconcileCourseOfferings(Document doc) {
}
} catch (JDOMException jde) {
- log.error(jde);
+ log.error(jde.getMessage());
}
if(log.isInfoEnabled()) log.info("Finished reconciling CourseOfferings in " + (System.currentTimeMillis()-start) + " ms");
}
@@ -343,7 +343,7 @@ protected void reconcileEnrollmentSets(Document doc) {
reconcileOfficialInstructors(element, enr);
}
} catch (JDOMException jde) {
- log.error(jde);
+ log.error(jde.getMessage());
}
if(log.isInfoEnabled()) log.info("Finished reconciling EnrollmentSets in " + (System.currentTimeMillis()-start) + " ms");
@@ -475,7 +475,7 @@ protected void reconcileSections(Document doc) {
}
}
} catch (JDOMException jde) {
- log.error(jde);
+ log.error(jde.getMessage());
}
if(log.isInfoEnabled()) log.info("Finished reconciling Sections in " + (System.currentTimeMillis()-start) + " ms");
}
@@ -576,7 +576,7 @@ protected void reconcileCourseSets(Document doc) {
}
}
} catch (JDOMException jde) {
- log.error(jde);
+ log.error(jde.getMessage());
}
if(log.isInfoEnabled()) log.info("Finished reconciling CourseSets in " + (System.currentTimeMillis()-start) + " ms");
}
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementAdministrationTest.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementAdministrationTest.java
index 4410142b87a9..b55a1180a42f 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementAdministrationTest.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementAdministrationTest.java
@@ -27,8 +27,8 @@
import java.util.List;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.junit.Assert;
import org.junit.Test;
import org.sakaiproject.coursemanagement.api.AcademicSession;
@@ -46,7 +46,7 @@
import org.springframework.beans.factory.annotation.Autowired;
public class CourseManagementAdministrationTest extends CourseManagementTestBase {
- private static final Log log = LogFactory.getLog(CourseManagementAdministrationTest.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseManagementAdministrationTest.class);
@Autowired
private CourseManagementService cm;
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementServiceTest.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementServiceTest.java
index 256c86594c93..d1600ef0221f 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementServiceTest.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/CourseManagementServiceTest.java
@@ -25,8 +25,8 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -41,7 +41,7 @@
import org.springframework.beans.factory.annotation.Autowired;
public class CourseManagementServiceTest extends CourseManagementTestBase {
- private static final Log log = LogFactory.getLog(CourseManagementServiceTest.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseManagementServiceTest.class);
@Autowired
private CourseManagementService cm;
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/HibernateTestDataLoader.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/HibernateTestDataLoader.java
index 7d62598a7f50..f3ff411d17e0 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/HibernateTestDataLoader.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/HibernateTestDataLoader.java
@@ -27,8 +27,8 @@
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.coursemanagement.api.AcademicSession;
import org.sakaiproject.coursemanagement.api.CourseManagementService;
import org.sakaiproject.coursemanagement.api.CourseOffering;
@@ -53,7 +53,7 @@
* @author Josh Holtzman
*/
public class HibernateTestDataLoader extends HibernateDaoSupport implements DataLoader {
- private static final Log log = LogFactory.getLog(HibernateTestDataLoader.class);
+ private static final Logger log = LoggerFactory.getLogger(HibernateTestDataLoader.class);
private CourseManagementService cm;
diff --git a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/performance/IndexPerformance.java b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/performance/IndexPerformance.java
index cf3daa82456e..1da1d972d2c1 100644
--- a/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/performance/IndexPerformance.java
+++ b/edu-services/cm-service/cm-impl/hibernate-impl/impl/src/test/org/sakaiproject/coursemanagement/test/performance/IndexPerformance.java
@@ -24,8 +24,8 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.coursemanagement.api.CourseManagementAdministration;
import org.sakaiproject.coursemanagement.api.CourseManagementService;
import org.sakaiproject.coursemanagement.api.Enrollment;
@@ -40,7 +40,7 @@
import org.springframework.transaction.support.DefaultTransactionDefinition;
public class IndexPerformance {
- private static final Log log = LogFactory.getLog(IndexPerformance.class);
+ private static final Logger log = LoggerFactory.getLogger(IndexPerformance.class);
private static final int secCount = 10;
private static final int enrollmentsPerEnrollmentSet = 100;
diff --git a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradableObject.java b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradableObject.java
index 20fdfaf572d8..66702d299414 100644
--- a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradableObject.java
+++ b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradableObject.java
@@ -28,8 +28,8 @@
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A GradableObject is a component of a Gradebook for which students can be
@@ -38,7 +38,7 @@
* @author Josh Holtzman
*/
public abstract class GradableObject implements Serializable {
- protected static final Log log = LogFactory.getLog(GradableObject.class);
+ protected static final Logger log = LoggerFactory.getLogger(GradableObject.class);
protected Long id;
protected int version;
diff --git a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradeMapping.java b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradeMapping.java
index 3e1a5e2abcbb..6aab3600320e 100644
--- a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradeMapping.java
+++ b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradeMapping.java
@@ -27,8 +27,8 @@
import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A GradeMapping provides a means to convert between an arbitrary set of grades
@@ -36,7 +36,7 @@
*
*/
public class GradeMapping implements Serializable, Comparable {
- protected Log log = LogFactory.getLog(GradeMapping.class);
+ protected Logger log = LoggerFactory.getLogger(GradeMapping.class);
protected Long id;
protected int version;
diff --git a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradebookArchive.java b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradebookArchive.java
index 468957294456..8ced7b6ef3dd 100644
--- a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradebookArchive.java
+++ b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/GradebookArchive.java
@@ -29,8 +29,8 @@
import java.io.ByteArrayOutputStream;
import java.util.Collection;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Models a gradebook and all of its dependent objects, which can all be
@@ -39,7 +39,7 @@
* @author Josh Holtzman
*/
public class GradebookArchive {
- private static Log log = LogFactory.getLog(GradebookArchive.class);
+ private static Logger log = LoggerFactory.getLogger(GradebookArchive.class);
private Gradebook gradebook;
private GradeMapping selectedGradeMapping;
diff --git a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/Spreadsheet.java b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/Spreadsheet.java
index ac7ca2441510..bd90534957ef 100644
--- a/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/Spreadsheet.java
+++ b/edu-services/gradebook-service/hibernate/src/java/org/sakaiproject/tool/gradebook/Spreadsheet.java
@@ -21,8 +21,8 @@
package org.sakaiproject.tool.gradebook;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
@@ -45,7 +45,7 @@ public class Spreadsheet implements Serializable {
protected String name;
protected Date dateCreated;
- protected static final Log log = LogFactory.getLog(Spreadsheet.class);
+ protected static final Logger log = LoggerFactory.getLogger(Spreadsheet.class);
public Spreadsheet(Gradebook gradebook, String content, String creator, String name, Date dateCreated) {
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/BaseHibernateManager.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/BaseHibernateManager.java
index 967455b4a5f3..89e0cab53b27 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/BaseHibernateManager.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/BaseHibernateManager.java
@@ -35,8 +35,8 @@
import java.util.Set;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -77,7 +77,7 @@
* logic, but not exposed to external callers.
*/
public abstract class BaseHibernateManager extends HibernateDaoSupport {
- private static final Log log = LogFactory.getLog(BaseHibernateManager.class);
+ private static final Logger log = LoggerFactory.getLogger(BaseHibernateManager.class);
// Oracle will throw a SQLException if we put more than this into a
// "WHERE tbl.col IN (:paramList)" query.
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookExternalAssessmentServiceImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookExternalAssessmentServiceImpl.java
index 33bf5b80029b..f873bd83a1de 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookExternalAssessmentServiceImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookExternalAssessmentServiceImpl.java
@@ -37,8 +37,8 @@
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -65,9 +65,9 @@
import org.springframework.orm.hibernate3.HibernateTemplate;
public class GradebookExternalAssessmentServiceImpl extends BaseHibernateManager implements GradebookExternalAssessmentService {
- private static final Log log = LogFactory.getLog(GradebookExternalAssessmentServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(GradebookExternalAssessmentServiceImpl.class);
// Special logger for data contention analysis.
- private static final Log logData = LogFactory.getLog(GradebookExternalAssessmentServiceImpl.class.getName() + ".GB_DATA");
+ private static final Logger logData = LoggerFactory.getLogger(GradebookExternalAssessmentServiceImpl.class.getName() + ".GB_DATA");
private GradebookService gradebookService;
private EventTrackingService eventTrackingService;
@@ -961,7 +961,7 @@ private Double convertStringToDouble(String doubleAsString) {
Number numericScore = getNumberFormat().parse(doubleAsString.trim());
scoreAsDouble = numericScore.doubleValue();
} catch (ParseException e) {
- log.error(e);
+ log.error(e.getMessage());
}
}
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookFrameworkServiceImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookFrameworkServiceImpl.java
index 79232fa18216..fa02b3539406 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookFrameworkServiceImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookFrameworkServiceImpl.java
@@ -31,8 +31,8 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -53,7 +53,7 @@
import org.springframework.orm.hibernate3.HibernateTemplate;
public class GradebookFrameworkServiceImpl extends BaseHibernateManager implements GradebookFrameworkService {
- private static final Log log = LogFactory.getLog(GradebookFrameworkServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(GradebookFrameworkServiceImpl.class);
public static final String UID_OF_DEFAULT_GRADING_SCALE_PROPERTY = "uidOfDefaultGradingScale";
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookServiceHibernateImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookServiceHibernateImpl.java
index 0fe56e996adb..78840cb9188d 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookServiceHibernateImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/component/gradebook/GradebookServiceHibernateImpl.java
@@ -46,8 +46,8 @@
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.Query;
@@ -94,7 +94,7 @@
* A Hibernate implementation of GradebookService.
*/
public class GradebookServiceHibernateImpl extends BaseHibernateManager implements GradebookService {
- private static final Log log = LogFactory.getLog(GradebookServiceHibernateImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(GradebookServiceHibernateImpl.class);
private Authz authz;
private GradebookPermissionService gradebookPermissionService;
@@ -2801,7 +2801,7 @@ private Double convertStringToDouble(String doubleAsString) {
Number numericScore = numberFormat.parse(doubleAsString.trim());
scoreAsDouble = numericScore.doubleValue();
} catch (ParseException e) {
- log.error(e);
+ log.error(e.getMessage());
}
}
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthnSakai2Impl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthnSakai2Impl.java
index 5456d7436239..5a16fd2236ca 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthnSakai2Impl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthnSakai2Impl.java
@@ -21,8 +21,8 @@
**********************************************************************************/
package org.sakaiproject.tool.gradebook.facades.sakai2impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.api.Session;
import org.sakaiproject.tool.cover.SessionManager;
import org.sakaiproject.tool.gradebook.facades.Authn;
@@ -33,7 +33,7 @@
* @author Josh Holtzman
*/
public class AuthnSakai2Impl implements Authn {
- private static final Log log = LogFactory.getLog(AuthnSakai2Impl.class);
+ private static final Logger log = LoggerFactory.getLogger(AuthnSakai2Impl.class);
/**
* @see org.sakaiproject.tool.gradebook.facades.Authn#getUserUid()
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthzSakai2Impl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthzSakai2Impl.java
index 3b2250fbe802..f1b4e6da0ac7 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthzSakai2Impl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/AuthzSakai2Impl.java
@@ -24,8 +24,8 @@
import java.util.Collection;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.cover.FunctionManager;
import org.sakaiproject.authz.cover.SecurityService;
@@ -47,7 +47,7 @@
* role-determined group-scoped authz.
*/
public class AuthzSakai2Impl extends AuthzSectionsImpl implements Authz {
- private static final Log log = LogFactory.getLog(AuthzSakai2Impl.class);
+ private static final Logger log = LoggerFactory.getLogger(AuthzSakai2Impl.class);
public static final String
PERMISSION_GRADE_ALL = "gradebook.gradeAll",
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/BaseEntityProducer.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/BaseEntityProducer.java
index 01c17baeb24b..9be3630723bb 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/BaseEntityProducer.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/BaseEntityProducer.java
@@ -45,7 +45,7 @@
*/
@Deprecated
public class BaseEntityProducer implements EntityProducer {
- //private static final Log log = LogFactory.getLog(BaseEntityProducer.class);
+ //private static final Logger log = LoggerFactory.getLogger(BaseEntityProducer.class);
protected String label; // This should always be set.
protected String referenceRoot = "/gradebook"; // stupid default but OK since it is not used
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/ContextManagementSakai2Impl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/ContextManagementSakai2Impl.java
index 5cb5d324c3fd..25e533e5a0a7 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/ContextManagementSakai2Impl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/ContextManagementSakai2Impl.java
@@ -22,8 +22,8 @@
package org.sakaiproject.tool.gradebook.facades.sakai2impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.api.Placement;
import org.sakaiproject.tool.cover.ToolManager;
import org.sakaiproject.tool.gradebook.facades.ContextManagement;
@@ -34,7 +34,7 @@
* @author Josh Holtzman
*/
public class ContextManagementSakai2Impl implements ContextManagement {
- private static final Log log = LogFactory.getLog(ContextManagementSakai2Impl.class);
+ private static final Logger log = LoggerFactory.getLogger(ContextManagementSakai2Impl.class);
private static final String DEFAULT_GRADEBOOK_NAME = "QA_6";
/**
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookConfigurationSakai.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookConfigurationSakai.java
index 9f4930ca4172..d4a1bfb86849 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookConfigurationSakai.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookConfigurationSakai.java
@@ -21,8 +21,8 @@
**********************************************************************************/
package org.sakaiproject.tool.gradebook.facades.sakai2impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.db.api.SqlService;
@@ -36,7 +36,7 @@
* issue HHH-1012.)
*/
public class GradebookConfigurationSakai extends GradebookConfiguration {
- private static final Log log = LogFactory.getLog(GradebookConfigurationSakai.class);
+ private static final Logger log = LoggerFactory.getLogger(GradebookConfigurationSakai.class);
private SqlService sqlService;
private boolean autoDdl;
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookEntityProducer.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookEntityProducer.java
index 91956944e548..407b0a0dc453 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookEntityProducer.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/GradebookEntityProducer.java
@@ -26,8 +26,8 @@
import java.util.Iterator;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.entity.api.ContextObserver;
import org.sakaiproject.entity.api.EntityTransferrer;
@@ -48,7 +48,7 @@
*/
@Deprecated
public class GradebookEntityProducer extends BaseEntityProducer implements ContextObserver, EntityTransferrer, HandlesImportable {
- private static final Log log = LogFactory.getLog(GradebookEntityProducer.class);
+ private static final Logger log = LoggerFactory.getLogger(GradebookEntityProducer.class);
private String[] toolIdArray;
private GradebookFrameworkService gradebookFrameworkService;
@@ -100,7 +100,7 @@ public void contextDeleted(String context, boolean toolPlacement) {
try {
gradebookFrameworkService.deleteGradebook(context);
} catch (GradebookNotFoundException e) {
- if (log.isWarnEnabled()) log.warn(e);
+ log.warn(e.getMessage());
}
}
}
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/UserDirectoryServiceSakai2Impl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/UserDirectoryServiceSakai2Impl.java
index ea2c0a59e909..2d732cd8ccf3 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/UserDirectoryServiceSakai2Impl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sakai2impl/UserDirectoryServiceSakai2Impl.java
@@ -22,8 +22,8 @@
package org.sakaiproject.tool.gradebook.facades.sakai2impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.user.api.UserNotDefinedException;
@@ -34,7 +34,7 @@
* Sakai2 implementation of the gradebook UserDirectoryService API.
*/
public class UserDirectoryServiceSakai2Impl implements UserDirectoryService {
- private static final Log log = LogFactory.getLog(UserDirectoryServiceSakai2Impl.class);
+ private static final Logger log = LoggerFactory.getLogger(UserDirectoryServiceSakai2Impl.class);
public String getUserDisplayName(String userUid) throws UnknownUserException {
try {
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/AuthzSectionsImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/AuthzSectionsImpl.java
index 75b07947269d..bfc7b43fcb2f 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/AuthzSectionsImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/AuthzSectionsImpl.java
@@ -29,8 +29,8 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.section.api.SectionAwareness;
import org.sakaiproject.section.api.coursemanagement.CourseSection;
@@ -47,7 +47,7 @@
* on the shared Section Awareness API.
*/
public class AuthzSectionsImpl implements Authz {
- private static final Log log = LogFactory.getLog(AuthzSectionsImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(AuthzSectionsImpl.class);
private Authn authn;
private SectionAwareness sectionAwareness;
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/UserDirectoryServiceStandaloneSectionsImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/UserDirectoryServiceStandaloneSectionsImpl.java
index d8b7676a5013..0b13bd19db64 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/UserDirectoryServiceStandaloneSectionsImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/sections/UserDirectoryServiceStandaloneSectionsImpl.java
@@ -22,8 +22,8 @@
package org.sakaiproject.tool.gradebook.facades.sections;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.User;
import org.sakaiproject.component.section.support.UserManager;
import org.sakaiproject.service.gradebook.shared.UnknownUserException;
@@ -31,7 +31,7 @@
import org.sakaiproject.user.api.UserNotDefinedException;
public class UserDirectoryServiceStandaloneSectionsImpl implements UserDirectoryService {
- private static final Log log = LogFactory.getLog(UserDirectoryServiceStandaloneSectionsImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(UserDirectoryServiceStandaloneSectionsImpl.class);
private UserManager userManager;
public String getUserDisplayName(final String userUid) throws UnknownUserException {
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/AuthnStandaloneImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/AuthnStandaloneImpl.java
index 0136eb2e1c92..c3f6c681f6e1 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/AuthnStandaloneImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/AuthnStandaloneImpl.java
@@ -26,15 +26,15 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.facades.Authn;
/**
* An implementation of the Authn facade to support demos and UI tests.
*/
public class AuthnStandaloneImpl implements Authn {
- private static Log log = LogFactory.getLog(AuthnStandaloneImpl.class);
+ private static Logger log = LoggerFactory.getLogger(AuthnStandaloneImpl.class);
private static String USER_ID_PARAMETER = "userUid";
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/ContextManagementStandaloneImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/ContextManagementStandaloneImpl.java
index c338b182989f..aa8a2a8ec3ba 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/ContextManagementStandaloneImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/ContextManagementStandaloneImpl.java
@@ -27,15 +27,15 @@
import javax.servlet.ServletRequest;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.facades.ContextManagement;
/**
* An implementation of the ContextManagement facade to support demos and UI tests.
*/
public class ContextManagementStandaloneImpl implements ContextManagement {
- private static Log logger = LogFactory.getLog(ContextManagementStandaloneImpl.class);
+ private static Logger logger = LoggerFactory.getLogger(ContextManagementStandaloneImpl.class);
private static final String GRADEBOOK_UID_PARAM = "gradebookUid";
diff --git a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/EventTrackingServiceStandaloneImpl.java b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/EventTrackingServiceStandaloneImpl.java
index 387ae3d4cf90..0acfe21eb34d 100644
--- a/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/EventTrackingServiceStandaloneImpl.java
+++ b/edu-services/gradebook-service/impl/src/java/org/sakaiproject/tool/gradebook/facades/standalone/EventTrackingServiceStandaloneImpl.java
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*******************************************************************************
* Copyright (c) 2006, 2007, 2008 The Sakai Foundation, The MIT Corporation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
@@ -12,32 +12,32 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- ******************************************************************************/
-
-package org.sakaiproject.tool.gradebook.facades.standalone;
-
-import org.sakaiproject.tool.gradebook.facades.EventTrackingService;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Author:Louis Majanja
- * Date: Feb 22, 2007
- * Time: 3:36:22 PM
- *
- *
- * an implementation of the EventTrackingService facade for the standalalone gradebook
- */
-public class EventTrackingServiceStandaloneImpl implements EventTrackingService {
-
- private static final Log log = LogFactory.getLog(EventTrackingServiceStandaloneImpl.class);
-
- /**
- *
- * @param message
- * @param referenceObject
- */
- public void postEvent(String message, String referenceObject) {
- if(log.isDebugEnabled()) log.debug("action: "+message + " object reference:"+referenceObject);
- }
-}
+ ******************************************************************************/
+
+package org.sakaiproject.tool.gradebook.facades.standalone;
+
+import org.sakaiproject.tool.gradebook.facades.EventTrackingService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Author:Louis Majanja
+ * Date: Feb 22, 2007
+ * Time: 3:36:22 PM
+ *
+ *
+ * an implementation of the EventTrackingService facade for the standalalone gradebook
+ */
+public class EventTrackingServiceStandaloneImpl implements EventTrackingService {
+
+ private static final Logger log = LoggerFactory.getLogger(EventTrackingServiceStandaloneImpl.class);
+
+ /**
+ *
+ * @param message
+ * @param referenceObject
+ */
+ public void postEvent(String message, String referenceObject) {
+ if(log.isDebugEnabled()) log.debug("action: "+message + " object reference:"+referenceObject);
+ }
+}
diff --git a/edu-services/scoring-service/impl/src/java/org/sakaiproject/scoringservice/impl/ScoringServiceImpl.java b/edu-services/scoring-service/impl/src/java/org/sakaiproject/scoringservice/impl/ScoringServiceImpl.java
index 3eed55c3e8fc..fc826aab4912 100644
--- a/edu-services/scoring-service/impl/src/java/org/sakaiproject/scoringservice/impl/ScoringServiceImpl.java
+++ b/edu-services/scoring-service/impl/src/java/org/sakaiproject/scoringservice/impl/ScoringServiceImpl.java
@@ -1,7 +1,7 @@
package org.sakaiproject.scoringservice.impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.scoringservice.api.ScoringAgent;
import org.sakaiproject.scoringservice.api.ScoringComponent;
import org.sakaiproject.scoringservice.api.ScoringService;
@@ -18,7 +18,7 @@ public class ScoringServiceImpl implements ScoringService {
private ArrayList sortedScoringAgents = new ArrayList();
private ScoringAgent defaultScoringAgent;
- private static final Log log = LogFactory.getLog(ScoringServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(ScoringServiceImpl.class);
public void init(){
}
diff --git a/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/IntegrationSupportImpl.java b/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/IntegrationSupportImpl.java
index 90ac8622d700..8ced72b3d366 100644
--- a/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/IntegrationSupportImpl.java
+++ b/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/IntegrationSupportImpl.java
@@ -30,8 +30,8 @@
import org.hibernate.Query;
import org.hibernate.Session;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.CourseManager;
import org.sakaiproject.section.api.SectionManager;
import org.sakaiproject.section.api.coursemanagement.Course;
@@ -50,7 +50,7 @@
* Provides integration support using the standalone hibernate implementation.
*/
public class IntegrationSupportImpl extends HibernateDaoSupport implements IntegrationSupport {
- private static final Log log = LogFactory.getLog(IntegrationSupportImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(IntegrationSupportImpl.class);
private CourseManager courseManager;
private SectionManager sectionManager;
diff --git a/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/UserManagerHibernateImpl.java b/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/UserManagerHibernateImpl.java
index fb6028af4930..e04c2eefa4b6 100644
--- a/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/UserManagerHibernateImpl.java
+++ b/edu-services/sections-service/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/UserManagerHibernateImpl.java
@@ -26,15 +26,15 @@
import org.hibernate.Query;
import org.hibernate.Session;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.User;
import org.sakaiproject.component.section.UserImpl;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
public class UserManagerHibernateImpl extends HibernateDaoSupport implements UserManager {
- private static Log log = LogFactory.getLog(UserManagerHibernateImpl.class);
+ private static Logger log = LoggerFactory.getLogger(UserManagerHibernateImpl.class);
public User createUser(final String userUid, final String displayName,
final String sortName, final String displayId) {
diff --git a/edu-services/sections-service/sections-impl/integration-support/src/test/org/sakaiproject/test/section/integration/IntegrationSupportTest.java b/edu-services/sections-service/sections-impl/integration-support/src/test/org/sakaiproject/test/section/integration/IntegrationSupportTest.java
index b71957569b92..0f8e4013a1f1 100644
--- a/edu-services/sections-service/sections-impl/integration-support/src/test/org/sakaiproject/test/section/integration/IntegrationSupportTest.java
+++ b/edu-services/sections-service/sections-impl/integration-support/src/test/org/sakaiproject/test/section/integration/IntegrationSupportTest.java
@@ -23,8 +23,8 @@
import java.util.List;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
@@ -52,7 +52,7 @@
"classpath:org/sakaiproject/component/section/support/spring-integrationSupport.xml"
})
public class IntegrationSupportTest extends AbstractJUnit4SpringContextTests {
- private static final Log log = LogFactory.getLog(IntegrationSupportTest.class);
+ private static final Logger log = LoggerFactory.getLogger(IntegrationSupportTest.class);
private static String SITE_1 = "site_1";
private static String USER_1 = "integration_user_1";
private static String USER_2 = "integration_user_2";
diff --git a/edu-services/sections-service/sections-impl/integration-test/src/java/org/sakaiproject/test/section/SectionAwarenessImplTest.java b/edu-services/sections-service/sections-impl/integration-test/src/java/org/sakaiproject/test/section/SectionAwarenessImplTest.java
index c228faa8e0fb..cc7182b4a4cc 100644
--- a/edu-services/sections-service/sections-impl/integration-test/src/java/org/sakaiproject/test/section/SectionAwarenessImplTest.java
+++ b/edu-services/sections-service/sections-impl/integration-test/src/java/org/sakaiproject/test/section/SectionAwarenessImplTest.java
@@ -24,10 +24,10 @@
import junit.framework.Assert;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.SectionAwareness;
import org.sakaiproject.section.api.coursemanagement.CourseSection;
import org.sakaiproject.section.api.coursemanagement.ParticipationRecord;
@@ -41,7 +41,7 @@
import org.sakaiproject.user.api.UserEdit;
public class SectionAwarenessImplTest extends SakaiTestBase {
- private static final Log log = LogFactory.getLog(SectionAwarenessImplTest.class);
+ private static final Logger log = LoggerFactory.getLogger(SectionAwarenessImplTest.class);
// Services
private SectionAwareness sectionAwareness;
diff --git a/edu-services/sections-service/sections-impl/integration-test/src/test/org/sakaiproject/test/section/SectionIntegrationTestSuite.java b/edu-services/sections-service/sections-impl/integration-test/src/test/org/sakaiproject/test/section/SectionIntegrationTestSuite.java
index ba2798226df9..bc4399702b00 100644
--- a/edu-services/sections-service/sections-impl/integration-test/src/test/org/sakaiproject/test/section/SectionIntegrationTestSuite.java
+++ b/edu-services/sections-service/sections-impl/integration-test/src/test/org/sakaiproject/test/section/SectionIntegrationTestSuite.java
@@ -20,8 +20,8 @@
**********************************************************************************/
package org.sakaiproject.test.section;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.test.SakaiTestBase;
import junit.extensions.TestSetup;
@@ -30,7 +30,7 @@
public class SectionIntegrationTestSuite extends SakaiTestBase {
- private static final Log log = LogFactory.getLog(SectionIntegrationTestSuite.class);
+ private static final Logger log = LoggerFactory.getLogger(SectionIntegrationTestSuite.class);
/**
* Runs only once for the entire TestSuite, so we can keep the same component manager
diff --git a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/CourseManagerImpl.java b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/CourseManagerImpl.java
index 861bdd6e822e..912f9e15db5a 100644
--- a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/CourseManagerImpl.java
+++ b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/CourseManagerImpl.java
@@ -20,8 +20,8 @@
**********************************************************************************/
package org.sakaiproject.component.section.sakai;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.CourseManager;
import org.sakaiproject.section.api.coursemanagement.Course;
import org.sakaiproject.section.api.coursemanagement.ParticipationRecord;
@@ -40,7 +40,7 @@
*/
public class CourseManagerImpl implements CourseManager {
- private static final Log log = LogFactory.getLog(CourseManagerImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseManagerImpl.class);
/**
* @inheritDoc
diff --git a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionAwarenessImpl.java b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionAwarenessImpl.java
index f5d8765fbfb9..9326c22e4813 100644
--- a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionAwarenessImpl.java
+++ b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionAwarenessImpl.java
@@ -29,8 +29,8 @@
import java.util.Locale;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.SectionAwareness;
import org.sakaiproject.section.api.coursemanagement.Course;
import org.sakaiproject.section.api.coursemanagement.CourseSection;
@@ -63,7 +63,7 @@
*/
public class SectionAwarenessImpl implements SectionAwareness {
- private static final Log log = LogFactory.getLog(SectionAwarenessImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(SectionAwarenessImpl.class);
// Sakai services
protected SiteService siteService;
diff --git a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionCmMetadataSynchronizer.java b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionCmMetadataSynchronizer.java
index 544e44feee84..3393dd05f304 100644
--- a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionCmMetadataSynchronizer.java
+++ b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionCmMetadataSynchronizer.java
@@ -24,8 +24,8 @@
import java.util.Iterator;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -55,7 +55,7 @@
*
*/
public class SectionCmMetadataSynchronizer implements Job {
- private static final Log log = LogFactory.getLog(SectionCmMetadataSynchronizer.class);
+ private static final Logger log = LoggerFactory.getLogger(SectionCmMetadataSynchronizer.class);
public static final int PAGE_SIZE = 100;
protected SiteService siteService;
@@ -137,10 +137,8 @@ private void syncSite(Site site) {
}
try {
siteService.save(site);
- } catch (IdUnusedException e) {
- log.error(e);
- } catch (PermissionException e) {
- log.error(e);
+ } catch (IdUnusedException | PermissionException e) {
+ log.error(e.getMessage(), e);
}
}
diff --git a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionManagerImpl.java b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionManagerImpl.java
index fc9a285bd3fe..79fc3edbdf2d 100644
--- a/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionManagerImpl.java
+++ b/edu-services/sections-service/sections-impl/sakai/impl/src/java/org/sakaiproject/component/section/sakai/SectionManagerImpl.java
@@ -34,8 +34,8 @@
import java.util.Calendar;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.thread_local.api.ThreadLocalManager;
import org.sakaiproject.tool.api.SessionManager;
import org.sakaiproject.section.api.SectionAwareness;
@@ -87,7 +87,7 @@
*/
public abstract class SectionManagerImpl implements SectionManager, SiteAdvisor {
- private static final Log log = LogFactory.getLog(SectionManagerImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(SectionManagerImpl.class);
// Sakai services set by method injection
protected abstract SiteService siteService();
@@ -545,7 +545,7 @@ public List getSectionEnrollments(String sectionUuid) {
try {
studentRole = getSectionStudentRole(group);
} catch (RoleConfigurationException rce) {
- log.error(rce);
+ log.error(rce.getMessage());
return new ArrayList();
}
diff --git a/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseImpl.java b/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseImpl.java
index fc482d4b27d6..ce6ed1fe490b 100644
--- a/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseImpl.java
+++ b/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseImpl.java
@@ -23,14 +23,14 @@
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.Course;
import org.sakaiproject.entity.api.ResourceProperties;
import org.sakaiproject.site.api.Site;
public class CourseImpl implements Course, Serializable {
- private static final Log log = LogFactory.getLog(CourseImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseImpl.class);
private static final long serialVersionUID = 1L;
public static final String EXTERNALLY_MAINTAINED = "sections_externally_maintained";
diff --git a/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseSectionImpl.java b/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseSectionImpl.java
index 42c83919be87..6cf285c2e999 100644
--- a/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseSectionImpl.java
+++ b/edu-services/sections-service/sections-impl/sakai/model/src/java/org/sakaiproject/component/section/sakai/CourseSectionImpl.java
@@ -34,8 +34,8 @@
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.Course;
import org.sakaiproject.section.api.coursemanagement.CourseSection;
import org.sakaiproject.section.api.coursemanagement.Meeting;
@@ -49,7 +49,7 @@ public class CourseSectionImpl implements CourseSection, ComparableJosh Holtzman
*/
public class AssignmentGradeValidator implements Validator, Serializable {
- private static Log logger = LogFactory.getLog(AssignmentGradeValidator.class);
+ private static Logger logger = LoggerFactory.getLogger(AssignmentGradeValidator.class);
/**
* @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext,
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/AssignmentPointsConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/AssignmentPointsConverter.java
index 9296dd5057a5..84680a745318 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/AssignmentPointsConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/AssignmentPointsConverter.java
@@ -25,8 +25,8 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.service.gradebook.shared.GradebookService;
import org.sakaiproject.tool.gradebook.AbstractGradeRecord;
@@ -44,7 +44,7 @@
* displayed in a special way with a tooltip "title" attribute.
*/
public class AssignmentPointsConverter extends PointsConverter {
- private static final Log log = LogFactory.getLog(AssignmentPointsConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(AssignmentPointsConverter.class);
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (log.isDebugEnabled()) log.debug("getAsString(" + context + ", " + component + ", " + value + ")");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/CategoryPointsConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/CategoryPointsConverter.java
index f786195a7e80..ecd80e621157 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/CategoryPointsConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/CategoryPointsConverter.java
@@ -27,8 +27,8 @@
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.service.gradebook.shared.GradebookService;
import org.sakaiproject.tool.gradebook.AbstractGradeRecord;
@@ -44,7 +44,7 @@
* displayed in a special way with a tooltip "title" attribute.
*/
public class CategoryPointsConverter extends PointsConverter {
- private static final Log log = LogFactory.getLog(CategoryPointsConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(CategoryPointsConverter.class);
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (log.isDebugEnabled()) log.debug("getAsString(" + context + ", " + component + ", " + value + ")");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverter.java
index 14d91b108dd4..041d6c42f7d4 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverter.java
@@ -25,8 +25,8 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.ui.AssignmentGradeRow;
import org.sakaiproject.tool.gradebook.ui.GradebookBean;
import org.sakaiproject.tool.gradebook.Assignment;
@@ -47,7 +47,7 @@
* also changes based upon the grade entry method.
*/
public class ClassAvgConverter extends PointsConverter {
- private static final Log log = LogFactory.getLog(ClassAvgConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(ClassAvgConverter.class);
private int averageDecimalPlaces = 0;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverterBasicDisplay.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverterBasicDisplay.java
index 829e6a3de483..9af5766dd401 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverterBasicDisplay.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ClassAvgConverterBasicDisplay.java
@@ -25,8 +25,8 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.ui.AssignmentGradeRow;
import org.sakaiproject.tool.gradebook.ui.GradebookBean;
import org.sakaiproject.tool.gradebook.Assignment;
@@ -42,7 +42,7 @@
* grade entry method for this gradebook. Truncates with 0 decimals or uses the config setting.
*/
public class ClassAvgConverterBasicDisplay extends PointsConverter {
- private static final Log log = LogFactory.getLog(ClassAvgConverterBasicDisplay.class);
+ private static final Logger log = LoggerFactory.getLogger(ClassAvgConverterBasicDisplay.class);
private int averageDecimalPlaces = 0;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRenderer.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRenderer.java
index cf06e5e965b7..a5ef22b41e54 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRenderer.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRenderer.java
@@ -30,8 +30,8 @@
import javax.faces.component.UIMessage;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Put the message in a "div" instead of a "span", allowing for much more
@@ -39,7 +39,7 @@
*/
public class DivMessageRenderer extends DivMessageRendererBase {
- private static final Log logger = LogFactory.getLog(DivMessageRenderer.class);
+ private static final Logger logger = LoggerFactory.getLogger(DivMessageRenderer.class);
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
// Note our complete disregard for class cast and null exceptions....
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRendererBase.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRendererBase.java
index 412c81f9b117..199bccb786c3 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRendererBase.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessageRendererBase.java
@@ -32,11 +32,11 @@
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public abstract class DivMessageRendererBase extends Renderer {
- private static final Log logger = LogFactory.getLog(DivMessageRendererBase.class);
+ private static final Logger logger = LoggerFactory.getLogger(DivMessageRendererBase.class);
public static String INNER_TAG = "div";
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessagesRenderer.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessagesRenderer.java
index 71b9d4b2ce08..d66ca5db709b 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessagesRenderer.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/DivMessagesRenderer.java
@@ -33,8 +33,8 @@
import javax.faces.component.UIMessages;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.ui.MessagingBean;
/**
@@ -75,7 +75,7 @@
*
*/
public class DivMessagesRenderer extends DivMessageRendererBase {
- private static final Log logger = LogFactory.getLog(DivMessagesRenderer.class);
+ private static final Logger logger = LoggerFactory.getLogger(DivMessagesRenderer.class);
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesPhaseListener.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesPhaseListener.java
index 5c158763885b..8106e312f018 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesPhaseListener.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesPhaseListener.java
@@ -26,11 +26,11 @@
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class FacesPhaseListener implements PhaseListener {
- private static final Log logger = LogFactory.getLog(FacesPhaseListener.class);
+ private static final Logger logger = LoggerFactory.getLogger(FacesPhaseListener.class);
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesUtil.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesUtil.java
index 83f0be0a6594..3deb538a9ceb 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesUtil.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/FacesUtil.java
@@ -37,8 +37,8 @@
import javax.faces.context.FacesContext;
import javax.faces.event.FacesEvent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.jsf.util.LocaleUtil;
import org.sakaiproject.tool.gradebook.ui.MessagingBean;
@@ -46,7 +46,7 @@
* A noninstantiable utility class, because every JSF project needs one.
*/
public class FacesUtil {
- private static final Log logger = LogFactory.getLog(FacesUtil.class);
+ private static final Logger logger = LoggerFactory.getLogger(FacesUtil.class);
/**
* Before display, scores are rounded at this number of decimal
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/HtmlSortHeaderRenderer.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/HtmlSortHeaderRenderer.java
index c931fef7c08e..a07ec6574253 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/HtmlSortHeaderRenderer.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/HtmlSortHeaderRenderer.java
@@ -53,8 +53,8 @@
import javax.faces.context.ResponseWriter;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.myfaces.component.UserRoleUtils;
import org.apache.myfaces.component.html.ext.HtmlDataTable;
import org.apache.myfaces.custom.sortheader.HtmlCommandSortHeader;
@@ -69,8 +69,7 @@
* @author Josh Holtzman
*/
public class HtmlSortHeaderRenderer extends HtmlLinkRendererBase {
- private static final Log log = LogFactory
- .getLog(HtmlSortHeaderRenderer.class);
+ private static final Logger log = LoggerFactory.getLogger(HtmlSortHeaderRenderer.class);
public final static String CURRENT_SORT_STYLE = "currentSort";
public final static String NOT_CURRENT_SORT_STYLE = "notCurrentSort";
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/NontrailingDoubleConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/NontrailingDoubleConverter.java
index 917c3c6922ac..61878e566483 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/NontrailingDoubleConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/NontrailingDoubleConverter.java
@@ -25,8 +25,8 @@
import javax.faces.context.FacesContext;
import javax.faces.convert.NumberConverter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.util.ResourceLoader;
@@ -41,7 +41,7 @@
* values to Double values before passing them to the backing bean.
*/
public class NontrailingDoubleConverter extends NumberConverter {
- private static final Log log = LogFactory.getLog(NontrailingDoubleConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(NontrailingDoubleConverter.class);
public NontrailingDoubleConverter() {
setType("number");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PercentageConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PercentageConverter.java
index a8ecce0e3866..322befaaaeaa 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PercentageConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PercentageConverter.java
@@ -26,8 +26,8 @@
import javax.faces.context.FacesContext;
import javax.faces.convert.NumberConverter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.util.ResourceLoader;
@@ -38,7 +38,7 @@
* decimal places, and then returns it as an integer percentage.
*/
public class PercentageConverter extends NumberConverter {
- private static final Log log = LogFactory.getLog(PercentageConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(PercentageConverter.class);
public PercentageConverter() {
setType("percent");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PointsConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PointsConverter.java
index d7fa1df773bf..573bd6ad4738 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PointsConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PointsConverter.java
@@ -26,8 +26,8 @@
import javax.faces.context.FacesContext;
import javax.faces.convert.NumberConverter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.util.ResourceLoader;
@@ -38,7 +38,7 @@
* decimal places, and then returns it with a maximum of two decimal places.
*/
public class PointsConverter extends NumberConverter {
- private static final Log log = LogFactory.getLog(PointsConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(PointsConverter.class);
public PointsConverter() {
setType("number");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PrecisePercentageConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PrecisePercentageConverter.java
index 10d94a451906..a8e04317ca4a 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PrecisePercentageConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/PrecisePercentageConverter.java
@@ -26,8 +26,8 @@
import javax.faces.context.FacesContext;
import javax.faces.convert.NumberConverter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.util.ResourceLoader;
@@ -44,7 +44,7 @@
*
*/
public class PrecisePercentageConverter extends NumberConverter {
- private static final Log log = LogFactory.getLog(PrecisePercentageConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(PrecisePercentageConverter.class);
public PrecisePercentageConverter() {
setType("percent");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ScoreConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ScoreConverter.java
index 98d4a52e5608..ee921d3923cf 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ScoreConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/ScoreConverter.java
@@ -25,8 +25,8 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.ui.AssignmentGradeRow;
import org.sakaiproject.tool.gradebook.Gradebook;
import org.sakaiproject.service.gradebook.shared.GradebookService;
@@ -37,7 +37,7 @@
* changes based upon the grade entry method.
*/
public class ScoreConverter extends PointsConverter {
- private static final Log log = LogFactory.getLog(ScoreConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(ScoreConverter.class);
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (log.isDebugEnabled()) log.debug("getAsString(" + context + ", " + component + ", " + value + ")");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/TotalPointsConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/TotalPointsConverter.java
index 579b4d9ef5fb..eacb02f03061 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/TotalPointsConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/TotalPointsConverter.java
@@ -28,8 +28,8 @@
import javax.faces.context.FacesContext;
import javax.faces.convert.NumberConverter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.util.ResourceLoader;
/**
@@ -40,7 +40,7 @@
* Example: 10.0 -> 10, 10.50 -> 10.5
*/
public class TotalPointsConverter extends NumberConverter {
- private static final Log log = LogFactory.getLog(TotalPointsConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(TotalPointsConverter.class);
public TotalPointsConverter() {
setType("number");
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/dhtmlpopup/DhtmlPopupComponent.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/dhtmlpopup/DhtmlPopupComponent.java
index 47db7ce7fac0..219e2de1da52 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/dhtmlpopup/DhtmlPopupComponent.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/dhtmlpopup/DhtmlPopupComponent.java
@@ -31,8 +31,8 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.jsf.iterator.IteratorComponent;
/*
@@ -48,7 +48,7 @@
*/
public class DhtmlPopupComponent extends IteratorComponent implements NamingContainer {
- private static final Log log = LogFactory.getLog(DhtmlPopupComponent.class);
+ private static final Logger log = LoggerFactory.getLogger(DhtmlPopupComponent.class);
public final static String COMPONENT_TYPE = "org.sakaiproject.tool.gradebook.jsf.dhtmlpopup";
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/gradebookItemTable/GradebookItemTableRenderer.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/gradebookItemTable/GradebookItemTableRenderer.java
index 894236817067..4f5118a17c0e 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/gradebookItemTable/GradebookItemTableRenderer.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/gradebookItemTable/GradebookItemTableRenderer.java
@@ -14,8 +14,8 @@
import javax.faces.el.ValueBinding;
import javax.faces.render.Renderer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.myfaces.shared_impl.renderkit.html.HTML;
import org.sakaiproject.tool.gradebook.jsf.FacesUtil;
@@ -26,7 +26,7 @@
public class GradebookItemTableRenderer extends Renderer {
- protected static final Log log = LogFactory.getLog(GradebookItemTableRenderer.class);
+ protected static final Logger log = LoggerFactory.getLogger(GradebookItemTableRenderer.class);
private static final String CURSOR = "cursor:pointer";
private static final String EXPANDED_IMG = "/images/expand.gif";
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/iterator/IteratorComponent.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/iterator/IteratorComponent.java
index 42421680f56b..2f7bad4165a0 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/iterator/IteratorComponent.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/iterator/IteratorComponent.java
@@ -33,8 +33,8 @@
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A simple looping component which encodes all its children for every record in
@@ -46,7 +46,7 @@
*/
public class IteratorComponent extends UIComponentBase implements NamingContainer {
- private static final Log log = LogFactory.getLog(IteratorComponent.class);
+ private static final Logger log = LoggerFactory.getLogger(IteratorComponent.class);
public final static String COMPONENT_TYPE = "org.sakaiproject.tool.gradebook.jsf.iterator";
public final static String COMPONENT_FAMILY = "javax.faces.Data";
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/spreadsheetUI/SpreadsheetUITag.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/spreadsheetUI/SpreadsheetUITag.java
index f0b8ea80df90..6a0d2264daff 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/spreadsheetUI/SpreadsheetUITag.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/jsf/spreadsheetUI/SpreadsheetUITag.java
@@ -25,8 +25,8 @@
import javax.faces.context.ResponseWriter;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.myfaces.component.UserRoleUtils;
import org.apache.myfaces.taglib.html.HtmlDataTableTag;
import org.apache.myfaces.component.html.ext.HtmlDataTable;
@@ -125,4 +125,4 @@ public void setValue(java.lang.String value) {
public void setVar(java.lang.String _var) {
this._var = _var;
}
-}
\ No newline at end of file
+}
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentBean.java
index 39f6defb5791..63ca4d4f8217 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentBean.java
@@ -38,8 +38,8 @@
import javax.faces.validator.ValidatorException;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.EnrollmentRecord;
import org.sakaiproject.section.api.facade.Role;
import org.sakaiproject.service.gradebook.shared.ConflictingAssignmentNameException;
@@ -54,7 +54,7 @@
import org.sakaiproject.service.gradebook.shared.GradebookService;
public class AssignmentBean extends GradebookDependentBean implements Serializable {
- private static final Log logger = LogFactory.getLog(AssignmentBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(AssignmentBean.class);
private Long assignmentId;
private Assignment assignment;
@@ -462,11 +462,11 @@ else if (getGradeEntryByLetter())
}
} catch (ConflictingAssignmentNameException e) {
- logger.error(e);
+ logger.error(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("edit_assignment_name_conflict_failure"));
return "failure";
} catch (StaleObjectModificationException e) {
- logger.error(e);
+ logger.error(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("edit_assignment_locking_failure"));
return "failure";
}
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentDetailsBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentDetailsBean.java
index 9e328bc56987..e263f40815ab 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentDetailsBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/AssignmentDetailsBean.java
@@ -34,8 +34,8 @@
import javax.faces.event.ActionEvent;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.EnrollmentRecord;
import org.sakaiproject.service.gradebook.shared.GradebookService;
import org.sakaiproject.service.gradebook.shared.StaleObjectModificationException;
@@ -51,7 +51,7 @@
import org.sakaiproject.tool.gradebook.jsf.FacesUtil;
public class AssignmentDetailsBean extends EnrollmentTableBean {
- private static final Log logger = LogFactory.getLog(AssignmentDetailsBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(AssignmentDetailsBean.class);
/**
* The following variable keeps bean initialization from overwriting
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ConfigurationBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ConfigurationBean.java
index 69183c497802..4634f9a83c4a 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ConfigurationBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ConfigurationBean.java
@@ -25,8 +25,8 @@
import java.util.Map;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.api.ServerConfigurationService;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
@@ -40,7 +40,7 @@
* there might be a more straightforward way to deliver this capability.)
*/
public class ConfigurationBean implements ApplicationContextAware{
- private static final Log log = LogFactory.getLog(ConfigurationBean.class);
+ private static final Logger log = LoggerFactory.getLogger(ConfigurationBean.class);
private ApplicationContext applicationContext;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradeDetailsBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradeDetailsBean.java
index 72e450c794a2..656234d683a3 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradeDetailsBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradeDetailsBean.java
@@ -41,8 +41,8 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.jsf.spreadsheet.SpreadsheetDataFileWriterCsv;
import org.sakaiproject.jsf.spreadsheet.SpreadsheetDataFileWriterXls;
@@ -61,7 +61,7 @@
import org.sakaiproject.tool.gradebook.jsf.FacesUtil;
public class CourseGradeDetailsBean extends EnrollmentTableBean {
- private static final Log logger = LogFactory.getLog(CourseGradeDetailsBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(CourseGradeDetailsBean.class);
// View maintenance fields - serializable.
private List scoreRows;
@@ -371,7 +371,7 @@ public void processUpdateGrades(ActionEvent event) {
try {
saveGrades();
} catch (StaleObjectModificationException e) {
- logger.error(e);
+ logger.error(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("course_grade_details_locking_failure"));
}
}
@@ -383,7 +383,7 @@ public String processCalculateCourseGrades() {
try {
calculateCourseGrades();
} catch (StaleObjectModificationException e) {
- logger.error(e);
+ logger.error(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("course_grade_details_locking_failure"));
}
return "courseGradeDetails";
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetConverterDefault.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetConverterDefault.java
index a373ef1be333..a229fbe4f85d 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetConverterDefault.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetConverterDefault.java
@@ -26,8 +26,8 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.EnrollmentRecord;
import org.sakaiproject.section.api.coursemanagement.User;
import org.sakaiproject.tool.gradebook.CourseGrade;
@@ -41,7 +41,7 @@
*/
public class CourseGradesToSpreadsheetConverterDefault implements CourseGradesToSpreadsheetConverter {
- private static final Log log = LogFactory.getLog(CourseGradesToSpreadsheetConverterDefault.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseGradesToSpreadsheetConverterDefault.class);
/* (non-Javadoc)
* @see org.sakaiproject.tool.gradebook.CourseGradesConverter#getSpreadsheetData(java.util.List, org.sakaiproject.tool.gradebook.CourseGrade, java.util.Map)
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetCustomConverter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetCustomConverter.java
index b2fcd12f4b28..d4ccb383364d 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetCustomConverter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/CourseGradesToSpreadsheetCustomConverter.java
@@ -26,8 +26,8 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.section.api.coursemanagement.EnrollmentRecord;
import org.sakaiproject.section.api.coursemanagement.User;
@@ -43,7 +43,7 @@
*/
public class CourseGradesToSpreadsheetCustomConverter implements CourseGradesToSpreadsheetConverter {
- private static final Log log = LogFactory.getLog(CourseGradesToSpreadsheetCustomConverter.class);
+ private static final Logger log = LoggerFactory.getLogger(CourseGradesToSpreadsheetCustomConverter.class);
/*
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EnrollmentTableBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EnrollmentTableBean.java
index 93cb10b0b8bc..22945fbfbe7d 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EnrollmentTableBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EnrollmentTableBean.java
@@ -43,8 +43,8 @@
import javax.faces.event.ValueChangeEvent;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.CourseSection;
import org.sakaiproject.section.api.coursemanagement.EnrollmentRecord;
import org.sakaiproject.service.gradebook.shared.UnknownUserException;
@@ -58,7 +58,7 @@
*/
public abstract class EnrollmentTableBean
extends GradebookDependentBean implements Paging, Serializable {
- private static final Log log = LogFactory.getLog(EnrollmentTableBean.class);
+ private static final Logger log = LoggerFactory.getLogger(EnrollmentTableBean.class);
/**
* A comparator that sorts enrollments by student sortName
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EntryServlet.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EntryServlet.java
index 1f5c7d95c03f..5f3ffdb76bae 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EntryServlet.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/EntryServlet.java
@@ -34,8 +34,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
@@ -48,7 +48,7 @@
* Redirects the request to the role-appropriate initial view of the gradebook.
*/
public class EntryServlet extends HttpServlet {
- private static final Log logger = LogFactory.getLog(EntryServlet.class);
+ private static final Logger logger = LoggerFactory.getLogger(EntryServlet.class);
public static final String INIT_SECRET = "org.apache.myfaces.secret";
public static final String GENERATE_RANDOM_SECRET = "GENERATE_RANDOM_SECRET";
@@ -110,7 +110,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
response.sendRedirect(path.toString());
}
} catch (IOException ioe) {
- logger.fatal("Could not redirect user: " + ioe);
+ logger.error("Could not redirect user: {}", ioe.getMessage(), ioe);
}
}
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/FeedbackOptionsBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/FeedbackOptionsBean.java
index 7f7c6b473a88..40d7cfda565f 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/FeedbackOptionsBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/FeedbackOptionsBean.java
@@ -32,8 +32,8 @@
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.service.gradebook.shared.StaleObjectModificationException;
import org.sakaiproject.tool.gradebook.GradeMapping;
import org.sakaiproject.tool.gradebook.Gradebook;
@@ -45,7 +45,7 @@
* grade-to-percentage mappings for the gradebook.
*/
public class FeedbackOptionsBean extends GradebookDependentBean implements Serializable {
- private static final Log log = LogFactory.getLog(FeedbackOptionsBean.class);
+ private static final Logger log = LoggerFactory.getLogger(FeedbackOptionsBean.class);
// View maintenance fields - serializable.
@@ -204,7 +204,7 @@ public String save() {
FacesUtil.addErrorMessage(getLocalizedString("feedback_options_illegal_change", new String[] {localGradebook.getSelectedGradeMapping().getName()}));
return null;
} catch (StaleObjectModificationException e) {
- log.error(e);
+ log.error(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("feedback_options_locking_failure"));
return null;
}
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookBean.java
index 8a6e02aa8513..f5f898924eae 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookBean.java
@@ -27,8 +27,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.SectionAwareness;
@@ -49,7 +49,7 @@
* configuration of and access to those services.
*/
public class GradebookBean extends InitializableBean {
- private static final Log logger = LogFactory.getLog(GradebookBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(GradebookBean.class);
private Long gradebookId;
private String gradebookUid;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookSetupBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookSetupBean.java
index a277826b435c..11d9afbb7e2b 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookSetupBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GradebookSetupBean.java
@@ -34,8 +34,8 @@
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.Assignment;
import org.sakaiproject.tool.gradebook.Category;
@@ -51,7 +51,7 @@
public class GradebookSetupBean extends GradebookDependentBean implements Serializable
{
- private static final Log logger = LogFactory.getLog(GradebookSetupBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(GradebookSetupBean.class);
private String gradeEntryMethod;
private String categorySetting;
@@ -679,7 +679,7 @@ else if (categorySetting.equals(CATEGORY_OPT_CAT_AND_WEIGHT))
return "failure";
}
catch (StaleObjectModificationException e) {
- logger.error(e);
+ logger.error(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("cat_locking_failure"));
return "failure";
}
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GraderRulesBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GraderRulesBean.java
index cab82be546ff..6c037290772c 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GraderRulesBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/GraderRulesBean.java
@@ -34,8 +34,8 @@
import javax.faces.model.SelectItem;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.Category;
import org.sakaiproject.tool.gradebook.jsf.FacesUtil;
import org.sakaiproject.tool.gradebook.Permission;
@@ -49,7 +49,7 @@
public class GraderRulesBean extends GradebookDependentBean implements Serializable
{
- private static final Log logger = LogFactory.getLog(GraderRulesBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(GraderRulesBean.class);
private List graderList;
private String selectedGraderId;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InitializableBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InitializableBean.java
index 24bb2e631010..8166b859bbf3 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InitializableBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InitializableBean.java
@@ -22,12 +22,12 @@
package org.sakaiproject.tool.gradebook.ui;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.jsf.model.PhaseAware;
public abstract class InitializableBean implements PhaseAware {
- private static final Log logger = LogFactory.getLog(InitializableBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(InitializableBean.class);
private transient boolean notValidated;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InstructorViewBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InstructorViewBean.java
index 68e8f1130841..e28092db50ec 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InstructorViewBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/InstructorViewBean.java
@@ -27,8 +27,8 @@
import javax.faces.event.ActionEvent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.EnrollmentRecord;
import org.sakaiproject.service.gradebook.shared.StaleObjectModificationException;
@@ -46,7 +46,7 @@
* Provides data for the instructor's view of a student's grades in the gradebook.
*/
public class InstructorViewBean extends ViewByStudentBean implements Serializable {
- private static Log logger = LogFactory.getLog(InstructorViewBean.class);
+ private static Logger logger = LoggerFactory.getLogger(InstructorViewBean.class);
private EnrollmentRecord previousStudent;
private EnrollmentRecord nextStudent;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/OverviewBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/OverviewBean.java
index 957e128441d2..b0ebf2e154e7 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/OverviewBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/OverviewBean.java
@@ -36,8 +36,8 @@
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.service.gradebook.shared.GradebookService;
import org.sakaiproject.tool.api.ToolSession;
@@ -53,7 +53,7 @@
* Backing bean for the visible list of assignments in the gradebook.
*/
public class OverviewBean extends GradebookDependentBean implements Serializable {
- private static final Log logger = LogFactory.getLog(OverviewBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(OverviewBean.class);
private static final Map columnSortMap;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RemoveAssignmentBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RemoveAssignmentBean.java
index 0727258366e0..593d4b23b3c3 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RemoveAssignmentBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RemoveAssignmentBean.java
@@ -24,8 +24,8 @@
import java.io.Serializable;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.service.gradebook.shared.StaleObjectModificationException;
import org.sakaiproject.tool.gradebook.Assignment;
import org.sakaiproject.tool.gradebook.jsf.FacesUtil;
@@ -36,7 +36,7 @@
* @author Josh Holtzman
*/
public class RemoveAssignmentBean extends GradebookDependentBean implements Serializable {
- private static final Log logger = LogFactory.getLog(RemoveAssignmentBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(RemoveAssignmentBean.class);
// View maintenance fields - serializable.
private Long assignmentId;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RoleFilter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RoleFilter.java
index 0eed7717f86c..7ab13628176b 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RoleFilter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RoleFilter.java
@@ -33,8 +33,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.facades.Authn;
import org.sakaiproject.tool.gradebook.facades.Authz;
import org.sakaiproject.tool.gradebook.facades.ContextManagement;
@@ -63,7 +63,7 @@
* other URLs (e.g., "/test/login.jsf") pass through.
*/
public class RoleFilter implements Filter {
- private static Log logger = LogFactory.getLog(RoleFilter.class);
+ private static Logger logger = LoggerFactory.getLogger(RoleFilter.class);
private String authnServiceBeanName;
private String authzServiceBeanName;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RosterBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RosterBean.java
index 7b28a97d56ba..5e92aa23ac0e 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RosterBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/RosterBean.java
@@ -48,8 +48,8 @@
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.myfaces.component.html.ext.HtmlDataTable;
import org.apache.myfaces.custom.sortheader.HtmlCommandSortHeader;
import org.sakaiproject.jsf.spreadsheet.SpreadsheetDataFileWriterCsv;
@@ -79,7 +79,7 @@
* Backing bean for the visible list of assignments in the gradebook.
*/
public class RosterBean extends EnrollmentTableBean implements Serializable, Paging {
- private static final Log logger = LogFactory.getLog(RosterBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(RosterBean.class);
// Used to generate IDs for the dynamically created assignment columns.
private static final String ASSIGNMENT_COLUMN_PREFIX = "asg_";
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetRemoveBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetRemoveBean.java
index 78b7abc3145c..0a05508f2dcd 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetRemoveBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetRemoveBean.java
@@ -19,8 +19,8 @@
import org.sakaiproject.tool.gradebook.Spreadsheet;
import org.sakaiproject.tool.gradebook.jsf.FacesUtil;
import org.sakaiproject.service.gradebook.shared.StaleObjectModificationException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.Serializable;
@@ -31,7 +31,7 @@
*/
public class SpreadsheetRemoveBean extends GradebookDependentBean implements Serializable {
- private static final Log logger = LogFactory.getLog(SpreadsheetRemoveBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(SpreadsheetRemoveBean.class);
private Long spreadsheetId;
private boolean removeConfirmed;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetUploadBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetUploadBean.java
index faf579e20d49..fd1618e399da 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetUploadBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/SpreadsheetUploadBean.java
@@ -42,8 +42,8 @@
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.myfaces.custom.fileupload.UploadedFile;
import org.apache.poi.hssf.OldExcelFormatException;
import org.apache.poi.hssf.usermodel.HSSFCell;
@@ -89,7 +89,7 @@ public class SpreadsheetUploadBean extends GradebookDependentBean implements Ser
private UploadedFile upFile;
private String pickedFileReference;
private String pickedFileDesc;
- private static final Log logger = LogFactory.getLog(SpreadsheetUploadBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(SpreadsheetUploadBean.class);
private Spreadsheet spreadsheet;
private Map rosterMap;
private List assignmentList;
@@ -1149,7 +1149,7 @@ public String saveFile(){
try{
getGradebookManager().createSpreadsheet(getGradebookId(),spreadsheet.getTitle(),this.getUserDirectoryService().getUserDisplayName(getUserUid()),new Date(),sb.toString());
}catch(ConflictingSpreadsheetNameException e){
- if(logger.isDebugEnabled())logger.debug(e);
+ logger.debug(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("upload_preview_save_failure"));
return null;
}
@@ -1208,7 +1208,7 @@ public String importData(){
points = "";
}
}catch(NumberFormatException e){
- if(logger.isDebugEnabled())logger.debug(e);
+ logger.debug(e.getMessage());
points = "";
}
if(logger.isDebugEnabled())logger.debug("user "+user + " userid " + userid +" points "+points);
@@ -1837,11 +1837,11 @@ public String saveGrades(){
AssignmentGradeRecord asnGradeRecord = new AssignmentGradeRecord(assignment,uid,scoreAsDouble);
asnGradeRecord.setPercentEarned(scoreAsDouble); // in case gb entry by % - sorted out in manager
gradeRecords.add(asnGradeRecord);
- if(logger.isDebugEnabled())logger.debug("added grades for " + uid + " - score " + scoreAsString);
+ logger.debug("added grades for {} - score {}", uid, scoreAsString);
} catch (ParseException pe) {
// the score should have already been validated at this point, so
// there is something wrong
- logger.error("ParseException encountered while parsing value: " + scoreAsString + " Score was not updated.");
+ logger.error("ParseException encountered while parsing value: {} Score was not updated.", scoreAsString);
}
} else if (getGradeEntryByLetter()) {
AssignmentGradeRecord asnGradeRecord = new AssignmentGradeRecord(assignment,uid,null);
@@ -1858,7 +1858,7 @@ public String saveGrades(){
return "spreadsheetListing";
} catch (ConflictingAssignmentNameException e) {
- if(logger.isErrorEnabled())logger.error(e);
+ logger.error(e.getMessage());
FacesUtil.addErrorMessage(getLocalizedString("add_assignment_name_conflict_failure"));
}
@@ -2505,7 +2505,7 @@ private InputStream getPickedFileStream(ContentResource resource) {
inStream = resource.streamContent();
}
catch(ServerOverloadException soe) {
- logger.error(soe.getStackTrace());
+ logger.error(soe.getMessage(), soe);
}
}
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/StudentViewBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/StudentViewBean.java
index 3545f031eecd..0c5459c5b577 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/StudentViewBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/StudentViewBean.java
@@ -18,8 +18,8 @@
import java.io.Serializable;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.event.api.EventTrackingService;
@@ -30,7 +30,7 @@
* @author Josh Holtzman
*/
public class StudentViewBean extends ViewByStudentBean implements Serializable {
- private static Log logger = LogFactory.getLog(StudentViewBean.class);
+ private static Logger logger = LoggerFactory.getLogger(StudentViewBean.class);
private String studentUidToView;
private String instViewReturnToPage;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ViewByStudentBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ViewByStudentBean.java
index 6103f8a5ab49..1a772eaa84e2 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ViewByStudentBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/ViewByStudentBean.java
@@ -30,8 +30,8 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.service.gradebook.shared.GradebookService;
import org.sakaiproject.service.gradebook.shared.GradebookExternalAssessmentService;
import org.sakaiproject.service.gradebook.shared.StaleObjectModificationException;
@@ -55,7 +55,7 @@
*
*/
public class ViewByStudentBean extends EnrollmentTableBean implements Serializable {
- private static Log logger = LogFactory.getLog(ViewByStudentBean.class);
+ private static Logger logger = LoggerFactory.getLogger(ViewByStudentBean.class);
// View maintenance fields - serializable.
private String userDisplayName;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/AuthnFilter.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/AuthnFilter.java
index 3a29154af200..f9d78df8c53f 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/AuthnFilter.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/AuthnFilter.java
@@ -34,8 +34,8 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.facades.Authn;
import org.springframework.web.context.support.WebApplicationContextUtils;
@@ -43,7 +43,7 @@
* An authentication filter for standalone use in demos and UI tests.
*/
public class AuthnFilter implements Filter {
- private static Log logger = LogFactory.getLog(AuthnFilter.class);
+ private static Logger logger = LoggerFactory.getLogger(AuthnFilter.class);
private String authnRedirect;
private String authnServiceBean;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/FrameworkManagerSectionsImpl.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/FrameworkManagerSectionsImpl.java
index 095e7f7f17d2..5199c445d776 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/FrameworkManagerSectionsImpl.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/FrameworkManagerSectionsImpl.java
@@ -26,8 +26,8 @@
import java.util.Iterator;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.section.api.coursemanagement.Course;
import org.sakaiproject.section.api.coursemanagement.ParticipationRecord;
import org.sakaiproject.component.section.support.IntegrationSupport;
@@ -36,7 +36,7 @@
import org.sakaiproject.tool.gradebook.business.GradebookManager;
public class FrameworkManagerSectionsImpl implements FrameworkManager {
- private static Log log = LogFactory.getLog(FrameworkManagerSectionsImpl.class);
+ private static Logger log = LoggerFactory.getLogger(FrameworkManagerSectionsImpl.class);
private IntegrationSupport integrationSupport;
private GradebookManager gradebookManager;
@@ -73,4 +73,4 @@ public void setGradebookManager(GradebookManager gradebookManager) {
this.gradebookManager = gradebookManager;
}
-}
\ No newline at end of file
+}
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/SelectGradebookBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/SelectGradebookBean.java
index 773a47d6d702..9ac5a09e8497 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/SelectGradebookBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/standalone/SelectGradebookBean.java
@@ -28,14 +28,14 @@
import java.util.Iterator;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.Gradebook;
import org.sakaiproject.tool.gradebook.facades.Authn;
import org.sakaiproject.tool.gradebook.ui.InitializableBean;
public class SelectGradebookBean extends InitializableBean {
- private static final Log logger = LogFactory.getLog(SelectGradebookBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(SelectGradebookBean.class);
private Authn authnService;
private FrameworkManager frameworkManager;
diff --git a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/test/LoginAsBean.java b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/test/LoginAsBean.java
index 6c552ba37922..0736c7e913ca 100644
--- a/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/test/LoginAsBean.java
+++ b/gradebook/app/ui/src/java/org/sakaiproject/tool/gradebook/ui/test/LoginAsBean.java
@@ -27,12 +27,12 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.tool.gradebook.ui.InitializableBean;
public class LoginAsBean extends InitializableBean {
- private static final Log logger = LogFactory.getLog(LoginAsBean.class);
+ private static final Logger logger = LoggerFactory.getLogger(LoginAsBean.class);
private List loginChoices;
diff --git a/gradebook/grades-rest/src/main/java/org/sakaiproject/gradebook/logic/ExternalLogic.java b/gradebook/grades-rest/src/main/java/org/sakaiproject/gradebook/logic/ExternalLogic.java
index caa560cf65c8..d77e100f9c51 100644
--- a/gradebook/grades-rest/src/main/java/org/sakaiproject/gradebook/logic/ExternalLogic.java
+++ b/gradebook/grades-rest/src/main/java/org/sakaiproject/gradebook/logic/ExternalLogic.java
@@ -23,8 +23,8 @@
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.authz.api.AuthzGroupService;
import org.sakaiproject.authz.api.Member;
import org.sakaiproject.authz.api.SecurityService;
@@ -71,7 +71,7 @@ public class ExternalLogic {
public String serverId = "UNKNOWN_SERVER_ID";
public final static String NO_LOCATION = "noLocationAvailable";
- private final static Log log = LogFactory.getLog(ExternalLogic.class);
+ private final static Logger log = LoggerFactory.getLogger(ExternalLogic.class);
protected AuthzGroupService authzGroupService;
public void setAuthzGroupService(AuthzGroupService authzGroupService) {
diff --git a/help/help-component/src/java/org/sakaiproject/component/app/help/DefaultGlossary.java b/help/help-component/src/java/org/sakaiproject/component/app/help/DefaultGlossary.java
index 8ac135f1e86a..8cea069f33a7 100644
--- a/help/help-component/src/java/org/sakaiproject/component/app/help/DefaultGlossary.java
+++ b/help/help-component/src/java/org/sakaiproject/component/app/help/DefaultGlossary.java
@@ -28,8 +28,8 @@
import java.util.Properties;
import java.util.TreeMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.app.help.Glossary;
import org.sakaiproject.api.app.help.GlossaryEntry;
import org.sakaiproject.component.app.help.model.GlossaryEntryBean;
@@ -45,7 +45,7 @@ public class DefaultGlossary implements Glossary
private String url;
private Map glossary = new TreeMap();
private boolean initialized = false;
- protected final Log logger = LogFactory.getLog(getClass());
+ protected final Logger logger = LoggerFactory.getLogger(getClass());
/**
* initialize glossary
@@ -67,7 +67,7 @@ protected void init()
}
catch (IOException e)
{
- logger.error(e);
+ logger.error(e.getMessage());
}
}
diff --git a/help/help-component/src/java/org/sakaiproject/component/app/help/HelpManagerImpl.java b/help/help-component/src/java/org/sakaiproject/component/app/help/HelpManagerImpl.java
index 3454b3a0df8f..1a34ab704ec4 100644
--- a/help/help-component/src/java/org/sakaiproject/component/app/help/HelpManagerImpl.java
+++ b/help/help-component/src/java/org/sakaiproject/component/app/help/HelpManagerImpl.java
@@ -51,8 +51,8 @@
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
@@ -158,7 +158,7 @@ public class HelpManagerImpl extends HibernateDaoSupport implements HelpManager
private ToolManager toolManager;
private HibernateTransactionManager txManager;
- private static final Log LOG = LogFactory.getLog(HelpManagerImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(HelpManagerImpl.class);
/**
* @see org.sakaiproject.api.app.help.HelpManager#getServerConfigurationService()
@@ -344,7 +344,7 @@ public Map getResourcesForActiveContexts(Map session)
}
catch (Exception e)
{
- LOG.error(e);
+ LOG.error(e.getMessage());
}
}
return resourceMap;
@@ -434,7 +434,7 @@ protected Set searchResources(Query query)
}
catch (Exception e)
{
- LOG.error(e);
+ LOG.error(e.getMessage());
}
finally
{
diff --git a/help/help-component/src/java/org/sakaiproject/component/app/help/RestConfigurationImpl.java b/help/help-component/src/java/org/sakaiproject/component/app/help/RestConfigurationImpl.java
index 77b1a5a8f10b..b2fe4444ad59 100644
--- a/help/help-component/src/java/org/sakaiproject/component/app/help/RestConfigurationImpl.java
+++ b/help/help-component/src/java/org/sakaiproject/component/app/help/RestConfigurationImpl.java
@@ -32,8 +32,8 @@
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.app.help.RestConfiguration;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -60,7 +60,7 @@ public class RestConfigurationImpl implements RestConfiguration
private static String REST_DOMAIN_URL;
private static String REST_CORPUS_URL;
- private final static Log LOG = LogFactory.getLog(RestConfigurationImpl.class);
+ private final static Logger LOG = LoggerFactory.getLogger(RestConfigurationImpl.class);
/**
* @see org.sakaiproject.api.app.help.RestConfiguration#getOrganization()
diff --git a/help/help-component/src/java/org/sakaiproject/component/app/help/TutorialEntityProviderImpl.java b/help/help-component/src/java/org/sakaiproject/component/app/help/TutorialEntityProviderImpl.java
index aaa24971075f..2accc6c05989 100644
--- a/help/help-component/src/java/org/sakaiproject/component/app/help/TutorialEntityProviderImpl.java
+++ b/help/help-component/src/java/org/sakaiproject/component/app/help/TutorialEntityProviderImpl.java
@@ -8,8 +8,8 @@
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.InvariantReloadingStrategy;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.app.help.TutorialEntityProvider;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.entitybroker.EntityReference;
@@ -22,7 +22,7 @@
public class TutorialEntityProviderImpl implements TutorialEntityProvider, AutoRegisterEntityProvider, RESTful{
- protected final Log log = LogFactory.getLog(getClass());
+ protected final Logger log = LoggerFactory.getLogger(getClass());
private ResourceLoader msgs = new ResourceLoader("TutorialMessages");
private static PropertiesConfiguration tutorialProps;
diff --git a/help/help-tool/src/java/org/sakaiproject/tool/help/ContentServlet.java b/help/help-tool/src/java/org/sakaiproject/tool/help/ContentServlet.java
index 1d3ac2d5b45d..1c5beb87f2f3 100644
--- a/help/help-tool/src/java/org/sakaiproject/tool/help/ContentServlet.java
+++ b/help/help-tool/src/java/org/sakaiproject/tool/help/ContentServlet.java
@@ -34,8 +34,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.app.help.HelpManager;
import org.sakaiproject.component.api.ServerConfigurationService;
@@ -55,7 +55,7 @@ public class ContentServlet extends HttpServlet
private static final long serialVersionUID = 1L;
/** Our log (commons). */
- private static Log M_log = LogFactory.getLog(ContentServlet.class);
+ private static Logger M_log = LoggerFactory.getLogger(ContentServlet.class);
private static final String DOC_ID = "docId";
diff --git a/help/help-tool/src/java/org/sakaiproject/tool/help/HelpJsfTool.java b/help/help-tool/src/java/org/sakaiproject/tool/help/HelpJsfTool.java
index d02810e65cab..82134a818239 100644
--- a/help/help-tool/src/java/org/sakaiproject/tool/help/HelpJsfTool.java
+++ b/help/help-tool/src/java/org/sakaiproject/tool/help/HelpJsfTool.java
@@ -29,8 +29,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.jsf.util.JsfTool;
import org.sakaiproject.util.Web;
@@ -47,7 +47,7 @@ public class HelpJsfTool extends JsfTool
{
/** Our log (commons). */
- private static Log M_log = LogFactory.getLog(HelpJsfTool.class);
+ private static Logger M_log = LoggerFactory.getLogger(HelpJsfTool.class);
private static String HELP_DOC_REGEXP = org.sakaiproject.api.app.help.HelpManager.HELP_DOC_REGEXP;
diff --git a/help/help-tool/src/java/org/sakaiproject/tool/help/QuestionTool.java b/help/help-tool/src/java/org/sakaiproject/tool/help/QuestionTool.java
index c3925121f257..1ebe4f510a4a 100644
--- a/help/help-tool/src/java/org/sakaiproject/tool/help/QuestionTool.java
+++ b/help/help-tool/src/java/org/sakaiproject/tool/help/QuestionTool.java
@@ -21,7 +21,8 @@
package org.sakaiproject.tool.help;
-import org.apache.commons.logging.Log;
+import lombok.extern.slf4j.Slf4j;
+import org.slf4j.Logger;
import org.sakaiproject.api.app.help.HelpManager;
import org.sakaiproject.component.cover.ServerConfigurationService;
@@ -33,6 +34,7 @@
* question tool
* @version $Id$
*/
+@Slf4j
public class QuestionTool
{
@@ -45,7 +47,6 @@ public class QuestionTool
private String toEmailAddress;
private EmailService emailService;
- private Log logger;
private HelpManager helpManager;
/**
@@ -280,10 +281,7 @@ private void sendEmail()
}
catch (Exception e)
{
- logger
- .error(
- "email service is not set up correctly, can't send user question to support consultant!",
- e);
+ log.error("email service is not set up correctly, can't send user question to support consultant!", e);
}
}
@@ -304,22 +302,4 @@ public void setContent(String content)
{
this.content = content;
}
-
- /**
- * get logger
- * @return Returns the logger.
- */
- public Log getLogger()
- {
- return logger;
- }
-
- /**
- * set logger
- * @param logger The logger to set.
- */
- public void setLogger(Log logger)
- {
- this.logger = logger;
- }
-}
\ No newline at end of file
+}
diff --git a/help/help-tool/src/java/org/sakaiproject/tool/help/RestContentProvider.java b/help/help-tool/src/java/org/sakaiproject/tool/help/RestContentProvider.java
index ae0316f6be24..da96f5a994e7 100644
--- a/help/help-tool/src/java/org/sakaiproject/tool/help/RestContentProvider.java
+++ b/help/help-tool/src/java/org/sakaiproject/tool/help/RestContentProvider.java
@@ -46,8 +46,8 @@
import javax.xml.transform.stream.StreamResult;
import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.app.help.HelpManager;
import org.sakaiproject.api.app.help.Resource;
import org.sakaiproject.component.cover.ServerConfigurationService;
@@ -73,8 +73,7 @@ public class RestContentProvider
private static Document xslDocumentPreprocess;
private static Document xslDocumentAllInOne;
- private static final Log LOG = LogFactory
- .getLog(RestContentProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(RestContentProvider.class);
/**
* @param htmlDocument
@@ -141,7 +140,7 @@ private static String serializeDocument(Document document)
tf = TransformerFactory.newInstance().newTransformer();
tf.transform(xmlSource, outputTarget);
} catch (TransformerException e) {
- LOG.warn(e);
+ LOG.warn(e.getMessage());
}
return out.toString();
}
diff --git a/help/help-tool/src/java/org/sakaiproject/tool/help/TableOfContentsTool.java b/help/help-tool/src/java/org/sakaiproject/tool/help/TableOfContentsTool.java
index 0220d5df4941..64653acb39c8 100644
--- a/help/help-tool/src/java/org/sakaiproject/tool/help/TableOfContentsTool.java
+++ b/help/help-tool/src/java/org/sakaiproject/tool/help/TableOfContentsTool.java
@@ -24,8 +24,8 @@
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sakaiproject.api.app.help.HelpManager;
import org.sakaiproject.api.app.help.TableOfContents;
@@ -41,7 +41,7 @@ public class TableOfContentsTool
private HelpManager helpManager;
private String baseUrl = null;
- private static final Log LOG = LogFactory.getLog(TableOfContentsTool.class);
+ private static final Logger LOG = LoggerFactory.getLogger(TableOfContentsTool.class);
/**
* get table of contents
@@ -102,4 +102,4 @@ private String getBaseUrl()
return baseUrl;
}
-}
\ No newline at end of file
+}
diff --git a/hierarchy/impl/src/java/org/sakaiproject/hierarchy/dao/HierarchyDaoImpl.java b/hierarchy/impl/src/java/org/sakaiproject/hierarchy/dao/HierarchyDaoImpl.java
index f9c93ef888c8..6e76cd51aeb3 100644
--- a/hierarchy/impl/src/java/org/sakaiproject/hierarchy/dao/HierarchyDaoImpl.java
+++ b/hierarchy/impl/src/java/org/sakaiproject/hierarchy/dao/HierarchyDaoImpl.java
@@ -1,50 +1,50 @@
-/*
-* Licensed to The Apereo Foundation under one or more contributor license
-* agreements. See the NOTICE file distributed with this work for
-* additional information regarding copyright ownership.
-*
-* The Apereo Foundation licenses this file to you under the Educational
-* Community License, Version 2.0 (the "License"); you may not use this file
-* except in compliance with the License. You may obtain a copy of the
-* License at:
-*
-* http://opensource.org/licenses/ecl2.txt
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.sakaiproject.hierarchy.dao;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.sakaiproject.genericdao.api.search.Restriction;
-import org.sakaiproject.genericdao.api.search.Search;
-import org.sakaiproject.genericdao.hibernate.HibernateGeneralGenericDao;
-
-import org.sakaiproject.hierarchy.dao.model.HierarchyNodeMetaData;
-
-/**
- * Implementation of DAO
- *
- * @author Aaron Zeckoski (aaronz@vt.edu)
- */
-public class HierarchyDaoImpl extends HibernateGeneralGenericDao implements HierarchyDao {
-
- private static Log log = LogFactory.getLog(HierarchyDaoImpl.class);
-
- public void fixupDatabase() {
- // fix up some of the null fields
- long count = 0;
- count = countBySearch(HierarchyNodeMetaData.class, new Search("isDisabled","", Restriction.NULL) );
- if (count > 0) {
- int counter = 0;
- counter += getHibernateTemplate().bulkUpdate("update HierarchyNodeMetaData nm set nm.isDisabled = false where nm.isDisabled is null");
- log.info("Updated " + counter + " HierarchyNodeMetaData.isDisabled fields from null to boolean false");
- }
- }
-}
+/*
+* Licensed to The Apereo Foundation under one or more contributor license
+* agreements. See the NOTICE file distributed with this work for
+* additional information regarding copyright ownership.
+*
+* The Apereo Foundation licenses this file to you under the Educational
+* Community License, Version 2.0 (the "License"); you may not use this file
+* except in compliance with the License. You may obtain a copy of the
+* License at:
+*
+* http://opensource.org/licenses/ecl2.txt
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.sakaiproject.hierarchy.dao;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.sakaiproject.genericdao.api.search.Restriction;
+import org.sakaiproject.genericdao.api.search.Search;
+import org.sakaiproject.genericdao.hibernate.HibernateGeneralGenericDao;
+
+import org.sakaiproject.hierarchy.dao.model.HierarchyNodeMetaData;
+
+/**
+ * Implementation of DAO
+ *
+ * @author Aaron Zeckoski (aaronz@vt.edu)
+ */
+public class HierarchyDaoImpl extends HibernateGeneralGenericDao implements HierarchyDao {
+
+ private static Logger log = LoggerFactory.getLogger(HierarchyDaoImpl.class);
+
+ public void fixupDatabase() {
+ // fix up some of the null fields
+ long count = 0;
+ count = countBySearch(HierarchyNodeMetaData.class, new Search("isDisabled","", Restriction.NULL) );
+ if (count > 0) {
+ int counter = 0;
+ counter += getHibernateTemplate().bulkUpdate("update HierarchyNodeMetaData nm set nm.isDisabled = false where nm.isDisabled is null");
+ log.info("Updated " + counter + " HierarchyNodeMetaData.isDisabled fields from null to boolean false");
+ }
+ }
+}
diff --git a/hierarchy/impl/src/java/org/sakaiproject/hierarchy/impl/HierarchyServiceImpl.java b/hierarchy/impl/src/java/org/sakaiproject/hierarchy/impl/HierarchyServiceImpl.java
index 69b4be927fa5..55f13b328104 100644
--- a/hierarchy/impl/src/java/org/sakaiproject/hierarchy/impl/HierarchyServiceImpl.java
+++ b/hierarchy/impl/src/java/org/sakaiproject/hierarchy/impl/HierarchyServiceImpl.java
@@ -1,1138 +1,1138 @@
-/*
-* Licensed to The Apereo Foundation under one or more contributor license
-* agreements. See the NOTICE file distributed with this work for
-* additional information regarding copyright ownership.
-*
-* The Apereo Foundation licenses this file to you under the Educational
-* Community License, Version 2.0 (the "License"); you may not use this file
-* except in compliance with the License. You may obtain a copy of the
-* License at:
-*
-* http://opensource.org/licenses/ecl2.txt
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.sakaiproject.hierarchy.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.sakaiproject.genericdao.api.search.Order;
-import org.sakaiproject.genericdao.api.search.Restriction;
-import org.sakaiproject.genericdao.api.search.Search;
-import org.sakaiproject.hierarchy.HierarchyService;
-import org.sakaiproject.hierarchy.dao.HierarchyDao;
-import org.sakaiproject.hierarchy.dao.model.HierarchyNodeMetaData;
-import org.sakaiproject.hierarchy.dao.model.HierarchyNodePermission;
-import org.sakaiproject.hierarchy.dao.model.HierarchyPersistentNode;
-import org.sakaiproject.hierarchy.impl.utils.HierarchyImplUtils;
-import org.sakaiproject.hierarchy.model.HierarchyNode;
-import org.sakaiproject.db.api.SqlService;
-
-/**
- * The default implementation of the Hierarchy interface
- *
- * @author Aaron Zeckoski (aaronz@vt.edu)
- */
-public class HierarchyServiceImpl implements HierarchyService {
-
- private static Log log = LogFactory.getLog(HierarchyServiceImpl.class);
-
- private static int ORACLE_IN_CLAUSE_SIZE_LIMIT = 1000;
- private boolean oracle = false;
-
- private HierarchyDao dao;
-
- public void setDao(HierarchyDao dao) {
- this.dao = dao;
- }
-
- private SqlService sqlService;
-
- public void setSqlService(SqlService sqlService) {
- this.sqlService = sqlService;
- }
-
- // private SessionManager sessionManager;
- // public void setSessionManager(SessionManager sessionManager) {
- // this.sessionManager = sessionManager;
- // }
-
- public void init() {
- log.info("init");
-
- if(sqlService != null && "oracle".equalsIgnoreCase(sqlService.getVendor())){
- this.oracle = true;
- }
-
- // handle any DB migration/cleanup which needs to happen (mostly for upgrades)
- dao.fixupDatabase();
- }
-
- public HierarchyNode createHierarchy(String hierarchyId) {
- if (hierarchyId.length() < 1 || hierarchyId.length() > 250) {
- throw new IllegalArgumentException("Invalid hierarchyId (" + hierarchyId
- + "): length must be 1 to 250 chars");
- }
-
- long count = dao.countBySearch(HierarchyNodeMetaData.class,
- new Search("hierarchyId", hierarchyId) );
- if (count > 0) {
- throw new IllegalArgumentException("Invalid hierarchyId (" + hierarchyId
- + "): this id is already in use, you must use a unique id when creating a new hierarchy");
- }
-
- HierarchyPersistentNode pNode = new HierarchyPersistentNode(); // no children or parents to
- // start
- HierarchyNodeMetaData metaData = new HierarchyNodeMetaData(pNode, hierarchyId, Boolean.TRUE, null); // getCurrentUserId());
- saveNodeAndMetaData(pNode, metaData);
-
- return HierarchyImplUtils.makeNode(pNode, metaData);
- }
-
- public HierarchyNode setHierarchyRootNode(String hierarchyId, String nodeId) {
- HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
- HierarchyNodeMetaData rootMetaData = getRootNodeMetaByHierarchy(hierarchyId);
-
- Set entities = new HashSet();
-
- if (rootMetaData != null) {
- if (metaData.getId().equals(rootMetaData.getId())) {
- // this node is already the root node
- return HierarchyImplUtils.makeNode(metaData);
- } else if (!metaData.getHierarchyId().equals(rootMetaData.getHierarchyId())) {
- throw new IllegalArgumentException("Cannot move a node from one hierarchy ("
- + metaData.getHierarchyId() + ") to another (" + hierarchyId
- + ") and replace the root node, this could orphan nodes");
- }
- rootMetaData.setIsRootNode(Boolean.FALSE);
- entities.add(metaData);
- }
-
- if (metaData.getNode().getParentIds() != null) {
- throw new IllegalArgumentException("Cannot assign a node (" + nodeId
- + ") to the hierarchy rootNode when it has parents");
- }
-
- metaData.setIsRootNode(Boolean.TRUE);
- entities.add(metaData);
-
- dao.saveSet(entities);
- return HierarchyImplUtils.makeNode(metaData);
- }
-
- @SuppressWarnings("rawtypes")
- public void destroyHierarchy(String hierarchyId) {
- List l = dao.findBySearch(HierarchyNodeMetaData.class,
- new Search("hierarchyId", hierarchyId) );
- if (l.isEmpty()) {
- throw new IllegalArgumentException("Could not find hierarchy to remove with the following id: "
- + hierarchyId);
- }
-
- Set nodes = new HashSet();
- Set nodesMetaData = new HashSet();
- for (int i = 0; i < l.size(); i++) {
- HierarchyNodeMetaData nmd = (HierarchyNodeMetaData) l.get(i);
- nodesMetaData.add(nmd);
- nodes.add(nmd.getNode());
- }
-
- Set[] entitySets = new Set[] { nodesMetaData, nodes };
- dao.deleteMixedSet(entitySets);
- }
-
- public HierarchyNode getRootNode(String hierarchyId) {
- HierarchyNodeMetaData metaData = getRootNodeMetaByHierarchy(hierarchyId);
- if (metaData == null) {
- return null;
- }
- return HierarchyImplUtils.makeNode(metaData);
- }
-
- public HierarchyNode getNodeById(String nodeId) {
- HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
- return HierarchyImplUtils.makeNode(metaData);
- }
-
-
- public Map getNodesByIds(String[] nodeIds) {
- List nodeMetas = getNodeMetas(nodeIds);
- Map m = new HashMap();
- for (HierarchyNodeMetaData metaData : nodeMetas) {
- HierarchyNode node = HierarchyImplUtils.makeNode(metaData);
- m.put(node.id, node);
- }
- return m;
- }
-
- public Set getChildNodes(String nodeId, boolean directOnly) {
- Set children = new HashSet();
-
- HierarchyNodeMetaData parentMetaData = getNodeMeta(nodeId);
- String childIdString = null;
- if (directOnly) {
- childIdString = parentMetaData.getNode().getDirectChildIds();
- } else {
- childIdString = parentMetaData.getNode().getChildIds();
- }
-
- if (childIdString == null) {
- return children;
- }
-
- Set childrenIds = HierarchyImplUtils.makeNodeIdSet(childIdString);
- List childNodeMetas = getNodeMetas(childrenIds);
- for (HierarchyNodeMetaData metaData : childNodeMetas) {
- children.add(HierarchyImplUtils.makeNode(metaData));
- }
- return children;
- }
-
- public Set getParentNodes(String nodeId, boolean directOnly) {
- Set parents = new HashSet();
-
- HierarchyNodeMetaData parentMetaData = getNodeMeta(nodeId);
- String parentIdString = null;
- if (directOnly) {
- parentIdString = parentMetaData.getNode().getDirectParentIds();
- } else {
- parentIdString = parentMetaData.getNode().getParentIds();
- }
-
- if (parentIdString == null) {
- return parents;
- }
-
- Set parentsIds = HierarchyImplUtils.makeNodeIdSet(parentIdString);
- List parentNodeMetas = getNodeMetas(parentsIds);
- for (HierarchyNodeMetaData metaData : parentNodeMetas) {
- parents.add(HierarchyImplUtils.makeNode(metaData));
- }
-
-
- return parents;
- }
-
- public HierarchyNode addNode(String hierarchyId, String parentNodeId) {
- if (parentNodeId == null) {
- throw new RuntimeException("Setting parentNodeId to null is not yet supported");
- }
-
- // validate the parent node and hierarchy (this needs to be cached for sure)
- HierarchyNodeMetaData parentNodeMeta = getNodeMeta(parentNodeId);
- if (parentNodeMeta == null) {
- throw new IllegalArgumentException("Invalid parent node id, cannot find node with id: "
- + parentNodeId);
- }
- if (!parentNodeMeta.getHierarchyId().equals(hierarchyId)) {
- throw new IllegalArgumentException("Invalid hierarchy id, cannot find node (" + parentNodeId
- + ") in this hierarchy: " + hierarchyId);
- }
-
- // get the set of all nodes above the new node (these will have to be updated)
- Set parentNodeIds = HierarchyImplUtils.makeNodeIdSet(parentNodeMeta.getNode().getParentIds());
- parentNodeIds.add(parentNodeId);
-
- // create the new node and assign the new parents from our parent
- HierarchyPersistentNode pNode = new HierarchyPersistentNode(HierarchyImplUtils
- .makeSingleEncodedNodeIdString(parentNodeId), HierarchyImplUtils
- .makeEncodedNodeIdString(parentNodeIds));
- HierarchyNodeMetaData metaData = new HierarchyNodeMetaData(pNode, hierarchyId, Boolean.FALSE, null); // getCurrentUserId());
- // save this new node (perhaps we should be saving all of these in one massive update?) -AZ
- saveNodeAndMetaData(pNode, metaData);
- String newNodeId = pNode.getId().toString();
-
- // update all the links in the tree for this new node
- List pNodesList = getNodes(parentNodeIds);
- Set pNodes = new HashSet();
- for (HierarchyPersistentNode node : pNodesList) {
- if (node.getId().toString().equals(parentNodeId)) {
- // special case for our parent, update direct children
- node.setDirectChildIds(
- HierarchyImplUtils.addSingleNodeIdToEncodedString(
- node.getDirectChildIds(), newNodeId));
- }
-
- // update the children for each node
- node.setChildIds(
- HierarchyImplUtils.addSingleNodeIdToEncodedString(node.getChildIds(), newNodeId));
-
- // add to the set of node to be saved
- pNodes.add(node);
- }
- dao.saveSet(pNodes);
-
- return HierarchyImplUtils.makeNode(pNode, metaData);
- }
-
- public HierarchyNode removeNode(String nodeId) {
- if (nodeId == null) {
- throw new NullPointerException("nodeId to remove cannot be null");
- }
-
- // validate the node
- HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
- if (metaData == null) {
- throw new IllegalArgumentException("Invalid node id, cannot find node with id: " + nodeId);
- }
- if (metaData.getIsRootNode().booleanValue()) {
- throw new IllegalArgumentException("Cannot remove the root node (" + nodeId + "), "
- + "you must remove the entire hierarchy (" + metaData.getHierarchyId()
- + ") to remove this root node");
- }
-
- // get the set of all nodes above the current node (these will have to be updated)
- HierarchyNode currentNode = HierarchyImplUtils.makeNode(metaData);
- if (currentNode.childNodeIds.size() != 0) {
- throw new IllegalArgumentException("Cannot remove a node with children nodes, "
- + "reduce the children on this node from " + currentNode.childNodeIds.size()
- + " to 0 before attempting to remove it");
- }
-
- if (currentNode.directParentNodeIds.size() > 1) {
- throw new IllegalArgumentException("Cannot remove a node with multiple parents, "
- + "reduce the parents on this node to 1 before attempting to remove it");
- }
-
- // get the "main" parent node
- String currentParentNodeId = getParentNodeId(currentNode);
-
- // update all the links in the tree for this removed node
- List pNodesList = getNodes(currentNode.parentNodeIds);
- Set pNodes = new HashSet();
- for (HierarchyPersistentNode pNode : pNodesList) {
- if (pNode.getId().toString().equals(currentParentNodeId)) {
- // special case for our parent, update direct children
- Set nodeChildren = HierarchyImplUtils.makeNodeIdSet(pNode.getDirectChildIds());
- nodeChildren.remove(nodeId);
- pNode.setDirectChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodeChildren));
- }
-
- // update the children for each node
- Set nodeChildren = HierarchyImplUtils.makeNodeIdSet(pNode.getChildIds());
- nodeChildren.remove(nodeId);
- pNode.setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodeChildren));
-
- // add to the set of nodes to be saved
- pNodes.add(pNode);
- }
- dao.saveSet(pNodes);
-
- return HierarchyImplUtils.makeNode(getNodeMeta(currentParentNodeId));
- }
-
- public HierarchyNode saveNodeMetaData(String nodeId, String title, String description, String permToken) {
- if (nodeId == null) {
- throw new NullPointerException("nodeId to remove cannot be null");
- }
-
- // validate the node
- HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
- if (metaData == null) {
- throw new IllegalArgumentException("Invalid node id, cannot find node with id: " + nodeId);
- }
-
- // update the node meta data
- if (title != null) {
- if (title.equals("")) {
- metaData.setTitle(null);
- } else {
- metaData.setTitle(title);
- }
- }
- if (description != null) {
- if (description.equals("")) {
- metaData.setDescription(null);
- } else {
- metaData.setDescription(description);
- }
- }
- if (permToken != null) {
- if (permToken.equals("")) {
- metaData.setPermToken(null);
- } else {
- metaData.setPermToken(permToken);
- }
- }
-
- // save the node meta data
- dao.save(metaData);
-
- return HierarchyImplUtils.makeNode(metaData);
- }
-
- public HierarchyNode setNodeDisabled(String nodeId, Boolean isDisabled) {
-
- if (nodeId == null) {
- throw new NullPointerException("nodeId cannot be null");
- }
-
- // validate the node
- HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
-
- if (metaData == null) {
- throw new IllegalArgumentException("Invalid node id, cannot find node with id: " + nodeId);
- }
-
- // update the node's isDisabled setting
- if (isDisabled != null) {
- metaData.setIsDisabled(isDisabled);
- }
-
- // save the node meta data
- dao.save(metaData);
-
- return HierarchyImplUtils.makeNode(metaData);
-
- }
-
- public HierarchyNode addChildRelation(String nodeId, String childNodeId) {
- if (nodeId == null || childNodeId == null) {
- throw new NullPointerException("nodeId (" + nodeId + ") and childNodeId (" + childNodeId
- + ") cannot be null");
- }
-
- if (nodeId.equals(childNodeId)) {
- throw new IllegalArgumentException("nodeId and childNodeId cannot be the same: " + nodeId);
- }
-
- HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
- if (metaData == null) {
- throw new IllegalArgumentException("Invalid nodeId: " + nodeId);
- }
-
- HierarchyNodeMetaData addMetaData = getNodeMeta(childNodeId);
- if (addMetaData == null) {
- throw new IllegalArgumentException("Invalid childNodeId: " + childNodeId);
- }
-
- HierarchyNode currentNode = HierarchyImplUtils.makeNode(metaData);
- // only add this if it is not already in there
- if (!currentNode.directChildNodeIds.contains(childNodeId)) {
- // first check for a cycle
- if (currentNode.childNodeIds.contains(childNodeId)
- || currentNode.parentNodeIds.contains(childNodeId)) {
- throw new IllegalArgumentException("Cannot add " + childNodeId + " as a child of " + nodeId
- + " because it is already in the node tree directly above or below this node");
- }
-
- // now we go ahead and update this node and all the related nodes
- HierarchyNode addNode = HierarchyImplUtils.makeNode(addMetaData);
- Set pNodes = new HashSet();
-
- // update the current node
- metaData.getNode().setDirectChildIds(
- HierarchyImplUtils.addSingleNodeIdToEncodedString(
- metaData.getNode().getDirectChildIds(), childNodeId));
- metaData.getNode().setChildIds(
- HierarchyImplUtils.addSingleNodeIdToEncodedString(
- metaData.getNode().getChildIds(), childNodeId));
- pNodes.add(metaData.getNode());
-
- // update the add node
- addMetaData.getNode().setDirectParentIds(
- HierarchyImplUtils.addSingleNodeIdToEncodedString(
- addMetaData.getNode().getDirectParentIds(), nodeId));
- addMetaData.getNode().setParentIds(
- HierarchyImplUtils.addSingleNodeIdToEncodedString(
- addMetaData.getNode().getParentIds(),nodeId));
- pNodes.add(addMetaData.getNode());
-
- // update the parents of the current node (they have new children)
- List pNodesList = getNodes(currentNode.parentNodeIds);
- Set nodesToAdd = addNode.childNodeIds;
- nodesToAdd.add(addNode.id);
- for (HierarchyPersistentNode pNode : pNodesList) {
- // update the children for each node
- Set nodeChildren = HierarchyImplUtils.makeNodeIdSet(pNode.getChildIds());
- nodeChildren.addAll(nodesToAdd);
- pNode.setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodeChildren));
-
- // add to the set of nodes to be saved
- pNodes.add(pNode);
- }
-
- // update the children of the add node (they have new parants)
- pNodesList = getNodes(addNode.childNodeIds);
- nodesToAdd = currentNode.parentNodeIds;
- nodesToAdd.add(currentNode.id);
- for (HierarchyPersistentNode pNode : pNodesList) {
- // update the parents for each node
- Set parents = HierarchyImplUtils.makeNodeIdSet(pNode.getParentIds());
- parents.addAll(nodesToAdd);
- pNode.setParentIds(HierarchyImplUtils.makeEncodedNodeIdString(parents));
-
- // add to the set of nodes to be saved
- pNodes.add(pNode);
- }
-
- dao.saveSet(pNodes);
- }
-
- return HierarchyImplUtils.makeNode(metaData);
- }
-
- public HierarchyNode removeChildRelation(String nodeId, String childNodeId) {
- if (nodeId == null || childNodeId == null) {
- throw new NullPointerException("nodeId (" + nodeId + ") and childNodeId (" + childNodeId
- + ") cannot be null");
- }
-
- if (nodeId.equals(childNodeId)) {
- throw new IllegalArgumentException("nodeId and childNodeId cannot be the same: " + nodeId);
- }
-
- HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
- if (metaData == null) {
- throw new IllegalArgumentException("Invalid nodeId: " + nodeId);
- }
-
- HierarchyNodeMetaData removeMetaData = getNodeMeta(childNodeId);
- if (removeMetaData == null) {
- throw new IllegalArgumentException("Invalid childNodeId: " + childNodeId);
- }
-
- HierarchyNode currentNode = HierarchyImplUtils.makeNode(metaData);
- // only do something if this child is a direct child of this node
- if (currentNode.directChildNodeIds.contains(childNodeId)) {
- // first check for orphaning
- HierarchyNode removeNode = HierarchyImplUtils.makeNode(removeMetaData);
- if (removeNode.directParentNodeIds.size() <= 1) {
- throw new IllegalArgumentException("Cannot remove " + childNodeId + " as a child of " + nodeId
- + " because it would orphan the child node, you need to use the remove method" +
- "if you want to remove a node or add this node as the child of another node first");
- }
-
- // now we go ahead and update this node and all the related nodes
- Set pNodes = new HashSet();
- Set nodes = null;
-
- // update the current node
- nodes = HierarchyImplUtils.makeNodeIdSet(metaData.getNode().getChildIds());
- nodes.remove(childNodeId);
- metaData.getNode().setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
- nodes = HierarchyImplUtils.makeNodeIdSet(metaData.getNode().getDirectChildIds());
- nodes.remove(childNodeId);
- metaData.getNode().setDirectChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
- pNodes.add(metaData.getNode());
-
- // update the remove node
- nodes = HierarchyImplUtils.makeNodeIdSet(removeMetaData.getNode().getParentIds());
- nodes.remove(nodeId);
- removeMetaData.getNode().setParentIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
- nodes = HierarchyImplUtils.makeNodeIdSet(removeMetaData.getNode().getDirectParentIds());
- nodes.remove(nodeId);
- removeMetaData.getNode().setDirectParentIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
- pNodes.add(removeMetaData.getNode());
-
- // update the parents of the current node (they have less children)
- List pNodesList = getNodes(currentNode.parentNodeIds);
- Set nodesToRemove = removeNode.childNodeIds;
- nodesToRemove.add(removeNode.id);
- for (HierarchyPersistentNode pNode : pNodesList) {
- // update the children for each node
- Set children = HierarchyImplUtils.makeNodeIdSet(pNode.getChildIds());
- children.removeAll(nodesToRemove);
- // add back in all the children of the currentNode because we may have
- // taken out part of the tree below where if it connects to the children of removeNode
- children.addAll(currentNode.childNodeIds);
- pNode.setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(children));
-
- // add to the set of nodes to be saved
- pNodes.add(pNode);
- }
-
- // update the children of the remove node (they have lost parents)
- pNodesList = getNodes(removeNode.childNodeIds);
- nodesToRemove = currentNode.parentNodeIds;
- nodesToRemove.add(currentNode.id);
- for (HierarchyPersistentNode pNode : pNodesList) {
- // update the parents for each node
- Set parents = HierarchyImplUtils.makeNodeIdSet(pNode.getParentIds());
- parents.removeAll(nodesToRemove);
- // add back in all the parents of the removeNode because we will have
- // taken out part of the tree above where it reconnects on the way to the root
- parents.addAll(removeNode.parentNodeIds);
- pNode.setParentIds(HierarchyImplUtils.makeEncodedNodeIdString(parents));
-
- // add to the set of nodes to be saved
- pNodes.add(pNode);
- }
-
- dao.saveSet(pNodes);
-
- }
-
- return HierarchyImplUtils.makeNode(metaData);
- }
-
- public HierarchyNode addParentRelation(String nodeId, String parentNodeId) {
- // TODO Not implemented yet - not sure we even want to allow this
- throw new RuntimeException("This method is not implemented yet");
- }
-
- public HierarchyNode removeParentRelation(String nodeId, String parentNodeId) {
- // TODO Not implemented yet - not sure this is even a good idea
- throw new RuntimeException("This method is not implemented yet");
- }
-
-
- public Set getNodesWithToken(String hierarchyId, String permToken) {
- if (permToken == null || permToken.equals("")) {
- throw new NullPointerException("permToken cannot be null or empty string");
- }
-
- List l = dao.findBySearch(HierarchyNodeMetaData.class,
- new Search("hierarchyId", hierarchyId) );
- if (l.isEmpty()) {
- throw new IllegalArgumentException("Could not find hierarchy with the following id: "
- + hierarchyId);
- }
-
- List nodeIdsList = dao.findBySearch(HierarchyNodeMetaData.class,
- new Search(new Restriction[] {
- new Restriction("hierarchyId", hierarchyId),
- new Restriction("permToken", permToken)
- }, new Order("node.id")));
-
- Set nodeIds = new TreeSet();
- for (Iterator iter = nodeIdsList.iterator(); iter.hasNext();) {
- HierarchyNodeMetaData metaData = iter.next();
- nodeIds.add(metaData.getNode().getId().toString());
- }
-
- return nodeIds;
- }
-
- public Map> getNodesWithTokens(String hierarchyId, String[] permTokens) {
- // it would be better if this were more efficient...
- if (permTokens == null) {
- throw new NullPointerException("permTokens cannot be null");
- }
-
- Map> tokenNodes = new HashMap>();
- for (int i = 0; i < permTokens.length; i++) {
- Set nodeIds = getNodesWithToken(hierarchyId, permTokens[i]);
- tokenNodes.put(permTokens[i], nodeIds);
- }
-
- return tokenNodes;
- }
-
- // PERMISSIONS
-
- public void assignUserNodePerm(String userId, String nodeId, String hierarchyPermission, boolean cascade) {
- if (userId == null || "".equals(userId)
- || nodeId == null || "".equals(nodeId)
- || hierarchyPermission == null || "".equals(hierarchyPermission)) {
- throw new IllegalArgumentException("Invalid arguments to assignUserNodePerm, no arguments can be null or blank: userId="+userId+", nodeId="+nodeId+", hierarchyPermission="+hierarchyPermission);
- }
- HierarchyNodePermission nodePerm = dao.findOneBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("userId", userId),
- new Restriction("nodeId", nodeId),
- new Restriction("permission", hierarchyPermission)
- }));
- if (nodePerm == null) {
- // validate the nodeId
- Long nodeIdeNum;
- try {
- nodeIdeNum = new Long(nodeId);
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("Node id ("+nodeId+") provided is invalid, must be a valid identifier from an existing node");
- }
- // check it exists
- HierarchyPersistentNode pNode = dao.findById(HierarchyPersistentNode.class, nodeIdeNum);
- if (pNode == null) {
- throw new IllegalArgumentException("Node id ("+nodeId+") provided is invalid, node does not exist");
- }
- // create the perm
- dao.create( new HierarchyNodePermission(userId, nodeId, hierarchyPermission) );
- } else {
- // permission already set, do nothing
- }
- if (cascade) {
- // cascade the permission creation
- HierarchyNode node = getNodeById(nodeId);
- if (node != null
- && node.childNodeIds != null
- && node.childNodeIds.size() > 0) {
- List nodeIdsList = new ArrayList(node.childNodeIds);
-
- int i = 0;
- List nodePerms = new ArrayList();
- do{
- int arraySize = nodeIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- // get all the permissions which are related to the nodes under this one
- List nodePermsItteration = dao.findBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("userId", userId),
- new Restriction("permission", hierarchyPermission),
- new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray())
- }));
- nodePerms.addAll(nodePermsItteration);
- i += arraySize;
- }while(i < nodeIdsList.size());
-
- Set allPerms = new HashSet();
- if (nodePerms.size() == 0) {
- // add all new ones
- for (String childNodeId : node.childNodeIds) {
- allPerms.add( new HierarchyNodePermission(userId, childNodeId, hierarchyPermission) );
- }
- } else {
- // only add the missing ones
- Set existingPermNodeIds = new HashSet();
- for (HierarchyNodePermission hierNodePerm : nodePerms) {
- existingPermNodeIds.add( hierNodePerm.getNodeId() );
- }
- for (String childNodeId : node.childNodeIds) {
- if (! existingPermNodeIds.contains(nodeId)) {
- allPerms.add( new HierarchyNodePermission(userId, childNodeId, hierarchyPermission) );
- }
- }
- }
- if (nodePerms.size() == node.childNodeIds.size()
- || allPerms.size() == 0) {
- // nothing to do here, all permissions already exist or there are none to add
- } else {
- // save the new permissions
- dao.saveSet( new HashSet(allPerms) );
- }
- }
- }
- }
-
- public void removeUserNodePerm(String userId, String nodeId, String hierarchyPermission, boolean cascade) {
- if (userId == null || "".equals(userId)
- || nodeId == null || "".equals(nodeId)
- || hierarchyPermission == null || "".equals(hierarchyPermission)) {
- throw new IllegalArgumentException("Invalid arguments to removeUserNodePerm, no arguments can be null or blank: userId="+userId+", nodeId="+nodeId+", hierarchyPermission="+hierarchyPermission);
- }
- if (! cascade) {
- // delete the current permission if it can be found
- HierarchyNodePermission nodePerm = dao.findOneBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("userId", userId),
- new Restriction("nodeId", nodeId),
- new Restriction("permission", hierarchyPermission)
- }));
- if (nodePerm == null) {
- // not found, nothing to do
- } else {
- dao.delete(nodePerm);
- }
- } else {
- // cascade the permission removal and delete current one as well
- HierarchyNode node = getNodeById(nodeId);
- if (node != null) {
- HashSet nodeIdsSet = new HashSet();
- nodeIdsSet.add(nodeId);
- // add in child nodes if there are any
- if (node.childNodeIds != null
- && node.childNodeIds.size() > 0) {
- nodeIdsSet.addAll(node.childNodeIds);
- }
- List nodeIdsList = new ArrayList(nodeIdsSet);
- int i = 0;
- do{
- int arraySize = nodeIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- // get all the permissions which are related to the nodes under this one
- List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("userId", userId),
- new Restriction("permission", hierarchyPermission),
- new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray())
- }));
- if (nodePerms.size() > 0) {
- // delete all as one operation
- dao.deleteSet( new HashSet(nodePerms) );
- }
- i += arraySize;
- }while(i < nodeIdsList.size());
- }
- }
- }
-
- public boolean checkUserNodePerm(String userId, String nodeId, String hierarchyPermission) {
- if (userId == null || "".equals(userId)
- || nodeId == null || "".equals(nodeId)
- || hierarchyPermission == null || "".equals(hierarchyPermission)) {
- throw new IllegalArgumentException("Invalid arguments to checkUserNodePerm, no arguments can be null or blank: userId="+userId+", nodeId="+nodeId+", hierarchyPermission="+hierarchyPermission);
- }
- boolean allowed = false;
- HierarchyNodePermission nodePerm = dao.findOneBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("userId", userId),
- new Restriction("nodeId", nodeId),
- new Restriction("permission", hierarchyPermission)
- }));
- if (nodePerm != null) {
- allowed = true;
- }
- return allowed;
- }
-
- public Set getNodesForUserPerm(String userId, String hierarchyPermission) {
- if (userId == null || "".equals(userId)
- || hierarchyPermission == null || "".equals(hierarchyPermission)) {
- throw new IllegalArgumentException("Invalid arguments to getNodesForUserPerm, no arguments can be null or blank: userId="+userId+", hierarchyPermission="+hierarchyPermission);
- }
- Set nodes = new HashSet();
- List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("userId", userId),
- new Restriction("permission", hierarchyPermission)
- }));
- Set nodeIds = new HashSet();
- for (HierarchyNodePermission nodePerm : nodePerms) {
- nodeIds.add( nodePerm.getNodeId() );
- }
- List nodeMetas = getNodeMetas(nodeIds);
- for (HierarchyNodeMetaData metaData : nodeMetas) {
- nodes.add( HierarchyImplUtils.makeNode(metaData) );
- }
- return nodes;
- }
-
- public Set getUserIdsForNodesPerm(String[] nodeIds, String hierarchyPermission) {
- if (nodeIds == null
- || hierarchyPermission == null || "".equals(hierarchyPermission)) {
- throw new IllegalArgumentException("Invalid arguments to getUserIdsForNodesPerm, no arguments can be null or blank: hierarchyPermission="+hierarchyPermission);
- }
- Set userIds = new HashSet();
- if (nodeIds.length > 0) {
- List nodeIdsList = new ArrayList(Arrays.asList(nodeIds));
- int i = 0;
- do{
- int arraySize = nodeIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray()),
- new Restriction("permission", hierarchyPermission)
- }));
- for (HierarchyNodePermission nodePerm : nodePerms) {
- userIds.add( nodePerm.getUserId() );
- }
- i += arraySize;
- }while(i < nodeIdsList.size());
- }
- return userIds;
- }
-
- public Set getPermsForUserNodes(String userId, String[] nodeIds) {
- if (userId == null || "".equals(userId)
- || nodeIds == null ) {
- throw new IllegalArgumentException("Invalid arguments to getPermsForUserNodes, no arguments can be null or blank: userId="+userId);
- }
- Set perms = new HashSet();
- if (nodeIds.length > 0) {
- List nodeIdsList = new ArrayList(Arrays.asList(nodeIds));
- int i = 0;
- do{
- int arraySize = nodeIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
- new Restriction[] {
- new Restriction("userId", userId),
- new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray())
- }));
- for (HierarchyNodePermission nodePerm : nodePerms) {
- perms.add( nodePerm.getPermission() );
- }
- i += arraySize;
- }while(i < nodeIdsList.size());
- }
- return perms;
- }
-
- public Map>> getUsersAndPermsForNodes(String... nodeIds) {
- if (nodeIds == null || nodeIds.length == 0) {
- throw new IllegalArgumentException("Invalid arguments to getUsersAndPermsForNodes, no arguments can be null or blank: nodeIds="+nodeIds);
- }
- Map>> m = new HashMap>>();
- for (String nodeId : nodeIds) {
- m.put(nodeId, new HashMap>());
- }
- List nodePerms = new ArrayList();
- List nodeIdsList = new ArrayList(Arrays.asList(nodeIds));
- int i = 0;
- do{
- int arraySize = nodeIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- List nodePermsItteration = dao.findBySearch(HierarchyNodePermission.class,
- new Search("nodeId", nodeIdsList.subList(i, i + arraySize).toArray()));
- nodePerms.addAll(nodePermsItteration);
- i += arraySize;
- }while(i < nodeIdsList.size());
-
- // nodeId -> (map of userId -> Set(permission))
- for (HierarchyNodePermission nodePerm : nodePerms) {
- String nodeId = nodePerm.getNodeId();
- if (! m.containsKey(nodeId)) {
- continue; // this should not really happen but better safe than sorry
- }
- String userId = nodePerm.getUserId();
- if (! m.get(nodeId).containsKey(userId) ) {
- m.get(nodeId).put(userId, new HashSet() );
- }
- m.get(nodeId).get(userId).add( nodePerm.getPermission() );
- }
- return m;
- }
-
- public Map>> getNodesAndPermsForUser(String... userIds) {
- if (userIds == null || userIds.length == 0) {
- throw new IllegalArgumentException("Invalid arguments to getNodesAndPermsForUser, no arguments can be null or blank: userIds="+userIds);
- }
- Map>> m = new HashMap>>();
- for (String userId : userIds) {
- m.put(userId, new HashMap>());
- }
- List userIdsList = new ArrayList(Arrays.asList(userIds));
- int i = 0;
- List nodePerms = new ArrayList();
- do{
- int arraySize = userIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- List nodePermsItteration = dao.findBySearch(HierarchyNodePermission.class,
- new Search("userId", userIdsList.subList(i, i + arraySize).toArray()));
- nodePerms.addAll(nodePermsItteration);
- i += arraySize;
- }while(i < userIdsList.size());
-
- // userId -> (map of nodeId -> Set(permission))
- for (HierarchyNodePermission nodePerm : nodePerms) {
- String userId = nodePerm.getUserId();
- if (! m.containsKey(userId)) {
- continue; // this should not really happen but better safe than sorry
- }
- String nodeId = nodePerm.getNodeId();
- if (! m.get(userId).containsKey(nodeId) ) {
- m.get(userId).put(nodeId, new HashSet() );
- }
- m.get(userId).get(nodeId).add( nodePerm.getPermission() );
- }
- return m;
- }
-
- // PRIVATE
-
-
- /**
- * Convenience method to save a node and metadata in one transaction
- *
- * @param pNode
- * @param metaData
- */
- @SuppressWarnings("rawtypes")
- private void saveNodeAndMetaData(HierarchyPersistentNode pNode, HierarchyNodeMetaData metaData) {
- Set pNodes = new HashSet();
- pNodes.add(pNode);
- Set metaDatas = new HashSet();
- metaDatas.add(metaData);
- Set[] entitySets = new Set[] { pNodes, metaDatas };
- dao.saveMixedSet(entitySets);
- /* NORMALLY the code below should not be needed, however,
- * we are seeing weird cases where the line above fails to create the metadata
- * so the code below is meant to detect that case and correct it by saving
- * each separately and realigning the ids manually
- */
- if (metaData.getId() == null) {
- // something went wrong and we're not sure what so delete pNode
- if (pNode.getId() != null) {
- dao.delete(pNode);
- }
- throw new RuntimeException("Metadata didn't save, node was removed: "+pNode);
- } else if (pNode.getId() == null) {
- // something went wrong and we're not sure what so delete metadata
- if (metaData.getId() != null) {
- dao.delete(metaData);
- }
- throw new RuntimeException("Metadata didn't save, metaData was removed: "+metaData);
- } else if (!metaData.getId().equals(pNode.getId())) {
- // the indexes are off... let's try to get them back in sync
- int i = 0;
- if (pNode.getId() > metaData.getId()) {
- while (i < 100 && metaData.getId() != null && pNode.getId() != metaData.getId()) {
- // need to keep saving metaData until it's sequence has caught up
- dao.delete(metaData);
- // set ID back to null to make it save with a new incremented ID
- metaData.setId(null);
- dao.save(metaData);
- i++;
- }
- } else {
- while (i < 100 && pNode.getId() != null && pNode.getId() != metaData.getId()) {
- // need to keep saving node until it's sequence has caught up
- dao.delete(pNode);
- // set ID back to null to make it save with a new incremented ID
- pNode.setId(null);
- dao.save(pNode);
- i++;
- }
- }
- if (pNode.getId() == null || metaData.getId() == null || pNode.getId() != metaData.getId()) {
- // ok we tried, it didn't work, so throw the exception
- throw new RuntimeException("Node ID: " + pNode.getId() + " doesn't match Metadata ID: " + metaData.getId());
- }
- }
- }
-
- /**
- * Fetch node data from storage
- *
- * @param nodeId
- * @return a {@link HierarchyNodeMetaData} or null if not found
- */
- private HierarchyNodeMetaData getNodeMeta(String nodeId) {
- List l = dao.findBySearch(HierarchyNodeMetaData.class,
- new Search("node.id", new Long(nodeId)));
- if (l.size() > 1) {
- throw new IllegalStateException("Invalid hierarchy state: more than one node with id: " + nodeId);
- } else if (l.size() == 1) {
- return l.get(0);
- } else {
- return null;
- }
- }
-
- /**
- * Find the current root node
- *
- * @param hierarchyId
- * @return the root {@link HierarchyNodeMetaData} of the hierarchy
- */
- private HierarchyNodeMetaData getRootNodeMetaByHierarchy(String hierarchyId) {
- List l = dao.findBySearch(HierarchyNodeMetaData.class,
- new Search(new Restriction[] {
- new Restriction("hierarchyId", hierarchyId),
- new Restriction("isRootNode", Boolean.TRUE)
- }) );
- if (l.size() > 1) {
- throw new IllegalStateException("Invalid hierarchy state: more than one root node for hierarchyId: "
- + hierarchyId);
- } else if (l.size() == 1) {
- return l.get(0);
- } else {
- return null;
- }
- }
-
- /**
- * Get all nodes and meta data based on a set of nodeIds
- *
- * @param nodeIds
- * @return
- */
- private List getNodeMetas(Set nodeIds) {
- return getNodeMetas(nodeIds.toArray(new String[] {}));
- }
-
- private List getNodeMetas(String[] nodeIds) {
- List l = null;
- if (nodeIds == null || nodeIds.length == 0) {
- l = new ArrayList();
- } else {
- Long[] pNodeIds = new Long[nodeIds.length];
- for (int i = 0; i < nodeIds.length; i++) {
- pNodeIds[i] = new Long(nodeIds[i]);
- }
- l = new ArrayList();
- List nodeIdsList = new ArrayList(Arrays.asList(pNodeIds));
- int i = 0;
- do{
- int arraySize = nodeIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- List lIterration = dao.findBySearch(HierarchyNodeMetaData.class,
- new Search("node.id", nodeIdsList.subList(i, i + arraySize).toArray()) );
- l.addAll(lIterration);
- i += arraySize;
- }while(i < nodeIdsList.size());
- }
- return l;
- }
-
- /**
- * Get all nodes only based on a set of nodeIds
- *
- * @param nodeIds
- * @return
- */
- private List getNodes(Set nodeIds) {
- return getNodes(nodeIds.toArray(new String[] {}));
- }
-
- private List getNodes(String[] nodeIds) {
- List l = null;
- if (nodeIds == null || nodeIds.length == 0) {
- l = new ArrayList();
- } else {
- Long[] pNodeIds = new Long[nodeIds.length];
- for (int i = 0; i < nodeIds.length; i++) {
- pNodeIds[i] = new Long(nodeIds[i]);
- }
- l = new ArrayList();
- List nodeIdsList = new ArrayList(Arrays.asList(pNodeIds));
- int i = 0;
- do{
- int arraySize = nodeIdsList.size() - i;
- if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
- arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
- }
- List lIterration = dao.findBySearch(HierarchyPersistentNode.class,
- new Search("id", nodeIdsList.subList(i, i + arraySize).toArray()) );
- l.addAll(lIterration);
- i += arraySize;
- }while(i < nodeIdsList.size());
- }
- return l;
- }
-
- /**
- * Find the direct parent node id for a node
- * @param node
- * @return the node if or null if none exists
- */
- private String getParentNodeId(HierarchyNode node) {
- String parentNodeId = null;
- if (node.directParentNodeIds != null &&
- node.directParentNodeIds.size() > 0) {
- parentNodeId = node.directParentNodeIds.iterator().next();
- }
- return parentNodeId;
- }
-
-}
+/*
+* Licensed to The Apereo Foundation under one or more contributor license
+* agreements. See the NOTICE file distributed with this work for
+* additional information regarding copyright ownership.
+*
+* The Apereo Foundation licenses this file to you under the Educational
+* Community License, Version 2.0 (the "License"); you may not use this file
+* except in compliance with the License. You may obtain a copy of the
+* License at:
+*
+* http://opensource.org/licenses/ecl2.txt
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.sakaiproject.hierarchy.impl;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.sakaiproject.genericdao.api.search.Order;
+import org.sakaiproject.genericdao.api.search.Restriction;
+import org.sakaiproject.genericdao.api.search.Search;
+import org.sakaiproject.hierarchy.HierarchyService;
+import org.sakaiproject.hierarchy.dao.HierarchyDao;
+import org.sakaiproject.hierarchy.dao.model.HierarchyNodeMetaData;
+import org.sakaiproject.hierarchy.dao.model.HierarchyNodePermission;
+import org.sakaiproject.hierarchy.dao.model.HierarchyPersistentNode;
+import org.sakaiproject.hierarchy.impl.utils.HierarchyImplUtils;
+import org.sakaiproject.hierarchy.model.HierarchyNode;
+import org.sakaiproject.db.api.SqlService;
+
+/**
+ * The default implementation of the Hierarchy interface
+ *
+ * @author Aaron Zeckoski (aaronz@vt.edu)
+ */
+public class HierarchyServiceImpl implements HierarchyService {
+
+ private static Logger log = LoggerFactory.getLogger(HierarchyServiceImpl.class);
+
+ private static int ORACLE_IN_CLAUSE_SIZE_LIMIT = 1000;
+ private boolean oracle = false;
+
+ private HierarchyDao dao;
+
+ public void setDao(HierarchyDao dao) {
+ this.dao = dao;
+ }
+
+ private SqlService sqlService;
+
+ public void setSqlService(SqlService sqlService) {
+ this.sqlService = sqlService;
+ }
+
+ // private SessionManager sessionManager;
+ // public void setSessionManager(SessionManager sessionManager) {
+ // this.sessionManager = sessionManager;
+ // }
+
+ public void init() {
+ log.info("init");
+
+ if(sqlService != null && "oracle".equalsIgnoreCase(sqlService.getVendor())){
+ this.oracle = true;
+ }
+
+ // handle any DB migration/cleanup which needs to happen (mostly for upgrades)
+ dao.fixupDatabase();
+ }
+
+ public HierarchyNode createHierarchy(String hierarchyId) {
+ if (hierarchyId.length() < 1 || hierarchyId.length() > 250) {
+ throw new IllegalArgumentException("Invalid hierarchyId (" + hierarchyId
+ + "): length must be 1 to 250 chars");
+ }
+
+ long count = dao.countBySearch(HierarchyNodeMetaData.class,
+ new Search("hierarchyId", hierarchyId) );
+ if (count > 0) {
+ throw new IllegalArgumentException("Invalid hierarchyId (" + hierarchyId
+ + "): this id is already in use, you must use a unique id when creating a new hierarchy");
+ }
+
+ HierarchyPersistentNode pNode = new HierarchyPersistentNode(); // no children or parents to
+ // start
+ HierarchyNodeMetaData metaData = new HierarchyNodeMetaData(pNode, hierarchyId, Boolean.TRUE, null); // getCurrentUserId());
+ saveNodeAndMetaData(pNode, metaData);
+
+ return HierarchyImplUtils.makeNode(pNode, metaData);
+ }
+
+ public HierarchyNode setHierarchyRootNode(String hierarchyId, String nodeId) {
+ HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
+ HierarchyNodeMetaData rootMetaData = getRootNodeMetaByHierarchy(hierarchyId);
+
+ Set entities = new HashSet();
+
+ if (rootMetaData != null) {
+ if (metaData.getId().equals(rootMetaData.getId())) {
+ // this node is already the root node
+ return HierarchyImplUtils.makeNode(metaData);
+ } else if (!metaData.getHierarchyId().equals(rootMetaData.getHierarchyId())) {
+ throw new IllegalArgumentException("Cannot move a node from one hierarchy ("
+ + metaData.getHierarchyId() + ") to another (" + hierarchyId
+ + ") and replace the root node, this could orphan nodes");
+ }
+ rootMetaData.setIsRootNode(Boolean.FALSE);
+ entities.add(metaData);
+ }
+
+ if (metaData.getNode().getParentIds() != null) {
+ throw new IllegalArgumentException("Cannot assign a node (" + nodeId
+ + ") to the hierarchy rootNode when it has parents");
+ }
+
+ metaData.setIsRootNode(Boolean.TRUE);
+ entities.add(metaData);
+
+ dao.saveSet(entities);
+ return HierarchyImplUtils.makeNode(metaData);
+ }
+
+ @SuppressWarnings("rawtypes")
+ public void destroyHierarchy(String hierarchyId) {
+ List l = dao.findBySearch(HierarchyNodeMetaData.class,
+ new Search("hierarchyId", hierarchyId) );
+ if (l.isEmpty()) {
+ throw new IllegalArgumentException("Could not find hierarchy to remove with the following id: "
+ + hierarchyId);
+ }
+
+ Set nodes = new HashSet();
+ Set nodesMetaData = new HashSet();
+ for (int i = 0; i < l.size(); i++) {
+ HierarchyNodeMetaData nmd = (HierarchyNodeMetaData) l.get(i);
+ nodesMetaData.add(nmd);
+ nodes.add(nmd.getNode());
+ }
+
+ Set[] entitySets = new Set[] { nodesMetaData, nodes };
+ dao.deleteMixedSet(entitySets);
+ }
+
+ public HierarchyNode getRootNode(String hierarchyId) {
+ HierarchyNodeMetaData metaData = getRootNodeMetaByHierarchy(hierarchyId);
+ if (metaData == null) {
+ return null;
+ }
+ return HierarchyImplUtils.makeNode(metaData);
+ }
+
+ public HierarchyNode getNodeById(String nodeId) {
+ HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
+ return HierarchyImplUtils.makeNode(metaData);
+ }
+
+
+ public Map getNodesByIds(String[] nodeIds) {
+ List nodeMetas = getNodeMetas(nodeIds);
+ Map m = new HashMap();
+ for (HierarchyNodeMetaData metaData : nodeMetas) {
+ HierarchyNode node = HierarchyImplUtils.makeNode(metaData);
+ m.put(node.id, node);
+ }
+ return m;
+ }
+
+ public Set getChildNodes(String nodeId, boolean directOnly) {
+ Set children = new HashSet();
+
+ HierarchyNodeMetaData parentMetaData = getNodeMeta(nodeId);
+ String childIdString = null;
+ if (directOnly) {
+ childIdString = parentMetaData.getNode().getDirectChildIds();
+ } else {
+ childIdString = parentMetaData.getNode().getChildIds();
+ }
+
+ if (childIdString == null) {
+ return children;
+ }
+
+ Set childrenIds = HierarchyImplUtils.makeNodeIdSet(childIdString);
+ List childNodeMetas = getNodeMetas(childrenIds);
+ for (HierarchyNodeMetaData metaData : childNodeMetas) {
+ children.add(HierarchyImplUtils.makeNode(metaData));
+ }
+ return children;
+ }
+
+ public Set getParentNodes(String nodeId, boolean directOnly) {
+ Set parents = new HashSet();
+
+ HierarchyNodeMetaData parentMetaData = getNodeMeta(nodeId);
+ String parentIdString = null;
+ if (directOnly) {
+ parentIdString = parentMetaData.getNode().getDirectParentIds();
+ } else {
+ parentIdString = parentMetaData.getNode().getParentIds();
+ }
+
+ if (parentIdString == null) {
+ return parents;
+ }
+
+ Set parentsIds = HierarchyImplUtils.makeNodeIdSet(parentIdString);
+ List parentNodeMetas = getNodeMetas(parentsIds);
+ for (HierarchyNodeMetaData metaData : parentNodeMetas) {
+ parents.add(HierarchyImplUtils.makeNode(metaData));
+ }
+
+
+ return parents;
+ }
+
+ public HierarchyNode addNode(String hierarchyId, String parentNodeId) {
+ if (parentNodeId == null) {
+ throw new RuntimeException("Setting parentNodeId to null is not yet supported");
+ }
+
+ // validate the parent node and hierarchy (this needs to be cached for sure)
+ HierarchyNodeMetaData parentNodeMeta = getNodeMeta(parentNodeId);
+ if (parentNodeMeta == null) {
+ throw new IllegalArgumentException("Invalid parent node id, cannot find node with id: "
+ + parentNodeId);
+ }
+ if (!parentNodeMeta.getHierarchyId().equals(hierarchyId)) {
+ throw new IllegalArgumentException("Invalid hierarchy id, cannot find node (" + parentNodeId
+ + ") in this hierarchy: " + hierarchyId);
+ }
+
+ // get the set of all nodes above the new node (these will have to be updated)
+ Set parentNodeIds = HierarchyImplUtils.makeNodeIdSet(parentNodeMeta.getNode().getParentIds());
+ parentNodeIds.add(parentNodeId);
+
+ // create the new node and assign the new parents from our parent
+ HierarchyPersistentNode pNode = new HierarchyPersistentNode(HierarchyImplUtils
+ .makeSingleEncodedNodeIdString(parentNodeId), HierarchyImplUtils
+ .makeEncodedNodeIdString(parentNodeIds));
+ HierarchyNodeMetaData metaData = new HierarchyNodeMetaData(pNode, hierarchyId, Boolean.FALSE, null); // getCurrentUserId());
+ // save this new node (perhaps we should be saving all of these in one massive update?) -AZ
+ saveNodeAndMetaData(pNode, metaData);
+ String newNodeId = pNode.getId().toString();
+
+ // update all the links in the tree for this new node
+ List pNodesList = getNodes(parentNodeIds);
+ Set pNodes = new HashSet();
+ for (HierarchyPersistentNode node : pNodesList) {
+ if (node.getId().toString().equals(parentNodeId)) {
+ // special case for our parent, update direct children
+ node.setDirectChildIds(
+ HierarchyImplUtils.addSingleNodeIdToEncodedString(
+ node.getDirectChildIds(), newNodeId));
+ }
+
+ // update the children for each node
+ node.setChildIds(
+ HierarchyImplUtils.addSingleNodeIdToEncodedString(node.getChildIds(), newNodeId));
+
+ // add to the set of node to be saved
+ pNodes.add(node);
+ }
+ dao.saveSet(pNodes);
+
+ return HierarchyImplUtils.makeNode(pNode, metaData);
+ }
+
+ public HierarchyNode removeNode(String nodeId) {
+ if (nodeId == null) {
+ throw new NullPointerException("nodeId to remove cannot be null");
+ }
+
+ // validate the node
+ HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
+ if (metaData == null) {
+ throw new IllegalArgumentException("Invalid node id, cannot find node with id: " + nodeId);
+ }
+ if (metaData.getIsRootNode().booleanValue()) {
+ throw new IllegalArgumentException("Cannot remove the root node (" + nodeId + "), "
+ + "you must remove the entire hierarchy (" + metaData.getHierarchyId()
+ + ") to remove this root node");
+ }
+
+ // get the set of all nodes above the current node (these will have to be updated)
+ HierarchyNode currentNode = HierarchyImplUtils.makeNode(metaData);
+ if (currentNode.childNodeIds.size() != 0) {
+ throw new IllegalArgumentException("Cannot remove a node with children nodes, "
+ + "reduce the children on this node from " + currentNode.childNodeIds.size()
+ + " to 0 before attempting to remove it");
+ }
+
+ if (currentNode.directParentNodeIds.size() > 1) {
+ throw new IllegalArgumentException("Cannot remove a node with multiple parents, "
+ + "reduce the parents on this node to 1 before attempting to remove it");
+ }
+
+ // get the "main" parent node
+ String currentParentNodeId = getParentNodeId(currentNode);
+
+ // update all the links in the tree for this removed node
+ List pNodesList = getNodes(currentNode.parentNodeIds);
+ Set pNodes = new HashSet();
+ for (HierarchyPersistentNode pNode : pNodesList) {
+ if (pNode.getId().toString().equals(currentParentNodeId)) {
+ // special case for our parent, update direct children
+ Set nodeChildren = HierarchyImplUtils.makeNodeIdSet(pNode.getDirectChildIds());
+ nodeChildren.remove(nodeId);
+ pNode.setDirectChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodeChildren));
+ }
+
+ // update the children for each node
+ Set nodeChildren = HierarchyImplUtils.makeNodeIdSet(pNode.getChildIds());
+ nodeChildren.remove(nodeId);
+ pNode.setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodeChildren));
+
+ // add to the set of nodes to be saved
+ pNodes.add(pNode);
+ }
+ dao.saveSet(pNodes);
+
+ return HierarchyImplUtils.makeNode(getNodeMeta(currentParentNodeId));
+ }
+
+ public HierarchyNode saveNodeMetaData(String nodeId, String title, String description, String permToken) {
+ if (nodeId == null) {
+ throw new NullPointerException("nodeId to remove cannot be null");
+ }
+
+ // validate the node
+ HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
+ if (metaData == null) {
+ throw new IllegalArgumentException("Invalid node id, cannot find node with id: " + nodeId);
+ }
+
+ // update the node meta data
+ if (title != null) {
+ if (title.equals("")) {
+ metaData.setTitle(null);
+ } else {
+ metaData.setTitle(title);
+ }
+ }
+ if (description != null) {
+ if (description.equals("")) {
+ metaData.setDescription(null);
+ } else {
+ metaData.setDescription(description);
+ }
+ }
+ if (permToken != null) {
+ if (permToken.equals("")) {
+ metaData.setPermToken(null);
+ } else {
+ metaData.setPermToken(permToken);
+ }
+ }
+
+ // save the node meta data
+ dao.save(metaData);
+
+ return HierarchyImplUtils.makeNode(metaData);
+ }
+
+ public HierarchyNode setNodeDisabled(String nodeId, Boolean isDisabled) {
+
+ if (nodeId == null) {
+ throw new NullPointerException("nodeId cannot be null");
+ }
+
+ // validate the node
+ HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
+
+ if (metaData == null) {
+ throw new IllegalArgumentException("Invalid node id, cannot find node with id: " + nodeId);
+ }
+
+ // update the node's isDisabled setting
+ if (isDisabled != null) {
+ metaData.setIsDisabled(isDisabled);
+ }
+
+ // save the node meta data
+ dao.save(metaData);
+
+ return HierarchyImplUtils.makeNode(metaData);
+
+ }
+
+ public HierarchyNode addChildRelation(String nodeId, String childNodeId) {
+ if (nodeId == null || childNodeId == null) {
+ throw new NullPointerException("nodeId (" + nodeId + ") and childNodeId (" + childNodeId
+ + ") cannot be null");
+ }
+
+ if (nodeId.equals(childNodeId)) {
+ throw new IllegalArgumentException("nodeId and childNodeId cannot be the same: " + nodeId);
+ }
+
+ HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
+ if (metaData == null) {
+ throw new IllegalArgumentException("Invalid nodeId: " + nodeId);
+ }
+
+ HierarchyNodeMetaData addMetaData = getNodeMeta(childNodeId);
+ if (addMetaData == null) {
+ throw new IllegalArgumentException("Invalid childNodeId: " + childNodeId);
+ }
+
+ HierarchyNode currentNode = HierarchyImplUtils.makeNode(metaData);
+ // only add this if it is not already in there
+ if (!currentNode.directChildNodeIds.contains(childNodeId)) {
+ // first check for a cycle
+ if (currentNode.childNodeIds.contains(childNodeId)
+ || currentNode.parentNodeIds.contains(childNodeId)) {
+ throw new IllegalArgumentException("Cannot add " + childNodeId + " as a child of " + nodeId
+ + " because it is already in the node tree directly above or below this node");
+ }
+
+ // now we go ahead and update this node and all the related nodes
+ HierarchyNode addNode = HierarchyImplUtils.makeNode(addMetaData);
+ Set pNodes = new HashSet();
+
+ // update the current node
+ metaData.getNode().setDirectChildIds(
+ HierarchyImplUtils.addSingleNodeIdToEncodedString(
+ metaData.getNode().getDirectChildIds(), childNodeId));
+ metaData.getNode().setChildIds(
+ HierarchyImplUtils.addSingleNodeIdToEncodedString(
+ metaData.getNode().getChildIds(), childNodeId));
+ pNodes.add(metaData.getNode());
+
+ // update the add node
+ addMetaData.getNode().setDirectParentIds(
+ HierarchyImplUtils.addSingleNodeIdToEncodedString(
+ addMetaData.getNode().getDirectParentIds(), nodeId));
+ addMetaData.getNode().setParentIds(
+ HierarchyImplUtils.addSingleNodeIdToEncodedString(
+ addMetaData.getNode().getParentIds(),nodeId));
+ pNodes.add(addMetaData.getNode());
+
+ // update the parents of the current node (they have new children)
+ List pNodesList = getNodes(currentNode.parentNodeIds);
+ Set nodesToAdd = addNode.childNodeIds;
+ nodesToAdd.add(addNode.id);
+ for (HierarchyPersistentNode pNode : pNodesList) {
+ // update the children for each node
+ Set nodeChildren = HierarchyImplUtils.makeNodeIdSet(pNode.getChildIds());
+ nodeChildren.addAll(nodesToAdd);
+ pNode.setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodeChildren));
+
+ // add to the set of nodes to be saved
+ pNodes.add(pNode);
+ }
+
+ // update the children of the add node (they have new parants)
+ pNodesList = getNodes(addNode.childNodeIds);
+ nodesToAdd = currentNode.parentNodeIds;
+ nodesToAdd.add(currentNode.id);
+ for (HierarchyPersistentNode pNode : pNodesList) {
+ // update the parents for each node
+ Set parents = HierarchyImplUtils.makeNodeIdSet(pNode.getParentIds());
+ parents.addAll(nodesToAdd);
+ pNode.setParentIds(HierarchyImplUtils.makeEncodedNodeIdString(parents));
+
+ // add to the set of nodes to be saved
+ pNodes.add(pNode);
+ }
+
+ dao.saveSet(pNodes);
+ }
+
+ return HierarchyImplUtils.makeNode(metaData);
+ }
+
+ public HierarchyNode removeChildRelation(String nodeId, String childNodeId) {
+ if (nodeId == null || childNodeId == null) {
+ throw new NullPointerException("nodeId (" + nodeId + ") and childNodeId (" + childNodeId
+ + ") cannot be null");
+ }
+
+ if (nodeId.equals(childNodeId)) {
+ throw new IllegalArgumentException("nodeId and childNodeId cannot be the same: " + nodeId);
+ }
+
+ HierarchyNodeMetaData metaData = getNodeMeta(nodeId);
+ if (metaData == null) {
+ throw new IllegalArgumentException("Invalid nodeId: " + nodeId);
+ }
+
+ HierarchyNodeMetaData removeMetaData = getNodeMeta(childNodeId);
+ if (removeMetaData == null) {
+ throw new IllegalArgumentException("Invalid childNodeId: " + childNodeId);
+ }
+
+ HierarchyNode currentNode = HierarchyImplUtils.makeNode(metaData);
+ // only do something if this child is a direct child of this node
+ if (currentNode.directChildNodeIds.contains(childNodeId)) {
+ // first check for orphaning
+ HierarchyNode removeNode = HierarchyImplUtils.makeNode(removeMetaData);
+ if (removeNode.directParentNodeIds.size() <= 1) {
+ throw new IllegalArgumentException("Cannot remove " + childNodeId + " as a child of " + nodeId
+ + " because it would orphan the child node, you need to use the remove method" +
+ "if you want to remove a node or add this node as the child of another node first");
+ }
+
+ // now we go ahead and update this node and all the related nodes
+ Set pNodes = new HashSet();
+ Set nodes = null;
+
+ // update the current node
+ nodes = HierarchyImplUtils.makeNodeIdSet(metaData.getNode().getChildIds());
+ nodes.remove(childNodeId);
+ metaData.getNode().setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
+ nodes = HierarchyImplUtils.makeNodeIdSet(metaData.getNode().getDirectChildIds());
+ nodes.remove(childNodeId);
+ metaData.getNode().setDirectChildIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
+ pNodes.add(metaData.getNode());
+
+ // update the remove node
+ nodes = HierarchyImplUtils.makeNodeIdSet(removeMetaData.getNode().getParentIds());
+ nodes.remove(nodeId);
+ removeMetaData.getNode().setParentIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
+ nodes = HierarchyImplUtils.makeNodeIdSet(removeMetaData.getNode().getDirectParentIds());
+ nodes.remove(nodeId);
+ removeMetaData.getNode().setDirectParentIds(HierarchyImplUtils.makeEncodedNodeIdString(nodes));
+ pNodes.add(removeMetaData.getNode());
+
+ // update the parents of the current node (they have less children)
+ List pNodesList = getNodes(currentNode.parentNodeIds);
+ Set nodesToRemove = removeNode.childNodeIds;
+ nodesToRemove.add(removeNode.id);
+ for (HierarchyPersistentNode pNode : pNodesList) {
+ // update the children for each node
+ Set children = HierarchyImplUtils.makeNodeIdSet(pNode.getChildIds());
+ children.removeAll(nodesToRemove);
+ // add back in all the children of the currentNode because we may have
+ // taken out part of the tree below where if it connects to the children of removeNode
+ children.addAll(currentNode.childNodeIds);
+ pNode.setChildIds(HierarchyImplUtils.makeEncodedNodeIdString(children));
+
+ // add to the set of nodes to be saved
+ pNodes.add(pNode);
+ }
+
+ // update the children of the remove node (they have lost parents)
+ pNodesList = getNodes(removeNode.childNodeIds);
+ nodesToRemove = currentNode.parentNodeIds;
+ nodesToRemove.add(currentNode.id);
+ for (HierarchyPersistentNode pNode : pNodesList) {
+ // update the parents for each node
+ Set parents = HierarchyImplUtils.makeNodeIdSet(pNode.getParentIds());
+ parents.removeAll(nodesToRemove);
+ // add back in all the parents of the removeNode because we will have
+ // taken out part of the tree above where it reconnects on the way to the root
+ parents.addAll(removeNode.parentNodeIds);
+ pNode.setParentIds(HierarchyImplUtils.makeEncodedNodeIdString(parents));
+
+ // add to the set of nodes to be saved
+ pNodes.add(pNode);
+ }
+
+ dao.saveSet(pNodes);
+
+ }
+
+ return HierarchyImplUtils.makeNode(metaData);
+ }
+
+ public HierarchyNode addParentRelation(String nodeId, String parentNodeId) {
+ // TODO Not implemented yet - not sure we even want to allow this
+ throw new RuntimeException("This method is not implemented yet");
+ }
+
+ public HierarchyNode removeParentRelation(String nodeId, String parentNodeId) {
+ // TODO Not implemented yet - not sure this is even a good idea
+ throw new RuntimeException("This method is not implemented yet");
+ }
+
+
+ public Set getNodesWithToken(String hierarchyId, String permToken) {
+ if (permToken == null || permToken.equals("")) {
+ throw new NullPointerException("permToken cannot be null or empty string");
+ }
+
+ List l = dao.findBySearch(HierarchyNodeMetaData.class,
+ new Search("hierarchyId", hierarchyId) );
+ if (l.isEmpty()) {
+ throw new IllegalArgumentException("Could not find hierarchy with the following id: "
+ + hierarchyId);
+ }
+
+ List nodeIdsList = dao.findBySearch(HierarchyNodeMetaData.class,
+ new Search(new Restriction[] {
+ new Restriction("hierarchyId", hierarchyId),
+ new Restriction("permToken", permToken)
+ }, new Order("node.id")));
+
+ Set nodeIds = new TreeSet();
+ for (Iterator iter = nodeIdsList.iterator(); iter.hasNext();) {
+ HierarchyNodeMetaData metaData = iter.next();
+ nodeIds.add(metaData.getNode().getId().toString());
+ }
+
+ return nodeIds;
+ }
+
+ public Map> getNodesWithTokens(String hierarchyId, String[] permTokens) {
+ // it would be better if this were more efficient...
+ if (permTokens == null) {
+ throw new NullPointerException("permTokens cannot be null");
+ }
+
+ Map> tokenNodes = new HashMap>();
+ for (int i = 0; i < permTokens.length; i++) {
+ Set nodeIds = getNodesWithToken(hierarchyId, permTokens[i]);
+ tokenNodes.put(permTokens[i], nodeIds);
+ }
+
+ return tokenNodes;
+ }
+
+ // PERMISSIONS
+
+ public void assignUserNodePerm(String userId, String nodeId, String hierarchyPermission, boolean cascade) {
+ if (userId == null || "".equals(userId)
+ || nodeId == null || "".equals(nodeId)
+ || hierarchyPermission == null || "".equals(hierarchyPermission)) {
+ throw new IllegalArgumentException("Invalid arguments to assignUserNodePerm, no arguments can be null or blank: userId="+userId+", nodeId="+nodeId+", hierarchyPermission="+hierarchyPermission);
+ }
+ HierarchyNodePermission nodePerm = dao.findOneBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("userId", userId),
+ new Restriction("nodeId", nodeId),
+ new Restriction("permission", hierarchyPermission)
+ }));
+ if (nodePerm == null) {
+ // validate the nodeId
+ Long nodeIdeNum;
+ try {
+ nodeIdeNum = new Long(nodeId);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Node id ("+nodeId+") provided is invalid, must be a valid identifier from an existing node");
+ }
+ // check it exists
+ HierarchyPersistentNode pNode = dao.findById(HierarchyPersistentNode.class, nodeIdeNum);
+ if (pNode == null) {
+ throw new IllegalArgumentException("Node id ("+nodeId+") provided is invalid, node does not exist");
+ }
+ // create the perm
+ dao.create( new HierarchyNodePermission(userId, nodeId, hierarchyPermission) );
+ } else {
+ // permission already set, do nothing
+ }
+ if (cascade) {
+ // cascade the permission creation
+ HierarchyNode node = getNodeById(nodeId);
+ if (node != null
+ && node.childNodeIds != null
+ && node.childNodeIds.size() > 0) {
+ List nodeIdsList = new ArrayList(node.childNodeIds);
+
+ int i = 0;
+ List nodePerms = new ArrayList();
+ do{
+ int arraySize = nodeIdsList.size() - i;
+ if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
+ arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
+ }
+ // get all the permissions which are related to the nodes under this one
+ List nodePermsItteration = dao.findBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("userId", userId),
+ new Restriction("permission", hierarchyPermission),
+ new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray())
+ }));
+ nodePerms.addAll(nodePermsItteration);
+ i += arraySize;
+ }while(i < nodeIdsList.size());
+
+ Set allPerms = new HashSet();
+ if (nodePerms.size() == 0) {
+ // add all new ones
+ for (String childNodeId : node.childNodeIds) {
+ allPerms.add( new HierarchyNodePermission(userId, childNodeId, hierarchyPermission) );
+ }
+ } else {
+ // only add the missing ones
+ Set existingPermNodeIds = new HashSet();
+ for (HierarchyNodePermission hierNodePerm : nodePerms) {
+ existingPermNodeIds.add( hierNodePerm.getNodeId() );
+ }
+ for (String childNodeId : node.childNodeIds) {
+ if (! existingPermNodeIds.contains(nodeId)) {
+ allPerms.add( new HierarchyNodePermission(userId, childNodeId, hierarchyPermission) );
+ }
+ }
+ }
+ if (nodePerms.size() == node.childNodeIds.size()
+ || allPerms.size() == 0) {
+ // nothing to do here, all permissions already exist or there are none to add
+ } else {
+ // save the new permissions
+ dao.saveSet( new HashSet(allPerms) );
+ }
+ }
+ }
+ }
+
+ public void removeUserNodePerm(String userId, String nodeId, String hierarchyPermission, boolean cascade) {
+ if (userId == null || "".equals(userId)
+ || nodeId == null || "".equals(nodeId)
+ || hierarchyPermission == null || "".equals(hierarchyPermission)) {
+ throw new IllegalArgumentException("Invalid arguments to removeUserNodePerm, no arguments can be null or blank: userId="+userId+", nodeId="+nodeId+", hierarchyPermission="+hierarchyPermission);
+ }
+ if (! cascade) {
+ // delete the current permission if it can be found
+ HierarchyNodePermission nodePerm = dao.findOneBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("userId", userId),
+ new Restriction("nodeId", nodeId),
+ new Restriction("permission", hierarchyPermission)
+ }));
+ if (nodePerm == null) {
+ // not found, nothing to do
+ } else {
+ dao.delete(nodePerm);
+ }
+ } else {
+ // cascade the permission removal and delete current one as well
+ HierarchyNode node = getNodeById(nodeId);
+ if (node != null) {
+ HashSet nodeIdsSet = new HashSet();
+ nodeIdsSet.add(nodeId);
+ // add in child nodes if there are any
+ if (node.childNodeIds != null
+ && node.childNodeIds.size() > 0) {
+ nodeIdsSet.addAll(node.childNodeIds);
+ }
+ List nodeIdsList = new ArrayList(nodeIdsSet);
+ int i = 0;
+ do{
+ int arraySize = nodeIdsList.size() - i;
+ if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
+ arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
+ }
+ // get all the permissions which are related to the nodes under this one
+ List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("userId", userId),
+ new Restriction("permission", hierarchyPermission),
+ new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray())
+ }));
+ if (nodePerms.size() > 0) {
+ // delete all as one operation
+ dao.deleteSet( new HashSet(nodePerms) );
+ }
+ i += arraySize;
+ }while(i < nodeIdsList.size());
+ }
+ }
+ }
+
+ public boolean checkUserNodePerm(String userId, String nodeId, String hierarchyPermission) {
+ if (userId == null || "".equals(userId)
+ || nodeId == null || "".equals(nodeId)
+ || hierarchyPermission == null || "".equals(hierarchyPermission)) {
+ throw new IllegalArgumentException("Invalid arguments to checkUserNodePerm, no arguments can be null or blank: userId="+userId+", nodeId="+nodeId+", hierarchyPermission="+hierarchyPermission);
+ }
+ boolean allowed = false;
+ HierarchyNodePermission nodePerm = dao.findOneBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("userId", userId),
+ new Restriction("nodeId", nodeId),
+ new Restriction("permission", hierarchyPermission)
+ }));
+ if (nodePerm != null) {
+ allowed = true;
+ }
+ return allowed;
+ }
+
+ public Set getNodesForUserPerm(String userId, String hierarchyPermission) {
+ if (userId == null || "".equals(userId)
+ || hierarchyPermission == null || "".equals(hierarchyPermission)) {
+ throw new IllegalArgumentException("Invalid arguments to getNodesForUserPerm, no arguments can be null or blank: userId="+userId+", hierarchyPermission="+hierarchyPermission);
+ }
+ Set nodes = new HashSet();
+ List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("userId", userId),
+ new Restriction("permission", hierarchyPermission)
+ }));
+ Set nodeIds = new HashSet();
+ for (HierarchyNodePermission nodePerm : nodePerms) {
+ nodeIds.add( nodePerm.getNodeId() );
+ }
+ List nodeMetas = getNodeMetas(nodeIds);
+ for (HierarchyNodeMetaData metaData : nodeMetas) {
+ nodes.add( HierarchyImplUtils.makeNode(metaData) );
+ }
+ return nodes;
+ }
+
+ public Set getUserIdsForNodesPerm(String[] nodeIds, String hierarchyPermission) {
+ if (nodeIds == null
+ || hierarchyPermission == null || "".equals(hierarchyPermission)) {
+ throw new IllegalArgumentException("Invalid arguments to getUserIdsForNodesPerm, no arguments can be null or blank: hierarchyPermission="+hierarchyPermission);
+ }
+ Set userIds = new HashSet();
+ if (nodeIds.length > 0) {
+ List nodeIdsList = new ArrayList(Arrays.asList(nodeIds));
+ int i = 0;
+ do{
+ int arraySize = nodeIdsList.size() - i;
+ if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
+ arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
+ }
+ List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray()),
+ new Restriction("permission", hierarchyPermission)
+ }));
+ for (HierarchyNodePermission nodePerm : nodePerms) {
+ userIds.add( nodePerm.getUserId() );
+ }
+ i += arraySize;
+ }while(i < nodeIdsList.size());
+ }
+ return userIds;
+ }
+
+ public Set getPermsForUserNodes(String userId, String[] nodeIds) {
+ if (userId == null || "".equals(userId)
+ || nodeIds == null ) {
+ throw new IllegalArgumentException("Invalid arguments to getPermsForUserNodes, no arguments can be null or blank: userId="+userId);
+ }
+ Set perms = new HashSet();
+ if (nodeIds.length > 0) {
+ List nodeIdsList = new ArrayList(Arrays.asList(nodeIds));
+ int i = 0;
+ do{
+ int arraySize = nodeIdsList.size() - i;
+ if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
+ arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
+ }
+ List nodePerms = dao.findBySearch(HierarchyNodePermission.class, new Search(
+ new Restriction[] {
+ new Restriction("userId", userId),
+ new Restriction("nodeId", nodeIdsList.subList(i, i + arraySize).toArray())
+ }));
+ for (HierarchyNodePermission nodePerm : nodePerms) {
+ perms.add( nodePerm.getPermission() );
+ }
+ i += arraySize;
+ }while(i < nodeIdsList.size());
+ }
+ return perms;
+ }
+
+ public Map>> getUsersAndPermsForNodes(String... nodeIds) {
+ if (nodeIds == null || nodeIds.length == 0) {
+ throw new IllegalArgumentException("Invalid arguments to getUsersAndPermsForNodes, no arguments can be null or blank: nodeIds="+nodeIds);
+ }
+ Map>> m = new HashMap>>();
+ for (String nodeId : nodeIds) {
+ m.put(nodeId, new HashMap>());
+ }
+ List nodePerms = new ArrayList();
+ List nodeIdsList = new ArrayList(Arrays.asList(nodeIds));
+ int i = 0;
+ do{
+ int arraySize = nodeIdsList.size() - i;
+ if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
+ arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
+ }
+ List nodePermsItteration = dao.findBySearch(HierarchyNodePermission.class,
+ new Search("nodeId", nodeIdsList.subList(i, i + arraySize).toArray()));
+ nodePerms.addAll(nodePermsItteration);
+ i += arraySize;
+ }while(i < nodeIdsList.size());
+
+ // nodeId -> (map of userId -> Set(permission))
+ for (HierarchyNodePermission nodePerm : nodePerms) {
+ String nodeId = nodePerm.getNodeId();
+ if (! m.containsKey(nodeId)) {
+ continue; // this should not really happen but better safe than sorry
+ }
+ String userId = nodePerm.getUserId();
+ if (! m.get(nodeId).containsKey(userId) ) {
+ m.get(nodeId).put(userId, new HashSet() );
+ }
+ m.get(nodeId).get(userId).add( nodePerm.getPermission() );
+ }
+ return m;
+ }
+
+ public Map>> getNodesAndPermsForUser(String... userIds) {
+ if (userIds == null || userIds.length == 0) {
+ throw new IllegalArgumentException("Invalid arguments to getNodesAndPermsForUser, no arguments can be null or blank: userIds="+userIds);
+ }
+ Map>> m = new HashMap