Commit c40cebba authored by Doğukan ÇELİK's avatar Doğukan ÇELİK

DataSource auto configuration have been disabled

parent dd283bf0
......@@ -48,7 +48,13 @@
<version>1.16.20</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>tr.edu.itu</groupId>
<artifactId>cavabunga-lib</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/cavabunga-lib.jar</systemPath>
</dependency>
</dependencies>
<build>
......
package edu.itu.cavabunga.cavabungacollectorlwncalendar;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
@SpringBootApplication
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class CavabungaCollectorLwnCalendarApplication {
public static void main(String[] args) {
......
......@@ -18,9 +18,9 @@ public class MainController {
private LwnCalendarParser lwnCalendarParser;
@GetMapping
public List<CalMContinue> parse(){
return lwnCalendarParser.parseCalendarForContinue("2018","07");
public List<CalMEvent> parse(){
return lwnCalendarParser.parseCalendar(lwnCalendarParser.parseCalendarForDate("2018","07"),
lwnCalendarParser.parseCalendarForEvent("2018","07"));
}
}
......@@ -7,4 +7,5 @@ import java.util.Date;
@Data
public class CalMEvent extends Element{
private String eventDate;
private String eventUrl;
}
......@@ -105,6 +105,7 @@ public class LwnCalendarParser {
if (column.className().equals("CalMEvent") && !column.text().trim().equals("")) {
CalMEvent event = calMEventFactory.create();
event.setText(column.text());
event.setEventUrl(column.select("a").attr("abs:href"));
event.setColumn(columnCount);
event.setRow(rowCount);
System.out.println(event.getRow() + " " + event.getColumn() + " " + event.getText());
......@@ -180,5 +181,17 @@ public class LwnCalendarParser {
return result;
}
public void mapCoreObjectToIcalFormat(){ }
public List<CalMEvent> parseCalendar(List<CalMDate> calMDateList, List<CalMEvent> calMEventList){
List<CalMEvent> result = new ArrayList<>();
for(CalMDate date : calMDateList){
for(CalMEvent event : calMEventList){
if(event.getColumn().equals(date.getColumn()) && event.getRow() > date.getRow()){
event.setEventDate(date.getDate());
result.add(event);
}
}
}
return result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment