Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Apr 13, 2016
2 parents 53724f3 + 14cdd15 commit 58f4543
Show file tree
Hide file tree
Showing 42 changed files with 1,115 additions and 2,821 deletions.
3 changes: 3 additions & 0 deletions build-system/pom.xml
Expand Up @@ -1396,6 +1396,9 @@
<ignoredUnusedDeclaredDependency>org.testng:testng</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>commons-lang:commons-lang</ignoredUnusedDeclaredDependency>

<!-- Declared, but not used if building only with the "default" profile -->
<ignoredUnusedDeclaredDependency>org.aspectj:aspectjweaver</ignoredUnusedDeclaredDependency>

<!-- There is some kind of conflict between these. TODO: clean up -->
<ignoredUnusedDeclaredDependency>xml-apis:xml-apis</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>stax:stax-api</ignoredUnusedDeclaredDependency>
Expand Down
Expand Up @@ -33,7 +33,7 @@ public class GuiStyleConstants {
public static final String STYLES_OBJECT_SERVICE_ICON = "fa fa-cloud";
public static final String STYLES_OBJECT_SERVICE_ICON_COLORED = STYLES_OBJECT_SERVICE_ICON + " object-service-color";

public static final String STYLES_OBJECT_RESOURCE_ICON = "fa fa-laptop";
public static final String STYLES_OBJECT_RESOURCE_ICON = "fa fa-database";
public static final String STYLES_OBJECT_RESOURCE_ICON_COLORED = STYLES_OBJECT_RESOURCE_ICON + " object-resource-color";

public static final String STYLES_OBJECT_TASK_ICON = "fa fa-tasks";
Expand Down
@@ -1,3 +1,18 @@
/*
* Copyright (c) 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.
*/
package com.evolveum.midpoint.gui.api.component;

import java.util.Collection;
Expand All @@ -21,8 +36,10 @@
import com.evolveum.midpoint.web.page.admin.configuration.PageImportObject;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;

/**
* @author katkav
*/
public abstract class MainObjectListPanel<T extends ObjectType> extends ObjectListPanel<T> {

private static final long serialVersionUID = 1L;

private static final String ID_REFRESH = "refresh";
Expand All @@ -42,7 +59,7 @@ protected void onClickPerformed(AjaxRequestTarget target) {
};
add(refreshIcon);

LinkIconPanel newObjectIcon = new LinkIconPanel(ID_NEW_OBJECT, new Model<String>("fa fa-edit")){
LinkIconPanel newObjectIcon = new LinkIconPanel(ID_NEW_OBJECT, new Model<String>("fa fa-edit")){

@Override
protected void onClickPerformed(AjaxRequestTarget target) {
Expand All @@ -51,7 +68,7 @@ protected void onClickPerformed(AjaxRequestTarget target) {
};
add(newObjectIcon);

LinkIconPanel importObject = new LinkIconPanel(ID_IMPORT_OBJECT, new Model<String>("fa fa-download")){
LinkIconPanel importObject = new LinkIconPanel(ID_IMPORT_OBJECT, new Model<String>("fa fa-download")){

@Override
protected void onClickPerformed(AjaxRequestTarget target) {
Expand Down
Expand Up @@ -49,6 +49,12 @@
import com.evolveum.midpoint.web.component.search.SearchFormPanel;
import com.evolveum.midpoint.web.component.util.ListDataProvider2;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.page.admin.reports.PageReports;
import com.evolveum.midpoint.web.page.admin.resources.PageResources;
import com.evolveum.midpoint.web.page.admin.roles.PageRoles;
import com.evolveum.midpoint.web.page.admin.services.PageService;
import com.evolveum.midpoint.web.page.admin.services.PageServices;
import com.evolveum.midpoint.web.page.admin.users.PageUsers;
import com.evolveum.midpoint.web.session.PageStorage;
import com.evolveum.midpoint.web.session.SessionStorage;
import com.evolveum.midpoint.web.session.UserProfileStorage.TableId;
Expand All @@ -58,12 +64,12 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

/**
* @author katkav
*/
public abstract class ObjectListPanel<T extends ObjectType> extends BasePanel<T> {

/**
*
*/
private static final long serialVersionUID = 1L;

// private static final String ID_SEARCH_FORM = "searchForm";
private static final String ID_MAIN_FORM = "mainForm";
private static final String ID_BUTTON_CANCEL = "cancelButton";
Expand Down Expand Up @@ -95,10 +101,11 @@ public Class<T> getType() {

static {
storageMap = new HashMap<Class, String>();
storageMap.put(UserType.class, SessionStorage.KEY_USERS);
storageMap.put(ResourceType.class, SessionStorage.KEY_RESOURCES);
storageMap.put(ReportType.class, SessionStorage.KEY_REPORTS);
storageMap.put(RoleType.class, SessionStorage.KEY_ROLES);
storageMap.put(PageUsers.class, SessionStorage.KEY_USERS);
storageMap.put(PageResources.class, SessionStorage.KEY_RESOURCES);
storageMap.put(PageReports.class, SessionStorage.KEY_REPORTS);
storageMap.put(PageRoles.class, SessionStorage.KEY_ROLES);
storageMap.put(PageServices.class, SessionStorage.KEY_SERVICES);
// storageMap.put(ObjectType.class, SessionStorage.KEY_CONFIGURATION);
// storageMap.put(FocusType.class, SessionStorage.KEY_ROLE_MEMBERS);

Expand Down Expand Up @@ -159,7 +166,7 @@ private void initLayout() {

@Override
public Search load() {
String storageKey = storageMap.get(type);
String storageKey = getStorageKey();//storageMap.get(parentPage.getClass());
Search search = null;
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap()
Expand Down Expand Up @@ -189,7 +196,7 @@ protected BaseSortableDataProvider<SelectableBean<T>> getProvider() {
parentPage, type) {
@Override
protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
String storageKey = storageMap.get(type);
String storageKey = getStorageKey();//storageMap.get(type);
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap()
.get(storageKey);
Expand Down Expand Up @@ -242,7 +249,7 @@ protected void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {

};
table.setOutputMarkupId(true);
String storageKey = storageMap.get(type);
String storageKey = getStorageKey();//storageMap.get(type);
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap().get(storageKey);
if (storage != null) {
Expand All @@ -264,13 +271,20 @@ private BaseSortableDataProvider<SelectableBean<T>> getDataProvider() {
protected BoxedTablePanel<SelectableBean<T>> getTable() {
return (BoxedTablePanel<SelectableBean<T>>) get(createComponentPath(ID_MAIN_FORM, ID_TABLE));
}

private String getStorageKey(){
return storageMap.get(parentPage.getClass());
}

private void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
BaseSortableDataProvider<SelectableBean<T>> provider = getDataProvider();
provider.setQuery(query);
String storageKey = storageMap.get(type);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap().get(storageKey);
if (storage == null) {
storage = getSession().getSessionStorage().initPageStorage(storageKey);
}
if (storage != null) {
storage.setSearch(searchModel.getObject());
storage.setPaging(null);
Expand Down Expand Up @@ -304,10 +318,6 @@ public StringResourceModel createStringResource(String resourceKey, Object... ob
return PageBase.createStringResourceStatic(this, resourceKey, objects);
}

protected void onCheckboxUpdate(AjaxRequestTarget target) {

}

protected abstract IColumn<SelectableBean<T>, String> createCheckboxColumn();

protected abstract IColumn<SelectableBean<T>, String> createNameColumn();
Expand Down
@@ -1,9 +1,9 @@
package com.evolveum.midpoint.gui.api.component;

import java.util.Collection;
import java.util.List;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.model.IModel;
Expand All @@ -26,7 +26,19 @@ public PopupObjectListPanel(String id, Class<T> type, boolean multiselect, PageB
@Override
protected IColumn<SelectableBean<T>, String> createCheckboxColumn() {
if (isMultiselect()) {
return new CheckBoxHeaderColumn<SelectableBean<T>>();
return new CheckBoxHeaderColumn<SelectableBean<T>>() {
@Override
protected void onUpdateRow(AjaxRequestTarget target, DataTable table, IModel<SelectableBean<T>> rowModel) {
super.onUpdateRow(target, table, rowModel);
onUpdateCheckbox(target);
};

@Override
protected void onUpdateHeader(AjaxRequestTarget target, boolean selected, DataTable table) {
super.onUpdateHeader(target, selected, table);
onUpdateCheckbox(target);
}
};
}
return null;
}
Expand Down Expand Up @@ -65,5 +77,9 @@ protected void onSelectPerformed(AjaxRequestTarget target, T object){
protected List<InlineMenuItem> createInlineMenu() {
return null;
}

protected void onUpdateCheckbox(AjaxRequestTarget target){

}

}
Expand Up @@ -17,28 +17,37 @@
<wicket:panel xmlns:wicket="http://wicket.apache.org">

<div class="form-inline search-form">

<div class="form-group">
<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 class="form-group col-md-4">
<label><wicket:message key="typedAssignablePanel.selectedResources" /></label>
<label class="form-control input-sm" wicket:id="resourcesSelected" />
</div>
<div class="form-group col-md-4">
<label><wicket:message key="typedAssignablePanel.selectedRoles" /></label>
<label class="form-control input-sm" wicket:id="rolesSelected" />
</div>
<div class="form-group col-md-4">
<label><wicket:message key="typedAssignablePanel.selectedOrgs" /></label>
<label class="form-control input-sm" wicket:id="orgSelected" />
</div>
<div wicket:id="countContainer">
<div class="form-group col-md-3">
<label><wicket:message key="typedAssignablePanel.selectedResources" /></label>
<label wicket:id="resourcesSelected" />
</div>
<div class="form-group col-md-3">
<label><wicket:message key="typedAssignablePanel.selectedRoles" /></label>
<label wicket:id="rolesSelected" />
</div>
<div class="form-group col-md-3">
<label><wicket:message key="typedAssignablePanel.selectedOrgs" /></label>
<label wicket:id="orgSelected" />
</div>
<div class="form-group col-md-3">
<label><wicket:message key="typedAssignablePanel.selectedServices" /></label>
<label wicket:id="servicesSelected" />
</div>
</div>
</div>

<div wicket:id="roleTable"></div>
<div wicket:id="resourceTable"></div>
<div wicket:id="orgTable"></div>
<div wicket:id="tablesContainer">
<div wicket:id="roleTable"></div>
<div wicket:id="resourceTable"></div>
<div wicket:id="orgTable"></div>
<div wicket:id="serviceTable"></div>
</div>
<a class="btn btn-sm btn-primary" wicket:id="assignButton"/>
</wicket:panel>

0 comments on commit 58f4543

Please sign in to comment.