You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by ad-os <gi...@git.apache.org> on 2017/01/29 21:35:14 UTC

[GitHub] incubator-fineract pull request #283: Notification Module

GitHub user ad-os opened a pull request:

    https://github.com/apache/incubator-fineract/pull/283

    Notification Module

    This module will allow developers to integrate notifications with their functionality. Here are some wikis on which you can read more about this module.
    
    1) [Notification Module Design](https://mifosforge.jira.com/wiki/pages/viewpage.action?pageId=133070890)
    2) [Notification API Developer User Guide](https://mifosforge.jira.com/wiki/display/MDZ/Notification+API+Developer+User+Guide)
    3) [Configure Notifications-End User guide](https://mifosforge.jira.com/wiki/display/docs/Configure+Notifications)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ad-os/incubator-fineract notification

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-fineract/pull/283.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #283
    
----
commit e97ecc4a687ace616175be9590110abb24df446b
Author: Adhyan <ad...@yahoo.com>
Date:   2017-01-03T08:54:30Z

    Added Notification Module
    
    Added Notification Module
    
    Added Notification Module
    
    Added Notification Module
    
    Added Notification Module
    
    Added Notification Module
    
    Added Notification Module

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r98609031
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationMapperReadPlatformServiceImpl.java ---
    @@ -0,0 +1,53 @@
    +/**
    + * 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.service;
    +
    +import org.apache.fineract.notification.domain.NotificationMapper;
    +import org.apache.fineract.notification.domain.NotificationMapperRepository;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.stereotype.Service;
    +
    +import java.util.List;
    +
    +@Service
    +public class NotificationMapperReadPlatformServiceImpl implements NotificationMapperReadPlatformService {
    --- End diff --
    
    Do we need this class? Why can't caller directly call methods on NotificationMapperRepository?
    Read platform services are designed to use JDBCTemplate


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r98609149
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationGeneratorReadPlatformServiceImpl.java ---
    @@ -0,0 +1,53 @@
    +/**
    + * 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.service;
    +
    +import org.apache.fineract.notification.domain.Notification;
    +import org.apache.fineract.notification.domain.NotificationRepository;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.stereotype.Service;
    +
    +import java.util.List;
    +
    +@Service
    +public class NotificationGeneratorReadPlatformServiceImpl implements NotificationGeneratorReadPlatformService {
    --- End diff --
    
    Or are you trying as repository wrapper? In such case why the class name is read platform service?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by ad-os <gi...@git.apache.org>.
Github user ad-os commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r103217772
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationMapperReadPlatformServiceImpl.java ---
    @@ -0,0 +1,53 @@
    +/**
    + * 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.service;
    +
    +import org.apache.fineract.notification.domain.NotificationMapper;
    +import org.apache.fineract.notification.domain.NotificationMapperRepository;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.stereotype.Service;
    +
    +import java.util.List;
    +
    +@Service
    +public class NotificationMapperReadPlatformServiceImpl implements NotificationMapperReadPlatformService {
    --- End diff --
    
    I am trying it as repository wrapper. What name should this class be named? Would it be NotificationMapperReadRepositoryWrapper?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r98609176
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationMapperReadPlatformServiceImpl.java ---
    @@ -0,0 +1,53 @@
    +/**
    + * 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.service;
    +
    +import org.apache.fineract.notification.domain.NotificationMapper;
    +import org.apache.fineract.notification.domain.NotificationMapperRepository;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.stereotype.Service;
    +
    +import java.util.List;
    +
    +@Service
    +public class NotificationMapperReadPlatformServiceImpl implements NotificationMapperReadPlatformService {
    --- End diff --
    
    Or are you trying as repository wrapper? In such case why the class name is read platform service?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by ad-os <gi...@git.apache.org>.
Github user ad-os commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r103187242
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/domain/Notification.java ---
    @@ -0,0 +1,112 @@
    +/**
    + * 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.domain;
    +
    +import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
    +
    +import javax.persistence.Column;
    +import javax.persistence.Entity;
    +import javax.persistence.Table;
    +
    +@Entity
    +@Table(name = "notification_generator")
    +public class Notification extends AbstractPersistableCustom<Long> {
    +
    +    @Column(name = "object_type")
    +    private String objectType;
    +
    +    @Column(name = "object_identifier")
    +    private Long objectIdentifier;
    +
    +    @Column(name = "action")
    +    private String action;
    +
    +    @Column(name = "actor")
    +    private Long actorId;
    --- End diff --
    
    Sorry about that, when the last time I changed the actorId to Long, I forgot to change it in the notification_generator definition. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r98609622
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/eventandlistener/NotificationEvent.java ---
    @@ -0,0 +1,50 @@
    +/**
    + * 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.eventandlistener;
    +
    +import org.apache.fineract.notification.data.NotificationData;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.jms.core.JmsTemplate;
    +import org.springframework.jms.core.MessageCreator;
    +import org.springframework.stereotype.Service;
    +
    +import javax.jms.Destination;
    +import javax.jms.JMSException;
    +import javax.jms.Message;
    +import javax.jms.Session;
    +
    +@Service
    +public class NotificationEvent {
    --- End diff --
    
    Is it a event or service? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by ad-os <gi...@git.apache.org>.
Github user ad-os commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r103213061
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationGeneratorReadPlatformServiceImpl.java ---
    @@ -0,0 +1,53 @@
    +/**
    + * 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.service;
    +
    +import org.apache.fineract.notification.domain.Notification;
    +import org.apache.fineract.notification.domain.NotificationRepository;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.stereotype.Service;
    +
    +import java.util.List;
    +
    +@Service
    +public class NotificationGeneratorReadPlatformServiceImpl implements NotificationGeneratorReadPlatformService {
    --- End diff --
    
    I am trying it as repository wrapper. What name should this class be named? Would it be NotificationGeneratorReadRepositoryWrapper?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r98608875
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationGeneratorReadPlatformServiceImpl.java ---
    @@ -0,0 +1,53 @@
    +/**
    + * 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.service;
    +
    +import org.apache.fineract.notification.domain.Notification;
    +import org.apache.fineract.notification.domain.NotificationRepository;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.stereotype.Service;
    +
    +import java.util.List;
    +
    +@Service
    +public class NotificationGeneratorReadPlatformServiceImpl implements NotificationGeneratorReadPlatformService {
    --- End diff --
    
    If you are reading Entity from NotificationRepository, do we need to have separate readplatform service? Why can't caller directly call method on NotificationRepository? Readplatforms are designed to use JDBCTemplate not Repositories. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by ad-os <gi...@git.apache.org>.
Github user ad-os commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r103218666
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/eventandlistener/NotificationEvent.java ---
    @@ -0,0 +1,50 @@
    +/**
    + * 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.eventandlistener;
    +
    +import org.apache.fineract.notification.data.NotificationData;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.jms.core.JmsTemplate;
    +import org.springframework.jms.core.MessageCreator;
    +import org.springframework.stereotype.Service;
    +
    +import javax.jms.Destination;
    +import javax.jms.JMSException;
    +import javax.jms.Message;
    +import javax.jms.Session;
    +
    +@Service
    +public class NotificationEvent {
    --- End diff --
    
    It is a service which broadcast the notification event to an external queue.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-fineract pull request #283: Notification Module

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/283#discussion_r98606959
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/notification/domain/Notification.java ---
    @@ -0,0 +1,112 @@
    +/**
    + * 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.domain;
    +
    +import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
    +
    +import javax.persistence.Column;
    +import javax.persistence.Entity;
    +import javax.persistence.Table;
    +
    +@Entity
    +@Table(name = "notification_generator")
    +public class Notification extends AbstractPersistableCustom<Long> {
    +
    +    @Column(name = "object_type")
    +    private String objectType;
    +
    +    @Column(name = "object_identifier")
    +    private Long objectIdentifier;
    +
    +    @Column(name = "action")
    +    private String action;
    +
    +    @Column(name = "actor")
    +    private Long actorId;
    --- End diff --
    
    actor is text in notification_generator definition. But entity is defined with Long?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---