Repository: syncope Updated Branches: refs/heads/master be774ee67 -> fe5a398c9
[SYNCOPE-156] fix any object creation form by including datetime picker (still reworking on) as well Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/fe5a398c Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/fe5a398c Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/fe5a398c Branch: refs/heads/master Commit: fe5a398c9ed8b1a26fbc4d8967a62f300f731922 Parents: be774ee Author: fmartelli <[email protected]> Authored: Fri Oct 30 18:21:53 2015 +0100 Committer: fmartelli <[email protected]> Committed: Fri Oct 30 18:21:53 2015 +0100 ---------------------------------------------------------------------- .../panels/AbstractSearchResultPanel.java | 4 +- .../console/panels/AnySearchResultPanel.java | 1 - .../console/rest/AbstractAnyRestClient.java | 11 ++- .../console/rest/AnyObjectRestClient.java | 3 +- .../client/console/rest/GroupRestClient.java | 2 +- .../client/console/rest/UserRestClient.java | 2 +- .../markup/html/form/AjaxDateFieldPanel.java | 80 ++++++++++++++++++++ .../markup/html/form/MultiFieldPanel.java | 35 +++++---- .../client/console/wizards/any/DerAttrs.java | 3 +- .../console/wizards/any/GroupDetails.java | 7 +- .../client/console/wizards/any/PlainAttrs.java | 48 ++++++++---- .../client/console/wizards/any/UserDetails.java | 14 ++-- .../client/console/wizards/any/VirAttrs.java | 4 +- .../markup/html/form/AjaxDateFieldPanel.html | 34 +++++++++ .../markup/html/form/DateTextFieldPanel.html | 22 ------ .../markup/html/form/DateTimeFieldPanel.html | 21 ----- .../html/form/DateTimeFieldPanel.properties | 17 ----- .../html/form/DateTimeFieldPanel_it.properties | 17 ----- .../form/DateTimeFieldPanel_pt_BR.properties | 17 ----- .../markup/html/form/MultiFieldPanel.html | 4 +- 20 files changed, 200 insertions(+), 146 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java index e6bd3ed..efd561b 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java @@ -138,6 +138,8 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM this.realm = realm; this.type = type; + + setWindowClosedReloadCallback(modal); } protected void initResultTable() { @@ -173,8 +175,6 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM }); paginatorForm.add(rowsChooser); // --------------------------- - -// setWindowClosedReloadCallback(modal); } public void search(final String fiql, final AjaxRequestTarget target) { http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java index 4e3efe3..3cc5e93 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java @@ -75,7 +75,6 @@ public class AnySearchResultPanel<T extends AnyTO> extends AbstractSearchResultP final String realm) { super(parentId, filtered, fiql, callerRef, restClient, realm, type); - //setCustomMarkupId(markupId); add(new Label("name", type)); this.schemaNames = new ArrayList<>(); http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java index 8ca57ab..c909aae 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java @@ -19,6 +19,7 @@ package org.apache.syncope.client.console.rest; import java.util.List; +import javax.ws.rs.core.GenericType; import org.apache.syncope.client.console.commons.status.StatusBean; import org.apache.syncope.client.console.commons.status.StatusUtils; import org.apache.syncope.common.lib.patch.AssociationPatch; @@ -28,6 +29,7 @@ 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.ConnObjectTO; +import org.apache.syncope.common.lib.to.ProvisioningResult; import org.apache.syncope.common.lib.types.ResourceAssociationAction; import org.apache.syncope.common.lib.types.ResourceDeassociationAction; import org.apache.syncope.common.rest.api.service.AnyService; @@ -49,14 +51,15 @@ public abstract class AbstractAnyRestClient extends BaseRestClient { public abstract ConnObjectTO readConnObject(String resourceName, Long key); - public abstract AnyTO delete(String etag, Long key); + public abstract <T extends AnyTO> ProvisioningResult<T> delete(String etag, Long key); - protected <T extends AnyTO, E extends AnyService<T, ?>> T delete( + protected <T extends AnyTO, E extends AnyService<T, ?>> ProvisioningResult<T> delete( final Class<E> serviceClass, final Class<T> objectType, final String etag, final Long key) { - T result; + ProvisioningResult<T> result; synchronized (this) { final E service = getService(etag, serviceClass); - result = service.delete(key).readEntity(objectType); + result = service.delete(key).readEntity(new GenericType<ProvisioningResult<T>>() { + }); resetClient(serviceClass); } return result; http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java index 589f140..ee3ff93 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java @@ -28,6 +28,7 @@ import org.apache.syncope.common.lib.to.BulkAction; import org.apache.syncope.common.lib.to.BulkActionResult; import org.apache.syncope.common.lib.to.ConnObjectTO; import org.apache.syncope.common.lib.to.PagedResult; +import org.apache.syncope.common.lib.to.ProvisioningResult; import org.apache.syncope.common.rest.api.service.AnyObjectService; import org.apache.syncope.common.rest.api.service.AnyService; import org.apache.wicket.extensions.markup.html.repeater.util.SortParam; @@ -107,7 +108,7 @@ public class AnyObjectRestClient extends AbstractAnyRestClient { } @Override - public AnyObjectTO delete(final String etag, final Long key) { + public ProvisioningResult<AnyObjectTO> delete(final String etag, final Long key) { return delete(AnyObjectService.class, AnyObjectTO.class, etag, key); } http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/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 fbf0ab0..1226199 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 @@ -110,7 +110,7 @@ public class GroupRestClient extends AbstractAnyRestClient { } @Override - public GroupTO delete(final String etag, final Long key) { + public ProvisioningResult<GroupTO> delete(final String etag, final Long key) { return delete(GroupService.class, GroupTO.class, etag, key); } http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/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 2f148c4..d665f83 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 @@ -87,7 +87,7 @@ public class UserRestClient extends AbstractAnyRestClient { } @Override - public UserTO delete(final String etag, final Long key) { + public ProvisioningResult<UserTO> delete(final String etag, final Long key) { return delete(UserService.class, UserTO.class, etag, key); } http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.java new file mode 100644 index 0000000..e7760d5 --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.java @@ -0,0 +1,80 @@ +/* + * 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.wicket.markup.html.form; + +import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.DateTextField; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.DateTextFieldConfig; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.datetime.DatetimePicker; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.datetime.DatetimePickerConfig; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.datetime.DatetimePickerIconConfig; +import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconType; +import java.util.Date; +import org.apache.syncope.common.lib.SyncopeConstants; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.ResourceModel; + +public class AjaxDateFieldPanel extends FieldPanel<Date> { + + private static final long serialVersionUID = -428975732068281726L; + + private final String datePattern; + + public AjaxDateFieldPanel(final String id, final String name, final IModel<Date> model, final String datePattern) { + super(id, name, model); + + this.datePattern = datePattern == null ? SyncopeConstants.DEFAULT_DATE_PATTERN : datePattern; + + if (this.datePattern.contains("H")) { + field = new DatetimePicker("textField", new DatetimePickerConfig() + .withFormat(this.datePattern) + .setShowToday(true) + .with(new DatetimePickerIconConfig() + .useDateIcon(FontAwesomeIconType.calendar) + .useTimeIcon(FontAwesomeIconType.clock_o) + .useUpIcon(FontAwesomeIconType.arrow_up) + .useDownIcon(FontAwesomeIconType.arrow_down) + )); + } else { + field = new DateTextField("textField", new DateTextFieldConfig() + .withFormat(this.datePattern) + .highlightToday(true) + .autoClose(true) + .showTodayButton(DateTextFieldConfig.TodayButton.TRUE)); + } + + add(field.setLabel(new ResourceModel(name, name)).setOutputMarkupId(true)); + add(field); + } + + @Override + public FieldPanel<Date> clone() { + final FieldPanel<Date> panel = new AjaxDateFieldPanel(getId(), name, new Model<Date>(null), datePattern); + + panel.setRequired(isRequired()); + panel.setReadOnly(isReadOnly()); + panel.setTitle(title); + + if (isRequiredLabelAdded) { + panel.addRequiredLabel(); + } + + return panel; + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java index b6c2d4f..0e5f99b 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java @@ -23,11 +23,11 @@ import java.util.List; import org.apache.syncope.client.console.commons.Constants; 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.ajax.markup.html.form.AjaxSubmitLink; import org.apache.wicket.event.Broadcast; -import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.panel.Fragment; @@ -44,7 +44,9 @@ public class MultiFieldPanel<E extends Serializable> extends AbstractFieldPanel< private final boolean eventTemplate; - private WebMarkupContainer container; + private final WebMarkupContainer container; + + private final Form<?> form; public MultiFieldPanel( final String id, final String name, final IModel<List<E>> model, final FieldPanel<E> panelTemplate) { @@ -69,12 +71,15 @@ public class MultiFieldPanel<E extends Serializable> extends AbstractFieldPanel< container = new WebMarkupContainer("multiValueContainer"); container.setOutputMarkupId(true); add(container); + + form = new Form<>("innerForm"); + container.add(form); // ----------------------- if (model.getObject().isEmpty()) { - container.addOrReplace(getNoDataFragment(model, name)); + form.addOrReplace(getNoDataFragment(model, name)); } else { - container.addOrReplace(getDataFragment(model, name)); + form.addOrReplace(getDataFragment(model, name)); } } @@ -112,18 +117,20 @@ public class MultiFieldPanel<E extends Serializable> extends AbstractFieldPanel< fieldPanel.setNewModel(item); item.add(fieldPanel.hideLabel().setRenderBodyOnly(true)); - final AjaxLink<Void> minus = new IndicatingAjaxLink<Void>("drop") { +// final AjaxLink<Void> minus = new IndicatingAjaxLink<Void>("drop") { + final AjaxSubmitLink minus = new AjaxSubmitLink("drop") { private static final long serialVersionUID = -7978723352517770644L; @Override - public void onClick(final AjaxRequestTarget target) { +// public void onClick(final AjaxRequestTarget target) { + protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) { //Drop current component model.getObject().remove(item.getModelObject()); fieldPanel.getField().clearInput(); if (model.getObject().isEmpty()) { - container.addOrReplace(getNoDataFragment(model, label)); + form.addOrReplace(getNoDataFragment(model, label)); } target.add(container); @@ -153,17 +160,19 @@ public class MultiFieldPanel<E extends Serializable> extends AbstractFieldPanel< } private Fragment getPlusFragment(final IModel<List<E>> model, final String label) { - final AjaxLink<Void> plus = new IndicatingAjaxLink<Void>("add") { +// final AjaxLink<Void> plus = new IndicatingAjaxLink<Void>("add") { + final AjaxSubmitLink plus = new AjaxSubmitLink("add") { private static final long serialVersionUID = -7978723352517770644L; @Override - public void onClick(final AjaxRequestTarget target) { +// public void onClick(final AjaxRequestTarget target) { + protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) { //Add current component model.getObject().add(null); if (model.getObject().size() == 1) { - container.addOrReplace(getDataFragment(model, label)); + form.addOrReplace(getDataFragment(model, label)); } target.add(container); @@ -181,10 +190,6 @@ public class MultiFieldPanel<E extends Serializable> extends AbstractFieldPanel< return view; } - public WebMarkupContainer getContainer() { - return container; - } - @Override public MultiFieldPanel<E> setModelObject(final List<E> object) { view.setModelObject(object); http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/DerAttrs.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/DerAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/DerAttrs.java index 42af808..fa1e21b 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/DerAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/DerAttrs.java @@ -120,7 +120,8 @@ public class DerAttrs extends WizardStep { model = new Model<String>(values.get(0)); } - final AjaxTextFieldPanel panel = new AjaxTextFieldPanel("panel", attrTO.getSchema(), model); + final AjaxTextFieldPanel panel = new AjaxTextFieldPanel( + "panel", attrTO.getSchema(), model, false); panel.setEnabled(false); panel.setRequired(true); http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java index 63ff592..3613558 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java @@ -72,7 +72,7 @@ public class GroupDetails extends WizardStep { this.add(groupOwnerSelectWin); final AjaxTextFieldPanel name - = new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(groupTO, "name")); + = new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(groupTO, "name"), false); final WebMarkupContainer jexlHelp = JexlHelpUtils.getJexlHelpWebContainer("jexlHelp"); @@ -88,7 +88,7 @@ public class GroupDetails extends WizardStep { userOwnerModel = new OwnerModel(groupTO, AnyTypeKind.USER); @SuppressWarnings("unchecked") - final AjaxTextFieldPanel userOwner = new AjaxTextFieldPanel("userOwner", "userOwner", userOwnerModel); + final AjaxTextFieldPanel userOwner = new AjaxTextFieldPanel("userOwner", "userOwner", userOwnerModel, false); userOwner.setReadOnly(true); userOwner.setOutputMarkupId(true); ownerContainer.add(userOwner); @@ -126,7 +126,8 @@ public class GroupDetails extends WizardStep { groupOwnerModel = new OwnerModel(groupTO, AnyTypeKind.GROUP); @SuppressWarnings("unchecked") - final AjaxTextFieldPanel groupOwner = new AjaxTextFieldPanel("groupOwner", "groupOwner", groupOwnerModel); + final AjaxTextFieldPanel groupOwner + = new AjaxTextFieldPanel("groupOwner", "groupOwner", groupOwnerModel, false); groupOwner.setReadOnly(true); groupOwner.setOutputMarkupId(true); ownerContainer.add(groupOwner); http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index 4501856..4982325 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -21,6 +21,7 @@ package org.apache.syncope.client.console.wizards.any; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.Date; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -30,6 +31,7 @@ import org.apache.syncope.client.console.commons.JexlHelpUtils; import org.apache.syncope.client.console.commons.Mode; import org.apache.syncope.client.console.rest.SchemaRestClient; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel; +import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDateFieldPanel; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel; import org.apache.syncope.client.console.wicket.markup.html.form.BinaryFieldPanel; @@ -197,29 +199,49 @@ public class PlainAttrs extends WizardStep { panel.setRequired(required); break; -// case Date: + case Date: + panel = new AjaxDateFieldPanel( + "panel", schemaTO.getKey(), new Model<Date>(), schemaTO.getConversionPattern()); +// // final String dataPattern = schemaTO.getConversionPattern() == null // ? SyncopeConstants.DEFAULT_DATE_PATTERN // : schemaTO.getConversionPattern(); // // if (dataPattern.contains("H")) { -// panel = new DateTimeFieldPanel("panel", schemaTO.getKey(), new Model<Date>(), dataPattern); // -// if (required) { -// panel.addRequiredLabel(); -// ((DateTimeFieldPanel) panel).setFormValidator(form); -// } -// panel.setStyleSheet("ui-widget-content ui-corner-all"); +// final DatetimePickerConfig conf = new DatetimePickerConfig().withFormat( +// "dd/MM/yyyy HH:mm:ss").with( +// new DatetimePickerIconConfig() +// .useDateIcon(FontAwesomeIconType.calendar) +// .useTimeIcon(FontAwesomeIconType.clock_o) +// .useUpIcon(FontAwesomeIconType.arrow_up) +// .useDownIcon(FontAwesomeIconType.arrow_down) +// ); +// +// add(new DatetimePicker("panel", conf)); +//// +//// panel = new DateTimeFieldPanel("panel", schemaTO.getKey(), new Model<Date>(), dataPattern); +//// +//// if (required) { +//// panel.addRequiredLabel(); +//// ((DateTimeFieldPanel) panel).setFormValidator(form); +//// } +//// panel.setStyleSheet("ui-widget-content ui-corner-all"); // } else { -// panel = new DateTextFieldPanel("panel", schemaTO.getKey(), new Model<Date>(), dataPattern); +// add(new DateTextField("panel", +// new DateTextFieldConfig() +// .autoClose(true) +// .withLanguage("es") +// .showTodayButton(DateTextFieldConfig.TodayButton.TRUE))); +//// panel = new DateTextFieldPanel("panel", schemaTO.getKey(), new Model<Date>(), dataPattern); // -// if (required) { -// panel.addRequiredLabel(); -// } +//// if (required) { +//// panel.addRequiredLabel(); +//// } // } -// break; + break; case Enum: - panel = new AjaxDropDownChoicePanel<String>("panel", schemaTO.getKey(), new Model<String>()); + panel = new AjaxDropDownChoicePanel<String>("panel", schemaTO.getKey(), new Model<String>(), false); ((AjaxDropDownChoicePanel<String>) panel).setChoices(getEnumeratedValues(schemaTO)); if (StringUtils.isNotBlank(schemaTO.getEnumerationKeys())) { http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java index 5918fd0..1b1fa58 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java @@ -40,8 +40,8 @@ public class UserDetails extends WizardStep { // ------------------------ // Username // ------------------------ - final FieldPanel<String> username = new AjaxTextFieldPanel("username", "username", - new PropertyModel<String>(userTO, "username")); + final FieldPanel<String> username = new AjaxTextFieldPanel( + "username", "username", new PropertyModel<String>(userTO, "username"), false); final WebMarkupContainer jexlHelp = JexlHelpUtils.getJexlHelpWebContainer("usernameJexlHelp"); @@ -61,23 +61,23 @@ public class UserDetails extends WizardStep { // ------------------------ final Form<?> form = new Form<>("passwordInnerForm"); add(form); - + final WebMarkupContainer pwdJexlHelp = JexlHelpUtils.getJexlHelpWebContainer("pwdJexlHelp"); final AjaxLink<?> pwdQuestionMarkJexlHelp = JexlHelpUtils.getAjaxLink(pwdJexlHelp, "pwdQuestionMarkJexlHelp"); form.add(pwdQuestionMarkJexlHelp); pwdQuestionMarkJexlHelp.add(pwdJexlHelp); - FieldPanel<String> passwordField - = new AjaxPasswordFieldPanel("password", "password", new PropertyModel<String>(userTO, "password")); + FieldPanel<String> passwordField = new AjaxPasswordFieldPanel( + "password", "password", new PropertyModel<String>(userTO, "password"), false); passwordField.setRequired(true); passwordField.setMarkupId("password"); passwordField.setPlaceholder("password"); ((PasswordTextField) passwordField.getField()).setResetPassword(true); form.add(passwordField); - FieldPanel<String> confirmPasswordField - = new AjaxPasswordFieldPanel("confirmPassword", "confirmPassword", new Model<String>()); + FieldPanel<String> confirmPasswordField = new AjaxPasswordFieldPanel( + "confirmPassword", "confirmPassword", new Model<String>(), false); confirmPasswordField.setRequired(true); confirmPasswordField.setMarkupId("confirmPassword"); confirmPasswordField.setPlaceholder("confirmPassword"); http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/VirAttrs.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/VirAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/VirAttrs.java index 3bfcc17..c17543d 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/VirAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/VirAttrs.java @@ -122,8 +122,8 @@ public class VirAttrs extends WizardStep { attrTO.setReadonly(schema.isReadonly()); - final AjaxTextFieldPanel panel - = new AjaxTextFieldPanel("panel", attrTO.getSchema(), new Model<String>()); + final AjaxTextFieldPanel panel = new AjaxTextFieldPanel( + "panel", attrTO.getSchema(), new Model<String>(), false); item.add(new MultiFieldPanel<String>( "panel", http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.html new file mode 100644 index 0000000..3168f31 --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDateFieldPanel.html @@ -0,0 +1,34 @@ +<!-- +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. +--> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> + <head> + <title>Ajaxt text field panel</title> + </head> + <body> + <wicket:extend> + <wicket:enclosure child="field-label"> + <label wicket:id="field-label">[LABEL]</label><span wicket:id="required"/> + <span wicket:id="externalAction"/> + </wicket:enclosure> + <fieldset class="input-group"> + <input type="text" class="form-control" wicket:id="textField"/> + </fieldset> + </wicket:extend> + </body> +</html> http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html deleted file mode 100644 index caaf991..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html +++ /dev/null @@ -1,22 +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. ---> -<wicket:extend> - <input type="text" class="text ui-widget-content ui-corner-all date_size" - wicket:id="field"/> -</wicket:extend> http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html deleted file mode 100644 index e3a191b..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html +++ /dev/null @@ -1,21 +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. ---> -<wicket:extend> - <span wicket:id="field"/> -</wicket:extend> http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties deleted file mode 100644 index 9a39f4c..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties +++ /dev/null @@ -1,17 +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. -field.DateTimeFieldPanel$DateTimeFormValidator=Field '${label0}' must be fully valued http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties deleted file mode 100644 index c524834..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties +++ /dev/null @@ -1,17 +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. -field.DateTimeFieldPanel$DateTimeFormValidator=Il campo '${label0}' dev'essere completamente valorizzato http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties deleted file mode 100644 index 95be437..0000000 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties +++ /dev/null @@ -1,17 +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. -field.DateTimeFieldPanel$DateTimeFormValidator=Campo'${label0}' precisa ser preenchido http://git-wip-us.apache.org/repos/asf/syncope/blob/fe5a398c/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html index d1e0a46..6bcb727 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html +++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html @@ -28,7 +28,9 @@ under the License. </wicket:enclosure> <span wicket:id="multiValueContainer"> - <span wicket:id="content">[content]</span> + <form wicket:id="innerForm"> + <span wicket:id="content">[content]</span> + </form> </span> <wicket:fragment wicket:id="noDataFragment">
