Skip to content

Commit

Permalink
modified midpoint.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ardanu committed Oct 13, 2016
2 parents caca48d + f486b2b commit e03ddb2
Show file tree
Hide file tree
Showing 42 changed files with 2,486 additions and 418 deletions.
Expand Up @@ -30,16 +30,19 @@ public class GuiStyleConstants {
public static final String CLASS_OBJECT_USER_BOX_THIN_CSS_CLASSES = "object-user-box-thin";

public static final String CLASS_OBJECT_ROLE_ICON = "fa fa-street-view";
public static final String CLASS_OBJECT_ROLE_BG = "object-role-bg";
public static final String CLASS_OBJECT_ROLE_ICON_COLORED = CLASS_OBJECT_ROLE_ICON + " object-role-color";
public static final String CLASS_OBJECT_ROLE_BOX_CSS_CLASSES = "object-role-box";
public static final String CLASS_OBJECT_ROLE_BOX_THIN_CSS_CLASSES = "object-role-box-thin";

public static final String CLASS_OBJECT_ORG_ICON = "fa fa-building";
public static final String CLASS_OBJECT_ORG_BG = "object-org-bg";
public static final String CLASS_OBJECT_ORG_ICON_COLORED = CLASS_OBJECT_ORG_ICON + " object-org-color";
public static final String CLASS_OBJECT_ORG_BOX_CSS_CLASSES = "object-org-box";
public static final String CLASS_OBJECT_ORG_BOX_THIN_CSS_CLASSES = "object-org-box-thin";

public static final String CLASS_OBJECT_SERVICE_ICON = "fa fa-cloud";
public static final String CLASS_OBJECT_SERVICE_BG = "object-service-bg";
public static final String CLASS_OBJECT_SERVICE_ICON_COLORED = CLASS_OBJECT_SERVICE_ICON + " object-service-color";
public static final String CLASS_OBJECT_SERVICE_BOX_CSS_CLASSES = "object-service-box";
public static final String CLASS_OBJECT_SERVICE_BOX_THIN_CSS_CLASSES = "object-service-box-thin";
Expand Down
Expand Up @@ -17,18 +17,23 @@

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.exception.*;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.page.admin.orgs.OrgTreePanel;
import com.evolveum.midpoint.web.page.self.dto.AssignmentViewType;
import com.evolveum.midpoint.web.session.SessionStorage;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.commons.lang.StringUtils;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import javax.xml.namespace.QName;
Expand All @@ -46,7 +51,13 @@ public class AssignmentCatalogPanel<F extends AbstractRoleType> extends BasePane
private static String ID_CATALOG_ITEMS_PANEL_CONTAINER = "catalogItemsPanelContainer";
private static String ID_CATALOG_ITEMS_PANEL = "catalogItemsPanel";

private static final String DOT_CLASS = AssignmentCatalogPanel.class.getName() + ".";
private static final String OPERATION_LOAD_ROLE_CATALOG_REFERENCE = DOT_CLASS + "loadRoleCatalogReference";
private static final Trace LOGGER = TraceManager.getTrace(AssignmentCatalogPanel.class);

private PageBase pageBase;
private IModel<String> rootOidModel;
private String rootOid;

public AssignmentCatalogPanel(String id) {
super(id);
Expand All @@ -55,21 +66,32 @@ public AssignmentCatalogPanel(String id) {
public AssignmentCatalogPanel(String id, String rootOid, PageBase pageBase) {
super(id);
this.pageBase = pageBase;
initLayout(null, rootOid);
this.rootOid = rootOid;
initLayout();
}

public AssignmentCatalogPanel(String id, PageBase pageBase) {
this(id, AssignmentViewType.getViewTypeFromSession(pageBase), pageBase);
}

public AssignmentCatalogPanel(String id, QName viewTypeClass, PageBase pageBase) {
public AssignmentCatalogPanel(String id, AssignmentViewType viewType, PageBase pageBase) {
super(id);
this.pageBase = pageBase;
initLayout(viewTypeClass, null);
AssignmentViewType.saveViewTypeToSession(pageBase, viewType);
initLayout();
}

private void initLayout(QName viewTypeClass, final String rootOid) {

private void initLayout() {
initModels();
setOutputMarkupId(true);
addOrReplaceLayout();
}
public void addOrReplaceLayout(){
WebMarkupContainer treePanelContainer = new WebMarkupContainer(ID_TREE_PANEL_CONTAINER);
treePanelContainer.setOutputMarkupId(true);
add(treePanelContainer);
if (rootOid != null) {
addOrReplace(treePanelContainer);
if (AssignmentViewType.ROLE_CATALOG_VIEW.equals(AssignmentViewType.getViewTypeFromSession(pageBase)) && StringUtils.isNotEmpty(rootOid)) {
OrgTreePanel treePanel = new OrgTreePanel(ID_TREE_PANEL, new IModel<String>() {
@Override
public String getObject() {
Expand Down Expand Up @@ -106,38 +128,85 @@ protected List<InlineMenuItem> createTreeChildrenMenu() {
};
treePanel.setOutputMarkupId(true);
treePanelContainer.add(new AttributeAppender("class", "col-md-3"));
treePanelContainer.add(treePanel);
treePanelContainer.addOrReplace(treePanel);
} else {
WebMarkupContainer treePanel = new WebMarkupContainer(ID_TREE_PANEL);
treePanel.setVisible(false);
treePanel.setOutputMarkupId(true);
treePanelContainer.add(treePanel);
treePanelContainer.addOrReplace(treePanel);
}

WebMarkupContainer catalogItemsPanelContainer = new WebMarkupContainer(ID_CATALOG_ITEMS_PANEL_CONTAINER);
catalogItemsPanelContainer.setOutputMarkupId(true);
add(catalogItemsPanelContainer);
addOrReplace(catalogItemsPanelContainer);

CatalogItemsPanel catalogItemsPanel;
if (rootOid != null) {
catalogItemsPanel = new CatalogItemsPanel(ID_CATALOG_ITEMS_PANEL, rootOid, pageBase);
CatalogItemsPanel catalogItemsPanel = new CatalogItemsPanel(ID_CATALOG_ITEMS_PANEL, rootOidModel, pageBase);
if (AssignmentViewType.ROLE_CATALOG_VIEW.equals(AssignmentViewType.getViewTypeFromSession(pageBase))) {
catalogItemsPanelContainer.add(new AttributeAppender("class", "col-md-9"));
} else {
catalogItemsPanel = new CatalogItemsPanel(ID_CATALOG_ITEMS_PANEL, viewTypeClass, pageBase);
catalogItemsPanelContainer.add(new AttributeAppender("class", "col-md-12"));
}
catalogItemsPanel.setOutputMarkupId(true);
catalogItemsPanelContainer.add(catalogItemsPanel);
catalogItemsPanelContainer.addOrReplace(catalogItemsPanel);
}

private void selectTreeItemPerformed(SelectableBean<OrgType> selected, AjaxRequestTarget target) {
final OrgType selectedOgr = selected.getValue();
CatalogItemsPanel catalogItemsPanel = new CatalogItemsPanel(ID_CATALOG_ITEMS_PANEL, selectedOgr.getOid(), pageBase);
rootOidModel.setObject(selectedOgr.getOid());
AssignmentViewType.saveViewTypeToSession(pageBase, AssignmentViewType.ROLE_CATALOG_VIEW);
CatalogItemsPanel catalogItemsPanel = new CatalogItemsPanel(ID_CATALOG_ITEMS_PANEL, rootOidModel, pageBase);
catalogItemsPanel.setOutputMarkupId(true);
((WebMarkupContainer) get(ID_CATALOG_ITEMS_PANEL_CONTAINER)).addOrReplace(catalogItemsPanel);
target.add(catalogItemsPanel);
target.add(get(ID_CATALOG_ITEMS_PANEL_CONTAINER));
}

private void initModels(){
rootOidModel = new IModel<String>() {
@Override
public String getObject() {
return rootOid;
}

@Override
public void setObject(String s) {
rootOid = s;
}

@Override
public void detach() {

}
};
}

public String getRootOid() {
return rootOid;
}

public void setRootOid(String rootOid) {
this.rootOid = rootOid;
}

private String getRoleCatalogOid() {
Task task = getPageBase().createAnonymousTask(OPERATION_LOAD_ROLE_CATALOG_REFERENCE);
OperationResult result = task.getResult();

PrismObject<SystemConfigurationType> config;
try {
config = getPageBase().getModelService().getObject(SystemConfigurationType.class,
SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, task, result);
} catch (ObjectNotFoundException | SchemaException | SecurityViolationException
| CommunicationException | ConfigurationException e) {
LOGGER.error("Error getting system configuration: {}", e.getMessage(), e);
return null;
}
if (config != null && config.asObjectable().getRoleManagement() != null &&
config.asObjectable().getRoleManagement().getRoleCatalogRef() != null) {
return config.asObjectable().getRoleManagement().getRoleCatalogRef().getOid();
}
return "";
}

}

Expand Up @@ -17,16 +17,19 @@
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div wicket:id="headerPanel" class="box-header">
<form class="form-inline search-form pull-left" wicket:id="searchForm">
<div wicket:id="headerPanel" class="row box-header">
<select class="col-md-3 input-sm" wicket:id="viewTypeSelect"/>

<form class="col-md-8 search-form" wicket:id="searchForm">
<div wicket:id="search"/>
</form>
<a wicket:id="cartButton" class="col-md-1 pull-right" style="font-size: 24px">
<a wicket:id="cartButton" class="col-md-1" style="font-size: 24px">
<i class="fa fa-shopping-cart" style="width: 50%;"></i>
<span wicket:id="itemsCount" class="badge bg-red" style="font-size: 10px; position: absolute; top: -1px; right: 50%;"></span>
<span wicket:id="itemsCount" class="badge bg-red"
style="font-size: 10px; position: absolute; top: -1px; right: 50%;"></span>
</a>
</div>
<div class="row" wicket:id="multiButtonTable" style="min-height: 460px; margin-left: 15px;"/>
<div class="row shopping-cart-item-table" wicket:id="multiButtonTable"/>
<div wicket:id="footer"/>
</wicket:panel>

Expand Down

0 comments on commit e03ddb2

Please sign in to comment.