All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.identity-mgt.challenges-set-mgt.jsp Maven / Gradle / Ivy

The newest version!


<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
<%@page import="org.wso2.carbon.CarbonConstants" %>
<%@page import="org.wso2.carbon.identity.mgt.stub.dto.ChallengeQuestionDTO" %>
<%@page import="org.wso2.carbon.identity.mgt.ui.IdentityManagementAdminClient" %>



<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="java.util.HashSet" %>
<%@ page import="java.util.List" %>
<%@ page import="org.owasp.encoder.Encode" %>



<%
    session.removeAttribute(IdentityManagementAdminClient.CHALLENGE_QUESTION);
    List challenges = null;
    HashSet questionSetNames = new HashSet();

    try {
        String cookie = (String) session
                .getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(),
                session);
        ConfigurationContext configContext = (ConfigurationContext) config
                .getServletContext()
                .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
        IdentityManagementAdminClient client =
                new IdentityManagementAdminClient(cookie, backendServerURL, configContext);

        ChallengeQuestionDTO[] questionDTOs = client.getChallengeQuestions();

        if(questionDTOs != null && questionDTOs.length > 0){
            for(ChallengeQuestionDTO questionDTO : questionDTOs){
                if(questionDTO.getQuestionSetId() != null){
                    questionSetNames.add(questionDTO.getQuestionSetId());
                }
            }
            challenges = new ArrayList(Arrays.asList(questionDTOs));
            session.setAttribute(IdentityManagementAdminClient.CHALLENGE_QUESTION, challenges);
        }
    } catch (Exception e) {
        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR,
                request);
%>
        
<%
        return;
    }



%>
        



    

    

Challenge Questions Management

Add new challenge questions set

 

<% if (questionSetNames.size() > 0) { for (String questionSetName : questionSetNames) { %> <% } } else { %> <% } %>
Challenge Questions Sets
<%=Encode.forHtmlContent(questionSetName)%> Delete
No challenges questions set registered




© 2015 - 2024 Weber Informatics LLC | Privacy Policy