Search in sources :

Example 1 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class ValidateSAML2SetupViewBean method endPropertyAttributesDisplay.

public String endPropertyAttributesDisplay(ChildContentDisplayEvent event) {
    String html = event.getContent();
    if (bOneRealm) {
        int idx = html.indexOf("tfRealm");
        idx = html.lastIndexOf("<tr>", idx);
        idx = html.indexOf("<td ", idx);
        idx = html.indexOf(">", idx);
        html = html.substring(0, idx + 1) + "<div id=\"divRealmLabel\" style=\"display:none\">" + html.substring(idx + 1);
        idx = html.indexOf("</td>", idx);
        html = html.substring(0, idx) + "</div>" + html.substring(idx);
        idx = html.indexOf("<td ", idx);
        idx = html.indexOf(">", idx);
        html = html.substring(0, idx + 1) + "<div id=\"divRealm\" style=\"display:none\">" + html.substring(idx + 1);
        idx = html.indexOf("</td>", idx);
        html = html.substring(0, idx) + "</div>" + html.substring(idx);
    }
    int idx = html.indexOf("tfCOT");
    idx = html.lastIndexOf("<tr>", idx);
    idx = html.indexOf("<td ", idx);
    idx = html.indexOf(">", idx);
    html = html.substring(0, idx + 1) + "<div id=\"divCOTLabel\" style=\"display:none\">" + html.substring(idx + 1);
    idx = html.indexOf("</td>", idx);
    html = html.substring(0, idx) + "</div>" + html.substring(idx);
    idx = html.indexOf("<td ", idx);
    idx = html.indexOf(">", idx);
    html = html.substring(0, idx + 1) + "<div id=\"divCOT\" style=\"display:none\">" + html.substring(idx + 1);
    idx = html.indexOf("</td>", idx);
    html = html.substring(0, idx) + "</div>" + html.substring(idx);
    TaskModel model = (TaskModel) getModel();
    idx = html.indexOf("tfCOT");
    idx = html.lastIndexOf("<input ", idx);
    html = html.substring(0, idx) + "<span class=\"ConTblCl1Div\" id=\"txtCot\"></span>&#160;" + "<a id=\"linkShowCOTTable\" href=\"javascript:showCOTTable()\"" + " style=\"display:none\">" + model.getLocalizedString("validate.cot.table.show") + "</a>" + "<a id=\"linkHideCOTTable\" href=\"javascript:hideCOTTable()\"" + " style=\"display:none\">" + model.getLocalizedString("validate.cot.table.hide") + "</a>" + html.substring(idx);
    idx = html.indexOf("<table ", idx);
    int idx1 = html.indexOf("</table>", idx);
    html = html.substring(0, idx) + html.substring(idx1 + 9);
    idx = html.indexOf("<div class=\"ConFldSetLgdDiv\">");
    if (idx == -1) {
        idx = html.indexOf("<legend class=\"ConFldSetLgd\"");
        idx = html.lastIndexOf("<fieldset ", idx);
        html = html.substring(0, idx) + "<div id=\"divCOTTable\">" + html.substring(idx);
        idx = html.indexOf("</fieldset>", idx);
        html = html.substring(0, idx + 11) + "</div>" + html.substring(idx + 11);
    } else {
        idx = html.lastIndexOf("<div ", idx - 3);
        html = html.substring(0, idx + 5) + "id=\"divCOTTable\" " + html.substring(idx + 5);
    }
    idx = html.indexOf("tfIDP");
    idx = html.lastIndexOf("<img ", idx);
    idx = html.lastIndexOf("<table ", idx - 2);
    html = html.substring(0, idx) + "<div id=\"divEntities\" style=\"display:none\">" + html.substring(idx);
    idx = html.indexOf("</table>", idx);
    idx = html.indexOf("</table>", idx + 3);
    html = html.substring(0, idx + 8) + "</div>" + html.substring(idx + 8);
    idx = html.indexOf("id=\"divCOTTable\"");
    idx = html.lastIndexOf(">", idx);
    if ((setCOTs != null) && !setCOTs.isEmpty()) {
        StringBuffer buff = new StringBuffer();
        buff.append("\n<script language=\"Javascript\">\n");
        buff.append("cots = new Array();\n");
        int cnt = 0;
        for (Iterator i = setCOTs.iterator(); i.hasNext(); cnt++) {
            String cotName = (String) i.next();
            buff.append("cots[").append(Integer.toString(cnt)).append("] = \"").append(cotName).append("\";\n");
        }
        buff.append("</script>\n");
        html += buff.toString();
    }
    html = addQuestionImages(html);
    return html;
}
Also used : Iterator(java.util.Iterator) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 2 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class CreateFedletWarningViewBean method endIalertCommonDisplay.

public String endIalertCommonDisplay(ChildContentDisplayEvent event) {
    TaskModel model = (TaskModel) getModel();
    String html = event.getContent();
    int idx = html.lastIndexOf("</div>");
    html = html.substring(0, idx + 6) + "<p>&nbsp;<p><center><div class=\"TtlBtnDiv\">" + "<input name=\"button1\" type=\"submit\" " + "" + "class=\"Btn1\" value=\"  " + model.getLocalizedString("button.ok") + "  \" onmouseover=\"javascript: this.className='Btn1Hov'\" " + "onmouseout=\"javascript: this.className='Btn1'\" " + "onblur=\"javascript: this.className='Btn1'\" " + "onfocus=\"javascript: this.className='Btn1Hov'\" " + "onClick=\"top.location.replace('../task/Home'); return false;\" " + "/></div></center>" + html.substring(idx + 6);
    return html;
}
Also used : TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 3 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class CreateHostedIDPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    String value = (String) getDisplayFieldValue(HAS_META_DATA);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(HAS_META_DATA, "no");
    }
    value = (String) getDisplayFieldValue(SELECT_COT);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(SELECT_COT, "no");
    }
    value = (String) getDisplayFieldValue(RADIO_EXTENDED);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_EXTENDED, "file");
    }
    value = (String) getDisplayFieldValue(RADIO_META);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_META, "file");
    }
    setDisplayFieldValue(ENTITY_ID, (AMSystemConfig.isConsoleRemote) ? SystemProperties.getServerInstanceName() : getRequestURL());
    populateTableModel();
    Set userAttrNames = AMAdminUtils.getUserAttributeNames();
    userAttrNames.remove("iplanet-am-user-account-life");
    CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
    OptionList optList = createOptionList(userAttrNames);
    optList.add(0, "name.attribute.mapping.select", "");
    menuUserAttribute.setOptions(optList);
    try {
        TaskModel model = (TaskModel) getModel();
        Set realms = model.getRealms();
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
        String realm = getRequestContext().getRequest().getParameter("realm");
        if (realm != null && !realm.trim().isEmpty()) {
            setDisplayFieldValue(REALM, realm);
        }
        Set keys = model.getSigningKeys();
        OptionList optionList = createOptionList(keys);
        optionList.add(0, model.getLocalizedString("configure.provider.keys.none"), "");
        CCDropDownMenu menuSignKeys = (CCDropDownMenu) getChild(SIGN_KEY);
        menuSignKeys.setOptions(optionList);
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : Set(java.util.Set) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 4 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class CreateSoapSTSDeploymentViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    try {
        TaskModel model = (TaskModel) getModel();
        Set realms = model.getRealms();
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
        String realm = getRequestContext().getRequest().getParameter("realm");
        if (realm != null && !realm.trim().isEmpty()) {
            setDisplayFieldValue(REALM, realm);
        }
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : Set(java.util.Set) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 5 with TaskModel

use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.

the class CreateHostedSPViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    String value = (String) getDisplayFieldValue(HAS_META_DATA);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(HAS_META_DATA, "no");
    }
    value = (String) getDisplayFieldValue(SELECT_COT);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(SELECT_COT, "no");
    }
    value = (String) getDisplayFieldValue(RADIO_EXTENDED);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_EXTENDED, "file");
    }
    value = (String) getDisplayFieldValue(RADIO_META);
    if ((value == null) || value.equals("")) {
        setDisplayFieldValue(RADIO_META, "file");
    }
    setDisplayFieldValue(ENTITY_ID, (AMSystemConfig.isConsoleRemote) ? SystemProperties.getServerInstanceName() : getRequestURL());
    populateTableModel();
    Set userAttrNames = AMAdminUtils.getUserAttributeNames();
    userAttrNames.remove("iplanet-am-user-account-life");
    CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
    OptionList optList = createOptionList(userAttrNames);
    optList.add(0, "name.attribute.mapping.select", "");
    menuUserAttribute.setOptions(optList);
    CCCheckBox cbAttrDefault = (CCCheckBox) getChild("tfDefaultAttrMapping");
    cbAttrDefault.setChecked(true);
    try {
        TaskModel model = (TaskModel) getModel();
        Set realms = model.getRealms();
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
        String realm = getRequestContext().getRequest().getParameter("realm");
        if (realm != null && !realm.trim().isEmpty()) {
            setDisplayFieldValue(REALM, realm);
        }
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
}
Also used : Set(java.util.Set) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList) TaskModel(com.sun.identity.console.task.model.TaskModel)

Aggregations

TaskModel (com.sun.identity.console.task.model.TaskModel)20 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)15 Set (java.util.Set)12 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)9 TreeSet (java.util.TreeSet)7 HttpServletRequest (javax.servlet.http.HttpServletRequest)7 OptionList (com.iplanet.jato.view.html.OptionList)5 Iterator (java.util.Iterator)5 Map (java.util.Map)5 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)2 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)1 StringTokenizer (java.util.StringTokenizer)1