Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
Conflicts:
	gui/admin-gui/src/main/resources/localization/Midpoint.properties
  • Loading branch information
katkav committed Apr 14, 2016
2 parents f3b397d + e0a2872 commit c7552e2
Show file tree
Hide file tree
Showing 70 changed files with 2,301 additions and 1,598 deletions.
Expand Up @@ -42,11 +42,21 @@ public class GuiStyleConstants {
public static final String CLASS_OBJECT_RESOURCE_BOX_CSS_CLASSES = "box object-resource-box";

public static final String CLASS_OBJECT_TASK_ICON = "fa fa-tasks";
public static final String CLASS_OBJECT_TASK_ICON_COLORED = CLASS_OBJECT_TASK_ICON;
public static final String CLASS_OBJECT_TASK_ICON_COLORED = CLASS_OBJECT_TASK_ICON + " object-task-color";
public static final String CLASS_OBJECT_TASK_BOX_CSS_CLASSES = "box object-task-box";


public static final String CLASS_OBJECT_WORK_ITEM_ICON = "fa fa-inbox";
public static final String CLASS_OBJECT_WORK_ITEM_ICON_COLORED = CLASS_OBJECT_WORK_ITEM_ICON + " object-task-color"; // TODO

public static final String CLASS_OBJECT_CERT_DEF_ICON = "fa fa-certificate";
public static final String CLASS_OBJECT_CERT_DEF_ICON_COLORED = CLASS_OBJECT_CERT_DEF_ICON + " object-task-color"; // TODO

public static final String CLASS_OBJECT_CERT_CAMPAIGN_ICON = "fa fa-gavel";
public static final String CLASS_OBJECT_CERT_CAMPAIGN_ICON_COLORED = CLASS_OBJECT_CERT_CAMPAIGN_ICON + " object-task-color"; // TODO

public static final String CLASS_ICON_STYLE_NORMAL = "icon-style-normal";
public static final String CLASS_ICON_STYLE_DISABLED = "icon-style-disabled";
public static final String CLASS_ICON_STYLE_ARCHIVED = "icon-style-archived";
public static final String CLASS_ICON_STYLE_PRIVILEGED = "icon-style-privileged";
public static final String CLASS_ICON_STYLE_WARNING = "icon-style-warning";
public static final String CLASS_ICON_STYLE_UP = "icon-style-up";
Expand Down
Expand Up @@ -111,7 +111,7 @@ public void onClick(AjaxRequestTarget target) {
};
add(newObjectIcon);

AjaxIconButton importObject = new AjaxIconButton(ID_IMPORT_OBJECT, new Model<>("fa fa-download"),
AjaxIconButton importObject = new AjaxIconButton(ID_IMPORT_OBJECT, new Model<>("fa fa-upload"),
mainObjectListPanel.createStringResource("MainObjectListPanel.import")) {

@Override
Expand Down
Expand Up @@ -17,12 +17,14 @@
<wicket:panel xmlns:wicket="http://wicket.apache.org">

<div class="form-inline search-form">
<div class="row">
<div class="form-group col-md-12">
<label><wicket:message key="roleMemberPanel.type" /></label>
<select class="form-control input-sm" wicket:id="type" />
</div>
</div>
<div class="row">
<div class="form-group col-md-12">
<label>
<wicket:message key="roleMemberPanel.type"/>
</label>
<select class="form-control input-sm" wicket:id="type"/>
</div>
</div>
<div wicket:id="countContainer">
<div class="form-group col-md-3">
<label><wicket:message key="typedAssignablePanel.selectedResources" /></label>
Expand Down
Expand Up @@ -977,7 +977,7 @@ protected List<SideBarMenuItem> createMenuItems() {
}

private MainMenuItem createWorkItemsItems() {
MainMenuItem item = new MainMenuItem("fa fa-inbox", createStringResource("PageAdmin.menu.top.workItems"), null);
MainMenuItem item = new MainMenuItem(GuiStyleConstants.CLASS_OBJECT_WORK_ITEM_ICON_COLORED, createStringResource("PageAdmin.menu.top.workItems"), null);

List<MenuItem> submenu = item.getItems();

Expand Down
Expand Up @@ -721,10 +721,16 @@ public static Locale getCurrentLocale(){
return locale;
}

public static String getLocalizedDate(Date date, String style){
public static String getLocalizedDate(XMLGregorianCalendar date, String style) {
return getLocalizedDate(XmlTypeConverter.toDate(date), style);
}

public static String getLocalizedDate(Date date, String style) {
if (date == null) {
return null;
}
PatternDateConverter converter = new PatternDateConverter(getLocalizedDatePattern(style), true );
return converter.convertToString(date, WebComponentUtil.getCurrentLocale());

}

public static boolean isActivationEnabled(PrismObject object) {
Expand Down Expand Up @@ -831,8 +837,12 @@ public static String createServiceIcon(PrismObject<ServiceType> object) {

private static <F extends FocusType> String getIconEnabledDisabled(PrismObject<F> object, String baseIcon) {
ActivationType activation = object.asObjectable().getActivation();
if (activation != null && ActivationStatusType.DISABLED.equals(activation.getEffectiveStatus())) {
return baseIcon + " " + GuiStyleConstants.CLASS_ICON_STYLE_DISABLED;
if (activation != null) {
if (ActivationStatusType.DISABLED.equals(activation.getEffectiveStatus())) {
return baseIcon + " " + GuiStyleConstants.CLASS_ICON_STYLE_DISABLED;
} else if (ActivationStatusType.ARCHIVED.equals(activation.getEffectiveStatus())) {
return baseIcon + " " + GuiStyleConstants.CLASS_ICON_STYLE_ARCHIVED;
}
}

return baseIcon + " " + GuiStyleConstants.CLASS_ICON_STYLE_NORMAL;
Expand Down
Expand Up @@ -34,7 +34,6 @@
</span>
</span>
<span wicket:id="summaryTagBox" class="summary-tag-box">
<span wicket:id="firstSummaryTag"/>
<wicket:child />
</span>
</span>
Expand Down
@@ -1,9 +1,9 @@
package com.evolveum.midpoint.web.component;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.model.PrismPropertyRealValueFromPrismObjectModel;
import com.evolveum.midpoint.web.model.PrismPropertyRealValueFromContainerableModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import org.apache.wicket.AttributeModifier;
Expand All @@ -21,7 +21,7 @@
* @author semancik
* @author mederly
*/
public abstract class AbstractSummaryPanel<O extends ObjectType> extends BasePanel<PrismObject<O>> {
public abstract class AbstractSummaryPanel<C extends Containerable> extends BasePanel<C> {

protected static final String ID_BOX = "summaryBox";
protected static final String ID_ICON_BOX = "summaryIconBox";
Expand All @@ -36,7 +36,6 @@ public abstract class AbstractSummaryPanel<O extends ObjectType> extends BasePan

protected static final String ID_PHOTO = "summaryPhoto"; // perhaps useful only for focal objects but it was simpler to include it here
protected static final String ID_ORGANIZATION = "summaryOrganization"; // similar (requires ObjectWrapper to get parent organizations so hard to use in ObjectSummaryPanel)
protected static final String ID_FIRST_SUMMARY_TAG = "firstSummaryTag";

protected static final String BOX_CSS_CLASS = "info-box";
protected static final String ICON_BOX_CSS_CLASS = "info-box-icon";
Expand All @@ -45,7 +44,7 @@ public abstract class AbstractSummaryPanel<O extends ObjectType> extends BasePan
protected WebMarkupContainer tagBox;
protected WebMarkupContainer iconBox;

public AbstractSummaryPanel(String id, IModel<PrismObject<O>> model) {
public AbstractSummaryPanel(String id, IModel<C> model) {
super(id, model);
}

Expand All @@ -56,10 +55,10 @@ protected void initLayoutCommon() {

box.add(new AttributeModifier("class", BOX_CSS_CLASS + " " + getBoxAdditionalCssClass()));

box.add(new Label(ID_DISPLAY_NAME, new PrismPropertyRealValueFromPrismObjectModel<>(getModel(), getDisplayNamePropertyName())));
box.add(new Label(ID_DISPLAY_NAME, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getDisplayNamePropertyName())));

WebMarkupContainer identifierPanel = new WebMarkupContainer(ID_IDENTIFIER_PANEL);
identifierPanel.add(new Label(ID_IDENTIFIER, new PrismPropertyRealValueFromPrismObjectModel<>(getModel(), getIdentifierPropertyName())));
identifierPanel.add(new Label(ID_IDENTIFIER, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getIdentifierPropertyName())));
identifierPanel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
Expand All @@ -69,15 +68,15 @@ public boolean isVisible() {
box.add(identifierPanel);

if (getTitlePropertyName() != null) {
box.add(new Label(ID_TITLE, new PrismPropertyRealValueFromPrismObjectModel<>(getModel(), getTitlePropertyName())));
box.add(new Label(ID_TITLE, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getTitlePropertyName())));
} else if (getTitleModel() != null) {
box.add(new Label(ID_TITLE, getTitleModel()));
} else {
box.add(new Label(ID_TITLE, " "));
}

if (getTitle2PropertyName() != null) {
box.add(new Label(ID_TITLE2, new PrismPropertyRealValueFromPrismObjectModel<>(getModel(), getTitle2PropertyName())));
box.add(new Label(ID_TITLE2, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getTitle2PropertyName())));
} else if (getTitle2Model() != null) {
box.add(new Label(ID_TITLE2, getTitle2Model()));
} else {
Expand All @@ -87,7 +86,7 @@ public boolean isVisible() {
}

if (getTitle3PropertyName() != null) {
box.add(new Label(ID_TITLE3, new PrismPropertyRealValueFromPrismObjectModel<>(getModel(), getTitle3PropertyName())));
box.add(new Label(ID_TITLE3, new PrismPropertyRealValueFromContainerableModel<>(getModel(), getTitle3PropertyName())));
} else if (getTitle3Model() != null) {
box.add(new Label(ID_TITLE3, getTitle3Model()));
} else {
Expand Down Expand Up @@ -159,7 +158,9 @@ protected QName getIdentifierPropertyName() {
return FocusType.F_NAME;
}

protected abstract QName getDisplayNamePropertyName();
protected QName getDisplayNamePropertyName() {
return ObjectType.F_NAME;
}

protected QName getTitlePropertyName() {
return null;
Expand Down
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-2016 Evolveum
~
~ Licensed 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">
<body>
<wicket:extend>
<span wicket:id="activationTag"/>
<wicket:child/>
</wicket:extend>
</body>
</html>
Expand Up @@ -20,6 +20,7 @@
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.util.SummaryTag;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.model.ContainerableFromPrismObjectModel;
import com.evolveum.midpoint.web.model.ReadOnlyPrismObjectFromObjectWrapperModel;
import com.evolveum.midpoint.web.model.ReadOnlyWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
Expand All @@ -36,19 +37,20 @@
*/
public abstract class FocusSummaryPanel<O extends ObjectType> extends AbstractSummaryPanel<O> {
private static final long serialVersionUID = 1L;


private static final String ID_ACTIVATION_TAG = "activationTag";
protected static final String ICON_CLASS_ACTIVATION_ACTIVE = "fa fa-check";
protected static final String ICON_CLASS_ACTIVATION_INACTIVE = "fa fa-times";

private IModel<ObjectWrapper<O>> wrapperModel;

public FocusSummaryPanel(String id, final IModel<ObjectWrapper<O>> model) {
super(id, new ReadOnlyPrismObjectFromObjectWrapperModel<O>(model));
super(id, new ContainerableFromPrismObjectModel<O>(new ReadOnlyPrismObjectFromObjectWrapperModel<O>(model)));

this.wrapperModel = model;
initLayoutCommon(); // calls getParentOrgModel that depends on wrapperModel

SummaryTag<O> tagActivation = new SummaryTag<O>(ID_FIRST_SUMMARY_TAG, model) {
SummaryTag<O> tagActivation = new SummaryTag<O>(ID_ACTIVATION_TAG, model) {
@Override
protected void initialize(ObjectWrapper<O> wrapper) {
ActivationType activation = null;
Expand Down Expand Up @@ -108,7 +110,7 @@ protected IModel<AbstractResource> getPhotoModel() {
@Override
public AbstractResource getObject() {
byte[] jpegPhoto = null;
O object = getModel().getObject().asObjectable();
O object = getModel().getObject();
if (object instanceof FocusType) {
jpegPhoto = ((FocusType) object).getJpegPhoto();
}
Expand Down
@@ -0,0 +1,28 @@
<!--
~ Copyright (c) 2010-2016 Evolveum
~
~ Licensed 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>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="row">
<div class="col-md-12">
<div wicket:id="container">
<div class="col-md-11" wicket:id="label"></div>
<div class="col-md-1 btn btn-primary btn-xs" wicket:id="button"></div>
</div>
</div>
</div>
</wicket:panel>
</html>

0 comments on commit c7552e2

Please sign in to comment.