Skip to content

Commit

Permalink
Interim commit before merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Mar 29, 2016
1 parent ca7cb17 commit e5d25b2
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 30 deletions.
@@ -0,0 +1,39 @@
<?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:panel>
<div class="box box-success">
<div class="box-body no-padding">
<table class="table table-striped">
<tr>
<td><wicket:message key="pageTaskEdit.recurring"/></td>
<td>
<div class="col-md-6">
<div wicket:id="recurrence"/>
</div>
</td>
</tr>
</table>
</div>
</div>
</wicket:panel>
</body>
</html>

@@ -0,0 +1,56 @@
/*
* 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.
*/
package com.evolveum.midpoint.web.page.admin.server;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.component.objectdetails.AbstractObjectTabPanel;
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.prism.PrismPropertyPanel;
import com.evolveum.midpoint.web.model.PropertyWrapperFromObjectWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;

/**
* @author semancik
*/
public class TaskApprovalsTabPanel extends AbstractObjectTabPanel<TaskType> {
private static final long serialVersionUID = 1L;

protected static final String ID_RECURRENCE = "recurrence";

private static final Trace LOGGER = TraceManager.getTrace(TaskApprovalsTabPanel.class);

public TaskApprovalsTabPanel(String id, Form mainForm,
LoadableModel<ObjectWrapper<TaskType>> taskWrapperModel,
PageBase pageBase) {
super(id, mainForm, taskWrapperModel, pageBase);
initLayout(pageBase);
}

private void initLayout(PageBase pageBase) {

PrismPropertyPanel recurrencePanel = new PrismPropertyPanel<>(ID_RECURRENCE,
new PropertyWrapperFromObjectWrapperModel(getObjectWrapperModel(), TaskType.F_RECURRENCE),
null, pageBase);
recurrencePanel.setLabelContainerVisible(false);
add(recurrencePanel);

}

}
Expand Up @@ -28,7 +28,6 @@
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -62,22 +61,17 @@ public TaskMainPanel(String id, LoadableModel<ObjectWrapper<TaskType>> objectMod
private void initLayout(PageTask2 parentPage) {
mainForm = new Form<>(ID_MAIN_FORM, true);
add(mainForm);
initLayoutTabs(parentPage);
initTabPanel(parentPage);
}

protected void initLayoutTabs(final PageTask2 parentPage) {
protected void initTabPanel(final PageTask2 parentPage) {
List<ITab> tabs = createTabs(parentPage);
TabbedPanel<ITab> tabPanel = AbstractObjectMainPanel.createTabPanel(parentPage, tabs);
mainForm.add(tabPanel);
}

protected List<ITab> createTabs(final PageTask2 parentPage) {
List<ITab> tabs = new ArrayList<>();
addDefaultTabs(parentPage, tabs);
return tabs;
}

protected void addDefaultTabs(final PageTask2 parentPage, List<ITab> tabs) {
tabs.add(
new AbstractTab(parentPage.createStringResource("pageTaskEdit.basic")){
@Override
Expand All @@ -92,30 +86,37 @@ public WebMarkupContainer getPanel(String panelId) {
return new TaskSchedulingTabPanel(panelId, mainForm, objectModel, parentPage);
}
});
// tabs.add(
// new AbstractTab(getProjectionsTabTitleModel(parentPage)){
// @Override
// public WebMarkupContainer getPanel(String panelId) {
// return createFocusProjectionsTabPanel(panelId, parentPage);
// }
// });
// tabs.add(
// new AbstractTab(getAssignmentsTabTitleModel(parentPage)){
// @Override
// public WebMarkupContainer getPanel(String panelId) {
// return createFocusAssignmentsTabPanel(panelId, parentPage);
// }
// });
// tabs.add(
// new AbstractTab(parentPage.createStringResource("pageAdminFocus.request")){
// @Override
// public WebMarkupContainer getPanel(String panelId) {
// return createRequestAssignmentTabPanel(panelId, parentPage);
// }
// });
tabs.add(
new AbstractTab(parentPage.createStringResource("pageTaskEdit.progress")){
@Override
public WebMarkupContainer getPanel(String panelId) {
return new TaskProgressTabPanel(panelId, mainForm, objectModel, parentPage);
}
});
tabs.add(
new AbstractTab(parentPage.createStringResource("pageTaskEdit.performance")){
@Override
public WebMarkupContainer getPanel(String panelId) {
return new TaskPerformanceTabPanel(panelId, mainForm, objectModel, taskDtoModel, parentPage);
}
});
tabs.add(
new AbstractTab(parentPage.createStringResource("pageTaskEdit.approvals")){
@Override
public WebMarkupContainer getPanel(String panelId) {
return new TaskApprovalsTabPanel(panelId, mainForm, objectModel, parentPage);
}
});
tabs.add(
new AbstractTab(parentPage.createStringResource("pageTaskEdit.result")){
@Override
public WebMarkupContainer getPanel(String panelId) {
return new TaskResultTabPanel(panelId, mainForm, objectModel, parentPage);
}
});
return tabs;
}


protected PageTask2 getDetailsPage() {
return (PageTask2) getPage();
}
Expand Down
@@ -0,0 +1,28 @@
<?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:panel>

<div wicket:id="statisticsPanel"/>

</wicket:panel>
</body>
</html>

@@ -0,0 +1,59 @@
/*
* 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.
*/
package com.evolveum.midpoint.web.page.admin.server;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.component.objectdetails.AbstractObjectTabPanel;
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.prism.PrismPropertyPanel;
import com.evolveum.midpoint.web.component.progress.StatisticsDtoModel;
import com.evolveum.midpoint.web.component.progress.StatisticsPanel;
import com.evolveum.midpoint.web.model.PropertyWrapperFromObjectWrapperModel;
import com.evolveum.midpoint.web.page.admin.server.dto.TaskDto;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;

/**
* @author semancik
*/
public class TaskPerformanceTabPanel extends AbstractObjectTabPanel<TaskType> {
private static final long serialVersionUID = 1L;

private static final String ID_STATISTICS_PANEL = "statisticsPanel";

private LoadableModel<TaskDto> taskDtoModel;

private static final Trace LOGGER = TraceManager.getTrace(TaskPerformanceTabPanel.class);

public TaskPerformanceTabPanel(String id, Form mainForm,
LoadableModel<ObjectWrapper<TaskType>> taskWrapperModel,
LoadableModel<TaskDto> taskDtoModel, PageBase pageBase) {
super(id, mainForm, taskWrapperModel, pageBase);
this.taskDtoModel = taskDtoModel;
initLayout(pageBase);
}

private void initLayout(PageBase pageBase) {
StatisticsDtoModel statisticsDtoModel = new StatisticsDtoModel(taskDtoModel);
StatisticsPanel statisticsPanel = new StatisticsPanel(ID_STATISTICS_PANEL, statisticsDtoModel);
add(statisticsPanel);
}
}
@@ -0,0 +1,39 @@
<?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:panel>
<div class="box box-success">
<div class="box-body no-padding">
<table class="table table-striped">
<tr>
<td><wicket:message key="pageTaskEdit.recurring"/></td>
<td>
<div class="col-md-6">
<div wicket:id="recurrence"/>
</div>
</td>
</tr>
</table>
</div>
</div>
</wicket:panel>
</body>
</html>

@@ -0,0 +1,56 @@
/*
* 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.
*/
package com.evolveum.midpoint.web.page.admin.server;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.component.objectdetails.AbstractObjectTabPanel;
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.prism.PrismPropertyPanel;
import com.evolveum.midpoint.web.model.PropertyWrapperFromObjectWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;

/**
* @author semancik
*/
public class TaskProgressTabPanel extends AbstractObjectTabPanel<TaskType> {
private static final long serialVersionUID = 1L;

protected static final String ID_RECURRENCE = "recurrence";

private static final Trace LOGGER = TraceManager.getTrace(TaskProgressTabPanel.class);

public TaskProgressTabPanel(String id, Form mainForm,
LoadableModel<ObjectWrapper<TaskType>> taskWrapperModel,
PageBase pageBase) {
super(id, mainForm, taskWrapperModel, pageBase);
initLayout(pageBase);
}

private void initLayout(PageBase pageBase) {

PrismPropertyPanel recurrencePanel = new PrismPropertyPanel<>(ID_RECURRENCE,
new PropertyWrapperFromObjectWrapperModel(getObjectWrapperModel(), TaskType.F_RECURRENCE),
null, pageBase);
recurrencePanel.setLabelContainerVisible(false);
add(recurrencePanel);

}

}

0 comments on commit e5d25b2

Please sign in to comment.