Skip to content

Commit

Permalink
SAK-46783 Global move dependencies to shared (sakaiproject#10699)
Browse files Browse the repository at this point in the history
* SAK-46783 - Collapse kernel-common and kernel-private into kernel-api
Move the shared kernel-util bits into kernel-api
Application specific things stay in kernel-util

Co-authored-by: Charles Severance <[email protected]>
  • Loading branch information
maurercw and csev authored Aug 4, 2022
1 parent 8499a00 commit a4d72b6
Show file tree
Hide file tree
Showing 117 changed files with 325 additions and 441 deletions.
4 changes: 4 additions & 0 deletions announcement/announcement-impl/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<deploy.target>components</deploy.target>
</properties>
<dependencies>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-util</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-storage-util</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions assignment/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.contentreview</groupId>
<artifactId>content-review-api</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions assignment/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-util</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-storage-util</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions assignment/runconversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ CLASSPATH="$CLASSPATH:"$m2repository"/commons-pool/commons-pool/1.3/commons-pool
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-api/$KERNELVERSION/sakai-kernel-api-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-impl/$KERNELVERSION/sakai-kernel-impl-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-util/$KERNELVERSION/sakai-kernel-util-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-common/$KERNELVERSION/sakai-kernel-common-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-component/$KERNELVERSION/sakai-kernel-component-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-private/$KERNELVERSION/sakai-kernel-private-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/log4j/log4j/1.2.9/log4j-1.2.9.jar"

# For Cygwin, ensure paths are in the proper format.
Expand Down
1 change: 0 additions & 1 deletion basiclti/basiclti-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<dependency>
<groupId>org.sakaiproject.portal</groupId>
<artifactId>sakai-portal-util</artifactId>
<version>${sakai.version}</version>
</dependency>
<dependency>
<groupId>org.sakaiproject.assignment</groupId>
Expand Down
4 changes: 4 additions & 0 deletions calendar/calendar-summary-tool/tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,9 @@
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
<version>${sakai.jakarta.jstl-api.version}</version>
</dependency>
<dependency>
<groupId>org.sakaiproject.portal</groupId>
<artifactId>sakai-portal-util</artifactId>
</dependency>
</dependencies>
</project>
4 changes: 0 additions & 4 deletions cloud-storage/googledrive/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<!--Other dependencies-->
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
4 changes: 0 additions & 4 deletions cloud-storage/googledrive/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
Expand Down
4 changes: 0 additions & 4 deletions cloud-storage/onedrive/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<!--Other dependencies-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
4 changes: 0 additions & 4 deletions cloud-storage/onedrive/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
Expand Down
4 changes: 4 additions & 0 deletions common/import-parsers/blackboard_6/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<artifactId>archive-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-util</artifactId>
</dependency>
Expand Down
4 changes: 0 additions & 4 deletions common/privacy-components/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
<deploy.target>components</deploy.target>
</properties>
<dependencies>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.common</groupId>
<artifactId>sakai-privacy-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@
# log.config=DEBUG.org.sakaiproject.content.*,DEBUG.org.sakaiproject.event.impl.*

## Override the logging configuration file
# Default: kernel/kernel-common/src/main/config/log4j.properties
# Default: kernel/api/src/main/config/log4j2.properties
# Place a new logging configuration file (for log4j it would be log4j.properties) in your sakai home


Expand Down
2 changes: 0 additions & 2 deletions content/content-runconversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ CLASSPATH="$CLASSPATH:"$m2repository"/commons-pool/commons-pool/1.3/commons-pool
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-api/$KERNELVERSION/sakai-kernel-api-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-impl/$KERNELVERSION/sakai-kernel-impl-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-util/$KERNELVERSION/sakai-kernel-util-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-common/$KERNELVERSION/sakai-kernel-common-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-component/$KERNELVERSION/sakai-kernel-component-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/org/sakaiproject/kernel/sakai-kernel-private/$KERNELVERSION/sakai-kernel-private-$KERNELVERSION.jar"
CLASSPATH="$CLASSPATH:"$m2repository"/log4j/log4j/1.2.9/log4j-1.2.9.jar"

# For Cygwin, ensure paths are in the proper format.
Expand Down
4 changes: 0 additions & 4 deletions conversations/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-util</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions deploy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@
<artifactId>pluto-taglib</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.sakaiproject.portal</groupId>
<artifactId>sakai-portal-util</artifactId>
</dependency>

<!-- spring -->
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions gradebookng/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-util</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-test</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions jobscheduler/scheduler-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-private</artifactId>
<version>23-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
Expand Down
70 changes: 70 additions & 0 deletions kernel/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
Expand All @@ -84,6 +88,11 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
Expand Down Expand Up @@ -114,5 +123,66 @@
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>org.gridgain</groupId>
<artifactId>ignite-hibernate_5.3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-parameter-names</artifactId>
<version>${sakai.jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
package org.sakaiproject.util;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.sakaiproject.timesheet.api.TimeSheetEntry;

public class TimeSheetUtil {

public String intToTime(int time) {
String timeReturn = "";
if(time >= 60) {
timeReturn = timeReturn.concat((time/60)+"h").concat(" ");
timeReturn = timeReturn.concat((time%60)+"m");
}else if(time>0 && time<60) {
timeReturn = time+"m";
}
return timeReturn;
}

public int timeToInt(String time) {
int timeParseInt=0;
if(StringUtils.isNotBlank(time)) {
String timeSheet[] = time.split("h|H");
if(timeSheet.length > 1) {
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60;
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[1].split("m|M")[0].trim());
}else {
if(timeSheet[0].contains("m") || timeSheet[0].contains("M")) {
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].split("m|M")[0].trim());
}else {
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60;
}
}
}
return timeParseInt;
}

public String getTotalTimeSheet(List<TimeSheetEntry> ats) {
int totalTime = 0;
for (TimeSheetEntry timeSheet : ats) {
totalTime = totalTime + timeToInt(timeSheet.getDuration());
}

return intToTime(totalTime);
}
}
package org.sakaiproject.util;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.sakaiproject.timesheet.api.TimeSheetEntry;

public class TimeSheetUtil {

public String intToTime(int time) {
String timeReturn = "";
if(time >= 60) {
timeReturn = timeReturn.concat((time/60)+"h").concat(" ");
timeReturn = timeReturn.concat((time%60)+"m");
}else if(time>0 && time<60) {
timeReturn = time+"m";
}
return timeReturn;
}

public int timeToInt(String time) {
int timeParseInt=0;
if(StringUtils.isNotBlank(time)) {
String timeSheet[] = time.split("h|H");
if(timeSheet.length > 1) {
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60;
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[1].split("m|M")[0].trim());
}else {
if(timeSheet[0].contains("m") || timeSheet[0].contains("M")) {
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].split("m|M")[0].trim());
}else {
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60;
}
}
}
return timeParseInt;
}

public String getTotalTimeSheet(List<TimeSheetEntry> ats) {
int totalTime = 0;
for (TimeSheetEntry timeSheet : ats) {
totalTime = totalTime + timeToInt(timeSheet.getDuration());
}

return intToTime(totalTime);
}
}
Loading

0 comments on commit a4d72b6

Please sign in to comment.