You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by ma...@apache.org on 2015/12/01 13:22:29 UTC
[1/2] syncope git commit: cli docs: report, SYNCOPE-722
Repository: syncope
Updated Branches:
refs/heads/master e34a8e4f3 -> 933fcc68f
cli docs: report, SYNCOPE-722
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/933fcc68
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/933fcc68
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/933fcc68
Branch: refs/heads/master
Commit: 933fcc68f0865a4af4c8034ba8be1a314f3d9e99
Parents: 630de0a
Author: massi <ma...@tirasa.net>
Authored: Tue Dec 1 12:59:19 2015 +0100
Committer: massi <ma...@tirasa.net>
Committed: Tue Dec 1 13:22:15 2015 +0100
----------------------------------------------------------------------
.../commands/report/ReportExportExecution.java | 2 +-
src/main/asciidoc/cli-report.adoc | 251 +++++++++++++++++++
src/main/asciidoc/cli.adoc | 4 +-
3 files changed, 255 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/933fcc68/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java
index 0dd7fb8..87583c2 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java
@@ -52,7 +52,7 @@ public class ReportExportExecution extends AbstractReportCommand {
try {
final String result = reportSyncopeOperations.exportExecutionResult(
parameter, input.lastParameter());
- reportResultManager.genericMessage(result);
+ reportResultManager.genericMessage(result + "created.");
} catch (final WebServiceException | SyncopeClientException ex) {
LOG.error("Error exporting execution", ex);
if (ex.getMessage().startsWith("NotFound")) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/933fcc68/src/main/asciidoc/cli-report.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/cli-report.adoc b/src/main/asciidoc/cli-report.adoc
new file mode 100644
index 0000000..48ee95a
--- /dev/null
+++ b/src/main/asciidoc/cli-report.adoc
@@ -0,0 +1,251 @@
+//
+// 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.
+//
+
+==== Report command
+The report command serves to retrieve the information about the configured reports.
+
+===== Help message
+[source,bash]
+----
+Usage: report [options]
+ Options:
+ --help
+ --details
+ --list
+ --list-jobs
+ --read
+ Syntax: --read {REPORT-ID} {REPORT-ID} [...]
+ --delete
+ Syntax: --delete {REPORT-ID} {REPORT-ID} [...]
+ --execute
+ Syntax: --execute {REPORT-ID}
+ --read-execution
+ Syntax: --read-execution {EXECUTION-ID} {EXECUTION-ID} [...]
+ --delete-execution
+ Syntax: --delete-execution {EXECUTION-ID} {EXECUTION-ID} [...]
+ --export-execution-result
+ Syntax: --export-execution-result {EXECUTION-ID} {EXECUTION-ID} [...] {FORMAT}
+ Format: CSV / HTML / PDF / XML / RTF
+----
+
+===== Details option
+This option shows a table with some details about the reports and their executions.
+
+[source]
+--
+$ ./syncopeadm.sh report --details
+--
+
+[source]
+--
+
+You are runnig: report --details
+
+##############################
+# #
+# REPORTS DETAILS #
+# #
+##############################
+# # #
+# DETAIL # VALUE #
+# # #
+##############################
+# # #
+# Total numbers # 1 #
+# Never executed # 0 #
+# # #
+##############################
+
+--
+
+===== List all option
+Running the command with this option you will see the list of report configured.
+
+[source]
+--
+$ ./syncopeadm.sh report --list
+--
+[source]
+--
+You are runnig: report --list
+
+ > REPORT ID: 1
+ name: test
+ cron expression: null
+ latest execution status: SUCCESS
+ start date: Sun Feb 26 15:40:04 CET 2012
+ end date: Sun Feb 26 15:41:04 CET 2012
+ CONF:
+ name: testUserReportlet
+ features: [key, username, workflowId, status, creationDate, lastLoginDate, changePwdDate, passwordHistorySize, failedLoginCount, memberships, resources]
+ plain attributes: [fullname, gender]
+ derived attributes: [cn]
+ virtual attributes: [virtualdata]
+ matching condition: null
+ EXECUTION:
+ REPORT EXEC ID: 1
+ status: SUCCESS
+ message: null
+ start date: Sun Feb 26 15:40:04 CET 2012
+ end date: Sun Feb 26 15:41:04 CET 2012
+ report id: 1
+--
+
+===== List reports execution option
+Running the command with this option you will see the list of the report execution executed.
+
+[source]
+--
+$ ./syncopeadm.sh report --list-jobs
+--
+
+[source]
+--
+
+You are runnig: report --list-jobs
+
+ REPORT EXEC ID: 0
+ status: Not Scheduled
+ message: null
+ start date: null
+ end date: null
+ report id: 1
+
+--
+
+===== Read option
+The option to read all the information of specified report.
+
+[source]
+--
+$ ./syncopeadm.sh report --read {REPORT-ID} {REPORT-ID} [...]
+--
+
+[source]
+--
+You are runnig: report --read 1
+
+ > REPORT ID: 1
+ name: test
+ cron expression: null
+ latest execution status: SUCCESS
+ start date: Sun Feb 26 15:40:04 CET 2012
+ end date: Sun Feb 26 15:41:04 CET 2012
+ CONF:
+ name: testUserReportlet
+ features: [key, username, workflowId, status, creationDate, lastLoginDate, changePwdDate, passwordHistorySize, failedLoginCount, memberships, resources]
+ plain attributes: [fullname, gender]
+ derived attributes: [cn]
+ virtual attributes: [virtualdata]
+ matching condition: null
+ EXECUTION:
+ REPORT EXEC ID: 1
+ status: SUCCESS
+ message: null
+ start date: Sun Feb 26 15:40:04 CET 2012
+ end date: Sun Feb 26 15:41:04 CET 2012
+ report id: 1
+--
+
+===== Read report executions option
+The option to read all the information of specified report execution.
+
+[source]
+--
+$ ./syncopeadm.sh rreport --read-execution {EXECUTION-ID} {EXECUTION-ID} [...]
+--
+
+[source]
+--
+You are runnig: report --read-execution 1
+
+ REPORT EXEC ID: 1
+ status: SUCCESS
+ message: null
+ start date: Sun Feb 26 15:40:04 CET 2012
+ end date: Sun Feb 26 15:41:04 CET 2012
+ report id: 1
+--
+
+===== Delete option
+The option to delete a specified report.
+
+[source]
+--
+$ ./syncopeadm.sh report --delete {REPORT-ID} {REPORT-ID} [...]
+--
+
+The delete option, as can be imagined, tries to remove a specified report.
+[source]
+--
+ - Report {REPORT-ID} successfully deleted
+--
+
+===== Delete report executions option
+The option to delete a specified report execution.
+
+[source]
+--
+$ ./syncopeadm.sh report --delete-execution {EXECUTION-ID} {EXECUTION-ID} [...]
+--
+
+The delete option, as can be imagined, tries to remove a specified report execution.
+[source]
+--
+ - Report execution {EXECUTION-ID} successfully deleted
+
+===== Execute option
+The option to run a report.
+
+[source]
+--
+$ ./syncopeadm.sh report --execute {REPORT-ID}
+--
+
+[source]
+--
+You are runnig: report --execute 1
+
+ - Report 1executed.
+
+
+ - Run --read 1 to see the results.
+--
+
+As you can read, after the execution, if the result is positive, you have to read the report to know the execution
+results.
+
+===== Export execution option
+The option to export an execution in a certain format to see the results.
+
+[NOTE]
+At the moment only the XML format is supported.
+
+[source]
+--
+$ ./syncopeadm.sh eport --export-execution-result {EXECUTION-ID} {EXECUTION-ID} [...] {FORMAT}
+ Format: CSV / HTML / PDF / XML / RTF
+--
+
+[source]
+--
+You are runnig: report --export-execution-result 101 XML
+
+ - export_101.xml created.
+--
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/933fcc68/src/main/asciidoc/cli.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/cli.adoc b/src/main/asciidoc/cli.adoc
index 7e4ade5..1e15c57 100644
--- a/src/main/asciidoc/cli.adoc
+++ b/src/main/asciidoc/cli.adoc
@@ -38,4 +38,6 @@ include::cli-notification.adoc[]
include::cli-schema.adoc[]
-include::cli-user.adoc[]
\ No newline at end of file
+include::cli-user.adoc[]
+
+include::cli-report.adoc[]
\ No newline at end of file
[2/2] syncope git commit: New message in execution result, SYNCOPE-158
Posted by ma...@apache.org.
New message in execution result, SYNCOPE-158
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/630de0af
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/630de0af
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/630de0af
Branch: refs/heads/master
Commit: 630de0af3fc5781be8a97c9077ce343ca4ba139f
Parents: e34a8e4
Author: massi <ma...@tirasa.net>
Authored: Tue Dec 1 12:51:25 2015 +0100
Committer: massi <ma...@tirasa.net>
Committed: Tue Dec 1 13:22:15 2015 +0100
----------------------------------------------------------------------
.../client/cli/commands/report/ReportExecute.java | 14 +++++++-------
.../cli/commands/report/ReportResultManager.java | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/630de0af/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java
index 284ede1..72bd9c8 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java
@@ -18,12 +18,9 @@
*/
package org.apache.syncope.client.cli.commands.report;
-import java.util.Arrays;
-import java.util.List;
import javax.xml.ws.WebServiceException;
import org.apache.syncope.client.cli.Input;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.ReportExecTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,10 +40,13 @@ public class ReportExecute extends AbstractReportCommand {
if (input.parameterNumber() == 1) {
try {
reportSyncopeOperations.execute(input.firstParameter());
- final List<ReportExecTO> executionList
- = reportSyncopeOperations.read(input.firstParameter()).getExecutions();
- final ReportExecTO lastExecution = executionList.get(executionList.size() - 1);
- reportResultManager.printReportExecution(Arrays.asList(lastExecution));
+ reportResultManager.genericMessage("Report " + input.firstParameter() + "executed.");
+ reportResultManager.genericMessage(
+ "Run "
+ + ReportCommand.ReportOptions.READ.getOptionName()
+ + " "
+ + input.firstParameter()
+ + " to see the results.");
} catch (final WebServiceException | SyncopeClientException ex) {
LOG.error("Error executin report", ex);
if (ex.getMessage().startsWith("NotFound")) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/630de0af/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportResultManager.java
index 5ac14e1..150aa77 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportResultManager.java
@@ -46,7 +46,7 @@ public class ReportResultManager extends CommonsResultManager {
for (final AbstractReportletConf reportletConf : reportTO.getReportletConfs()) {
printReportletConf(reportletConf);
}
- System.out.println(" EXECUTION:");
+ System.out.println(" EXECUTIONS:");
printReportExecution(reportTO.getExecutions());
System.out.println("");
}