Search in sources :

Example 1 with PolicyResourceComparator

use of com.sun.identity.console.service.model.PolicyResourceComparator in project OpenAM by OpenRock.

the class SCPolicyResourceComparatorViewBeanBase method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        PolicyResourceComparator rc = getValues();
        handleButton1Request(rc);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) PolicyResourceComparator(com.sun.identity.console.service.model.PolicyResourceComparator)

Example 2 with PolicyResourceComparator

use of com.sun.identity.console.service.model.PolicyResourceComparator in project OpenAM by OpenRock.

the class SCPolicyResourceComparatorViewBeanBase method getValues.

private PolicyResourceComparator getValues() throws AMConsoleException {
    String serviceType = (String) propertySheetModel.getValue(ATTR_SERVICE_TYPE);
    String clazz = (String) propertySheetModel.getValue(ATTR_CLASS);
    String delimiter = (String) propertySheetModel.getValue(ATTR_DELIMITER);
    String wildcard = (String) propertySheetModel.getValue(ATTR_WILDCARD);
    String oneLevelWildcard = (String) propertySheetModel.getValue(ATTR_ONE_LEVEL_WILDCARD);
    String caseSensitive = (String) propertySheetModel.getValue(ATTR_CASE_SENSITIVE);
    if (serviceType.trim().length() == 0) {
        throw new AMConsoleException("policy.service.resource.comparator.missing.service.type.message");
    }
    PolicyResourceComparator c = new PolicyResourceComparator();
    c.setServiceType(serviceType);
    c.setClazz(clazz);
    c.setDelimiter(delimiter);
    c.setWildcard(wildcard);
    c.setOneLevelWildcard(oneLevelWildcard);
    c.setCaseSensitive(caseSensitive);
    return c;
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) PolicyResourceComparator(com.sun.identity.console.service.model.PolicyResourceComparator)

Example 3 with PolicyResourceComparator

use of com.sun.identity.console.service.model.PolicyResourceComparator in project OpenAM by OpenRock.

the class SCPolicyViewBean method populateResourceComparatorTable.

private void populateResourceComparatorTable(Set resourceComp) {
    tablePopulated = true;
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(TBL_RESOURCE);
    tblModel.clearAll();
    boolean firstEntry = true;
    int counter = 0;
    for (Iterator iter = resourceComp.iterator(); iter.hasNext(); ) {
        String c = (String) iter.next();
        PolicyResourceComparator comp = new PolicyResourceComparator(c);
        if (!firstEntry) {
            tblModel.appendRow();
        } else {
            firstEntry = false;
        }
        tblModel.setValue(TBL_RESOURCE_COMPARATOR_DATA_NAME, comp.getServiceType());
        tblModel.setValue(TBL_RESOURCE_COMPARATOR_HREF_ACTION, Integer.toString(counter));
        tblModel.setValue(TBL_RESOURCE_COMPARATOR_LABEL_ACTION, "policy.service.table.resource.comparator.action.edit.label");
        counter++;
    }
    setPageSessionAttribute(SCPolicyModel.ATTRIBUTE_NAME_RESOURCE_COMPARATOR, (OrderedSet) resourceComp);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) PolicyResourceComparator(com.sun.identity.console.service.model.PolicyResourceComparator)

Example 4 with PolicyResourceComparator

use of com.sun.identity.console.service.model.PolicyResourceComparator in project OpenAM by OpenRock.

the class SCPolicyResourceComparatorViewBeanBase method setValues.

protected void setValues(String value) {
    PolicyResourceComparator rc = new PolicyResourceComparator(value);
    propertySheetModel.setValue(ATTR_SERVICE_TYPE, rc.getServiceType());
    propertySheetModel.setValue(ATTR_CLASS, rc.getClazz());
    propertySheetModel.setValue(ATTR_WILDCARD, rc.getWildcard());
    propertySheetModel.setValue(ATTR_DELIMITER, rc.getDelimiter());
    propertySheetModel.setValue(ATTR_ONE_LEVEL_WILDCARD, rc.getOneLevelWildcard());
    propertySheetModel.setValue(ATTR_CASE_SENSITIVE, rc.getCaseSensitive());
}
Also used : PolicyResourceComparator(com.sun.identity.console.service.model.PolicyResourceComparator)

Aggregations

PolicyResourceComparator (com.sun.identity.console.service.model.PolicyResourceComparator)4 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)1 Iterator (java.util.Iterator)1