Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion fineract-provider/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ dependencies {
//[group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0']
[group: 'org.springframework', name:'spring-jms'],
[group: 'org.apache.activemq', name: 'activemq-broker']

)
testCompile 'junit:junit:4.11',
'junit:junit-dep:4.11',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package org.apache.fineract.integrationtests;

/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -18,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.fineract.integrationtests;

import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.builder.ResponseSpecBuilder;
Expand Down Expand Up @@ -54,4 +52,5 @@ public void testNotificationRetrieval() {
System.out.println("Response : " + response.toString());
Assert.assertNotNull(response);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package org.apache.fineract.integrationtests.common;

/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -18,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.integrationtests.common;

import com.jayway.restassured.specification.RequestSpecification;
import com.jayway.restassured.specification.ResponseSpecification;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.time.StopWatch;
import org.apache.fineract.notification.service.NotificationReadPlatformService;
import org.apache.fineract.infrastructure.cache.domain.CacheType;
import org.apache.fineract.infrastructure.cache.service.CacheWritePlatformService;
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
Expand Down Expand Up @@ -78,6 +79,7 @@ public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFil
private final ToApiJsonSerializer<PlatformRequestLog> toApiJsonSerializer;
private final ConfigurationDomainService configurationDomainService;
private final CacheWritePlatformService cacheWritePlatformService;

private final NotificationReadPlatformService notificationReadPlatformService;
private final String tenantRequestHeader = "Fineract-Platform-TenantId";
private final boolean exceptionIfHeaderMissing = true;
Expand Down Expand Up @@ -177,6 +179,12 @@ protected void onSuccessfulAuthentication(HttpServletRequest request,
response.addHeader("X-Notification-Refresh", "false");
}

if(notificationReadPlatformService.hasUnreadNotifications(user.getId())) {
response.addHeader("X-Notification-Refresh", "true");
} else {
response.addHeader("X-Notification-Refresh", "false");
}

String pathURL = request.getRequestURI();
boolean isSelfServiceRequest = (pathURL != null && pathURL.contains("/self/"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.fineract.notification.api;


import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
import org.apache.fineract.infrastructure.core.serialization.ToApiJsonSerializer;
Expand Down Expand Up @@ -86,4 +85,5 @@ public void update() {
this.context.authenticatedUser();
this.notificationReadPlatformService.updateNotificationReadStatus();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.fineract.notification.cache;


public class CacheNotificationResponseHeader {

private boolean hasNotifications;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class NotificationData implements Serializable {
private String action;
private Long actorId;
private String content;
private boolean isRead;
private boolean isSystemGenerated;
private String tenantIdentifier;
private String createdAt;
Expand All @@ -40,12 +41,13 @@ public NotificationData() {
}

public NotificationData(String objectType, Long objectId, String action, Long actorId, String content, boolean isSystemGenerated,
String tenantIdentifier, Long officeId, List<Long> userIds) {
boolean isRead, String tenantIdentifier, Long officeId, List<Long> userIds) {
this.objectType = objectType;
this.objectId = objectId;
this.action = action;
this.actorId = actorId;
this.content = content;
this.isRead = isRead;
this.isSystemGenerated = isSystemGenerated;
this.tenantIdentifier = tenantIdentifier;
this.officeId = officeId;
Expand Down Expand Up @@ -123,6 +125,14 @@ public String getContent() {
public void setContent(String content) {
this.content = content;
}

public boolean isRead() {
return this.isRead;
}

public void setRead(boolean isRead) {
this.isRead = isRead;
}

public boolean isSystemGenerated() {
return isSystemGenerated;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache 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://www.apache.org/licenses/LICENSE-2.0
*
* 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.apache.fineract.notification.data;

import java.io.Serializable;

public class TopicData implements Serializable {

private final Long id;
private final String title;
private final boolean enabled;
private final Long entityId;
private final String entityType;
private final String memberType;

public TopicData(Long id, String title, boolean enabled, Long entityId, String entityType,
String memberType) {
this.id = id;
this.title = title;
this.enabled = enabled;
this.entityId = entityId;
this.entityType = entityType;
this.memberType = memberType;
}

public TopicData(Long id, String title, Long entityId, String entityType,
String memberType) {
this.id = id;
this.title = title;
this.enabled = true;
this.entityId = entityId;
this.entityType = entityType;
this.memberType = memberType;
}

public Long getId() {
return this.id;
}

public String getTitle() {
return this.title;
}

public boolean isEnabled() {
return this.enabled;
}

public Long getEntityId() {
return this.entityId;
}

public String getEntityType() {
return this.entityType;
}

public String getMemberType() {
return this.memberType;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache 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://www.apache.org/licenses/LICENSE-2.0
*
* 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.apache.fineract.notification.data;

import org.joda.time.LocalDate;

public class TopicSubscriberData {

private final Long id;
private final Long topicId;
private final Long userId;
private final LocalDate subscriptionDate;

public TopicSubscriberData(Long id, Long topicId, Long userId, LocalDate subscriptionDate) {
this.id = id;
this.topicId = topicId;
this.userId = userId;
this.subscriptionDate = subscriptionDate;
}

public TopicSubscriberData(Long id, Long topicId, Long userId) {
this.id = id;
this.topicId = topicId;
this.userId = userId;
this.subscriptionDate = new LocalDate();
}

public Long getId() {
return this.id;
}

public Long getTopicId() {
return this.topicId;
}

public Long getUserId() {
return this.userId;
}

public LocalDate getSubscriptionDate() {
return this.subscriptionDate;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.*;

@Entity
@Table(name = "notification_generator")
Expand Down Expand Up @@ -90,7 +88,7 @@ public Long getActor() {
return actorId;
}

public void setActor(Long actor) {
public void setActor(Long actorId) {
this.actorId = actorId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.fineract.notification.domain;


import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
import org.apache.fineract.useradministration.domain.AppUser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@

import org.springframework.data.jpa.repository.JpaRepository;


public interface NotificationMapperRepository extends JpaRepository<NotificationMapper, Long> {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@

import org.springframework.data.jpa.repository.JpaRepository;


public interface NotificationRepository extends JpaRepository<Notification, Long> {}
Loading