Skip to content

Commit

Permalink
checked in first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mspanesar145 committed Jun 9, 2018
1 parent a60c2e5 commit ae17d80
Show file tree
Hide file tree
Showing 156 changed files with 544 additions and 49 deletions.
122 changes: 122 additions & 0 deletions .classpath

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
1 change: 1 addition & 0 deletions .gradle/1.11/taskArtifacts/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#Thu Jun 07 23:40:03 IST 2018
Binary file added .gradle/1.11/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file added .gradle/1.11/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file added .gradle/1.11/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file added .gradle/1.11/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file added .gradle/1.11/taskArtifacts/taskArtifacts.bin
Binary file not shown.
16 changes: 16 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cenes-backend</name>
<comment/>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<linkedResources/>
</projectDescription>
16 changes: 16 additions & 0 deletions .project~
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cenes</name>
<comment/>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<linkedResources/>
</projectDescription>
13 changes: 13 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
#Thu Jun 07 23:44:33 IST 2018
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
Binary file added build/classes/main/com/cg/CgApplication.class
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/Alarm.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/CenesProperty.class
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/CgGeneral.class
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/Diary.class
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/DiaryMember.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/Member.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/Notification.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/UserFriend.class
Binary file not shown.
Binary file added build/classes/main/com/cg/bo/UserToken.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/constant/CgConstants.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/dto/HomeScreenDto.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/enums/CgEnums.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/events/bo/Event.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/events/bo/MeTime.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/test/TestClass$math.class
Binary file not shown.
Binary file added build/classes/main/com/cg/test/TestClass.class
Binary file not shown.
Binary file added build/classes/main/com/cg/user/bo/User.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/main/com/cg/utils/CenesUtils.class
Binary file not shown.
Binary file added build/libs/dateconv-rest-service-1.0.0.jar
Binary file not shown.
Binary file not shown.
43 changes: 43 additions & 0 deletions build/resources/main/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
server.port=8181

spring.datasource.url=jdbc:mysql://localhost/cenes_backend?useUnicode=yes&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=password
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.testOnBorrow=true
spring.datasource.validationQuery=SELECT 1
spring.datasource.init-sql="SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;"

spring.jpa.openInView=true
spring.jpa.show-sql=true
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto=update
security.basic.enabled=false
server.session-timeout=300

mail.server.host=smtp.mandrillapp.com
mail.server.port=587
mail.server.protocol=smtp
mail.server.username[email protected]
mail.server.password=pn6X0jGKpGg6VH-wOd9pxw

web.prefix=/WEB-INF/templates
web.templateMode=HTML5
web.characterEncoding=UTF-8
web.order=2

spring.email.prefix=mail/
spring.email.templateMode=HTML5
spring.email.characterEncoding=UTF-8
spring.email.order=1

spring.http.multipart.max-file-size=20MB
spring.http.multipart.max-request-size=20MB

file.path=/home/rbpcadmin/tmp/

cenes.domain=http://ec2-18-216-7-227.us-east-2.compute.amazonaws.com
cenes.imageUploadPath=/home/mandeep/svn/cenes/cenes/src/main/webapp/assets/uploads/[userId]/profile/
cenes.eventUploadPath=/home/mandeep/svn/cenes/cenes/src/main/webapp/assets/uploads/[userId]/events/
cenes.diaryUploadPath=/home/mandeep/svn/cenes/cenes/src/main/webapp/assets/uploads/[userId]/diary/
cenes.salt=c$ne&)@l$nder
Binary file added build/resources/main/cenesGroupProd.p12
Binary file not shown.
7 changes: 7 additions & 0 deletions build/resources/main/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
handlers = com.logentries.jul.LogentriesHandler
.handlers = com.logentries.jul.LogentriesHandler

com.logentries.jul.LogentriesHandler.token = LOGENTRIES_TOKEN
com.logentries.jul.LogentriesHandler.port = 10000
com.logentries.jul.LogentriesHandler.host = data.logentries.com
com.logentries.jul.LogentriesHandler.formatter = java.util.logging.SimpleFormatter
41 changes: 41 additions & 0 deletions build/resources/main/mail/email-inlineimage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:remove="all">Template for HTML email with inline image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="#{greeting(${name})}">
Hello, Peter Static!
</p>
<p th:if="${name.length() gt 10}">
Wow! You've got a long name (more than 10 chars)!
</p>
<p>
You have been successfully subscribed to the <b>Fake newsletter</b> on
<span th:text="${#dates.format(subscriptionDate)}">28-12-2012</span>
</p>
<p>Your hobbies are:</p>
<ul th:remove="all-but-first">
<li th:each="hobby : ${hobbies}" th:text="${hobby}">Reading</li>
<li>Writing</li>
<li>Bowling</li>
</ul>
<p>
You can find <b>your inlined image</b> just below this text.
</p>
<p>
<img src="sample.png" th:src="'cid:' + ${test}" />
</p>
<p>
<img src="sample.png" th:src="'cid:' + ${test2}" />
</p>
<p>
<img src="sample.png" th:src="'cid:' + ${imageResourceName}" />
</p>
<p>
Regards, <br />
&emsp; <em>The Thymeleaf Team</em>
</p>
</body>
</html>
29 changes: 29 additions & 0 deletions build/resources/main/mail/email-simple.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:remove="all">Template for HTML email (simple)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="#{greeting(${name})}">
Hello, Peter Static!
</p>
<p th:if="${name.length() gt 10}">
Wow! You've got a long name (more than 10 chars)!
</p>
<p>
You have been successfully subscribed to the <b>Fake newsletter</b> on
<span th:text="${#dates.format(subscriptionDate)}">28-12-2012</span>
</p>
<p>Your hobbies are:</p>
<ul th:remove="all-but-first">
<li th:each="hobby : ${hobbies}" th:text="${hobby}">Reading</li>
<li>Writing</li>
<li>Bowling</li>
</ul>
<p>
Regards, <br />
&emsp; <em>The Thymeleaf Team</em>
</p>
</body>
</html>
32 changes: 32 additions & 0 deletions build/resources/main/mail/email-withattachment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:remove="all">Template for HTML email with attachment</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="#{greeting(${name})}">
Hello, Peter Static!
</p>
<p th:if="${name.length() gt 10}">
Wow! You've got a long name (more than 10 chars)!
</p>
<p>
You have been successfully subscribed to the <b>Fake newsletter</b> on
<span th:text="${#dates.format(subscriptionDate)}">28-12-2012</span>
</p>
<p>Your hobbies are:</p>
<ul th:remove="all-but-first">
<li th:each="hobby : ${hobbies}" th:text="${hobby}">Reading</li>
<li>Writing</li>
<li>Bowling</li>
</ul>
<p>
You can find <b>your uploaded attachment</b> attached to this message.
</p>
<p>
Regards, <br />
&emsp; <em>The Thymeleaf Team</em>
</p>
</body>
</html>
4 changes: 4 additions & 0 deletions build/resources/main/mail/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<body>
<img src="../../images/jt_net.png" th:attr="src=@{images/jt_net.png}"/>
tile email <h2 th:text="${title}">Title</h2>
</body>
Binary file added build/resources/main/mail/sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/resources/main/pushCert.p12
Binary file not shown.
4 changes: 4 additions & 0 deletions build/resources/main/templates/just.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<body>
<img src="../../images/jt_net.png" th:attr="src=@{images/jt_net.png}"/>
just tile resourse <h2 th:text="${title}">Title other</h2>
</body>
4 changes: 4 additions & 0 deletions build/resources/main/templates/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<body>
<img src="../../images/jt_net.png" th:attr="src=@{images/jt_net.png}"/>
tile resorse<h2 th:text="${title}">Title</h2>
</body>
30 changes: 30 additions & 0 deletions build/resources/main/test.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
server.port=8181

spring.datasource.url=jdbc:mysql://localhost/wip-test?zeroDateTimeBehavior=convertToNull
spring.datasource.username=root
spring.datasource.password=password
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.testOnBorrow=true
spring.datasource.validationQuery=SELECT 1

spring.jpa.openInView=true
spring.jpa.show-sql=true
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto=update
security.basic.enabled=false
server.session-timeout=300
mail.server.host=smtp.mandrillapp.com
mail.server.port=587
mail.server.protocol=smtp
mail.server.username[email protected]
mail.server.password=pn6X0jGKpGg6VH-wOd9pxw

web.prefix=/WEB-INF/templates
web.templateMode=HTML5
web.characterEncoding=UTF-8
web.order=2

spring.email.prefix=mail/
spring.email.templateMode=HTML5
spring.email.characterEncoding=UTF-8
spring.email.order=1
2 changes: 2 additions & 0 deletions build/tmp/jar/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0

9 changes: 9 additions & 0 deletions src/main/java/com/cg/events/bo/RecurringEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@

import org.hibernate.annotations.Cascade;

/**
* This Object will hold the Event that is to be occurred recurrlly.
* If there is a task that is done regularly like GYM, Swimming, Sleep, Walk etc
* this object will hold this entry.
*
* @author mandeep
*
*/

@Entity
@Table(name="recurring_events")
public class RecurringEvent {
Expand Down
36 changes: 1 addition & 35 deletions src/main/java/com/cg/jobs/RecurringEventUpdaterJob.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package com.cg.jobs;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import com.cg.events.bo.Event;
import com.cg.events.bo.RecurringEvent;
import com.cg.events.bo.RecurringEvent.RecurringEventProcessStatus;
import com.cg.events.bo.RecurringPattern;
import com.cg.manager.RecurringManager;
import com.cg.service.EventService;

Expand All @@ -33,36 +28,7 @@ public void runRecurringEventUpdatorJob() {
//Find All Recurring Patterns
if (recurringEvents != null && recurringEvents.size() > 0) {
for (RecurringEvent recurringEvent : recurringEvents) {
List<RecurringPattern> patterns = recurringEvent.getRecurringPatterns();
if (patterns != null && patterns.size() > 0) {
for (RecurringPattern pattern : patterns) {
Calendar currentCal = Calendar.getInstance();
currentCal.setTime(new Date());

if (pattern.getDayOfWeek() != null) {//Event to be occurred Daily
List<Event> dailyEvents = recurringManager.handleDailyEventLogic(currentCal,recurringEvent,pattern);
if (dailyEvents != null && dailyEvents.size() > 0) {
eventService.saveEventsBatch(dailyEvents);
System.out.println("Saving Daily Events Batch Size : "+dailyEvents.size());
Event event = dailyEvents.get(dailyEvents.size()-1);

Calendar generatedUptoCal = Calendar.getInstance();
generatedUptoCal.setTime(event.getStartTime());
generatedUptoCal.add(Calendar.DAY_OF_MONTH,1);
pattern.setSlotsGeneratedUpto(generatedUptoCal.getTime());
}
} else if (pattern.getMonthOfYear() != null) {//Event to be occurred Yearly
List<Event> yearlyEvents = recurringManager.handleYearlyEventLogic(currentCal,recurringEvent,pattern);
if (yearlyEvents != null && yearlyEvents.size() > 0) {
eventService.saveEventsBatch(yearlyEvents);
System.out.println("Saving Yearly Events Batch Size : "+yearlyEvents.size());
}
}
}
}
recurringEvent.setProcessed(RecurringEventProcessStatus.processed.ordinal());
recurringEvent.setUpdateTimestamp(new Date());
eventService.saveUpdateRecurringEvent(recurringEvent);
//recurringManager.processRecurringEvent(recurringEvent);
}
}

Expand Down
Loading

0 comments on commit ae17d80

Please sign in to comment.