Return-Path: X-Original-To: apmail-syncope-commits-archive@www.apache.org Delivered-To: apmail-syncope-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 708B018208 for ; Fri, 20 Nov 2015 14:23:09 +0000 (UTC) Received: (qmail 32404 invoked by uid 500); 20 Nov 2015 14:23:09 -0000 Delivered-To: apmail-syncope-commits-archive@syncope.apache.org Received: (qmail 32374 invoked by uid 500); 20 Nov 2015 14:23:09 -0000 Mailing-List: contact commits-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list commits@syncope.apache.org Received: (qmail 32327 invoked by uid 99); 20 Nov 2015 14:23:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Nov 2015 14:23:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 31DCEE02D3; Fri, 20 Nov 2015 14:23:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mdisabatino@apache.org To: commits@syncope.apache.org Date: Fri, 20 Nov 2015 14:23:10 -0000 Message-Id: <2e113e6f39e2489893538fef911aa957@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] syncope git commit: [SYNCOPE-156] Added the management of AnyTypeClasses [SYNCOPE-156] Added the management of AnyTypeClasses Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/e6e2a471 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/e6e2a471 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/e6e2a471 Branch: refs/heads/master Commit: e6e2a4718f534240d97b64152b55041449f2ce90 Parents: 444182f Author: Marco Di Sabatino Di Diodoro Authored: Fri Nov 20 15:22:03 2015 +0100 Committer: Marco Di Sabatino Di Diodoro Committed: Fri Nov 20 15:22:14 2015 +0100 ---------------------------------------------------------------------- .../syncope/client/console/pages/BasePage.java | 8 +- .../syncope/client/console/pages/Schemas.java | 141 ------------- .../syncope/client/console/pages/Types.java | 202 +++++++++++++++++++ .../console/panels/AnyTypeClassDetails.java | 104 ++++++++++ .../console/panels/AnyTypeClassModalPanel.java | 87 ++++++++ .../console/panels/AnyTypeClassesPanel.java | 144 ++++++++++++- .../client/console/panels/AnyTypePanel.java | 33 +++ .../client/console/panels/SchemaModalPanel.java | 2 +- .../client/console/panels/SchemasPanel.java | 1 - .../markup/html/form/AjaxPalettePanel.java | 94 +++++++-- .../wicket/markup/html/form/NonI18nPalette.java | 11 + .../client/console/wizards/any/AuxClasses.java | 46 ++--- .../client/console/wizards/any/Resources.java | 37 ++-- .../client/console/wizards/any/Roles.java | 17 +- .../syncope/client/console/pages/BasePage.html | 2 +- .../syncope/client/console/pages/Schemas.html | 54 ----- .../client/console/pages/Schemas.properties | 18 -- .../client/console/pages/Schemas_it.properties | 18 -- .../console/pages/Schemas_pt_BR.properties | 18 -- .../syncope/client/console/pages/Types.html | 56 +++++ .../client/console/pages/Types.properties | 18 ++ .../client/console/pages/Types_it.properties | 18 ++ .../client/console/pages/Types_pt_BR.properties | 18 ++ .../console/panels/AnyTypeClassDetails.html | 57 ++++++ .../panels/AnyTypeClassDetails.properties | 20 ++ .../panels/AnyTypeClassDetails_it.properties | 20 ++ .../panels/AnyTypeClassDetails_pt_BR.properties | 20 ++ .../console/panels/AnyTypeClassModalPanel.html | 32 +++ .../console/panels/AnyTypeClassesPanel.html | 56 +++++ .../panels/AnyTypeClassesPanel.properties | 19 ++ .../panels/AnyTypeClassesPanel_it.properties | 19 ++ .../panels/AnyTypeClassesPanel_pt_BR.properties | 19 ++ 32 files changed, 1085 insertions(+), 324 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java index 16c7151..f77233e 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java @@ -84,11 +84,11 @@ public class BasePage extends AbstractBasePage implements IAjaxIndicatorAware { WebMarkupContainer confULContainer = new WebMarkupContainer(getULContainerId("configuration")); confLIContainer.add(confULContainer); - liContainer = new WebMarkupContainer(getLIContainerId("schemas")); + liContainer = new WebMarkupContainer(getLIContainerId("types")); confULContainer.add(liContainer); - BookmarkablePageLink schemaLink = new BookmarkablePageLink<>("schemas", Schemas.class); -// MetaDataRoleAuthorizationStrategy.authorize(schemaLink, WebPage.ENABLE, StandardEntitlement.SCHEMA_LIST); - liContainer.add(schemaLink); + BookmarkablePageLink typesLink = new BookmarkablePageLink<>("types", Types.class); + MetaDataRoleAuthorizationStrategy.authorize(typesLink, WebPage.ENABLE, StandardEntitlement.SCHEMA_LIST); + liContainer.add(typesLink); liContainer = new WebMarkupContainer(getLIContainerId("workflow")); confULContainer.add(liContainer); http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/pages/Schemas.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Schemas.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Schemas.java deleted file mode 100644 index 0e8b408..0000000 --- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Schemas.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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.syncope.client.console.pages; - -import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel; -import java.util.ArrayList; -import java.util.List; -import org.apache.syncope.client.console.SyncopeConsoleSession; -import org.apache.syncope.client.console.commons.Constants; -import org.apache.syncope.client.console.panels.SchemasPanel; -import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink; -import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal; -import org.apache.syncope.common.lib.to.AbstractSchemaTO; -import org.apache.wicket.PageReference; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.markup.html.AjaxLink; -import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy; -import org.apache.wicket.extensions.markup.html.tabs.AbstractTab; -import org.apache.wicket.extensions.markup.html.tabs.ITab; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.panel.EmptyPanel; -import org.apache.wicket.markup.html.panel.Panel; -import org.apache.wicket.model.Model; -import org.apache.wicket.model.ResourceModel; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.syncope.client.console.panels.SchemaModalPanel; -import org.apache.syncope.common.lib.types.StandardEntitlement; -import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; - -public class Schemas extends BasePage { - - private static final long serialVersionUID = 8091922398776299403L; - - private final BaseModal modal; - - public Schemas(final PageParameters parameters) { - super(parameters); - - this.modal = new BaseModal<>("modal"); - - final WebMarkupContainer content = new WebMarkupContainer("content"); - content.add(new Label("header", "AnyTypeClasses/Schemas")); - content.setOutputMarkupId(true); - content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList(getPageReference()))); - content.add(buildCreateSchemaLink()); - add(content); - - modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { - - private static final long serialVersionUID = 8804221891699487139L; - - @Override - public void onClose(final AjaxRequestTarget target) { - target.add(); - modal.show(false); - - if (((AbstractBasePage) Schemas.this.getPage()).isModalResult()) { - info(getString(Constants.OPERATION_SUCCEEDED)); - feedbackPanel.refresh(target); - ((AbstractBasePage) Schemas.this.getPage()).setModalResult(false); - } - } - }); - - add(modal); - - } - - private List buildTabList(final PageReference pageReference) { - - final List tabs = new ArrayList<>(); - - tabs.add(new AbstractTab(new Model<>("AnyTypeClasses")) { - - private static final long serialVersionUID = -6815067322125799251L; - - @Override - public Panel getPanel(final String panelId) { -// final AnyTypeClassesPanel objectClassesPanel = -// new AnyTypeClassesPanel(panelId, getPageReference(), false); -// objectClassesPanel.setEnabled(false); -// return objectClassesPanel; - return new EmptyPanel(panelId); - } - }); - - tabs.add(new AbstractTab(new Model<>("Schemas")) { - - private static final long serialVersionUID = -6815067322125799251L; - - @Override - public Panel getPanel(final String panelId) { - return new SchemasPanel(panelId, getPageReference(), modal); - } - }); - - return tabs; - } - - private AjaxLink buildCreateSchemaLink() { - - final AjaxLink createLink = new ClearIndicatingAjaxLink("createSchemaLink", getPageReference()) { - - private static final long serialVersionUID = -7978723352517770644L; - - @Override - protected void onClickInternal(final AjaxRequestTarget target) { - modal.header(new ResourceModel("createSchema")); - - final SchemaModalPanel panel = new SchemaModalPanel(modal, getPageReference(), true); - - target.add(modal.setContent(panel)); - modal.addSumbitButton(); - modal.show(true); - } - }; - - if (SyncopeConsoleSession.get().owns(StandardEntitlement.SCHEMA_CREATE)) { - MetaDataRoleAuthorizationStrategy.authorize(createLink, ENABLE, StandardEntitlement.SCHEMA_CREATE); - } - - return createLink; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/pages/Types.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Types.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Types.java new file mode 100644 index 0000000..8c710b7 --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Types.java @@ -0,0 +1,202 @@ +/* + * 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.syncope.client.console.pages; + +import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel; +import java.util.ArrayList; +import java.util.List; +import org.apache.syncope.client.console.SyncopeConsoleSession; +import org.apache.syncope.client.console.commons.Constants; +import org.apache.syncope.client.console.panels.AnyTypeClassModalPanel; +import org.apache.syncope.client.console.panels.AnyTypeClassesPanel; +import org.apache.syncope.client.console.panels.ModalPanel; +import org.apache.syncope.client.console.panels.SchemasPanel; +import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink; +import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal; +import org.apache.syncope.common.lib.to.AbstractSchemaTO; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy; +import org.apache.wicket.extensions.markup.html.tabs.AbstractTab; +import org.apache.wicket.extensions.markup.html.tabs.ITab; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.ResourceModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.syncope.client.console.panels.SchemaModalPanel; +import org.apache.syncope.common.lib.to.AnyTypeClassTO; +import org.apache.syncope.common.lib.to.AnyTypeTO; +import org.apache.syncope.common.lib.to.PlainSchemaTO; +import org.apache.syncope.common.lib.types.StandardEntitlement; +import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; +import org.apache.wicket.markup.html.panel.EmptyPanel; + +public class Types extends BasePage { + + private static final long serialVersionUID = 8091922398776299403L; + + private final BaseModal schemaModal; + + private final BaseModal anyTypeClassModal; + + private final BaseModal anyTypeModal; + + private final AjaxBootstrapTabbedPanel tabbedPanel; + + private enum Type { + SCHEMA, + ANYTYPECLASS, + ANYTYPE, + RELATIONSHIPTYPE; + } + + public Types(final PageParameters parameters) { + super(parameters); + + this.schemaModal = new BaseModal<>("schemaModal"); + this.anyTypeClassModal = new BaseModal<>("anyTypeClassModal"); + this.anyTypeModal = new BaseModal<>("anyTypeModal"); + + final WebMarkupContainer content = new WebMarkupContainer("content"); + content.add(new Label("header", "Types")); + content.setOutputMarkupId(true); + tabbedPanel = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()); + content.add(tabbedPanel); + + final AjaxLink createSchemaLink = + buildCreateLink("createSchema", schemaModal, Type.SCHEMA); + content.add(createSchemaLink); + + if (SyncopeConsoleSession.get().owns(StandardEntitlement.SCHEMA_CREATE)) { + MetaDataRoleAuthorizationStrategy.authorize(createSchemaLink, ENABLE, StandardEntitlement.SCHEMA_CREATE); + } + + final AjaxLink createAnyTypeClassLink = + buildCreateLink("createAnyTypeClass", anyTypeClassModal, Type.ANYTYPECLASS); + content.add(createAnyTypeClassLink); + + if (SyncopeConsoleSession.get().owns(StandardEntitlement.ANYTYPECLASS_CREATE)) { + MetaDataRoleAuthorizationStrategy.authorize( + createSchemaLink, ENABLE, StandardEntitlement.ANYTYPECLASS_CREATE); + } + + add(content); + addWindowWindowClosedCallback(schemaModal); + addWindowWindowClosedCallback(anyTypeClassModal); + addWindowWindowClosedCallback(anyTypeModal); + add(schemaModal); + add(anyTypeClassModal); + add(anyTypeModal); + } + + private List buildTabList() { + + final List tabs = new ArrayList<>(); + + tabs.add(new AbstractTab(new Model<>("AnyTypes")) { + + private static final long serialVersionUID = -6815067322125799251L; + + @Override + public Panel getPanel(final String panelId) { + //return new AnyTypePanel(panelId, getPageReference(), anyTypeModal); + return new EmptyPanel(panelId); + } + }); + + tabs.add(new AbstractTab(new Model<>("AnyTypeClasses")) { + + private static final long serialVersionUID = -6815067322125799251L; + + @Override + public Panel getPanel(final String panelId) { + return new AnyTypeClassesPanel(panelId, getPageReference(), anyTypeClassModal); + } + }); + + tabs.add(new AbstractTab(new Model<>("Schemas")) { + + private static final long serialVersionUID = -6815067322125799251L; + + @Override + public Panel getPanel(final String panelId) { + return new SchemasPanel(panelId, getPageReference(), schemaModal); + } + }); + + return tabs; + } + + private AjaxLink buildCreateLink(final String label, final BaseModal modal, final Type type) { + + final AjaxLink createLink = new ClearIndicatingAjaxLink(label, getPageReference()) { + + private static final long serialVersionUID = -7978723352517770644L; + + @Override + protected void onClickInternal(final AjaxRequestTarget target) { + modal.header(new ResourceModel(label)); + target.add(modal.setContent(buildModalPanel(type))); + modal.addSumbitButton(); + modal.show(true); + } + }; + + return createLink; + } + + private ModalPanel buildModalPanel(final Type type) { + final ModalPanel panel; + switch (type) { + case ANYTYPECLASS: + anyTypeClassModal.setFormModel(new AnyTypeClassTO()); + panel = new AnyTypeClassModalPanel(anyTypeClassModal, getPageReference(), true); + break; + case ANYTYPE: + case RELATIONSHIPTYPE: + case SCHEMA: + default: + schemaModal.setFormModel(new PlainSchemaTO()); + panel = new SchemaModalPanel(schemaModal, getPageReference(), true); + } + return panel; + } + + private void addWindowWindowClosedCallback(final BaseModal modal) { + modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { + + private static final long serialVersionUID = 8804221891699487139L; + + @Override + public void onClose(final AjaxRequestTarget target) { + tabbedPanel.setSelectedTab(tabbedPanel.getSelectedTab()); + target.add(tabbedPanel); + modal.show(false); + + if (((AbstractBasePage) Types.this.getPage()).isModalResult()) { + info(getString(Constants.OPERATION_SUCCEEDED)); + feedbackPanel.refresh(target); + ((AbstractBasePage) Types.this.getPage()).setModalResult(false); + } + } + }); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassDetails.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassDetails.java new file mode 100644 index 0000000..1b0206e --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassDetails.java @@ -0,0 +1,104 @@ +/* + * 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.syncope.client.console.panels; + +import java.util.List; +import org.apache.syncope.client.console.SyncopeConsoleSession; +import org.apache.syncope.client.console.rest.SchemaRestClient; +import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel; +import org.apache.syncope.common.lib.to.AnyTypeClassTO; +import org.apache.syncope.common.rest.api.service.AnyTypeClassService; +import org.apache.wicket.markup.html.TransparentWebMarkupContainer; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.model.util.ListModel; + +public class AnyTypeClassDetails extends Panel { + + private static final long serialVersionUID = 3321861543207340469L; + + private final AnyTypeClassTO anyTypeClassTO; + + private final SchemaRestClient schemaRestClient = new SchemaRestClient(); + + private final List availablePlainSchemas = schemaRestClient.getPlainSchemaNames(); + + private final List availableDerSchemas = schemaRestClient.getDerSchemaNames(); + + private final List availableVirSchemas = schemaRestClient.getVirSchemaNames(); + + public AnyTypeClassDetails(final String id, + final AnyTypeClassTO anyTypeClassTO, final boolean edit) { + super(id); + + this.anyTypeClassTO = anyTypeClassTO; + buildAvailableSchemas(anyTypeClassTO.getKey()); + + final TransparentWebMarkupContainer container = new TransparentWebMarkupContainer("container"); + container.setOutputMarkupId(true); + add(container); + + final AjaxPalettePanel plainSchema = + new AjaxPalettePanel.Builder() + .setAllowOrder(true) + .setAllowMoveAll(true) + .build("plainSchemas", + new PropertyModel>(this.anyTypeClassTO, "plainSchemas"), + new ListModel<>(availablePlainSchemas)); + + plainSchema.setOutputMarkupId(true); + plainSchema.setEnabled(edit); + container.add(plainSchema); + + final AjaxPalettePanel derSchema = + new AjaxPalettePanel.Builder() + .setAllowOrder(true) + .setAllowMoveAll(true) + .build("derSchemas", + new PropertyModel>(this.anyTypeClassTO, "derSchemas"), + new ListModel<>(availableDerSchemas)); + + derSchema.setOutputMarkupId(true); + derSchema.setEnabled(edit); + container.add(derSchema); + + final AjaxPalettePanel virSchema = + new AjaxPalettePanel.Builder() + .setAllowOrder(true) + .setAllowMoveAll(true) + .build("virSchemas", + new PropertyModel>(this.anyTypeClassTO, "virSchemas"), + new ListModel<>(availableVirSchemas)); + + virSchema.setOutputMarkupId(true); + virSchema.setEnabled(edit); + container.add(virSchema); + } + + private void buildAvailableSchemas(final String key) { + + for (AnyTypeClassTO item : SyncopeConsoleSession.get().getService(AnyTypeClassService.class).list()) { + if (key == null || !item.getKey().equals(key)) { + availablePlainSchemas.removeAll(item.getPlainSchemas()); + availableDerSchemas.removeAll(item.getDerSchemas()); + availableVirSchemas.removeAll(item.getVirSchemas()); + } + } + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.java new file mode 100644 index 0000000..6df508f --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.java @@ -0,0 +1,87 @@ +/* + * 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.syncope.client.console.panels; + +import org.apache.syncope.client.console.SyncopeConsoleSession; +import org.apache.syncope.client.console.commons.Constants; +import org.apache.syncope.client.console.pages.AbstractBasePage; +import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal; +import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel; +import org.apache.syncope.common.lib.to.AnyTypeClassTO; +import org.apache.syncope.common.rest.api.service.AnyTypeClassService; +import org.apache.wicket.PageReference; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.model.CompoundPropertyModel; +import org.apache.wicket.model.PropertyModel; + +public class AnyTypeClassModalPanel extends AbstractModalPanel { + + private static final long serialVersionUID = 1086997609984272599L; + + private final AnyTypeClassTO anyTypeClassTO; + + private final boolean createFlag; + + public AnyTypeClassModalPanel( + final BaseModal modal, + final PageReference pageRef, + final boolean createFlag) { + super(modal, pageRef); + + this.anyTypeClassTO = modal.getFormModel(); + this.createFlag = createFlag; + + final Form antTypeClassForm = new Form<>("form"); + antTypeClassForm.setModel(new CompoundPropertyModel<>(anyTypeClassTO)); + antTypeClassForm.setOutputMarkupId(true); + + final AjaxTextFieldPanel key = + new AjaxTextFieldPanel("key", getString("key"), new PropertyModel(anyTypeClassTO, "key")); + key.addRequiredLabel(); + key.setEnabled(anyTypeClassTO.getKey() == null || anyTypeClassTO.getKey().isEmpty()); + antTypeClassForm.add(key); + + antTypeClassForm.add(new AnyTypeClassDetails("details", anyTypeClassTO, true)); + add(antTypeClassForm); + } + + @Override + public void onSubmit(final AjaxRequestTarget target, final Form form) { + + try { + final AnyTypeClassTO updatedAnyTypeClassTO = AnyTypeClassTO.class.cast(form.getModelObject()); + + if (createFlag) { + SyncopeConsoleSession.get().getService(AnyTypeClassService.class).create(updatedAnyTypeClassTO); + } else { + SyncopeConsoleSession.get().getService(AnyTypeClassService.class).update(updatedAnyTypeClassTO); + } + + if (pageRef.getPage() instanceof AbstractBasePage) { + ((AbstractBasePage) pageRef.getPage()).setModalResult(true); + } + modal.close(target); + } catch (Exception e) { + LOG.error("While creating or updating AnyTypeClass", e); + error(getString(Constants.ERROR) + ": " + e.getMessage()); + modal.getFeedbackPanel().refresh(target); + } + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java index 2d1c07f..28a9fab 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java @@ -18,15 +18,155 @@ */ package org.apache.syncope.client.console.panels; +import java.io.Serializable; +import java.util.List; +import org.apache.syncope.client.console.SyncopeConsoleSession; +import org.apache.syncope.client.console.commons.Constants; +import org.apache.syncope.client.console.pages.AbstractBasePage; +import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal; +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.to.AnyTypeClassTO; +import org.apache.syncope.common.lib.types.StandardEntitlement; +import org.apache.syncope.common.rest.api.service.AnyTypeClassService; import org.apache.wicket.PageReference; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.ListChoice; import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class AnyTypeClassesPanel extends Panel { private static final long serialVersionUID = -2356760296223908382L; - public AnyTypeClassesPanel(final String id, final PageReference pageReference, final boolean unwraped) { + private static final Logger LOG = LoggerFactory.getLogger(AnyTypeClassesPanel.class); + + private final ListChoice anyTypeClasses; + + private AnyTypeClassDetails anyTypeClassesDetails; + + public AnyTypeClassesPanel(final String id, final PageReference pageRef, final BaseModal modal) { super(id); + + this.setOutputMarkupId(true); + + final WebMarkupContainer container = new WebMarkupContainer("container"); + container.setOutputMarkupId(true); + add(container); + + anyTypeClasses = new ListChoice( + "anyTypeClasses", new Model(), + SyncopeConsoleSession.get().getService(AnyTypeClassService.class).list()) { + + private static final long serialVersionUID = 4022366881854379834L; + + @Override + protected CharSequence getDefaultChoice(final String selectedValue) { + return null; + } + }; + + anyTypeClasses.setChoiceRenderer(new IChoiceRenderer() { + + private static final long serialVersionUID = 1048000918946220007L; + + @Override + public Object getDisplayValue(final AnyTypeClassTO object) { + return object.getKey(); + } + + @Override + public String getIdValue(final AnyTypeClassTO object, final int index) { + return object.getKey(); + } + + @Override + public AnyTypeClassTO getObject(final String id, + final IModel> choices) { + for (AnyTypeClassTO item : choices.getObject()) { + if (item.getKey().equals(id)) { + return item; + } + } + return null; + } + }); + + anyTypeClasses.setNullValid(true); + container.add(anyTypeClasses); + + updateAnyTypeClassDetails(new AnyTypeClassTO(), false); + container.add(anyTypeClassesDetails); + + anyTypeClasses.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { + + private static final long serialVersionUID = -1107858522700306810L; + + @Override + protected void onUpdate(final AjaxRequestTarget target) { + updateAnyTypeClassDetails(anyTypeClasses.getModelObject(), true); + container.addOrReplace(anyTypeClassesDetails); + target.add(container); + } + }); + + final ActionLinksPanel.Builder actionLinks = ActionLinksPanel.builder(pageRef); + actionLinks.setDisableIndicator(true); + actionLinks.addWithRoles(new ActionLink() { + + private static final long serialVersionUID = -3722207913631435501L; + + @Override + public void onClick(final AjaxRequestTarget target, final Serializable ignore) { + if (anyTypeClasses != null && anyTypeClasses.getModelObject() != null) { + modal.header(Model.of(anyTypeClasses.getModelObject().getKey())); + modal.setFormModel(anyTypeClasses.getModelObject()); + modal.addSumbitButton(); + modal.show(true); + target.add(modal.setContent(new AnyTypeClassModalPanel(modal, pageRef, false))); + } + } + }, ActionLink.ActionType.EDIT, StandardEntitlement.ANYTYPECLASS_UPDATE).addWithRoles( + new ActionLink() { + + private static final long serialVersionUID = -3722207913631435501L; + + @Override + public void onClick(final AjaxRequestTarget target, final Serializable ignore) { + try { + if (anyTypeClasses != null && anyTypeClasses.getModelObject() != null) { + SyncopeConsoleSession.get() + .getService(AnyTypeClassService.class).delete(anyTypeClasses.getModelObject().getKey()); + anyTypeClasses.setModelObject(null); + anyTypeClasses.setChoices(SyncopeConsoleSession.get().getService(AnyTypeClassService.class). + list()); + target.add(anyTypeClasses); + target.add(updateAnyTypeClassDetails(new AnyTypeClassTO(), true)); + info(getString(Constants.OPERATION_SUCCEEDED)); + } + } catch (Exception e) { + LOG.error("While deleting AnyTypeClass", e); + error(getString(Constants.ERROR) + ": " + e.getMessage()); + } + ((AbstractBasePage) pageRef.getPage()).getFeedbackPanel().refresh(target); + } + }, ActionLink.ActionType.DELETE, StandardEntitlement.ANYTYPECLASS_DELETE); + + container.add(actionLinks.build("editRemove")); + } + + private Panel updateAnyTypeClassDetails(final AnyTypeClassTO anyTypeClassTO, final boolean visible) { + anyTypeClassesDetails = new AnyTypeClassDetails("anyTypeClassesDetails", anyTypeClassTO, false); + anyTypeClassesDetails.setOutputMarkupId(true); + anyTypeClassesDetails.setOutputMarkupPlaceholderTag(true); + anyTypeClassesDetails.setVisible(visible); + anyTypeClassesDetails.setEnabled(false); + return anyTypeClassesDetails; } - } http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java new file mode 100644 index 0000000..bbf73a7 --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java @@ -0,0 +1,33 @@ +/* + * 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.syncope.client.console.panels; + +import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal; +import org.apache.syncope.common.lib.to.AnyTypeTO; +import org.apache.wicket.PageReference; +import org.apache.wicket.markup.html.panel.Panel; + +public class AnyTypePanel extends Panel { + + private static final long serialVersionUID = 3905038169553185171L; + + public AnyTypePanel(final String id, final PageReference pageReference, final BaseModal modal) { + super(id); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java index 2f589cc..f822471 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java @@ -90,7 +90,7 @@ public class SchemaModalPanel extends AbstractModalPanel { if (createFlag) { try { - Class schemaTOClass = schemaType.getToClass(); + final Class schemaTOClass = schemaType.getToClass(); modal.setFormModel((AbstractSchemaTO) schemaTOClass.newInstance()); } catch (InstantiationException | IllegalAccessException ex) { LOG.error("SchemaType not found", ex); http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemasPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemasPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemasPanel.java index a449044..6792b9c 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemasPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemasPanel.java @@ -121,7 +121,6 @@ public class SchemasPanel extends Panel { final Collapsible collapsible = new Collapsible("collapsePanel", buildTabList()); collapsible.setOutputMarkupId(true); add(collapsible); - } private List buildTabList() { http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java index bb86e7f..33b04da 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java @@ -18,11 +18,15 @@ */ package org.apache.syncope.client.console.wicket.markup.html.form; +import java.io.Serializable; import java.util.Collection; import java.util.List; +import org.apache.wicket.Component; import org.apache.wicket.extensions.markup.html.form.palette.Palette; +import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.model.IModel; +import org.apache.wicket.model.ResourceModel; import org.apache.wicket.model.util.ListModel; public class AjaxPalettePanel extends AbstractFieldPanel> { @@ -31,30 +35,38 @@ public class AjaxPalettePanel extends AbstractFieldPanel> { protected final Palette palette; - public AjaxPalettePanel(final String id, final IModel> model, final ListModel choices) { - this(id, model, choices, false); - } - - public AjaxPalettePanel(final String id, final IModel> model, final ListModel choices, - final boolean allowOrder) { - - this(id, model, choices, new SelectChoiceRenderer(), allowOrder, false); - } - - public AjaxPalettePanel(final String id, final IModel> model, final ListModel choices, - final IChoiceRenderer renderer, final boolean allowOrder, final boolean allowMoveAll) { + public AjaxPalettePanel(final String id, + final IModel> model, final ListModel choices, + final IChoiceRenderer renderer, final boolean allowOrder, + final boolean allowMoveAll, final String availableLabel, final String selectedLabel) { super(id, id, model); - this.palette = createPalette(model, choices, renderer, allowOrder, allowMoveAll); + this.palette = createPalette(model, choices, renderer, allowOrder, allowMoveAll, availableLabel, selectedLabel); add(palette.setOutputMarkupId(true)); setOutputMarkupId(true); } - protected final Palette createPalette(final IModel> model, final ListModel choices, - final IChoiceRenderer renderer, final boolean allowOrder, final boolean allowMoveAll) { + protected final Palette createPalette( + final IModel> model, final ListModel choices, + final IChoiceRenderer renderer, + final boolean allowOrder, final boolean allowMoveAll, + final String availableLabel, final String selectedLabel) { + + return new NonI18nPalette("paletteField", model, choices, renderer, 8, allowOrder, allowMoveAll) { - return new NonI18nPalette<>("paletteField", model, choices, renderer, 8, allowOrder, allowMoveAll); + private static final long serialVersionUID = -3074655279011678437L; + + @Override + protected Component newAvailableHeader(final String componentId) { + return new Label(componentId, new ResourceModel("palette.available", availableLabel)); + } + + @Override + protected Component newSelectedHeader(final String componentId) { + return new Label(componentId, new ResourceModel("palette.selected", selectedLabel)); + } + }; } @Override @@ -66,4 +78,54 @@ public class AjaxPalettePanel extends AbstractFieldPanel> { public Collection getModelCollection() { return palette.getModelCollection(); } + + public static class Builder { + + private IChoiceRenderer renderer; + + private boolean allowOrder; + + private boolean allowMoveAll; + + private String selectedLabel; + + private String availableLabel; + + public Builder() { + this.allowMoveAll = false; + this.allowOrder = false; + this.renderer = new SelectChoiceRenderer<>(); + } + + public Builder setAllowOrder(final boolean allowOrder) { + this.allowOrder = allowOrder; + return this; + } + + public Builder setAllowMoveAll(final boolean allowMoveAll) { + this.allowMoveAll = allowMoveAll; + return this; + } + + public Builder setSelectedLabel(final String selectedLabel) { + this.selectedLabel = selectedLabel; + return this; + } + + public Builder setAvailableLabel(final String availableLabel) { + this.availableLabel = availableLabel; + return this; + } + + public Builder setRenderer(final IChoiceRenderer renderer) { + this.renderer = renderer; + return this; + } + + public AjaxPalettePanel build( + final String id, final IModel> model, final ListModel choices) { + return new AjaxPalettePanel<>(id, model, + choices, renderer, allowOrder, allowMoveAll, availableLabel, selectedLabel); + } + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java index 3a923d5..b705f59 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java @@ -19,6 +19,7 @@ package org.apache.syncope.client.console.wicket.markup.html.form; import java.util.Collection; +import org.apache.wicket.Component; import org.apache.wicket.extensions.markup.html.form.palette.Palette; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.model.IModel; @@ -40,4 +41,14 @@ public class NonI18nPalette extends Palette { protected boolean localizeDisplayValues() { return false; } + + @Override + protected Component newAvailableHeader(final String componentId) { + return super.newAvailableHeader(componentId); + } + + @Override + protected Component newSelectedHeader(final String componentId) { + return super.newSelectedHeader(componentId); + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java index e63a70e..6e612b6 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java @@ -61,16 +61,17 @@ public class AuxClasses extends WizardStep { ? UserTO.class.cast(entityTO).getMemberships() : AnyObjectTO.class.cast(entityTO).getMemberships(); - fragment.add(new AjaxPalettePanel<>( - "groups", - new ListModel(CollectionUtils.collect(memberships, + fragment.add(new AjaxPalettePanel.Builder().setAllowOrder(true) + .build( + "groups", + new ListModel(CollectionUtils.collect(memberships, new Transformer() { - @Override - public String transform(final MembershipTO input) { - return String.format("[%d] %s", input.getRightKey(), input.getGroupName()); - } - }, new ArrayList())) { + @Override + public String transform(final MembershipTO input) { + return String.format("[%d] %s", input.getRightKey(), input.getGroupName()); + } + }, new ArrayList())) { private static final long serialVersionUID = 1L; @@ -94,38 +95,37 @@ public class AuxClasses extends WizardStep { } return new MembershipTO.Builder().left(entityTO.getType(), entityTO.getKey()). - group(groupKey, groupName).build(); + group(groupKey, groupName).build(); } }, memberships); } }, - new ListModel<>(CollectionUtils.collect(groupRestClient.list( - entityTO.getRealm(), -1, -1, new SortParam<>("name", true), null), + new ListModel<>(CollectionUtils.collect(groupRestClient.list( + entityTO.getRealm(), -1, -1, new SortParam<>("name", true), null), new Transformer() { - @Override - public String transform(final GroupTO input) { - return String.format("[%d] %s", input.getKey(), input.getName()); - } - }, new ArrayList())), - true).setOutputMarkupId(true)); + @Override + public String transform(final GroupTO input) { + return String.format("[%d] %s", input.getKey(), input.getName()); + } + }, new ArrayList()))).setOutputMarkupId(true)); } add(fragment); final List current = Arrays.asList(anyTypeClass); - final List choices = new ArrayList(); + final List choices = new ArrayList<>(); for (AnyTypeClassTO aux : AnyTypeRestClient.getAllAnyTypeClass()) { if (!current.contains(aux.getKey())) { choices.add(aux.getKey()); } } - add(new AjaxPalettePanel<>( - "auxClasses", - new PropertyModel>(entityTO, "auxClasses"), - new ListModel<>(choices), - true).setOutputMarkupId(true)); + add(new AjaxPalettePanel.Builder(). + setAllowOrder(true) + .build("auxClasses", + new PropertyModel>(entityTO, "auxClasses"), + new ListModel<>(choices)).setOutputMarkupId(true)); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java index 8f9a362..86ad35f 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java @@ -37,30 +37,29 @@ public class Resources extends WizardStep { public Resources(final T entityTO) { this.setOutputMarkupId(true); - add(new AjaxPalettePanel<>("resources", + add(new AjaxPalettePanel.Builder().build("resources", new PropertyModel>(entityTO, "resources") { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Override - public List getObject() { - return new ArrayList<>(entityTO.getResources()); - } + @Override + public List getObject() { + return new ArrayList<>(entityTO.getResources()); + } + + @Override + public void setObject(final List object) { + entityTO.getResources().clear(); + entityTO.getResources().addAll(object); + } + }, new ListModel<>(CollectionUtils.collect( + ResourceRestClient.getAll(), + new Transformer() { @Override - public void setObject(final List object) { - entityTO.getResources().clear(); - entityTO.getResources().addAll(object); + public String transform(final ResourceTO input) { + return input.getKey(); } - }, - new ListModel<>(CollectionUtils.collect( - ResourceRestClient.getAll(), - new Transformer() { - - @Override - public String transform(final ResourceTO input) { - return input.getKey(); - } - }, new ArrayList()))).setOutputMarkupId(true)); + }, new ArrayList()))).setOutputMarkupId(true)); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java index 179783a..e5f500b 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java @@ -38,16 +38,17 @@ public class Roles extends WizardStep { public Roles(final UserTO entityTO) { this.setOutputMarkupId(true); - add(new AjaxPalettePanel<>("roles", - new PropertyModel>(entityTO, "roles"), - new ListModel<>(CollectionUtils.collect( + add(new AjaxPalettePanel.Builder() + .build("roles", + new PropertyModel>(entityTO, "roles"), + new ListModel<>(CollectionUtils.collect( RoleRestClient.getAll(), new Transformer() { - @Override - public String transform(final RoleTO input) { - return input.getKey(); - } - }, new ArrayList()))).setOutputMarkupId(true)); + @Override + public String transform(final RoleTO input) { + return input.getKey(); + } + }, new ArrayList()))).setOutputMarkupId(true)); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html index 755a846..243ee5f 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html @@ -116,7 +116,7 @@ under the License.
  • Workflow
  • Logs
  • Layouts
  • -
  • +
  • Notifications
  • http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.html deleted file mode 100644 index d16dd64..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - -
    -
    -
    -
    -

    - -

    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.properties deleted file mode 100644 index 9defe37..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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. -createSchema=Create new schema -createAnyTypeClass=Create new AnyTypeClass http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_it.properties deleted file mode 100644 index e9994ec..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_it.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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. -createSchema=Crea un nuovo schema -createAnyTypeClass=Crea un nuovo AnyTypeClass http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_pt_BR.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_pt_BR.properties deleted file mode 100644 index 1d42eb5..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schemas_pt_BR.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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. -createSchema=Cria um novo schema -createAnyTypeClass=Cria um novo AnyTypeClass http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.html new file mode 100644 index 0000000..3dc2364 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.html @@ -0,0 +1,56 @@ + + + + +
    +
    +
    +
    +

    + +

    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.properties new file mode 100644 index 0000000..9defe37 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types.properties @@ -0,0 +1,18 @@ +# 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. +createSchema=Create new schema +createAnyTypeClass=Create new AnyTypeClass http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_it.properties new file mode 100644 index 0000000..e9994ec --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_it.properties @@ -0,0 +1,18 @@ +# 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. +createSchema=Crea un nuovo schema +createAnyTypeClass=Crea un nuovo AnyTypeClass http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_pt_BR.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_pt_BR.properties new file mode 100644 index 0000000..1d42eb5 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Types_pt_BR.properties @@ -0,0 +1,18 @@ +# 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. +createSchema=Cria um novo schema +createAnyTypeClass=Cria um novo AnyTypeClass http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.html new file mode 100644 index 0000000..cfa9d7e --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.html @@ -0,0 +1,57 @@ + + + + + + +
    +
    +

    +
    +
    +
    + [plainSchemas] +
    +
    +
    +
    +
    +

    +
    +
    +
    + [derSchemas] +
    +
    +
    +
    +
    +

    +
    +
    +
    + [virSchemas] +
    +
    +
    +
    +
    + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.properties new file mode 100644 index 0000000..835d123 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails.properties @@ -0,0 +1,20 @@ +# 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. + +plainSchemas=Plain Schemas +derSchemas=Derived Schemas +virSchemas=Virtual Schemas http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_it.properties new file mode 100644 index 0000000..835d123 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_it.properties @@ -0,0 +1,20 @@ +# 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. + +plainSchemas=Plain Schemas +derSchemas=Derived Schemas +virSchemas=Virtual Schemas http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_pt_BR.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_pt_BR.properties new file mode 100644 index 0000000..835d123 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassDetails_pt_BR.properties @@ -0,0 +1,20 @@ +# 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. + +plainSchemas=Plain Schemas +derSchemas=Derived Schemas +virSchemas=Virtual Schemas http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.html new file mode 100644 index 0000000..ea82eb3 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassModalPanel.html @@ -0,0 +1,32 @@ + + + +
    +
    +
    + [key] +
    +
    + [details] +
    +
    +
    +
    + http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.html new file mode 100644 index 0000000..0fec0c7 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.html @@ -0,0 +1,56 @@ + + + + + + + +
    +
    +
    +

    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + [anyTypeClassesDetails] +
    +
    +
    + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.properties new file mode 100644 index 0000000..6438ab9 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.properties @@ -0,0 +1,19 @@ +# 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. +select=Select + +anyTypeClasses=AnyTypeClasses http://git-wip-us.apache.org/repos/asf/syncope/blob/e6e2a471/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel_it.properties new file mode 100644 index 0000000..8b1b519 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnyTypeClassesPanel_it.properties @@ -0,0 +1,19 @@ +# 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. +select=Seleziona + +anyTypeClasses=AnyTypeClasses