web.identity-mgt.email-template-config.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.wso2.carbon.identity.mgt.ui Show documentation
Show all versions of org.wso2.carbon.identity.mgt.ui Show documentation
A custom wso2 products or solution
The newest version!
<%@page import="org.apache.axis2.context.ConfigurationContext"%>
<%@page import="org.wso2.carbon.CarbonConstants"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
prefix="carbon"%>
<%@page import="org.wso2.carbon.identity.mgt.stub.dto.EmailTemplateDTO"%>
<%@page import="org.wso2.carbon.identity.mgt.ui.AccountCredentialMgtConfigClient"%>
<%@page import="org.wso2.carbon.identity.mgt.ui.EmailConfigDTO"%>
<%@page import="org.apache.commons.lang.StringEscapeUtils"%>
<%@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.ResourceBundle"%>
<%@ page import="org.owasp.encoder.Encode" %>
<%
String username = request.getParameter("username");
String forwardTo = null;
AccountCredentialMgtConfigClient client = null;
EmailConfigDTO emailConfig = null;
String emailSubject = null;
String emailBody = null;
String emailFooter = null;
String templateName = null;
String emailSubject0 = null;
String emailBody0 = null;
String emailFooter0 = null;
String templateName0 = null;
if (username == null) {
username = (String) request.getSession().getAttribute("logged-user");
}
String BUNDLE = "org.wso2.carbon.identity.mgt.ui.i18n.Resources";
ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE, request.getLocale());
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);
client = new AccountCredentialMgtConfigClient(cookie,
backendServerURL, configContext);
try {
emailConfig = client.loadEmailConfig();
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
String message = resourceBundle
.getString("error.while.loading.email.tepmplate.data");
CarbonUIMessage.sendCarbonUIMessage(message, CarbonUIMessage.ERROR, request);
forwardTo = "../admin/error.jsp";
}
%>
<%
if ( forwardTo != null) {
%>
<%
return;
}
%>