Skip to content

Commit

Permalink
selected relation is stored to session (shop cart)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 1, 2018
1 parent 0350a77 commit b90b710
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Expand Up @@ -213,7 +213,7 @@ public FilterRegistrationBean<WicketFilter> wicket() {
registration.setDispatcherTypes(DispatcherType.ERROR, DispatcherType.REQUEST, DispatcherType.FORWARD);
registration.addUrlPatterns("/*");
registration.addInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
registration.addInitParameter(Application.CONFIGURATION, "deployment"); // development
registration.addInitParameter(Application.CONFIGURATION, "development"); // development
registration.addInitParameter("applicationBean", "midpointApplication");
registration.addInitParameter(WicketFilter.APP_FACT_PARAM, "org.apache.wicket.spring.SpringWebApplicationFactory");

Expand Down
Expand Up @@ -370,7 +370,15 @@ private void initRelationPanel(WebMarkupContainer parametersPanel){
parametersPanel.add(relationContainer);

List<QName> availableRelations = WebComponentUtil.getCategoryRelationChoices(AreaCategoryType.SELF_SERVICE, PageAssignmentShoppingCart.this);
relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, null, availableRelations, false));
relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, getRoleCatalogStorage().getSelectedRelation(),
availableRelations, false){
private static final long serialVersionUID = 1L;

@Override
protected void onValueChanged(AjaxRequestTarget target){
getRoleCatalogStorage().setSelectedRelation(getRelationValue());
}
});
}

private QName getRelationParameterValue(){
Expand Down
Expand Up @@ -27,6 +27,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand All @@ -41,7 +42,7 @@ public class RoleCatalogStorage implements PageStorage, OrgTreeStateStorage {
*/
private Map<Integer, Search> roleCatalogSearchMap = new HashMap<>();

/**
/**<
* Paging DTO used in table on page {@link PageAssignmentShoppingCart}
*/

Expand All @@ -60,6 +61,7 @@ public class RoleCatalogStorage implements PageStorage, OrgTreeStateStorage {
private ObjectPaging roleCatalogPaging;
private int assignmentRequestLimit = -1;
private boolean inverse = false;
private QName selectedRelation = null;

public Search getSearch() {
return roleCatalogSearchMap.get(getDefaultTabIndex() < 0 ? 0 : getDefaultTabIndex());
Expand Down Expand Up @@ -222,6 +224,14 @@ public void setAssignmentRequestLimit(int assignmentRequestLimit) {
this.assignmentRequestLimit = assignmentRequestLimit;
}

public QName getSelectedRelation() {
return selectedRelation;
}

public void setSelectedRelation(QName selectedRelation) {
this.selectedRelation = selectedRelation;
}

@Override
public boolean isInverse(){
return inverse;
Expand Down

0 comments on commit b90b710

Please sign in to comment.