diff --git a/impl/src/java/org/sakaiproject/attendance/dao/impl/AttendanceDaoImpl.java b/impl/src/java/org/sakaiproject/attendance/dao/impl/AttendanceDaoImpl.java index 5591d5c..4e60049 100644 --- a/impl/src/java/org/sakaiproject/attendance/dao/impl/AttendanceDaoImpl.java +++ b/impl/src/java/org/sakaiproject/attendance/dao/impl/AttendanceDaoImpl.java @@ -48,9 +48,7 @@ public class AttendanceDaoImpl extends HibernateDaoSupport implements Attendance */ @SuppressWarnings("unchecked") public AttendanceSite getAttendanceSite(final String siteID) { - if(log.isDebugEnabled()){ - log.debug("getSiteBySite_ID "); - } + log.debug("getSiteBySite_ID "); HibernateCallback hcb = new HibernateCallback() { @Override @@ -69,7 +67,7 @@ public Object doInHibernate(Session session) throws HibernateException { */ @SuppressWarnings("unchecked") public AttendanceSite getAttendanceSite(final Long id) { - log.debug("getAttendanceSite by ID: " + id); + log.debug("getAttendanceSite by ID: {}", id); return (AttendanceSite) getByIDHelper(id, QUERY_GET_SITE_BY_ID); } @@ -79,9 +77,7 @@ public AttendanceSite getAttendanceSite(final Long id) { */ @SuppressWarnings("unchecked") public boolean addAttendanceSite(AttendanceSite aS) { - if(log.isDebugEnabled()) { - log.debug("addAttendanceSite ( " + aS.toString() + ")"); - } + log.debug("addAttendanceSite ( {})", aS.toString()); try { getHibernateTemplate().save(aS); @@ -110,9 +106,7 @@ public boolean updateAttendanceSite(AttendanceSite aS) { */ @SuppressWarnings("unchecked") public AttendanceEvent getAttendanceEvent(final long id) { - if(log.isDebugEnabled()) { - log.debug("getAttendanceEvent()" + String.valueOf(id)); - } + log.debug("getAttendanceEvent(){}", id); return (AttendanceEvent) getByIDHelper(id, QUERY_GET_ATTENDANCE_EVENT); } @@ -122,9 +116,7 @@ public AttendanceEvent getAttendanceEvent(final long id) { */ @SuppressWarnings("unchecked") public List getAttendanceEventsForSite(final AttendanceSite aS) { - if(log.isDebugEnabled()) { - log.debug("getAttendanceEventsForSite(AttendanceSite id)"); - } + log.debug("getAttendanceEventsForSite(AttendanceSite id)"); return getEventsForAttendanceSiteHelper(aS); } @@ -133,10 +125,7 @@ public List getAttendanceEventsForSite(final AttendanceSite aS) * {@inheritDoc} */ public Serializable addAttendanceEventNow(AttendanceEvent attendanceEvent) { - - if(log.isDebugEnabled()) { - log.debug("addAttendanceEventNow( " + attendanceEvent.toString() + ")"); - } + log.debug("addAttendanceEventNow( {})", attendanceEvent.toString()); try{ return getHibernateTemplate().save(attendanceEvent); @@ -150,9 +139,7 @@ public Serializable addAttendanceEventNow(AttendanceEvent attendanceEvent) { * {@inheritDoc} */ public boolean updateAttendanceEvent(AttendanceEvent aE) { - if(log.isDebugEnabled()) { - log.debug("updateAttendanceEvent aE: " + aE.getName()); - } + log.debug("updateAttendanceEvent aE: {}", aE.getName()); try{ getHibernateTemplate().saveOrUpdate(aE); @@ -167,9 +154,7 @@ public boolean updateAttendanceEvent(AttendanceEvent aE) { * {@inheritDoc} */ public boolean deleteAttendanceEvent(AttendanceEvent aE) { - if(log.isDebugEnabled()) { - log.debug("deleteAttendanceEvent aE: " + aE.getName()); - } + log.debug("deleteAttendanceEvent aE: {}", aE.getName()); if(aE.getStats() !=null && aE.getStats().getId() == null){ aE.setStats(null); @@ -188,9 +173,7 @@ public boolean deleteAttendanceEvent(AttendanceEvent aE) { * {@inheritDoc} */ public AttendanceRecord getStatusRecord(final long id) { - if(log.isDebugEnabled()) { - log.debug("getAttendanceRecord()" + String.valueOf(id)); - } + log.debug("getAttendanceRecord(){}", id); return (AttendanceRecord) getByIDHelper(id, QUERY_GET_ATTENDANCE_RECORD); } @@ -199,9 +182,7 @@ public AttendanceRecord getStatusRecord(final long id) { * {@inheritDoc} */ public boolean addAttendanceRecord(AttendanceRecord aR) { - if(log.isDebugEnabled()){ - log.debug("addAttendanceRecord sR for User '" + aR.getUserID() + "' event " + aR.getAttendanceEvent().getName() + " with Status " + aR.getStatus().toString()); - } + log.debug("addAttendanceRecord sR for User '{}' event {} with Status {}", aR.getUserID(), aR.getAttendanceEvent().getName(), aR.getStatus().toString()); try { getHibernateTemplate().save(aR); @@ -258,9 +239,7 @@ public void updateAttendanceStatuses(List attendanceStatusList */ @SuppressWarnings("unchecked") public List getActiveStatusesForSite(final AttendanceSite attendanceSite) { - if(log.isDebugEnabled()){ - log.debug("getActiveStatusesForSite(AttendanceSite " + attendanceSite.getSiteID() + " )"); - } + log.debug("getActiveStatusesForSite(AttendanceSite {} )", attendanceSite.getSiteID()); try { return getHibernateTemplate().execute(session -> session @@ -278,9 +257,7 @@ public List getActiveStatusesForSite(final AttendanceSite atte */ @SuppressWarnings("unchecked") public List getAllStatusesForSite(final AttendanceSite attendanceSite) { - if(log.isDebugEnabled()){ - log.debug("getAllStatusesForSite(AttendanceSite attendanceSite)"); - } + log.debug("getAllStatusesForSite(AttendanceSite attendanceSite)"); try { return getHibernateTemplate().execute(session -> session @@ -297,9 +274,7 @@ public List getAllStatusesForSite(final AttendanceSite attenda * {@inheritDoc} */ public AttendanceStatus getAttendanceStatusById(final Long id) { - if(log.isDebugEnabled()) { - log.debug("getAttendanceStatus()" + String.valueOf(id)); - } + log.debug("getAttendanceStatus(){}", id); return (AttendanceStatus) getByIDHelper(id, QUERY_GET_ATTENDANCE_STATUS); } @@ -308,9 +283,7 @@ public AttendanceStatus getAttendanceStatusById(final Long id) { * {@inheritDoc} */ public AttendanceGrade getAttendanceGrade(final Long id) { - if(log.isDebugEnabled()) { - log.debug("getAttendanceGrade, id: " + id.toString()); - } + log.debug("getAttendanceGrade, id: " + id.toString()); return (AttendanceGrade) getByIDHelper(id, QUERY_GET_ATTENDANCE_GRADE_BY_ID); } @@ -319,9 +292,7 @@ public AttendanceGrade getAttendanceGrade(final Long id) { * {@inheritDoc} */ public AttendanceGrade getAttendanceGrade(final String userID, final AttendanceSite aS) { - if(log.isDebugEnabled()) { - log.debug("getAttendanceGrades for user " + userID + " in site " + aS.getSiteID()); - } + log.debug("getAttendanceGrades for user {} in site {}", userID, aS.getSiteID()); try{ return (AttendanceGrade) getHibernateTemplate().execute(session -> session @@ -340,9 +311,7 @@ public AttendanceGrade getAttendanceGrade(final String userID, final AttendanceS */ @SuppressWarnings("unchecked") public List getAttendanceGrades(final AttendanceSite aS) { - if(log.isDebugEnabled()){ - log.debug("getAttendanceGrades for: " + aS.getSiteID()); - } + log.debug("getAttendanceGrades for: {}", aS.getSiteID()); try{ return getHibernateTemplate().execute(session -> session @@ -359,9 +328,7 @@ public List getAttendanceGrades(final AttendanceSite aS) { * {@inheritDoc} */ public boolean addAttendanceGrade(AttendanceGrade aG) { - if(log.isDebugEnabled()){ - log.debug("addAttendanceGrade for User '" + aG.getUserID() + "' grade " + aG.getGrade() + " for site " + aG.getAttendanceSite().getSiteID()); - } + log.debug("addAttendanceGrade for User '{}' grade {} for site {}", aG.getUserID(), aG.getGrade(), aG.getAttendanceSite().getSiteID()); try { getHibernateTemplate().save(aG); @@ -376,9 +343,7 @@ public boolean addAttendanceGrade(AttendanceGrade aG) { * {@inheritDoc} */ public boolean updateAttendanceGrade(AttendanceGrade aG) { - if(log.isDebugEnabled()){ - log.debug("updateAttendanceGrade for User '" + aG.getUserID() + "' grade " + aG.getGrade() + " for site " + aG.getAttendanceSite().getSiteID()); - } + log.debug("updateAttendanceGrade for User '{}' grade {} for site {}", aG.getUserID(), aG.getGrade(), aG.getAttendanceSite().getSiteID()); try { getHibernateTemplate().saveOrUpdate(aG); @@ -393,7 +358,7 @@ public boolean updateAttendanceGrade(AttendanceGrade aG) { * {@inheritDoc} */ public AttendanceUserStats getAttendanceUserStats(final String userId, final AttendanceSite aS) { - log.debug("getAttendanceUserStats for User '" + userId + "' and Site: '" + aS.getSiteID() + "'."); + log.debug("getAttendanceUserStats for User '{}' and Site: '{}'.", userId, aS.getSiteID()); try{ return (AttendanceUserStats) getHibernateTemplate().execute(session -> session @@ -402,7 +367,7 @@ public AttendanceUserStats getAttendanceUserStats(final String userId, final Att .setParameter(USER_ID, userId) .uniqueResult()); } catch (DataAccessException e) { - log.error("DataAccessException getting AttendanceUserStats for User '" + userId + "' and Site: '" + aS.getSiteID() + "'.", e); + log.error("DataAccessException getting AttendanceUserStats for User '{}' and Site: '{}'.", userId, aS.getSiteID(), e); return null; } } @@ -412,7 +377,7 @@ public AttendanceUserStats getAttendanceUserStats(final String userId, final Att */ @SuppressWarnings("unchecked") public List getAttendanceUserStatsForSite(final AttendanceSite aS) { - log.debug("getAttendanceUserStatsForSite for site: " + aS.getSiteID()); + log.debug("getAttendanceUserStatsForSite for site: {}", aS.getSiteID()); try{ return getHibernateTemplate().execute(session -> session @@ -429,13 +394,13 @@ public List getAttendanceUserStatsForSite(final AttendanceS * {@inheritDoc} */ public boolean updateAttendanceUserStats(AttendanceUserStats aUS) { - log.debug("updateAttendanceUserStats for User '" + aUS.getUserID() + "' and Site: '" + aUS.getAttendanceSite().getSiteID() + "'."); + log.debug("updateAttendanceUserStats for User '{}' and Site: '{}'.", aUS.getUserID(), aUS.getAttendanceSite().getSiteID()); try { getHibernateTemplate().saveOrUpdate(aUS); return true; } catch (DataAccessException e) { - log.error("updateAttendanceUserStats, id: '" + aUS.getId() + "' failed.", e); + log.error("updateAttendanceUserStats, id: '{}' failed.", aUS.getId(), e); return false; } } @@ -444,13 +409,8 @@ public boolean updateAttendanceUserStats(AttendanceUserStats aUS) { * {@inheritDoc} */ public boolean addGradingRule(GradingRule gradingRule) { - if (log.isDebugEnabled()) { - log.debug("add grading rule to site " + gradingRule.getAttendanceSite().getSiteID() + - " status: " + gradingRule.getStatus() + - " range: " + gradingRule.getStartRange() + - " - " + gradingRule.getEndRange() + - " points: " + gradingRule.getPoints()); - } + log.debug("add grading rule to site {} status: {} range: {} - {} points: {}", gradingRule.getAttendanceSite().getSiteID(), gradingRule.getStatus(), gradingRule.getStartRange(), gradingRule.getEndRange(), gradingRule.getPoints()); + try { getHibernateTemplate().save(gradingRule); return true; @@ -479,7 +439,7 @@ public boolean deleteGradingRule(GradingRule gradingRule) { * {@inheritDoc} */ public AttendanceItemStats getAttendanceItemStats(AttendanceEvent aE) { - log.debug("getAttendanceUserStats for Event '" + aE.getName() + "' and Site: '" + aE.getAttendanceSite().getSiteID() + "'."); + log.debug("getAttendanceUserStats for Event '{}' and Site: '{}'.", aE.getName(), aE.getAttendanceSite().getSiteID()); try{ return (AttendanceItemStats) getHibernateTemplate().execute(session -> session @@ -487,7 +447,7 @@ public AttendanceItemStats getAttendanceItemStats(AttendanceEvent aE) { .setParameter(ATTENDANCE_EVENT, aE) .uniqueResult()); } catch (DataAccessException e) { - log.error("DataAccessException getting AttendanceItemStats for Event '" + aE.getName() + "' and Site: '" + aE.getAttendanceSite().getSiteID() + "'.", e); + log.error("DataAccessException getting AttendanceItemStats for Event '{}' and Site: '{}'.", aE.getName(), aE.getAttendanceSite().getSiteID(), e); return null; } } @@ -496,7 +456,7 @@ public AttendanceItemStats getAttendanceItemStats(AttendanceEvent aE) { * {@inheritDoc} */ public boolean updateAttendanceItemStats(AttendanceItemStats aIS) { - log.debug("updateAttendanceItemStats, '" + aIS.getId() + "', for Event '" + aIS.getAttendanceEvent().getName() + "' and site: '" + aIS.getAttendanceEvent().getAttendanceSite().getSiteID() + "'."); + log.debug("updateAttendanceItemStats, '{}', for Event '{}' and site: '{}'.", aIS.getId(), aIS.getAttendanceEvent().getName(), aIS.getAttendanceEvent().getAttendanceSite().getSiteID()); try { getHibernateTemplate().saveOrUpdate(aIS); @@ -512,9 +472,7 @@ public boolean updateAttendanceItemStats(AttendanceItemStats aIS) { */ @SuppressWarnings("unchecked") public List getGradingRulesForSite(AttendanceSite attendanceSite) { - if(log.isDebugEnabled()){ - log.debug("getGradingRulesForSite(AttendanceSite " + attendanceSite.getSiteID() + " )"); - } + log.debug("getGradingRulesForSite(AttendanceSite {} )", attendanceSite.getSiteID()); try { return getHibernateTemplate().execute(session -> session @@ -589,9 +547,7 @@ public void init() { @SuppressWarnings("unchecked") private List getEventsForAttendanceSiteHelper(final AttendanceSite aS){ - if(log.isDebugEnabled()){ - log.debug("getAttendanceEventsForSiteHelper()"); - } + log.debug("getAttendanceEventsForSiteHelper()"); try { return getHibernateTemplate().execute(session -> session @@ -607,9 +563,7 @@ private List getEventsForAttendanceSiteHelper(final AttendanceS // Generic Function to get something by it's ID. private Object getByIDHelper(final long id, final String queryString) { - if(log.isDebugEnabled()) { - log.debug("getByIDHelper() id: '" + String.valueOf(id) + "' String: " + queryString); - } + log.debug("getByIDHelper() id: '{}' String: {}", id, queryString); try { return getHibernateTemplate().execute(session -> session @@ -619,7 +573,7 @@ private Object getByIDHelper(final long id, final String queryString) { .uniqueResult()); } catch (DataAccessException e) { - log.error("getByIDHelper for " + queryString + " failed", e); + log.error("getByIDHelper for {} failed", queryString, e); return null; } } diff --git a/impl/src/java/org/sakaiproject/attendance/export/PDFEventExporterImpl.java b/impl/src/java/org/sakaiproject/attendance/export/PDFEventExporterImpl.java index 1d48c3d..ffba623 100644 --- a/impl/src/java/org/sakaiproject/attendance/export/PDFEventExporterImpl.java +++ b/impl/src/java/org/sakaiproject/attendance/export/PDFEventExporterImpl.java @@ -116,7 +116,7 @@ private void buildDocumentShell(OutputStream outputStream, boolean isSignInSheet document.close(); // no need to close PDFwriter? } catch (DocumentException e) { - e.printStackTrace(); + log.warn("Exception creating PDF", e); } } @@ -135,7 +135,7 @@ private PdfPTable signInSheetTable() { table.addCell(nameHeader); table.addCell(signatureHeader); - Collections.sort(users, new SortNameUserComparator()); + users.sort(new SortNameUserComparator()); for(User user : users) { @@ -190,7 +190,7 @@ private PdfPTable attendanceSheetTable() { table.addCell(statusHeader); } - Collections.sort(users, new SortNameUserComparator()); + users.sort(new SortNameUserComparator()); for(User user : users) { diff --git a/impl/src/java/org/sakaiproject/attendance/impl/AttendanceGradebookProviderImpl.java b/impl/src/java/org/sakaiproject/attendance/impl/AttendanceGradebookProviderImpl.java index 4776af7..29edb41 100644 --- a/impl/src/java/org/sakaiproject/attendance/impl/AttendanceGradebookProviderImpl.java +++ b/impl/src/java/org/sakaiproject/attendance/impl/AttendanceGradebookProviderImpl.java @@ -39,12 +39,13 @@ * * @author Leonardo Canessa [lcanessa1 (at) udayton (dot) edu] */ +@Setter @Slf4j public class AttendanceGradebookProviderImpl implements AttendanceGradebookProvider { - @Setter private AttendanceLogic attendanceLogic; - @Setter private SakaiProxy sakaiProxy; - @Setter private ToolManager toolManager; - @Setter private GradingService gradingService; + private AttendanceLogic attendanceLogic; + private SakaiProxy sakaiProxy; + private ToolManager toolManager; + private GradingService gradingService; /** * {@inheritDoc} @@ -57,10 +58,7 @@ public void init() { * {@inheritDoc} */ public boolean create(AttendanceSite aS, String categoryId) { - if(log.isDebugEnabled()) { - log.debug("create Gradebook"); - } - + log.debug("create Gradebook"); boolean returnVal = false; String siteID = aS.getSiteID(); @@ -88,10 +86,7 @@ public boolean create(AttendanceSite aS, String categoryId) { * {@inheritDoc} */ public boolean remove(AttendanceSite aS) { - if(log.isDebugEnabled()) { - log.debug("remove GB for AS " + aS.getSiteID()); - } - + log.debug("remove GB for AS {}", aS.getSiteID()); String siteID = aS.getSiteID(); String aUID = getAttendanceUID(aS); if(gradingService.isExternalAssignmentDefined(siteID, aUID)) { @@ -99,7 +94,7 @@ public boolean remove(AttendanceSite aS) { gradingService.removeExternalAssignment(siteID, aUID); return true; } catch (AssessmentNotFoundException e) { - log.warn("Attempted to remove AttendanceSite " + siteID + " from GB failed. Assessment not found", e); + log.warn("Attempted to remove AttendanceSite {} from GB failed. Assessment not found", siteID, e); return false; } } @@ -110,9 +105,7 @@ public boolean remove(AttendanceSite aS) { * {@inheritDoc} */ public boolean update(AttendanceSite aS, String categoryId) { - if(log.isDebugEnabled()) { - log.debug("Updating GB for AS " + aS.getSiteID()); - } + log.debug("Updating GB for AS {}", aS.getSiteID()); Long categoryIdNumber = null; if(categoryId != null){ categoryIdNumber = Long.valueOf(categoryId); @@ -124,7 +117,7 @@ public boolean update(AttendanceSite aS, String categoryId) { gradingService.updateExternalAssessment(siteID, aUID, null, null, aS.getGradebookItemName(), categoryIdNumber, aS.getMaximumGrade(), null, false); return true; } catch (ConflictingAssignmentNameException e) { - log.warn("Failed to update AttendanceSite for site " + siteID + " in Gradebook", e); + log.warn("Failed to update AttendanceSite for site {} in Gradebook", siteID, e); return false; } } @@ -143,7 +136,6 @@ public boolean sendToGradebook(final AttendanceGrade aG) { final AttendanceSite aS = aG.getAttendanceSite(); final String siteID = aS.getSiteID(); String aSUID = getAttendanceUID(aS); - final Boolean sendToGradebook = aS.getSendToGradebook(); if(sendToGradebook != null && sendToGradebook) { diff --git a/impl/src/java/org/sakaiproject/attendance/logic/AttendanceLogicImpl.java b/impl/src/java/org/sakaiproject/attendance/logic/AttendanceLogicImpl.java index 2989c30..18bc23b 100644 --- a/impl/src/java/org/sakaiproject/attendance/logic/AttendanceLogicImpl.java +++ b/impl/src/java/org/sakaiproject/attendance/logic/AttendanceLogicImpl.java @@ -22,13 +22,11 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; - import org.sakaiproject.attendance.api.AttendanceGradebookProvider; import org.sakaiproject.attendance.dao.AttendanceDao; import org.sakaiproject.attendance.model.*; import org.sakaiproject.entity.api.Entity; import org.sakaiproject.entity.api.EntityManager; -import org.sakaiproject.entity.api.EntityProducer; import org.sakaiproject.entity.api.EntityTransferrer; import org.sakaiproject.user.api.User; @@ -39,6 +37,7 @@ * @author David Bauer [dbauer1 (at) udayton (dot) edu] * @author Steve Swinsburg (steve.swinsburg@gmail.com) */ +@Setter @Slf4j public class AttendanceLogicImpl implements AttendanceLogic, EntityTransferrer { @@ -850,7 +849,7 @@ private Double grade(String userId, AttendanceSite attendanceSite) { @Override public Map transferCopyEntities(String fromContext, String toContext, List ids, List transferOptions) { - return transferCopyEntities(fromContext, toContext, ids, transferOptions); + return transferCopyEntities(fromContext, toContext, ids, transferOptions, false); } @Override @@ -899,20 +898,11 @@ public Map transferCopyEntities(String fromContext, String toCon return transversalMap; } - @Override - public void updateEntityReferences(String toContext, Map transversalMap) { - return; - } - - @Setter - private AttendanceDao dao; + private AttendanceDao dao; - @Setter private SakaiProxy sakaiProxy; - @Setter private AttendanceGradebookProvider attendanceGradebookProvider; - @Setter private EntityManager entityManager; } diff --git a/impl/src/java/org/sakaiproject/attendance/logic/SakaiProxyImpl.java b/impl/src/java/org/sakaiproject/attendance/logic/SakaiProxyImpl.java index 8f3842e..da7a182 100644 --- a/impl/src/java/org/sakaiproject/attendance/logic/SakaiProxyImpl.java +++ b/impl/src/java/org/sakaiproject/attendance/logic/SakaiProxyImpl.java @@ -28,7 +28,6 @@ import org.sakaiproject.site.api.Group; import org.sakaiproject.site.api.Site; import org.sakaiproject.site.api.SiteService; -import org.sakaiproject.tool.api.Session; import org.sakaiproject.tool.api.SessionManager; import org.sakaiproject.tool.api.ToolManager; import org.sakaiproject.user.api.*; @@ -42,6 +41,8 @@ * @author David Bauer [dbauer1 (at) udayton (dot) edu] * @author Steve Swinsburg (steve.swinsburg@gmail.com) */ +@Setter +@Getter @Slf4j public class SakaiProxyImpl implements SakaiProxy { @@ -357,38 +358,21 @@ public void init() { log.debug("SakaiProxyImpl init()"); } - private Preferences getCurrentUserPreferences() { - return preferencesService.getPreferences(getCurrentUserId()); - } - - private Session getCurrentSession() { - return sessionManager.getCurrentSession(); - } - - @Getter @Setter private ToolManager toolManager; - @Getter @Setter private SessionManager sessionManager; - @Getter @Setter private UserDirectoryService userDirectoryService; - @Getter @Setter private SecurityService securityService; - @Getter @Setter private EventTrackingService eventTrackingService; - @Getter @Setter private ServerConfigurationService serverConfigurationService; - @Getter @Setter private SiteService siteService; - @Getter @Setter private PreferencesService preferencesService; - @Getter @Setter private AuthzGroupService authzGroupService; } diff --git a/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalc.java b/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalc.java index d4ebc00..e2bb68b 100644 --- a/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalc.java +++ b/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalc.java @@ -51,7 +51,7 @@ public void execute() { List ids = dao.getAttendanceSiteBatch(syncTime, lastId); if(ids.isEmpty()) { String summary = getOverallSummary(); - if("".equals(summary)) { + if(summary.isEmpty()) { log.info("AttendanceStatCalc no sites left to sync"); } else { log.info("AttendanceStatCalc done, but there are errors\n{}", summary); diff --git a/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalcJob.java b/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalcJob.java index 484168a..c07b46b 100644 --- a/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalcJob.java +++ b/impl/src/java/org/sakaiproject/attendance/services/AttendanceStatCalcJob.java @@ -89,9 +89,7 @@ public void execute(JobExecutionContext context) { log.info("Start Job: {}", whoAmI); attendanceStatCalc.execute(); - logoutFromSakai(); - } public void loginToSakai(String whoAs, String jobName, String jobError) { diff --git a/tool/src/java/org/sakaiproject/attendance/tool/pages/EventInputPage.java b/tool/src/java/org/sakaiproject/attendance/tool/pages/EventInputPage.java index e210e73..45ba4fe 100644 --- a/tool/src/java/org/sakaiproject/attendance/tool/pages/EventInputPage.java +++ b/tool/src/java/org/sakaiproject/attendance/tool/pages/EventInputPage.java @@ -1,4 +1,6 @@ package org.sakaiproject.attendance.tool.pages; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.codec.binary.StringUtils; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; @@ -24,7 +26,7 @@ public class EventInputPage extends BasePage{ private ModalWindow window; private boolean isEditing; private boolean recursiveAddAnother; - private String nextPage; + @Getter @Setter private String nextPage; public static String STUDENT_OVERVIEW = "org.sakaiproject.attendance.tool.pages.StudentView"; public static String GRADING = "org.sakaiproject.attendance.tool.pages.GradingPage"; public static String SETTINGS = "org.sakaiproject.attendance.tool.pages.SettingsPage"; @@ -127,11 +129,4 @@ public boolean isVisible() { }; } - public void setNextPage(String canonicalName){ - this.nextPage = canonicalName; - } - - public String getNextPage(){ - return this.nextPage; - } }