http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/java/org/apache/syncope/client/console/panels/Resources.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/Resources.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/Resources.java deleted file mode 100644 index 755b2d1..0000000 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/Resources.java +++ /dev/null @@ -1,485 +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.panels; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import org.apache.syncope.client.console.PreferenceManager; -import org.apache.syncope.client.console.commons.Constants; -import org.apache.syncope.client.console.commons.SortableDataProviderComparator; -import org.apache.syncope.client.console.pages.BasePage; -import org.apache.syncope.client.console.pages.ConnectorModalPage; -import org.apache.syncope.client.console.pages.ProvisioningModalPage; -import org.apache.syncope.client.console.pages.ResourceModalPage; -import org.apache.syncope.client.console.rest.ConnectorRestClient; -import org.apache.syncope.client.console.rest.ResourceRestClient; -import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink; -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.client.console.wicket.markup.html.form.LinkPanel; -import org.apache.syncope.common.lib.SyncopeClientException; -import org.apache.syncope.common.lib.to.ResourceTO; -import org.apache.syncope.common.lib.to.GroupTO; -import org.apache.syncope.common.lib.to.UserTO; -import org.apache.syncope.common.lib.types.Entitlement; -import org.apache.wicket.AttributeModifier; -import org.apache.wicket.Page; -import org.apache.wicket.PageReference; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; -import org.apache.wicket.ajax.markup.html.AjaxLink; -import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy; -import org.apache.wicket.event.IEvent; -import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; -import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; -import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; -import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn; -import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; -import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider; -import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; -import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.DropDownChoice; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.panel.Panel; -import org.apache.wicket.markup.repeater.Item; -import org.apache.wicket.model.AbstractReadOnlyModel; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; -import org.apache.wicket.model.PropertyModel; -import org.apache.wicket.model.StringResourceModel; -import org.apache.wicket.spring.injection.annot.SpringBean; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Resources WebPage. - */ -public class Resources extends Panel { - - private static final long serialVersionUID = -3789252860990261728L; - - protected static final Logger LOG = LoggerFactory.getLogger(Resources.class); - - private static final int WIN_HEIGHT = 600; - - private static final int WIN_WIDTH = 1100; - - @SpringBean - private PreferenceManager prefMan; - - @SpringBean - private ResourceRestClient resourceRestClient; - - private final ModalWindow createResourceWin; - - private final ModalWindow editResourceWin; - - private final int resourcePaginatorRows; - - private WebMarkupContainer resourceContainer; - - private final ModalWindow editConnectorWin; - - /** - * Modal window to be used for user status management. - */ - protected final ModalWindow statusmodal = new ModalWindow("statusModal"); - - /** - * Schemas to be shown modal window height. - */ - private static final int STATUS_MODAL_WIN_HEIGHT = 500; - - /** - * Schemas to be shown modal window width. - */ - private static final int STATUS_MODAL_WIN_WIDTH = 700; - - @SpringBean - private ConnectorRestClient connectorRestClient; - - private final PageReference pageRef; - - public Resources(final String id, final PageReference pageRef) { - super(id); - this.pageRef = pageRef; - - createResourceWin = new ModalWindow("createResourceWin"); - add(createResourceWin); - - editResourceWin = new ModalWindow("editResourceWin"); - add(editResourceWin); - - editConnectorWin = new ModalWindow("editConnectorWin"); - add(editConnectorWin); - - statusmodal.setCssClassName(ModalWindow.CSS_CLASS_GRAY); - statusmodal.setInitialHeight(STATUS_MODAL_WIN_HEIGHT); - statusmodal.setInitialWidth(STATUS_MODAL_WIN_WIDTH); - statusmodal.setCookieName("status-modal"); - add(statusmodal); - - resourcePaginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_RESOURCES_PAGINATOR_ROWS); - - setupResources(); - } - - private void setupResources() { - List<IColumn<ResourceTO, String>> columns = new ArrayList<>(); - - columns.add(new PropertyColumn<ResourceTO, String>(new StringResourceModel("key", this, null), "key", "key")); - - columns.add(new AbstractColumn<ResourceTO, String>( - new StringResourceModel("connector", this, null, "connector")) { - - private static final long serialVersionUID = 8263694778917279290L; - - @Override - public void populateItem(final Item<ICellPopulator<ResourceTO>> cellItem, final String componentId, - final IModel<ResourceTO> rowModel) { - - final AjaxLink<String> editLink = new ClearIndicatingAjaxLink<String>("link", pageRef) { - - private static final long serialVersionUID = -7978723352517770644L; - - @Override - protected void onClickInternal(final AjaxRequestTarget target) { - - editConnectorWin.setPageCreator(new ModalWindow.PageCreator() { - - private static final long serialVersionUID = -7834632442532690940L; - - @Override - public Page createPage() { - return new ConnectorModalPage(Resources.this.pageRef, - editConnectorWin, - connectorRestClient.read(rowModel.getObject().getConnectorId())); - } - }); - - editConnectorWin.show(target); - } - }; - editLink.add(new Label("linkTitle", rowModel.getObject().getConnectorDisplayName())); - - LinkPanel editConnPanel = new LinkPanel(componentId); - editConnPanel.add(editLink); - - cellItem.add(editConnPanel); - - MetaDataRoleAuthorizationStrategy.authorize(editConnPanel, ENABLE, Entitlement.CONNECTOR_READ); - } - }); - - columns.add(new AbstractColumn<ResourceTO, String>( - new StringResourceModel("propagationPrimary", this, null)) { - - private static final long serialVersionUID = -3503023501954863131L; - - @Override - public void populateItem(final Item<ICellPopulator<ResourceTO>> item, - final String componentId, final IModel<ResourceTO> model) { - - item.add(new Label(componentId, "")); - item.add(new AttributeModifier("class", new Model<>( - Boolean.toString(model.getObject().isPropagationPrimary())))); - } - - @Override - public String getCssClass() { - return "narrowcolumn"; - } - }); - - columns.add(new PropertyColumn<ResourceTO, String>(new StringResourceModel( - "propagationPriority", this, null), "propagationPriority", "propagationPriority") { - - private static final long serialVersionUID = 1L; - - @Override - public String getCssClass() { - return "narrowcolumn"; - } - }); - - columns.add(new AbstractColumn<ResourceTO, String>(new StringResourceModel("actions", this, null, "")) { - - private static final long serialVersionUID = 2054811145491901166L; - - @Override - public String getCssClass() { - return "action"; - } - - @Override - public void populateItem(final Item<ICellPopulator<ResourceTO>> cellItem, final String componentId, - final IModel<ResourceTO> model) { - - final ResourceTO resourceTO = model.getObject(); - - final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef); - panel.add(new ActionLink() { - - private static final long serialVersionUID = -3722207913631435501L; - - @Override - public void onClick(final AjaxRequestTarget target) { - statusmodal.setPageCreator(new ModalWindow.PageCreator() { - - private static final long serialVersionUID = -7834632442532690940L; - - @Override - public Page createPage() { - return new ProvisioningModalPage<>( - pageRef, statusmodal, model.getObject(), UserTO.class); - } - }); - - statusmodal.show(target); - } - }, ActionLink.ActionType.MANAGE_USERS, "Resources"); - - panel.add(new ActionLink() { - - private static final long serialVersionUID = -3722207913631435501L; - - @Override - public void onClick(final AjaxRequestTarget target) { - - statusmodal.setPageCreator(new ModalWindow.PageCreator() { - - private static final long serialVersionUID = -7834632442532690940L; - - @Override - public Page createPage() { - return new ProvisioningModalPage<>( - pageRef, statusmodal, model.getObject(), GroupTO.class); - } - }); - - statusmodal.show(target); - } - }, ActionLink.ActionType.MANAGE_GROUPS, "Resources"); - - panel.add(new ActionLink() { - - private static final long serialVersionUID = -3722207913631435501L; - - @Override - public void onClick(final AjaxRequestTarget target) { - resourceTO.setUsyncToken(null); - resourceTO.setRsyncToken(null); - try { - resourceRestClient.update(resourceTO); - info(getString(Constants.OPERATION_SUCCEEDED)); - } catch (SyncopeClientException e) { - error(getString(Constants.ERROR) + ":" + e.getMessage()); - - LOG.error("While resetting sync token from " + resourceTO.getKey(), e); - } - - ((BasePage) pageRef.getPage()).getFeedbackPanel().refresh(target); - target.add(resourceContainer); - } - }, ActionLink.ActionType.RESET, "Resources"); - - panel.add(new ActionLink() { - - private static final long serialVersionUID = -3722207913631435501L; - - @Override - public void onClick(final AjaxRequestTarget target) { - editResourceWin.setPageCreator(new ModalWindow.PageCreator() { - - private static final long serialVersionUID = -7834632442532690940L; - - @Override - public Page createPage() { - return new ResourceModalPage(pageRef, editResourceWin, resourceTO, false); - } - }); - - editResourceWin.show(target); - } - }, ActionLink.ActionType.EDIT, "Resources"); - - panel.add(new ActionLink() { - - private static final long serialVersionUID = -3722207913631435501L; - - @Override - public void onClick(final AjaxRequestTarget target) { - try { - resourceRestClient.delete(resourceTO.getKey()); - info(getString(Constants.OPERATION_SUCCEEDED)); - } catch (SyncopeClientException e) { - error(getString(Constants.ERROR) + ": " + e.getMessage()); - - LOG.error("While deleting resource " + resourceTO.getKey(), e); - } - - ((BasePage) pageRef.getPage()).getFeedbackPanel().refresh(target); - target.add(resourceContainer); - } - }, ActionLink.ActionType.DELETE, "Resources"); - - cellItem.add(panel); - } - }); - - final AjaxDataTablePanel<ResourceTO, String> table = new AjaxDataTablePanel<>( - "resourceDatatable", - columns, - (ISortableDataProvider<ResourceTO, String>) new ResourcesProvider(), - resourcePaginatorRows, - Arrays.asList(new ActionLink.ActionType[] { ActionLink.ActionType.DELETE }), - resourceRestClient, - "key", - "Resources", - pageRef); - - resourceContainer = new WebMarkupContainer("resourceContainer"); - resourceContainer.add(table); - resourceContainer.setOutputMarkupId(true); - - add(resourceContainer); - - ((BasePage) pageRef.getPage()).setWindowClosedCallback(createResourceWin, resourceContainer); - ((BasePage) pageRef.getPage()).setWindowClosedCallback(editResourceWin, resourceContainer); - - createResourceWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY); - createResourceWin.setInitialHeight(WIN_HEIGHT); - createResourceWin.setInitialWidth(WIN_WIDTH); - createResourceWin.setCookieName("create-res-modal"); - - editResourceWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY); - editResourceWin.setInitialHeight(WIN_HEIGHT); - editResourceWin.setInitialWidth(WIN_WIDTH); - editResourceWin.setCookieName("edit-res-modal"); - - editConnectorWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY); - editConnectorWin.setInitialHeight(WIN_HEIGHT); - editConnectorWin.setInitialWidth(WIN_WIDTH); - editConnectorWin.setCookieName("edit-conn-modal"); - - AjaxLink<Void> createResourceLink - = new ClearIndicatingAjaxLink<Void>("createResourceLink", pageRef) { - - private static final long serialVersionUID = -7978723352517770644L; - - @Override - protected void onClickInternal(final AjaxRequestTarget target) { - createResourceWin.setPageCreator(new ModalWindow.PageCreator() { - - private static final long serialVersionUID = -7834632442532690940L; - - @Override - public Page createPage() { - final ResourceModalPage windows = new ResourceModalPage(Resources.this.pageRef, - editResourceWin, new ResourceTO(), true); - return windows; - } - }); - - createResourceWin.show(target); - } - }; - - MetaDataRoleAuthorizationStrategy.authorize(createResourceLink, ENABLE, Entitlement.RESOURCE_CREATE); - - add(createResourceLink); - - @SuppressWarnings("rawtypes") - final Form paginatorForm = new Form("resourcePaginatorForm"); - - @SuppressWarnings({ "unchecked", "rawtypes" }) - final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, - "resourcePaginatorRows"), prefMan.getPaginatorChoices()); - - rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { - - private static final long serialVersionUID = -1107858522700306810L; - - @Override - protected void onUpdate(final AjaxRequestTarget target) { - prefMan.set(getRequest(), getResponse(), Constants.PREF_RESOURCES_PAGINATOR_ROWS, - String.valueOf(resourcePaginatorRows)); - - table.setItemsPerPage(resourcePaginatorRows); - target.add(resourceContainer); - } - }); - - paginatorForm.add(rowsChooser); - add(paginatorForm); - } - - class ResourcesProvider extends SortableDataProvider<ResourceTO, String> { - - private static final long serialVersionUID = -9055916672926643975L; - - private final SortableDataProviderComparator<ResourceTO> comparator; - - public ResourcesProvider() { - super(); - //Default sorting - setSort("key", SortOrder.ASCENDING); - comparator = new SortableDataProviderComparator<>(this); - } - - @Override - public Iterator<ResourceTO> iterator(final long first, final long count) { - List<ResourceTO> list = resourceRestClient.getAll(); - - Collections.sort(list, comparator); - - return list.subList((int) first, (int) first + (int) count).iterator(); - } - - @Override - public long size() { - return resourceRestClient.getAll().size(); - } - - @Override - public IModel<ResourceTO> model(final ResourceTO resource) { - return new AbstractReadOnlyModel<ResourceTO>() { - - private static final long serialVersionUID = 8952474152465381634L; - - @Override - public ResourceTO getObject() { - return resource; - } - }; - } - } - - @Override - public void onEvent(final IEvent<?> event) { - if (event.getPayload() instanceof AbstractSearchResultPanel.EventDataWrapper) { - ((AbstractSearchResultPanel.EventDataWrapper) event.getPayload()).getTarget().add(resourceContainer); - } - } -}
http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java index 5535c7b..3298d3f 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java @@ -28,11 +28,11 @@ import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.BulkAction; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ConnBundleTO; -import org.apache.syncope.common.lib.to.ConnIdObjectClassTO; import org.apache.syncope.common.lib.to.ConnInstanceTO; import org.apache.syncope.common.lib.to.PlainSchemaTO; import org.apache.syncope.common.lib.to.ResourceTO; import org.apache.syncope.common.lib.types.ConnConfProperty; +import org.apache.syncope.common.lib.wrap.ConnIdObjectClass; import org.apache.syncope.common.rest.api.service.ConnectorService; import org.apache.syncope.common.rest.api.service.ResourceService; import org.springframework.beans.BeanUtils; @@ -196,8 +196,8 @@ public class ConnectorRestClient extends BaseRestClient { return schemaNames; } - public List<ConnIdObjectClassTO> getSupportedObjectClasses(final ConnInstanceTO connectorTO) { - List<ConnIdObjectClassTO> result = Collections.emptyList(); + public List<ConnIdObjectClass> getSupportedObjectClasses(final ConnInstanceTO connectorTO) { + List<ConnIdObjectClass> result = Collections.emptyList(); try { result = getService(ConnectorService.class).getSupportedObjectClasses(connectorTO.getKey(), connectorTO); } catch (Exception e) { http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java index ef490e2..a146857 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java @@ -25,6 +25,7 @@ import org.apache.syncope.client.console.commons.status.StatusBean; import org.apache.syncope.client.console.commons.status.StatusUtils; import org.apache.syncope.client.lib.SyncopeClient; import org.apache.syncope.common.lib.mod.GroupMod; +import org.apache.syncope.common.lib.mod.ResourceAssociationMod; import org.apache.syncope.common.lib.to.BulkAction; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ConnObjectTO; @@ -119,31 +120,34 @@ public class GroupRestClient extends AbstractAnyRestClient { return getService(GroupService.class).bulk(action); } - public void unlink(final String etag, final long groupId, final List<StatusBean> statuses) { + public void unlink(final String etag, final long groupKey, final List<StatusBean> statuses) { synchronized (this) { GroupService service = getService(etag, GroupService.class); - service.bulkDeassociation(groupId, ResourceDeassociationActionType.UNLINK, + service.bulkDeassociation(groupKey, ResourceDeassociationActionType.UNLINK, CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); resetClient(GroupService.class); } } - public void link(final String etag, final long groupId, final List<StatusBean> statuses) { + public void link(final String etag, final long groupKey, final List<StatusBean> statuses) { synchronized (this) { GroupService service = getService(etag, GroupService.class); - service.bulkAssociation(groupId, ResourceAssociationActionType.LINK, - CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), - ResourceKey.class)); + + ResourceAssociationMod associationMod = new ResourceAssociationMod(); + associationMod.getTargetResources().addAll( + CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); + service.bulkAssociation(groupKey, ResourceAssociationActionType.LINK, associationMod); + resetClient(GroupService.class); } } - public BulkActionResult deprovision(final String etag, final long groupId, final List<StatusBean> statuses) { + public BulkActionResult deprovision(final String etag, final long groupKey, final List<StatusBean> statuses) { BulkActionResult result; synchronized (this) { GroupService service = getService(etag, GroupService.class); - result = service.bulkDeassociation(groupId, ResourceDeassociationActionType.DEPROVISION, + result = service.bulkDeassociation(groupKey, ResourceDeassociationActionType.DEPROVISION, CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)). readEntity(BulkActionResult.class); @@ -152,24 +156,27 @@ public class GroupRestClient extends AbstractAnyRestClient { return result; } - public BulkActionResult provision(final String etag, final long groupId, final List<StatusBean> statuses) { + public BulkActionResult provision(final String etag, final long groupKey, final List<StatusBean> statuses) { BulkActionResult result; synchronized (this) { GroupService service = getService(etag, GroupService.class); - result = service.bulkAssociation(groupId, ResourceAssociationActionType.PROVISION, - CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), - ResourceKey.class)). + + ResourceAssociationMod associationMod = new ResourceAssociationMod(); + associationMod.getTargetResources().addAll( + CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); + + result = service.bulkAssociation(groupKey, ResourceAssociationActionType.PROVISION, associationMod). readEntity(BulkActionResult.class); resetClient(GroupService.class); } return result; } - public BulkActionResult unassign(final String etag, final long groupId, final List<StatusBean> statuses) { + public BulkActionResult unassign(final String etag, final long groupKey, final List<StatusBean> statuses) { BulkActionResult result; synchronized (this) { GroupService service = getService(etag, GroupService.class); - result = service.bulkDeassociation(groupId, ResourceDeassociationActionType.UNASSIGN, + result = service.bulkDeassociation(groupKey, ResourceDeassociationActionType.UNASSIGN, CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)). readEntity(BulkActionResult.class); @@ -178,14 +185,18 @@ public class GroupRestClient extends AbstractAnyRestClient { return result; } - public BulkActionResult assign(final String etag, final long groupId, final List<StatusBean> statuses) { + public BulkActionResult assign(final String etag, final long groupKey, final List<StatusBean> statuses) { BulkActionResult result; synchronized (this) { GroupService service = getService(etag, GroupService.class); - result = service.bulkAssociation(groupId, ResourceAssociationActionType.ASSIGN, - CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), - ResourceKey.class)). + + ResourceAssociationMod associationMod = new ResourceAssociationMod(); + associationMod.getTargetResources().addAll( + CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); + + result = service.bulkAssociation(groupKey, ResourceAssociationActionType.ASSIGN, associationMod). readEntity(BulkActionResult.class); + resetClient(GroupService.class); } return result; http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java index 64daf50..bfe6385 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java @@ -122,22 +122,22 @@ public class UserRestClient extends AbstractAnyRestClient { return getService(ResourceService.class).readConnObject(resourceName, AnyTypeKind.USER.name(), id); } - public void suspend(final String etag, final long userId, final List<StatusBean> statuses) { + public void suspend(final String etag, final long userKey, final List<StatusBean> statuses) { StatusMod statusMod = StatusUtils.buildStatusMod(statuses, false); statusMod.setType(StatusMod.ModType.SUSPEND); synchronized (this) { UserService service = getService(etag, UserService.class); - service.status(userId, statusMod); + service.status(userKey, statusMod); resetClient(UserService.class); } } - public void reactivate(final String etag, final long userId, final List<StatusBean> statuses) { + public void reactivate(final String etag, final long userKey, final List<StatusBean> statuses) { StatusMod statusMod = StatusUtils.buildStatusMod(statuses, true); statusMod.setType(StatusMod.ModType.REACTIVATE); synchronized (this) { UserService service = getService(etag, UserService.class); - service.status(userId, statusMod); + service.status(userKey, statusMod); resetClient(UserService.class); } } @@ -147,34 +147,34 @@ public class UserRestClient extends AbstractAnyRestClient { return getService(UserService.class).bulk(action); } - public void unlink(final String etag, final long userId, final List<StatusBean> statuses) { + public void unlink(final String etag, final long userKey, final List<StatusBean> statuses) { synchronized (this) { UserService service = getService(etag, UserService.class); - service.bulkDeassociation(userId, ResourceDeassociationActionType.UNLINK, + service.bulkDeassociation(userKey, ResourceDeassociationActionType.UNLINK, CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); resetClient(UserService.class); } } - public void link(final String etag, final long userId, final List<StatusBean> statuses) { + public void link(final String etag, final long userKey, final List<StatusBean> statuses) { synchronized (this) { UserService service = getService(etag, UserService.class); - final ResourceAssociationMod associationMod = new ResourceAssociationMod(); + ResourceAssociationMod associationMod = new ResourceAssociationMod(); associationMod.getTargetResources().addAll( CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); - service.bulkAssociation(userId, ResourceAssociationActionType.LINK, associationMod); + service.bulkAssociation(userKey, ResourceAssociationActionType.LINK, associationMod); resetClient(UserService.class); } } - public BulkActionResult deprovision(final String etag, final long userId, final List<StatusBean> statuses) { + public BulkActionResult deprovision(final String etag, final long userKey, final List<StatusBean> statuses) { BulkActionResult result; synchronized (this) { UserService service = getService(etag, UserService.class); - result = service.bulkDeassociation(userId, ResourceDeassociationActionType.DEPROVISION, + result = service.bulkDeassociation(userKey, ResourceDeassociationActionType.DEPROVISION, CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)). readEntity(BulkActionResult.class); @@ -183,32 +183,31 @@ public class UserRestClient extends AbstractAnyRestClient { return result; } - public BulkActionResult provision(final String etag, final long userId, + public BulkActionResult provision(final String etag, final long userKey, final List<StatusBean> statuses, final boolean changepwd, final String password) { BulkActionResult result; synchronized (this) { UserService service = getService(etag, UserService.class); - final ResourceAssociationMod associationMod = new ResourceAssociationMod(); - associationMod.getTargetResources().addAll(CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses). - getResourceNames(), - ResourceKey.class)); + ResourceAssociationMod associationMod = new ResourceAssociationMod(); + associationMod.getTargetResources().addAll( + CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); associationMod.setChangePwd(changepwd); associationMod.setPassword(password); - result = service.bulkAssociation(userId, ResourceAssociationActionType.PROVISION, associationMod). + result = service.bulkAssociation(userKey, ResourceAssociationActionType.PROVISION, associationMod). readEntity(BulkActionResult.class); resetClient(UserService.class); } return result; } - public BulkActionResult unassign(final String etag, final long userId, final List<StatusBean> statuses) { + public BulkActionResult unassign(final String etag, final long userKey, final List<StatusBean> statuses) { BulkActionResult result; synchronized (this) { UserService service = getService(etag, UserService.class); - result = service.bulkDeassociation(userId, ResourceDeassociationActionType.UNASSIGN, + result = service.bulkDeassociation(userKey, ResourceDeassociationActionType.UNASSIGN, CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)). readEntity(BulkActionResult.class); @@ -217,21 +216,20 @@ public class UserRestClient extends AbstractAnyRestClient { return result; } - public BulkActionResult assign(final String etag, final long userId, + public BulkActionResult assign(final String etag, final long userKey, final List<StatusBean> statuses, final boolean changepwd, final String password) { BulkActionResult result; synchronized (this) { UserService service = getService(etag, UserService.class); - final ResourceAssociationMod associationMod = new ResourceAssociationMod(); - associationMod.getTargetResources().addAll(CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses). - getResourceNames(), - ResourceKey.class)); + ResourceAssociationMod associationMod = new ResourceAssociationMod(); + associationMod.getTargetResources().addAll( + CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceKey.class)); associationMod.setChangePwd(changepwd); associationMod.setPassword(password); - result = service.bulkAssociation(userId, ResourceAssociationActionType.ASSIGN, associationMod). + result = service.bulkAssociation(userKey, ResourceAssociationActionType.ASSIGN, associationMod). readEntity(BulkActionResult.class); resetClient(UserService.class); } http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java index 013fa3a..8f6cc5c 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java @@ -37,19 +37,16 @@ public class ActionResultColumn<T, S> extends AbstractColumn<T, S> { private static final long serialVersionUID = 7955560320949560716L; - /** - * Logger. - */ private static final Logger LOG = LoggerFactory.getLogger(ActionResultColumn.class); private final BulkActionResult results; - private final String idFieldName; + private final String keyFieldName; - public ActionResultColumn(final BulkActionResult results, final String idFieldName) { + public ActionResultColumn(final BulkActionResult results, final String keyFieldName) { super(new Model<String>()); this.results = results; - this.idFieldName = idFieldName; + this.keyFieldName = keyFieldName; } @Override @@ -65,10 +62,10 @@ public class ActionResultColumn<T, S> extends AbstractColumn<T, S> { @Override public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) { try { - final PropertyDescriptor propDesc = BeanUtils.getPropertyDescriptor(rowModel.getObject().getClass(), - idFieldName); - final Object id = propDesc.getReadMethod().invoke(rowModel.getObject(), new Object[0]); - final Status status = id == null ? null : results.getResultMap().get(id.toString()); + PropertyDescriptor propDesc = + BeanUtils.getPropertyDescriptor(rowModel.getObject().getClass(), keyFieldName); + Object id = propDesc.getReadMethod().invoke(rowModel.getObject(), new Object[0]); + Status status = id == null ? null : results.getResults().get(id.toString()); item.add(new Label(componentId, status == null ? Status.SUCCESS : status.toString())); } catch (Exception e) { LOG.error("Errore retrieving target id value", e); http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties index 8a8eb3f..789919b 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties @@ -28,7 +28,7 @@ extAttrNames=External attributes intMappingTypes=Internal mapping types entity=Entity groupSchema=Group Schema -accountId=AccountId +connObjectKey=ConnObjectKey mandatoryCondition=Mandatory password=Password purpose=Purpose @@ -39,9 +39,9 @@ intAttrNames=Internal attributes enforceMandatoryCondition=Enforce mandatory condition fieldName=Field name -accountIdValidation=There must be exactly one AccountId +connObjectKeyValidation=There must be exactly one ConnObjectKey propagationMode=Propagation mode -accountLink=Account link +connObjectLink=ConnObjectLink enable=Enable createTraceLevel=Create trace level http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties index b98b3ae..54179a5 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties @@ -28,7 +28,7 @@ extAttrNames=Attributi esterni intMappingTypes=Tipo mapping interno entity=Entità groupSchema=Schema Gruppo -accountId=AccountId +connObjectKey=ConnObjectKey mandatoryCondition=Obbligatorio password=Password purpose=Scopo @@ -39,9 +39,9 @@ intAttrNames=Attributi interni enforceMandatoryCondition=Abilita mandatory condition fieldName=Nome campo -accountIdValidation=Deve essere definito esattamente un AccountId +connObjectKeyValidation=Deve essere definito esattamente un ConnObjectKey propagationMode=Modalit\u00e0 di propagazione -accountLink=Account link +connObjectLink=ConnObjectLink enable=Abilita createTraceLevel=Livello di tracciamento delle creazioni http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties index a91df81..45c3616 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties +++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties @@ -28,7 +28,7 @@ extAttrNames=Atributos Externos intMappingTypes=Tipos internos de mapeamentos entity=Entidade groupSchema=Esquema de Grupo -accountId=Identificador da Conta +connObjectKey=ConnObjectKey mandatoryCondition=Obrigat\u00f3rio password=Senha purpose=Prop\u00f3sito @@ -39,9 +39,9 @@ intAttrNames=Atributos internos enforceMandatoryCondition=Aplicar condi\u00e7\u00e3o obrigat\u00f3ria fieldName=Nome do Campo -accountIdValidation=Precisa ser exatamente um Identificador de Conta +connObjectKeyValidation=Precisa ser exatamente um ConnObjectKey propagationMode=Modo de propaga\u00e7\u00e3o -accountLink=Link de Conta +connObjectLink=ConnObjectLink enable=Habilitado createTraceLevel=Criar n\u00edvel de trace http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html index 0e145bb..fe6c4ef 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html @@ -43,7 +43,7 @@ under the License. </span> </a> </th> - <th><wicket:message key="accountId"/></th> + <th><wicket:message key="connObjectKey"/></th> <th><label wicket:id="passwordLabel"/></th> <th><wicket:message key="purpose"/></th> </tr> @@ -67,7 +67,7 @@ under the License. <span wicket:id="mandatoryCondition">[mandatoryCondition]</span> </td> <td> - <span wicket:id="accountId">[accountId]</span> + <span wicket:id="connObjectKey">[connObjectKey]</span> </td> <td> <span wicket:id="password">[password]</span> @@ -90,21 +90,21 @@ under the License. </tfoot> </table> - <table id="accountLinkTable" + <table id="connObjectLinkTable" class="table" style="font-size: 1em;margin-top:2px;" - wicket:id="accountLinkContainer"> + wicket:id="connObjectLinkContainer"> <tbody> <tr> <th width="10%" align="left"><wicket:message key="enable"/></th> - <th align="left"><wicket:message key="accountLink"/></th> + <th align="left"><wicket:message key="connObjectLink"/></th> </tr> <tr> <td width="10%"> - <span wicket:id="accountLinkCheckbox">[accountLinkCheckbox]</span> + <span wicket:id="connObjectLinkCheckbox">[connObjectLinkCheckbox]</span> </td> <td> - <span wicket:id="accountLink">[accountLink]</span> + <span wicket:id="connObjectLink">[connObjectLink]</span> </td> </tr> </tbody> http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.html deleted file mode 100644 index 3d02b33..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.html +++ /dev/null @@ -1,52 +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. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite"> - <body> - <wicket:panel> - - <div> - <div id="users-contain" class="ui-widget" style="width:inherit"> - <span wicket:id="resourceContainer"> - <span wicket:id="resourceDatatable">[resources]</span> - </span> - - <span style="float:right"> - <form wicket:id="resourcePaginatorForm" style="display:inline"> - <label><wicket:message key="displayRows"/></label> - <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/> - </form> - </span> - </div> - - <div wicket:id="statusModal">[Show modal window for provisioning status]</div> - <div wicket:id="createResourceWin">[Show modal window for creating resource]</div> - <div wicket:id="editResourceWin">[Show modal window for editing resource]</div> - <div wicket:id="editConnectorWin">[Show modal window for editing connector]</div> - - <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="createResourceLink"> - <wicket:message key="create-resource"/> - </a> - </div> - - </wicket:panel> - </body> -</html> http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.properties deleted file mode 100644 index fb6b8a1..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources.properties +++ /dev/null @@ -1,34 +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. -tab1=Resources -edit=Edit -delete=Delete -create-resource=Create -propagationPriority=Propagation priority -propagationPrimary=Propagation primary - -tab2=Connectors -displayName=Display name -version=Version -bundleName=Bundle name -edit=Edit -delete=Delete -create-connector=Create -delete_error=Operation forbidden:the connector you're trying to delete is connected to a Resource -connector=Connector -reloadConnectors=Reload connectors -confirmReloadConnectors=This request is potentially dangerous for running operations, continue? http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_it.properties deleted file mode 100644 index 80a5185..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_it.properties +++ /dev/null @@ -1,34 +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. -tab1=Risorse -edit=Modifica -delete=Rimuovi -create-resource=Crea -propagationPriority=Priorit\u00e0 in propagazione -propagationPrimary=Primaria in propagazione - -tab2=Connettori -create-connector=Crea -version=Versione -bundleName=Bundle name -edit=Modifica -delete=Elimina -delete_error=Operazione vietata: il connettore che si desidera rimuovere \u00e8 correlato ad una risorsa -displayName=Nome visualizzato -connector=Connettore -reloadConnectors=Ricarica connettori -confirmReloadConnectors=Questa richiesta \u00e8 potenzialmente dannosa per le operazioni in corso, proseguire? http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_pt_BR.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_pt_BR.properties deleted file mode 100644 index a631352..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Resources_pt_BR.properties +++ /dev/null @@ -1,32 +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. -tab1=Recursos -edit=Alterar -delete=Excluir -create-resource=Criar -propagationPriority=Prioridade de propaga\u00e7\u00e3o -propagationPrimary=Propaga\u00e7\u00e3o prim\u00e1ria - -tab2=Conectores -displayName=Mostar -version=Vers\u00e3o -bundleName=Nome do Pacote -create-connector=Criar -delete_error=Opera\u00e7\u00e3o n\u00e3o permitida\: o conector que voc\u00ea est\u00e1 tentando excluir est\u00e1 conectado a um recurso -connector=Conector -reloadConnectors=Carregar Conector -confirmReloadConnectors=Esta requis\u00e7\u00e3o \u00e9 potencialmente perigosa para opera\u00e7\u00f5es em execu\u00e7\u00e3o, prosseguir? http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java ---------------------------------------------------------------------- diff --git a/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java b/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java index c981739..b744dc1 100644 --- a/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java +++ b/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java @@ -33,6 +33,7 @@ import org.apache.cxf.jaxrs.client.WebClient; import org.apache.syncope.client.lib.builders.ListQueryBuilder; import org.apache.syncope.client.lib.builders.AnyListQueryBuilder; import org.apache.syncope.client.lib.builders.AnySearchQueryBuilder; +import org.apache.syncope.common.lib.search.AnyObjectFiqlSearchConditionBuilder; import org.apache.syncope.common.lib.search.OrderByClauseBuilder; import org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder; import org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder; @@ -89,6 +90,15 @@ public class SyncopeClient { } /** + * Returns a new instance of {@link AnyObjectFiqlSearchConditionBuilder}, for assisted building of FIQL queries. + * + * @return default instance of {@link AnyObjectFiqlSearchConditionBuilder} + */ + public static AnyObjectFiqlSearchConditionBuilder getAnyObjectSearchConditionBuilder() { + return new AnyObjectFiqlSearchConditionBuilder(); + } + + /** * Returns a new instance of {@link OrderByClauseBuilder}, for assisted building of {@link orderby} clauses. * * @return default instance of {@link OrderByClauseBuilder} @@ -119,8 +129,7 @@ public class SyncopeClient { /** * Returns a new instance of {@link AnySearchQueryBuilder}, for assisted building of some service's - * {@code search()} - * arguments. + * {@code search()} arguments. * * @return default instance of {@link AnySearchQueryBuilder} */ http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/client/lib/src/main/java/org/apache/syncope/client/lib/builders/AnyListQueryBuilder.java ---------------------------------------------------------------------- diff --git a/client/lib/src/main/java/org/apache/syncope/client/lib/builders/AnyListQueryBuilder.java b/client/lib/src/main/java/org/apache/syncope/client/lib/builders/AnyListQueryBuilder.java index 62e4bbe..afd29e9 100644 --- a/client/lib/src/main/java/org/apache/syncope/client/lib/builders/AnyListQueryBuilder.java +++ b/client/lib/src/main/java/org/apache/syncope/client/lib/builders/AnyListQueryBuilder.java @@ -45,6 +45,7 @@ public class AnyListQueryBuilder extends ListQueryBuilder { if (instance.getRealms() == null) { instance.setRealms(new ArrayList<String>()); } + instance.getRealms().add(realm); return this; } http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/mod/AnyMod.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/mod/AnyMod.java b/common/lib/src/main/java/org/apache/syncope/common/lib/mod/AnyMod.java index e5fcb85..f84e65a 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/mod/AnyMod.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/mod/AnyMod.java @@ -18,6 +18,7 @@ */ package org.apache.syncope.common.lib.mod; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.HashSet; import java.util.Set; @@ -144,6 +145,7 @@ public abstract class AnyMod extends AbstractBaseBean { /** * @return true is all backing collections are empty. */ + @JsonIgnore public boolean isEmpty() { return plainAttrsToUpdate.isEmpty() && plainAttrsToRemove.isEmpty() && derAttrsToAdd.isEmpty() && derAttrsToRemove.isEmpty() http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/search/AbstractFiqlSearchConditionBuilder.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/search/AbstractFiqlSearchConditionBuilder.java b/common/lib/src/main/java/org/apache/syncope/common/lib/search/AbstractFiqlSearchConditionBuilder.java index 9279e72..0ace0b5 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/search/AbstractFiqlSearchConditionBuilder.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/search/AbstractFiqlSearchConditionBuilder.java @@ -49,6 +49,7 @@ public abstract class AbstractFiqlSearchConditionBuilder extends FiqlSearchCondi return new Builder(properties); } + @Override public SyncopeProperty is(final String property) { return newBuilderInstance().is(property); } http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectFiqlSearchConditionBuilder.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectFiqlSearchConditionBuilder.java b/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectFiqlSearchConditionBuilder.java new file mode 100644 index 0000000..67e7e15 --- /dev/null +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectFiqlSearchConditionBuilder.java @@ -0,0 +1,71 @@ +/* + * 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.common.lib.search; + +import java.util.Map; +import org.apache.cxf.jaxrs.ext.search.client.CompleteCondition; + +/** + * Extends {@link AbstractFiqlSearchConditionBuilder} by providing some additional facilities for searching + * any objects in Syncope. + */ +public class AnyObjectFiqlSearchConditionBuilder extends AbstractFiqlSearchConditionBuilder { + + public AnyObjectFiqlSearchConditionBuilder() { + super(); + } + + public AnyObjectFiqlSearchConditionBuilder(final Map<String, String> properties) { + super(properties); + } + + @Override + protected Builder newBuilderInstance() { + return new Builder(properties); + } + + @Override + public AnyObjectProperty is(final String property) { + return newBuilderInstance().is(property); + } + + public CompleteCondition type(final String type) { + return newBuilderInstance().is(SpecialAttr.TYPE.toString()).equalTo(type); + } + + protected static class Builder extends AbstractFiqlSearchConditionBuilder.Builder + implements AnyObjectProperty, CompleteCondition { + + public Builder(final Map<String, String> properties) { + super(properties); + } + + public Builder(final Builder parent) { + super(parent); + } + + @Override + public AnyObjectProperty is(final String property) { + Builder b = new Builder(this); + b.result = property; + return b; + } + + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectProperty.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectProperty.java b/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectProperty.java new file mode 100644 index 0000000..c675712 --- /dev/null +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/search/AnyObjectProperty.java @@ -0,0 +1,23 @@ +/* + * 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.common.lib.search; + +public interface AnyObjectProperty extends SyncopeProperty { + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java b/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java index 9877267..551a0ad 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/search/SpecialAttr.java @@ -25,6 +25,7 @@ import org.apache.commons.collections4.Predicate; public enum SpecialAttr { NULL("$null"), + TYPE("$type"), RESOURCES("$resources"), GROUPS("$groups"), ROLES("$roles"); http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java deleted file mode 100644 index c562b69..0000000 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java +++ /dev/null @@ -1,74 +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.common.lib.to; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.apache.syncope.common.lib.AbstractBaseBean; - -/** - * Mimic ConnId's ObjectClass information. - */ -@XmlRootElement(name = "connIdObjectClass") -@XmlType -public class ConnIdObjectClassTO extends AbstractBaseBean { - - private static final long serialVersionUID = 5802458031138859994L; - - @XmlEnum - public enum DefaultType { - - ACCOUNT("__ACCOUNT__"), - GROUP("__GROUP__"); - - private final String specialName; - - private DefaultType(final String specialName) { - this.specialName = specialName; - } - - public String getSpecialName() { - return specialName; - } - } - - public static final ConnIdObjectClassTO ACCOUNT = new ConnIdObjectClassTO(DefaultType.ACCOUNT.getSpecialName()); - - public static final ConnIdObjectClassTO GROUP = new ConnIdObjectClassTO(DefaultType.GROUP.getSpecialName()); - - private String type; - - public ConnIdObjectClassTO() { - super(); - } - - public ConnIdObjectClassTO(final String type) { - super(); - this.type = type; - } - - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java index 92be8e1..c573278 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/MappingTO.java @@ -61,7 +61,7 @@ public class MappingTO extends AbstractBaseBean { protected boolean addConnObjectKeyItem(final MappingItemTO connObjectItem) { if (IntMappingType.UserVirtualSchema == connObjectItem.getIntMappingType() || IntMappingType.GroupVirtualSchema == connObjectItem.getIntMappingType() - || IntMappingType.AnyVirtualSchema == connObjectItem.getIntMappingType() + || IntMappingType.AnyObjectVirtualSchema == connObjectItem.getIntMappingType() || IntMappingType.Password == connObjectItem.getIntMappingType()) { throw new IllegalArgumentException("Virtual attributes cannot be set as connObjectKey"); http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java index 3537bc5..4588a36 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java @@ -53,10 +53,10 @@ public enum IntMappingType { // ------------------------- // Any attribute types (the same in AnyMappingType) // ------------------------- - AnyPlainSchema(AnyTypeKind.ANY_OBJECT), - AnyDerivedSchema(AnyTypeKind.ANY_OBJECT), - AnyVirtualSchema(AnyTypeKind.ANY_OBJECT), - AnyKey(AnyTypeKind.ANY_OBJECT); + AnyObjectPlainSchema(AnyTypeKind.ANY_OBJECT), + AnyObjectDerivedSchema(AnyTypeKind.ANY_OBJECT), + AnyObjectVirtualSchema(AnyTypeKind.ANY_OBJECT), + AnyObjectKey(AnyTypeKind.ANY_OBJECT); private final AnyTypeKind anyTypeKind; @@ -119,7 +119,7 @@ public enum IntMappingType { public static Set<IntMappingType> getEmbedded() { return EnumSet.of(IntMappingType.UserKey, IntMappingType.Username, IntMappingType.Password, IntMappingType.GroupKey, IntMappingType.GroupName, IntMappingType.GroupOwnerSchema, - IntMappingType.AnyKey); + IntMappingType.AnyObjectKey); } /** @@ -192,10 +192,10 @@ public enum IntMappingType { */ private enum AnyMappingType { - AnyPlainSchema, - AnyDerivedSchema, - AnyVirtualSchema, - AnyKey; + AnyObjectPlainSchema, + AnyObjectDerivedSchema, + AnyObjectVirtualSchema, + AnyObjectKey; } } http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java ---------------------------------------------------------------------- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java b/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java new file mode 100644 index 0000000..868b3f1 --- /dev/null +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java @@ -0,0 +1,30 @@ +/* + * 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.common.lib.wrap; + +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +@XmlRootElement(name = "connIdObjectClass") +@XmlType +public class ConnIdObjectClass extends AbstractWrappable<String> { + + private static final long serialVersionUID = 613925852330408531L; + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java ---------------------------------------------------------------------- diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java new file mode 100644 index 0000000..b460b54 --- /dev/null +++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java @@ -0,0 +1,49 @@ +/* + * 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.common.rest.api.service; + +import javax.ws.rs.BeanParam; +import javax.ws.rs.GET; +import javax.ws.rs.MatrixParam; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import org.apache.syncope.common.lib.mod.AnyObjectMod; +import org.apache.syncope.common.lib.to.AnyObjectTO; +import org.apache.syncope.common.lib.to.PagedResult; +import org.apache.syncope.common.rest.api.beans.AnyListQuery; + +/** + * REST operations for anyObjects. + */ +@Path("anyObjects") +public interface AnyObjectService extends AnyService<AnyObjectTO, AnyObjectMod> { + + /** + * Returns a paged list of existing any objects matching the given query, for the given type. + * + * @param type any type + * @param listQuery query conditions + * @return paged list of existing any objects matching the given query, for the given type + */ + @GET + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + PagedResult<AnyObjectTO> list(@MatrixParam("type") String type, @BeanParam AnyListQuery listQuery); + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java ---------------------------------------------------------------------- diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java new file mode 100644 index 0000000..90fbf7d --- /dev/null +++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java @@ -0,0 +1,191 @@ +/* + * 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.common.rest.api.service; + +import java.util.List; +import javax.validation.constraints.NotNull; +import javax.ws.rs.BeanParam; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.cxf.jaxrs.model.wadl.Description; +import org.apache.cxf.jaxrs.model.wadl.Descriptions; +import org.apache.cxf.jaxrs.model.wadl.DocTarget; +import org.apache.syncope.common.lib.mod.AnyMod; +import org.apache.syncope.common.lib.mod.ResourceAssociationMod; +import org.apache.syncope.common.lib.to.AnyTO; +import org.apache.syncope.common.lib.to.BulkAction; +import org.apache.syncope.common.lib.to.BulkActionResult; +import org.apache.syncope.common.lib.to.PagedResult; +import org.apache.syncope.common.lib.types.ResourceAssociationActionType; +import org.apache.syncope.common.lib.types.ResourceDeassociationActionType; +import org.apache.syncope.common.lib.wrap.ResourceKey; +import org.apache.syncope.common.rest.api.beans.AnyListQuery; +import org.apache.syncope.common.rest.api.beans.AnySearchQuery; + +public interface AnyService<TO extends AnyTO, MOD extends AnyMod> extends JAXRSService { + + /** + * Reads the any object matching the provided key. + * + * @param key key of any object to be read + * @return any object with matching id + */ + @GET + @Path("{key}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + TO read(@NotNull @PathParam("key") Long key); + + /** + * Returns a paged list of existing any objects matching the given query. + * + * @param listQuery query conditions + * @return paged list of existing any objects matching the given query + */ + @GET + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + PagedResult<TO> list(@BeanParam AnyListQuery listQuery); + + /** + * Returns a paged list of any objects matching the given query. + * + * @param searchQuery query conditions + * @return paged list of any objects matching the given query + */ + @GET + @Path("search") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + PagedResult<TO> search(@BeanParam AnySearchQuery searchQuery); + + /** + * Creates a new any object. + * + * @param anyTO any object to be created + * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created any object as well as the any + * object itself enriched with propagation status information - {@link AnyTO} as <tt>Entity</tt> + */ + @Descriptions({ + @Description(target = DocTarget.RESPONSE, + value = "Featuring <tt>Location</tt> header of created any object as well as the " + + "any object itself enriched with propagation status information - " + + "<tt>AnyTO</tt> as <tt>Entity</tt>") + }) + @POST + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response create(@NotNull TO anyTO); + + /** + * Updates any object matching the provided key. + * + * @param key key of any object to be updated + * @param anyMod modification to be applied to any object matching the provided key + * @return <tt>Response</tt> object featuring the updated any object enriched with propagation status information + * - {@link AnyTO} as <tt>Entity</tt> + */ + @Descriptions({ + @Description(target = DocTarget.RESPONSE, + value = "Featuring the updated any object enriched with propagation status information - " + + "<tt>AnyTO</tt> as <tt>Entity</tt>") + }) + @POST + @Path("{key}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response update(@NotNull @PathParam("key") Long key, @NotNull MOD anyMod); + + /** + * Deletes any object matching provided key. + * + * @param key key of any object to be deleted + * @return <tt>Response</tt> object featuring the deleted any object enriched with propagation status information + * - {@link AnyTO} as <tt>Entity</tt> + */ + @Descriptions({ + @Description(target = DocTarget.RESPONSE, + value = "Featuring the deleted any object enriched with propagation status information - " + + "<tt>AnyTO</tt> as <tt>Entity</tt>") + }) + @DELETE + @Path("{key}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response delete(@NotNull @PathParam("key") Long key); + + /** + * Executes resource-related operations on given any object. + * + * @param key any object id. + * @param type resource association action type + * @param resourceNames external resources to be used for propagation-related operations + * @return <tt>Response</tt> object featuring + * {@link BulkActionResult} as <tt>Entity</tt> + */ + @Descriptions({ + @Description(target = DocTarget.RESPONSE, + value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>") + }) + @POST + @Path("{key}/deassociate/{type}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response bulkDeassociation( + @NotNull @PathParam("key") Long key, + @NotNull @PathParam("type") ResourceDeassociationActionType type, + @NotNull List<ResourceKey> resourceNames); + + /** + * Executes resource-related operations on given any object. + * + * @param key any object id. + * @param type resource association action type + * @param associationMod external resources to be used for propagation-related operations + * @return <tt>Response</tt> object featuring {@link BulkActionResult} as <tt>Entity</tt> + */ + @Descriptions({ + @Description(target = DocTarget.RESPONSE, + value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>") + }) + @POST + @Path("{key}/associate/{type}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response bulkAssociation( + @NotNull @PathParam("key") Long key, + @NotNull @PathParam("type") ResourceAssociationActionType type, + @NotNull ResourceAssociationMod associationMod); + + /** + * Executes the provided bulk action. + * + * @param bulkAction list of any object ids against which the bulk action will be performed. + * @return Bulk action result + */ + @POST + @Path("bulk") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + BulkActionResult bulk(@NotNull BulkAction bulkAction); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/a45a46bb/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java ---------------------------------------------------------------------- diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java index 07fc6a4..e0c240f 100644 --- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java +++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java @@ -38,11 +38,11 @@ import org.apache.cxf.jaxrs.model.wadl.DocTarget; import org.apache.syncope.common.lib.to.BulkAction; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ConnBundleTO; -import org.apache.syncope.common.lib.to.ConnIdObjectClassTO; import org.apache.syncope.common.lib.to.ConnInstanceTO; import org.apache.syncope.common.lib.to.PlainSchemaTO; import org.apache.syncope.common.lib.types.ConnConfProperty; import org.apache.syncope.common.lib.wrap.BooleanWrap; +import org.apache.syncope.common.lib.wrap.ConnIdObjectClass; /** * REST operations for connector bundles and instances. @@ -100,7 +100,7 @@ public interface ConnectorService extends JAXRSService { @Path("{key}/supportedObjectClasses") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - List<ConnIdObjectClassTO> getSupportedObjectClasses( + List<ConnIdObjectClass> getSupportedObjectClasses( @NotNull @PathParam("key") Long key, @NotNull ConnInstanceTO connInstanceTO);
