You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by gi...@apache.org on 2015/05/29 12:53:02 UTC
syncope git commit: [SYNCOPE-660] Merge from 1_2_X - replacing wrong
packages
Repository: syncope
Updated Branches:
refs/heads/master 34a0422ae -> 582eeb452
[SYNCOPE-660] Merge from 1_2_X - replacing wrong packages
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/582eeb45
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/582eeb45
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/582eeb45
Branch: refs/heads/master
Commit: 582eeb4521e1961491cdc86c6e1aaabd4123e672
Parents: 34a0422
Author: giacomolm <gi...@hotmail.it>
Authored: Fri May 29 12:50:53 2015 +0200
Committer: giacomolm <gi...@hotmail.it>
Committed: Fri May 29 12:50:53 2015 +0200
----------------------------------------------------------------------
.../syncope/client/console/pages/Reports.java | 71 ++++++++--------
.../syncope/client/console/pages/Tasks.java | 42 +++++-----
.../console/panels/NotificationTasks.java | 35 ++++----
.../client/console/panels/RuntimePanel.java | 2 +-
.../client/console/panels/SchedTasks.java | 41 +++++-----
.../client/console/panels/SyncTasksPanel.java | 49 ++++++-----
.../client/console/rest/ReportRestClient.java | 22 ++---
.../client/console/rest/TaskRestClient.java | 85 +++++++-------------
.../html/repeater/data/table/JobColumn.java | 4 +-
9 files changed, 158 insertions(+), 193 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Reports.java b/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
index 88fdf1c..ff32fef 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
@@ -16,31 +16,30 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.console.pages;
+package org.apache.syncope.client.console.pages;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
-import org.apache.syncope.common.to.EventCategoryTO;
-import org.apache.syncope.common.to.ReportTO;
-import org.apache.syncope.common.types.AuditElements.Result;
-import org.apache.syncope.common.types.AuditLoggerName;
-import org.apache.syncope.common.util.LoggerEventUtils;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.console.commons.PreferenceManager;
-import org.apache.syncope.console.commons.SortableDataProviderComparator;
-import org.apache.syncope.console.pages.panels.LoggerCategoryPanel;
-import org.apache.syncope.console.pages.panels.SelectedEventsPanel;
-import org.apache.syncope.console.rest.LoggerRestClient;
-import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.panels.LoggerCategoryPanel;
+import org.apache.syncope.client.console.panels.SelectedEventsPanel;
+import org.apache.syncope.client.console.rest.LoggerRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.EventCategoryTO;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.AuditElements.Result;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -116,8 +115,8 @@ public class Reports extends BasePage {
paginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_REPORT_PAGINATOR_ROWS);
- List<IColumn<ReportTO, String>> columns = new ArrayList<IColumn<ReportTO, String>>();
- columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("id"), "id", "id"));
+ List<IColumn<ReportTO, String>> columns = new ArrayList<>();
+ columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("key"), "key", "key"));
columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("name"), "name", "name"));
columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("lastExec"), "lastExec", "lastExec"));
columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("nextExec"), "nextExec", "nextExec"));
@@ -166,7 +165,7 @@ public class Reports extends BasePage {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- reportRestClient.startExecution(reportTO.getId());
+ reportRestClient.startExecution(reportTO.getKey());
getSession().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -184,7 +183,7 @@ public class Reports extends BasePage {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- reportRestClient.delete(reportTO.getId());
+ reportRestClient.delete(reportTO.getKey());
info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -218,8 +217,7 @@ public class Reports extends BasePage {
});
final AjaxFallbackDefaultDataTable<ReportTO, String> reportTable =
- new AjaxFallbackDefaultDataTable<ReportTO, String>(
- "reportTable", columns, new ReportProvider(), paginatorRows);
+ new AjaxFallbackDefaultDataTable<>("reportTable", columns, new ReportProvider(), paginatorRows);
reportContainer.add(reportTable);
reportContainer.setOutputMarkupId(true);
@@ -253,7 +251,7 @@ public class Reports extends BasePage {
paginatorForm.add(rowsChooser);
add(paginatorForm);
- AjaxLink createLink = new ClearIndicatingAjaxLink("createLink", getPageReference()) {
+ AjaxLink<Void> createLink = new ClearIndicatingAjaxLink<Void>("createLink", getPageReference()) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -291,11 +289,11 @@ public class Reports extends BasePage {
final Form form = new Form("auditForm");
auditContainer.add(form);
- final List<String> events = new ArrayList<String>();
+ final List<String> events = new ArrayList<>();
final List<AuditLoggerName> audits = loggerRestClient.listAudits();
for (AuditLoggerName audit : audits) {
- events.add(LoggerEventUtils.buildEvent(
+ events.add(AuditLoggerName.buildEvent(
audit.getType(),
audit.getCategory(),
audit.getSubcategory(),
@@ -303,7 +301,7 @@ public class Reports extends BasePage {
audit.getResult()));
}
- final ListModel<String> model = new ListModel<String>(new ArrayList<String>(events));
+ final ListModel<String> model = new ListModel<>(new ArrayList<>(events));
form.add(new LoggerCategoryPanel(
"events", loggerRestClient.listEvents(), model, getPageReference(), "Reports") {
@@ -334,8 +332,8 @@ public class Reports extends BasePage {
for (String toBeRemoved : eventSelectionChanged.getToBeRemoved()) {
if (events.contains(toBeRemoved)) {
- final Map.Entry<EventCategoryTO, Result> eventCategory =
- LoggerEventUtils.parseEventCategory(toBeRemoved);
+ Pair<EventCategoryTO, Result> eventCategory =
+ AuditLoggerName.parseEventCategory(toBeRemoved);
final AuditLoggerName auditLoggerName = new AuditLoggerName(
eventCategory.getKey().getType(),
@@ -352,8 +350,8 @@ public class Reports extends BasePage {
for (String toBeAdded : eventSelectionChanged.getToBeAdded()) {
if (!events.contains(toBeAdded)) {
- final Map.Entry<EventCategoryTO, Result> eventCategory =
- LoggerEventUtils.parseEventCategory(toBeAdded);
+ Pair<EventCategoryTO, Result> eventCategory =
+ AuditLoggerName.parseEventCategory(toBeAdded);
final AuditLoggerName auditLoggerName = new AuditLoggerName(
eventCategory.getKey().getType(),
@@ -382,8 +380,8 @@ public class Reports extends BasePage {
super();
//Default sorting
- setSort("id", SortOrder.ASCENDING);
- comparator = new SortableDataProviderComparator<ReportTO>(this);
+ setSort("key", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<>(this);
}
@Override
@@ -415,6 +413,7 @@ public class Reports extends BasePage {
};
}
}
+
/**
* IndicatorMarkupId behaviour is embedded in Reports.html
*/
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java b/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
index 11819c6..df2a87f 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.console.pages;
+package org.apache.syncope.client.console.pages;
import java.util.ArrayList;
import java.util.Arrays;
@@ -24,19 +24,19 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
-import org.apache.syncope.common.to.SchedTaskTO;
-import org.apache.syncope.common.to.TaskExecTO;
-import org.apache.syncope.common.to.AbstractTaskTO;
-import org.apache.syncope.console.commons.SortableDataProviderComparator;
-import org.apache.syncope.console.pages.panels.AjaxDataTablePanel;
-import org.apache.syncope.console.pages.panels.NotificationTasks;
-import org.apache.syncope.console.pages.panels.PropagationTasks;
-import org.apache.syncope.console.pages.panels.SchedTasks;
-import org.apache.syncope.console.pages.panels.PushTasksPanel;
-import org.apache.syncope.console.pages.panels.SyncTasksPanel;
-import org.apache.syncope.console.rest.BaseRestClient;
-import org.apache.syncope.console.rest.TaskRestClient;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.panels.AjaxDataTablePanel;
+import org.apache.syncope.client.console.panels.NotificationTasks;
+import org.apache.syncope.client.console.panels.PropagationTasks;
+import org.apache.syncope.client.console.panels.PushTasksPanel;
+import org.apache.syncope.client.console.panels.SchedTasks;
+import org.apache.syncope.client.console.panels.SyncTasksPanel;
+import org.apache.syncope.client.console.rest.BaseRestClient;
+import org.apache.syncope.client.console.rest.TaskRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
import org.apache.wicket.PageReference;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
@@ -141,8 +141,8 @@ public class Tasks extends BasePage {
super();
//Default sorting
- setSort("id", SortOrder.DESCENDING);
- comparator = new SortableDataProviderComparator<T>(this);
+ setSort("key", SortOrder.DESCENDING);
+ comparator = new SortableDataProviderComparator<>(this);
this.paginatorRows = paginatorRows;
this.restClient = restClient;
this.id = id;
@@ -151,7 +151,7 @@ public class Tasks extends BasePage {
@Override
public Iterator<T> iterator(final long first, final long count) {
- final List<T> tasks = new ArrayList<T>();
+ final List<T> tasks = new ArrayList<>();
final int page = ((int) first / paginatorRows);
@@ -184,7 +184,7 @@ public class Tasks extends BasePage {
@Override
public IModel<T> model(final T object) {
- return new CompoundPropertyModel<T>(object);
+ return new CompoundPropertyModel<>(object);
}
}
@@ -208,7 +208,7 @@ public class Tasks extends BasePage {
final BaseRestClient restClient) {
@SuppressWarnings("unchecked")
- final AjaxDataTablePanel<AbstractTaskTO, String> table = new AjaxDataTablePanel<AbstractTaskTO, String>(
+ final AjaxDataTablePanel<AbstractTaskTO, String> table = new AjaxDataTablePanel<>(
"datatable",
columns,
(ISortableDataProvider<AbstractTaskTO, String>) dataProvider,
@@ -216,7 +216,7 @@ public class Tasks extends BasePage {
Arrays.asList(new ActionLink.ActionType[] {
ActionLink.ActionType.DELETE, ActionLink.ActionType.DRYRUN, ActionLink.ActionType.EXECUTE }),
restClient,
- "id",
+ "key",
TASKS,
pageRef);
@@ -232,8 +232,8 @@ public class Tasks extends BasePage {
* IndicatorMarkupId behaviour is embedded in Tasks.html
*/
@Override
+
public String getAjaxIndicatorMarkupId() {
return "";
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
index 9c7b458..6449450 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
@@ -16,21 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.console.pages.panels;
+package org.apache.syncope.client.console.panels;
import java.util.ArrayList;
import java.util.List;
-import org.apache.syncope.common.to.NotificationTaskTO;
-import org.apache.syncope.common.to.AbstractTaskTO;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.console.pages.NotificationTaskModalPage;
-import org.apache.syncope.console.pages.Tasks;
-import org.apache.syncope.console.pages.Tasks.TasksProvider;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.NotificationTaskModalPage;
+import org.apache.syncope.client.console.pages.Tasks;
+import org.apache.syncope.client.console.pages.Tasks.TasksProvider;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.NotificationTaskTO;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
import org.apache.wicket.PageReference;
@@ -138,10 +138,10 @@ public class NotificationTasks extends AbstractTasks {
}
private List<IColumn<AbstractTaskTO, String>> getColumns() {
- final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+ final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("sender", this, null), "sender", "sender"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
@@ -152,9 +152,8 @@ public class NotificationTasks extends AbstractTasks {
new StringResourceModel("traceLevel", this, null), "traceLevel", "traceLevel"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
-
columns.add(new JobColumn<AbstractTaskTO, String>(new StringResourceModel("", this, null, ""), "runtime",
- pageRef, restClient));
+ pageRef, restClient));
columns.add(new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
@@ -195,7 +194,7 @@ public class NotificationTasks extends AbstractTasks {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.startExecution(taskTO.getId(), false);
+ restClient.startExecution(taskTO.getKey(), false);
getSession().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -213,7 +212,7 @@ public class NotificationTasks extends AbstractTasks {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.delete(taskTO.getId(), NotificationTaskTO.class);
+ restClient.delete(taskTO.getKey(), NotificationTaskTO.class);
info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/panels/RuntimePanel.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/RuntimePanel.java b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/RuntimePanel.java
index 34e058e..ba15f5d 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/RuntimePanel.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/RuntimePanel.java
@@ -19,7 +19,7 @@
package org.apache.syncope.client.console.panels;
import org.apache.syncope.client.console.rest.JobRestClient;
-import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
index 78591a8..9a64c83 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
@@ -16,25 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.console.pages.panels;
-
-import static org.apache.syncope.console.pages.panels.AbstractTasks.TASKS;
+package org.apache.syncope.client.console.panels;
import java.util.ArrayList;
import java.util.List;
-import org.apache.syncope.common.to.SchedTaskTO;
-import org.apache.syncope.common.to.AbstractTaskTO;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.console.pages.SchedTaskModalPage;
-import org.apache.syncope.console.pages.Tasks;
-import org.apache.syncope.console.pages.Tasks.TasksProvider;
-import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.SchedTaskModalPage;
+import org.apache.syncope.client.console.pages.Tasks;
+import org.apache.syncope.client.console.pages.Tasks.TasksProvider;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
import org.apache.wicket.PageReference;
@@ -156,7 +154,7 @@ public class SchedTasks extends AbstractTasks {
final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
columns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("name", this, null), "name", "name"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
@@ -169,9 +167,8 @@ public class SchedTasks extends AbstractTasks {
new StringResourceModel("nextExec", this, null), "nextExec", "nextExec"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
-
columns.add(new JobColumn<AbstractTaskTO, String>(new StringResourceModel("", this, null, ""), "runtime",
- pageRef, restClient));
+ pageRef, restClient));
columns.add(new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
@@ -211,7 +208,7 @@ public class SchedTasks extends AbstractTasks {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.startExecution(taskTO.getId(), false);
+ restClient.startExecution(taskTO.getKey(), false);
getSession().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -229,7 +226,7 @@ public class SchedTasks extends AbstractTasks {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.startExecution(taskTO.getId(), true);
+ restClient.startExecution(taskTO.getKey(), true);
getSession().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -247,7 +244,7 @@ public class SchedTasks extends AbstractTasks {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.delete(taskTO.getId(), SchedTaskTO.class);
+ restClient.delete(taskTO.getKey(), SchedTaskTO.class);
info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
index 032f4e4..50d91df 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
@@ -16,22 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.console.pages.panels;
+package org.apache.syncope.client.console.panels;
import java.util.ArrayList;
import java.util.List;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.common.to.AbstractTaskTO;
-import org.apache.syncope.common.to.SyncTaskTO;
-import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.console.pages.RoleTemplateModalPage;
-import org.apache.syncope.console.pages.SyncTaskModalPage;
-import org.apache.syncope.console.pages.UserTemplateModalPage;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.GroupTemplateModalPage;
+import org.apache.syncope.client.console.pages.SyncTaskModalPage;
+import org.apache.syncope.client.console.pages.UserTemplateModalPage;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.JobColumn;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
import org.apache.wicket.PageReference;
@@ -43,7 +43,7 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.StringResourceModel;
-public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
+public class SyncTasksPanel extends AbstractProvisioningTasksPanel<SyncTaskTO> {
private static final long serialVersionUID = 53189199346016099L;
@@ -54,10 +54,10 @@ public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
@Override
protected List<IColumn<AbstractTaskTO, String>> getColumns() {
- final List<IColumn<AbstractTaskTO, String>> syncTaskscolumns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+ final List<IColumn<AbstractTaskTO, String>> syncTaskscolumns = new ArrayList<>();
syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("name", this, null), "name", "name"));
syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
@@ -70,9 +70,8 @@ public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
new StringResourceModel("nextExec", this, null), "nextExec", "nextExec"));
syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
-
- syncTaskscolumns.add(new JobColumn<AbstractTaskTO, String>(new StringResourceModel("", this, null, ""), "runtime",
- pageRef, restClient));
+ syncTaskscolumns.add(new JobColumn<AbstractTaskTO, String>(new StringResourceModel("", this, null, ""),
+ "runtime", pageRef, restClient));
syncTaskscolumns.add(
new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
@@ -141,13 +140,13 @@ public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
@Override
public Page createPage() {
- return new RoleTemplateModalPage(pageRef, window, taskTO);
+ return new GroupTemplateModalPage(pageRef, window, taskTO);
}
});
window.show(target);
}
- }, ActionLink.ActionType.ROLE_TEMPLATE, TASKS);
+ }, ActionLink.ActionType.GROUP_TEMPLATE, TASKS);
panel.add(new ActionLink() {
@@ -156,7 +155,7 @@ public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.startExecution(taskTO.getId(), false);
+ restClient.startExecution(taskTO.getKey(), false);
getSession().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -174,7 +173,7 @@ public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.startExecution(taskTO.getId(), true);
+ restClient.startExecution(taskTO.getKey(), true);
getSession().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -192,7 +191,7 @@ public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
@Override
public void onClick(final AjaxRequestTarget target) {
try {
- restClient.delete(taskTO.getId(), SyncTaskTO.class);
+ restClient.delete(taskTO.getKey(), SyncTaskTO.class);
info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
@@ -206,7 +205,7 @@ public class SyncTasksPanel extends AbstractSyncTasksPanel<SyncTaskTO> {
}
@Override
- public Component getHeader(String componentId) {
+ public Component getHeader(final String componentId) {
final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
panel.add(new ActionLink() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java b/client/old_console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java
index 9b8afdb..5cfe83f 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java
@@ -16,19 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.console.rest;
+package org.apache.syncope.client.console.rest;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.Response;
-import org.apache.syncope.common.services.ReportService;
-import org.apache.syncope.common.to.ReportTO;
-import org.apache.syncope.common.types.ReportExecExportFormat;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.common.to.ReportExecTO;
-import org.apache.syncope.common.types.JobAction;
-import org.apache.syncope.common.types.JobStatusType;
-import org.apache.syncope.common.wrap.ReportletConfClass;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.ReportExecExportFormat;
+import org.apache.syncope.common.lib.wrap.ReportletConfClass;
+import org.apache.syncope.common.lib.types.JobAction;
+import org.apache.syncope.common.lib.types.JobStatusType;
+import org.apache.syncope.common.rest.api.service.ReportService;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
import org.springframework.stereotype.Component;
@@ -73,7 +72,7 @@ public class ReportRestClient extends JobRestClient implements ExecutionRestClie
}
public void update(final ReportTO reportTO) {
- getService(ReportService.class).update(reportTO.getId(), reportTO);
+ getService(ReportService.class).update(reportTO.getKey(), reportTO);
}
/**
@@ -108,7 +107,8 @@ public class ReportRestClient extends JobRestClient implements ExecutionRestClie
public Response exportExecutionResult(final Long executionId, final ReportExecExportFormat fmt) {
return getService(ReportService.class).exportExecutionResult(executionId, fmt);
}
-
+
+
@Override
public boolean isJobRunning(final long reportId) {
for (ReportExecTO reportExecTO : getService(ReportService.class).listJobs(JobStatusType.RUNNING)) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java b/client/old_console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
index c83ce88..2b09630 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
@@ -16,28 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.console.rest;
+package org.apache.syncope.client.console.rest;
-import java.util.ArrayList;
import java.util.List;
-import org.apache.syncope.common.services.TaskService;
-import org.apache.syncope.common.reqres.BulkAction;
-import org.apache.syncope.common.reqres.BulkActionResult;
-import org.apache.syncope.common.wrap.JobClass;
-import org.apache.syncope.common.to.NotificationTaskTO;
-import org.apache.syncope.common.to.PropagationTaskTO;
-import org.apache.syncope.common.to.SchedTaskTO;
-import org.apache.syncope.common.wrap.SyncActionClass;
-import org.apache.syncope.common.to.SyncTaskTO;
-import org.apache.syncope.common.to.AbstractTaskTO;
-import org.apache.syncope.common.types.TaskType;
-import org.apache.syncope.common.util.CollectionWrapper;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.common.to.PushTaskTO;
-import org.apache.syncope.common.to.TaskExecTO;
-import org.apache.syncope.common.types.JobAction;
-import org.apache.syncope.common.types.JobStatusType;
-import org.apache.syncope.common.wrap.PushActionClass;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.NotificationTaskTO;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.PushTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.types.JobAction;
+import org.apache.syncope.common.lib.types.JobStatusType;
+import org.apache.syncope.common.rest.api.service.TaskService;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
import org.springframework.stereotype.Component;
@@ -49,42 +44,16 @@ public class TaskRestClient extends JobRestClient implements ExecutionRestClient
private static final long serialVersionUID = 6284485820911028843L;
- /**
- * Return a list of job classes.
- *
- * @return list of classes.
- */
public List<String> getJobClasses() {
- List<JobClass> jobClasses = null;
-
- try {
- jobClasses = new ArrayList<JobClass>(getService(TaskService.class).getJobClasses());
- } catch (SyncopeClientException e) {
- LOG.error("While getting all job classes", e);
- }
- return CollectionWrapper.unwrap(jobClasses);
+ return SyncopeSession.get().getSyncopeTO().getTaskJobs();
}
public List<String> getSyncActionsClasses() {
- List<SyncActionClass> actions = null;
-
- try {
- actions = new ArrayList<SyncActionClass>(getService(TaskService.class).getSyncActionsClasses());
- } catch (SyncopeClientException e) {
- LOG.error("While getting all sync actions classes", e);
- }
- return CollectionWrapper.unwrap(actions);
+ return SyncopeSession.get().getSyncopeTO().getSyncActions();
}
public List<String> getPushActionsClasses() {
- List<PushActionClass> actions = null;
-
- try {
- actions = new ArrayList<PushActionClass>(getService(TaskService.class).getPushActionsClasses());
- } catch (SyncopeClientException e) {
- LOG.error("While getting all sync actions classes", e);
- }
- return CollectionWrapper.unwrap(actions);
+ return SyncopeSession.get().getSyncopeTO().getPushActions();
}
/**
@@ -160,27 +129,29 @@ public class TaskRestClient extends JobRestClient implements ExecutionRestClient
}
public void updateSchedTask(final SchedTaskTO taskTO) {
- getService(TaskService.class).update(taskTO.getId(), taskTO);
+ getService(TaskService.class).update(taskTO.getKey(), taskTO);
}
public void updateSyncTask(final SyncTaskTO taskTO) {
- getService(TaskService.class).update(taskTO.getId(), taskTO);
+ getService(TaskService.class).update(taskTO.getKey(), taskTO);
}
public BulkActionResult bulkAction(final BulkAction action) {
return getService(TaskService.class).bulk(action);
}
-
+
@Override
- public boolean isJobRunning(final long taskId){
- for(TaskExecTO taskExecTO : getService(TaskService.class).listJobs(JobStatusType.RUNNING)){
- if(taskExecTO.getTask()== taskId) return true;
+ public boolean isJobRunning(final long taskId) {
+ for (TaskExecTO taskExecTO : getService(TaskService.class).listJobs(JobStatusType.RUNNING)) {
+ if (taskExecTO.getTask() == taskId) {
+ return true;
+ }
}
return false;
}
-
+
@Override
- public void startJob(final long taskId){
+ public void startJob(final long taskId) {
getService(TaskService.class).actionJob(taskId, JobAction.START);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/582eeb45/client/old_console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/JobColumn.java
----------------------------------------------------------------------
diff --git a/client/old_console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/JobColumn.java b/client/old_console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/JobColumn.java
index ba47421..4cca6bf 100644
--- a/client/old_console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/JobColumn.java
+++ b/client/old_console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/JobColumn.java
@@ -20,8 +20,8 @@ package org.apache.syncope.client.console.wicket.extensions.markup.html.repeater
import org.apache.syncope.client.console.panels.RuntimePanel;
import org.apache.syncope.client.console.rest.JobRestClient;
-import org.apache.syncope.common.to.AbstractTaskTO;
-import org.apache.syncope.common.to.ReportTO;
+import org.apache.syncope.common.lib.to.AbsractTaskTO;
+import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;