[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15418312#comment-15418312 ] ASF GitHub Bot commented on FINERACT-65: Github user asfgit closed the pull request at: https://github.com/apache/incubator-fineract/pull/197 > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15411724#comment-15411724 ] ASF GitHub Bot commented on FINERACT-65: Github user emmanuelnnaa commented on the issue: https://github.com/apache/incubator-fineract/pull/191 @nazeer1100126 Will create a new pull request. > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15411725#comment-15411725 ] ASF GitHub Bot commented on FINERACT-65: Github user emmanuelnnaa closed the pull request at: https://github.com/apache/incubator-fineract/pull/191 > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15411493#comment-15411493 ] ASF GitHub Bot commented on FINERACT-65: Github user emmanuelnnaa commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/191#discussion_r73839176 --- Diff: fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java --- @@ -2736,4 +2736,27 @@ public CommandWrapperBuilder deleteSelfServiceBeneficiaryTPT(final Long benefici return this; } -} \ No newline at end of file + public CommandWrapperBuilder createReportMailingJob(final String entityName) { +this.actionName = "CREATE"; +this.entityName = entityName; +this.entityId = null; +this.href = "/reportmailingjobs"; +return this; +} + +public CommandWrapperBuilder updateReportMailingJob(final String entityName, final Long entityId) { --- End diff -- @nazeer1100126 permission name = "REPORTMAILINGJOB" which is the same as the entity name. > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15411492#comment-15411492 ] ASF GitHub Bot commented on FINERACT-65: Github user emmanuelnnaa commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/191#discussion_r73839123 --- Diff: fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java --- @@ -2736,4 +2736,27 @@ public CommandWrapperBuilder deleteSelfServiceBeneficiaryTPT(final Long benefici return this; } -} \ No newline at end of file + public CommandWrapperBuilder createReportMailingJob(final String entityName) { +this.actionName = "CREATE"; +this.entityName = entityName; +this.entityId = null; +this.href = "/reportmailingjobs"; +return this; +} + +public CommandWrapperBuilder updateReportMailingJob(final String entityName, final Long entityId) { +this.actionName = "UPDATE"; +this.entityName = entityName; +this.entityId = entityId; +this.href = "/reportmailingjobs/" + entityId; +return this; +} + +public CommandWrapperBuilder deleteReportMailingJob(final String entityName, final Long entityId) { --- End diff -- @nazeer1100126 permission name = "REPORTMAILINGJOB" which is the same as the entity name. > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15411488#comment-15411488 ] ASF GitHub Bot commented on FINERACT-65: Github user emmanuelnnaa commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/191#discussion_r73838915 --- Diff: fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRepositoryWrapper.java --- @@ -0,0 +1,56 @@ +/** + * 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.infrastructure.reportmailingjob.domain; + +import org.apache.fineract.infrastructure.reportmailingjob.exception.ReportMailingJobNotFoundException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ReportMailingJobRepositoryWrapper { +private final ReportMailingJobRepository reportMailingJobRepository; + +@Autowired +public ReportMailingJobRepositoryWrapper(final ReportMailingJobRepository reportMailingJobRepository) { +this.reportMailingJobRepository = reportMailingJobRepository; +} + +/** + * find report mailing job by ID, throw a "entity not found" exception if the job does not exist + * + * @param id -- the identifier of the report mailing job to be found + * @return ReportMailingJob object + **/ +public ReportMailingJob findOneThrowExceptionIfNotFound(final Long id) { +final ReportMailingJob reportMailingJob = this.reportMailingJobRepository.findOne(id); + +if (reportMailingJob == null || reportMailingJob.isDeleted()) { +throw new ReportMailingJobNotFoundException(id); +} + +return reportMailingJob; +} + +/** + * @return ReportMailingJobRepository Jpa Repository object + **/ +public ReportMailingJobRepository getReportMailingJobRepository() { --- End diff -- @nazeer1100126 Both methods are used in the "org.apache.fineract.infrastructure.reportmailingjob.service.ReportMailingJobWritePlatformServiceImpl" class. > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15405690#comment-15405690 ] ASF GitHub Bot commented on FINERACT-65: Github user nazeer1100126 commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/191#discussion_r73314684 --- Diff: fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java --- @@ -0,0 +1,495 @@ +/** + * 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.infrastructure.reportmailingjob.service; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + +import org.apache.commons.lang.StringUtils; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder; +import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException; +import org.apache.fineract.infrastructure.core.service.DateUtils; +import org.apache.fineract.infrastructure.dataqueries.domain.Report; +import org.apache.fineract.infrastructure.dataqueries.domain.ReportRepositoryWrapper; +import org.apache.fineract.infrastructure.dataqueries.service.ReadReportingService; +import org.apache.fineract.infrastructure.documentmanagement.contentrepository.FileSystemContentRepository; +import org.apache.fineract.infrastructure.jobs.annotation.CronTarget; +import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException; +import org.apache.fineract.infrastructure.jobs.service.JobName; +import org.apache.fineract.infrastructure.report.provider.ReportingProcessServiceProvider; +import org.apache.fineract.infrastructure.report.service.ReportingProcessService; +import org.apache.fineract.infrastructure.reportmailingjob.ReportMailingJobConstants; +import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJobEmailAttachmentFileFormat; +import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJobEmailData; +import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJobPreviousRunStatus; +import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJobStretchyReportParamDateOption; +import org.apache.fineract.infrastructure.reportmailingjob.domain.ReportMailingJob; +import org.apache.fineract.infrastructure.reportmailingjob.domain.ReportMailingJobRepository; +import org.apache.fineract.infrastructure.reportmailingjob.domain.ReportMailingJobRepositoryWrapper; +import org.apache.fineract.infrastructure.reportmailingjob.domain.ReportMailingJobRunHistory; +import org.apache.fineract.infrastructure.reportmailingjob.domain.ReportMailingJobRunHistoryRepository; +import org.apache.fineract.infrastructure.reportmailingjob.util.ReportMailingJobDateUtil; +import org.apache.fineract.infrastructure.reportmailingjob.validation.ReportMailingJobValidator; +import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; +import org.apache.fineract.portfolio.calendar.service.CalendarUtils; +import org.apache.fineract.useradministration.domain.AppUser; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15405489#comment-15405489 ] ASF GitHub Bot commented on FINERACT-65: Github user nazeer1100126 commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/191#discussion_r73291621 --- Diff: fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java --- @@ -2736,4 +2736,27 @@ public CommandWrapperBuilder deleteSelfServiceBeneficiaryTPT(final Long benefici return this; } -} \ No newline at end of file + public CommandWrapperBuilder createReportMailingJob(final String entityName) { +this.actionName = "CREATE"; +this.entityName = entityName; +this.entityId = null; +this.href = "/reportmailingjobs"; +return this; +} + +public CommandWrapperBuilder updateReportMailingJob(final String entityName, final Long entityId) { --- End diff -- Caller is passing permission name and entity id. But you are assigning permission name to entity name > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FINERACT-65) Implement ability to schedule & e-mail reports
[ https://issues.apache.org/jira/browse/FINERACT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15405452#comment-15405452 ] ASF GitHub Bot commented on FINERACT-65: Github user nazeer1100126 commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/191#discussion_r73289816 --- Diff: fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingService.java --- @@ -44,4 +47,7 @@ ReportData retrieveReport(final Long id); Collection getAllowedReportTypes(); + +ByteArrayOutputStream generatePentahoReportAsOutputStream(String reportName, String outputTypeParam, --- End diff -- I don't see any reference to this method. Is it required as implementation returns just null > Implement ability to schedule & e-mail reports > -- > > Key: FINERACT-65 > URL: https://issues.apache.org/jira/browse/FINERACT-65 > Project: Apache Fineract > Issue Type: New Feature >Reporter: Emmanuel Nnaa >Assignee: Markus Geiss >Priority: Minor > > Some reports take a bit longer to run, therefore we should be able to allow > our users to schedule them overnight to be e-mailed. > The way this should work is: > - Add e-mailaddress to users and make it mandatory (possibly already in > MifosX) > - Allow users to configure schedule entries which consist of: > - One or multiple target users (e-mailaddresses) > - Set the preferred subject and content of the e-mail (Look at user generated > documents API in MifosX for replacing certain variables) > - Choose the run frequency of the report (daily, weekly, every x'th day of > the month etc, cron-like flexibility with a UI) > - Pick the preferred output format (PDF/XLS/CSV) > These reports should be picked up by a scheduled job overnight and then run > in serial to avoid performance hits and sent out to the users. -- This message was sent by Atlassian JIRA (v6.3.4#6332)