Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 11, 2016
2 parents cb7d140 + 0a80fb7 commit 51da6b1
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 63 deletions.
@@ -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.web.component.assignment;

import com.evolveum.midpoint.gui.api.component.BasePanel;
Expand All @@ -24,7 +39,9 @@
* Created by honchar.
*/
public class AssignmentCatalogPanel<F extends AbstractRoleType> extends BasePanel {
private static String ID_TREE_PANEL_CONTAINER = "treePanelContainer";
private static final long serialVersionUID = 1L;

private static String ID_TREE_PANEL_CONTAINER = "treePanelContainer";
private static String ID_TREE_PANEL = "treePanel";
private static String ID_CATALOG_ITEMS_PANEL_CONTAINER = "catalogItemsPanelContainer";
private static String ID_CATALOG_ITEMS_PANEL = "catalogItemsPanel";
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.web.component.assignment;

import com.evolveum.midpoint.gui.api.component.BasePanel;
Expand Down Expand Up @@ -46,7 +61,9 @@
* Created by honchar
*/
public class CatalogItemsPanel extends BasePanel implements IPageableItems {
private static String ID_MULTI_BUTTON_TABLE = "multiButtonTable";
private static final long serialVersionUID = 1L;

private static final String ID_MULTI_BUTTON_TABLE = "multiButtonTable";
private static final String ID_SEARCH_FORM = "searchForm";
private static final String ID_SEARCH = "search";
private static final String ID_PAGING_FOOTER = "pagingFooter";
Expand All @@ -57,7 +74,7 @@ public class CatalogItemsPanel extends BasePanel implements IPageableItems {
private static final String ID_BUTTON_TOOLBAR = "buttonToolbar";
private static final String ID_FOOTER = "footer";
private static final String ID_CART_BUTTON = "cartButton";
private static String ID_CART_ITEMS_COUNT = "itemsCount";
private static final String ID_CART_ITEMS_COUNT = "itemsCount";
private static final String ID_HEADER_PANEL = "headerPanel";

private static final String DOT_CLASS = CatalogItemsPanel.class.getName();
Expand Down
Expand Up @@ -17,13 +17,28 @@
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div class="row" wicket:id="row">
<div class="row shopping-cart-row" wicket:id="row">
<div wicket:id="cell">
<a wicket:id="assignmentButton" class="col-sm-3 btn btn-app" style="height: 80px;">
<span wicket:id="plusIcon" class="badge bg-green" style="font-size: 24px;"></span>
<i wicket:id="typeIcon"></i>
<label wicket:id="buttonLabel"></label>
</a>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-green shopping-cart-item-box">
<div wicket:id="inner" class="inner">
<h4 wicket:id="innerLabel"></h4>
</div>
<div class="icon">
<i wicket:id="typeIcon"></i>
</div>
<div class="shopping-cart-item-box-footer">
<span wicket:id="detailsLink" class="shopping-cart-item-button-details">
<!-- TODO: convert static text to tranlatable message -->
Details <i class="fa fa-arrow-circle-right"></i>
</span>
<span wicket:id="addToCartLink" class="shopping-cart-item-button-add">
<!-- TODO: convert static text to tranlatable message -->
Add to cart <i class="fa fa-plus-circle"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</wicket:panel>
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.web.component.data;

import com.evolveum.midpoint.gui.api.component.BasePanel;
Expand All @@ -22,12 +37,15 @@
* Created honchar.
*/
public class MultiButtonTable extends BasePanel<List<AssignmentEditorDto>> {
private static final String ID_ROW = "row";
private static final long serialVersionUID = 1L;

private static final String ID_ROW = "row";
private static final String ID_CELL = "cell";
private static final String ID_BUTTON_TYPE_ICON = "typeIcon";
private static final String ID_BUTTON_LABEL = "buttonLabel";
private static final String ID_BUTTON_PLUS_ICON = "plusIcon";
private static final String ID_BUTTON = "assignmentButton";
private static final String ID_INNER = "inner";
private static final String ID_INNER_LABEL = "innerLabel";
private static final String ID_TYPE_ICON = "typeIcon";
private static final String ID_ADD_TO_CART_LINK = "addToCartLink";
private static final String ID_DETAILS_LINK = "detailsLink";

private long itemsCount = 0;
private long itemsPerRow = 0;
Expand Down Expand Up @@ -77,7 +95,7 @@ private void initLayout(){
}

protected void populateCell(WebMarkupContainer cellContainer, final AssignmentEditorDto assignment){
AjaxLink assignmentButton = new AjaxLink(ID_BUTTON) {
AjaxLink inner = new AjaxLink(ID_INNER) {
private static final long serialVersionUID = 1L;

@Override
Expand Down Expand Up @@ -107,45 +125,51 @@ public void detach() {
}
}
};
// assignmentButton.add(new AttributeModifier("class", "col-md-4"));
Label plusLabel = new Label(ID_BUTTON_PLUS_ICON, "+");
// plusLabel.add(new AttributeAppender("title", getPageBase().createStringResource("MultiButtonPanel.plusIconTitle")));
plusLabel.add(new AjaxEventBehavior("click") {
private static final long serialVersionUID = 1L;

@Override
protected void onEvent(AjaxRequestTarget target) {
addAssignmentPerformed(assignment, target);
}
});
assignmentButton.add(plusLabel);
cellContainer.add(inner);

Label nameLabel = new Label(ID_INNER_LABEL, assignment.getName());
inner.add(nameLabel);

AjaxLink detailsLink = new AjaxLink(ID_DETAILS_LINK) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
// TODO
}

};
cellContainer.add(detailsLink);

AjaxLink addToCartLink = new AjaxLink(ID_ADD_TO_CART_LINK) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
addAssignmentPerformed(assignment, target);
}

};
cellContainer.add(addToCartLink);


WebMarkupContainer icon = new WebMarkupContainer(ID_BUTTON_TYPE_ICON);
WebMarkupContainer icon = new WebMarkupContainer(ID_TYPE_ICON);
icon.add(new AttributeAppender("class", getIconClass(assignment.getType())));
assignmentButton.add(icon);

Label nameLabel = new Label(ID_BUTTON_LABEL, assignment.getName());
// nameLabel.add(new AjaxEventBehavior("click") {
// private static final long serialVersionUID = 1L;
// @Override
// protected void onEvent(AjaxRequestTarget ajaxRequestTarget) {
//
// }
// });
assignmentButton.add(nameLabel);
cellContainer.add(assignmentButton);
cellContainer.add(icon);

}

protected void assignmentDetailsPerformed(AjaxRequestTarget target){
}

private String getIconClass(AssignmentEditorDtoType type){
// TODO: switch to icon constants
if (AssignmentEditorDtoType.ROLE.equals(type)){
return "fa fa-street-view object-role-color";
return "fa fa-street-view";
}else if (AssignmentEditorDtoType.SERVICE.equals(type)){
return "fa fa-cloud object-service-color";
return "fa fa-cloud";
}else if (AssignmentEditorDtoType.ORG_UNIT.equals(type)){
return "fa fa-building object-org-color";
return "fa fa-building";
} else {
return "";
}
Expand Down
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-2013 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>

todo

</wicket:extend>
</body>
</html>
@@ -0,0 +1,44 @@
package com.evolveum.midpoint.web.page.admin.reports;

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.web.application.AuthorizationAction;
import com.evolveum.midpoint.web.application.PageDescriptor;
import com.evolveum.midpoint.web.page.admin.configuration.PageAdminConfiguration;
import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType;


@PageDescriptor(url = "/admin/auditLogDetails", action = {
@AuthorizationAction(actionUri = PageAdminReports.AUTH_REPORTS_ALL,
label = PageAdminConfiguration.AUTH_CONFIGURATION_ALL_LABEL,
description = PageAdminConfiguration.AUTH_CONFIGURATION_ALL_DESCRIPTION),
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_AUDIT_LOG_VIEWER_URL,
label = "PageAuditLogViewer.auth.auditLogViewer.label",
description = "PageAuditLogViewer.auth.auditLogViewer.description")})
public class PageAuditLogDetails extends PageBase{

private static final long serialVersionUID = 1L;

private IModel<AuditEventRecordType> recordModel;

public PageAuditLogDetails(final AuditEventRecordType recordType) {

recordModel = new LoadableModel<AuditEventRecordType>(false) {

@Override
protected AuditEventRecordType load() {
return recordType;
}
};

initLayout();
}

private void initLayout(){
//TODO
}

}
Expand Up @@ -24,6 +24,7 @@
import com.evolveum.midpoint.web.application.PageDescriptor;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.data.BoxedTablePanel;
import com.evolveum.midpoint.web.component.data.column.LinkColumn;
import com.evolveum.midpoint.web.component.input.DatePanel;
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
import com.evolveum.midpoint.web.component.input.TextPanel;
Expand Down Expand Up @@ -113,7 +114,7 @@ private void initParametersPanel(Form mainForm){
AjaxButton ajaxButton = new AjaxButton(ID_SEARCH_BUTTON, createStringResource("BasicSearchPanel.search")) {
@Override
public void onClick(AjaxRequestTarget arg0) {
Form mainForm = (Form)get(ID_MAIN_FORM);
Form mainForm = (Form)getParent().getParent();
initTable(mainForm);
arg0.add(mainForm);
// TODO Auto-generated method stub
Expand All @@ -131,11 +132,21 @@ private void initTable(Form mainForm){
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_AUDIT_LOG_VIEWER));
table.setShowPaging(true);
table.setOutputMarkupId(true);
mainForm.add(table);
mainForm.addOrReplace(table);
}

private List<IColumn<SelectableBean<AuditEventRecordType>, String>> initColumns() {
List<IColumn<SelectableBean<AuditEventRecordType>, String>> columns = new ArrayList<>();
private List<IColumn<AuditEventRecordType, String>> initColumns() {
List<IColumn<AuditEventRecordType, String>> columns = new ArrayList<>();
IColumn<AuditEventRecordType, String> linkColumn = new LinkColumn<AuditEventRecordType>(createStringResource("PageAuditLogViewer.column.time"), "timestamp"){

@Override
public void onClick(AjaxRequestTarget target, IModel<AuditEventRecordType> rowModel) {
setResponsePage(new PageAuditLogDetails(rowModel.getObject()));
}


};
columns.add(linkColumn);
IColumn timeColumn = new PropertyColumn(createStringResource("PageAuditLogViewer.column.time"), "timestamp");
columns.add(timeColumn);
IColumn initiatorColumn = new PropertyColumn(createStringResource("PageAuditLogViewer.column.initiatorRef"), "initiatorRef");
Expand Down
Expand Up @@ -2,6 +2,7 @@

import com.evolveum.midpoint.audit.api.AuditEventRecord;
import com.evolveum.midpoint.web.component.data.BaseSortableDataProvider;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType;
import org.apache.wicket.Component;
import org.apache.wicket.model.IModel;
Expand Down Expand Up @@ -43,15 +44,16 @@ public List<AuditEventRecordType> getObject() {
return listRecords(auditEventQuery, true);
}

@Override
public void setObject(List<AuditEventRecordType> auditEventRecordTypes) {

}

@Override
public void detach() {

}

@Override
public void setObject(List<AuditEventRecordType> object) {
// TODO Auto-generated method stub

}
};
}

Expand Down

0 comments on commit 51da6b1

Please sign in to comment.