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

web.task.edittask.jsp Maven / Gradle / Ivy


<%@ page import="org.apache.axiom.om.OMElement" %>
<%@ page import="org.apache.synapse.task.TaskDescription" %>
<%@ page import="org.wso2.carbon.task.ui.internal.TaskClientConstants" %>
<%@ page import="org.wso2.carbon.task.ui.internal.TaskManagementClient" %>
<%@ page import="org.wso2.carbon.task.ui.internal.TaskManagementHelper" %>
<%@ page import="org.owasp.encoder.Encode" %>
<%@ page import="javax.xml.namespace.QName" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Set" %>
<%@ page import="org.wso2.carbon.CarbonConstants" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>

<%
    boolean disableTaskClass = new Boolean((String) config.getServletContext().getAttribute(
            CarbonConstants.PRODUCT_XML_WSO2CARBON + TaskClientConstants.DISABLE_TASK_CLASS));
    boolean disableTaskProperties = new Boolean((String) config.getServletContext().getAttribute(
            CarbonConstants.PRODUCT_XML_WSO2CARBON + TaskClientConstants.DISABLE_TASK_PROPERTIES));
%>




<%
    String name = request.getParameter("taskName");
    if (name == null || "".equals(name)) {
%>

<%
        return;
    }
    String group = request.getParameter("taskGroup");
    if (group == null || "".equals(group)) {

%>

<%
        return;
    }

    try {
        TaskManagementClient client = TaskManagementClient.getInstance(config, session);
        TaskDescription taskDescription = TaskManagementHelper.getTaskDescription(request, client, name, group);
%>



: <%=name%>

<% if (!disableTaskClass) { %> <% } else { %> <% } %> <% if (!disableTaskProperties) { %> <% } else { Set properties = taskDescription.getXmlProperties(); if (properties != null && !properties.isEmpty()) { int i = 0; for (OMElement property : properties) { if (property != null) { String propName = property.getAttributeValue(new QName("", "name", "")); if (propName != null && !"".equals(propName)) { String value = property.getAttributeValue((new QName("", "value", ""))); boolean isLiteral = value != null && !"".equals(value); OMElement omValue = property.getFirstElement(); String textFieldStyle = ""; String textAreaStyle = "display:none;"; if (value == null) { value = ""; } String xmlString = ""; if (omValue != null) { xmlString = omValue.toString(); textAreaStyle = ""; textFieldStyle = "display:none;"; } %> <% i++; } } } %> <% } } %> <% String cron = taskDescription.getCronExpression(); int count = taskDescription.getCount(); long interval = taskDescription.getInterval(); if (taskDescription.getIntervalInMs()) { interval = interval / 1000; } boolean simpleTrigger = cron == null || "".equals(cron); %> <% if (simpleTrigger) {%> <% } else {%> <%} %> <% if (simpleTrigger) {%> <% } else {%> <%} %> <% List pinnedServerList = taskDescription.getPinnedServers(); String pinnedServerStr = ""; if (pinnedServerList != null && !pinnedServerList.isEmpty()) { for (String pinnedServer : pinnedServerList) { if (pinnedServer != null && !"".equals(pinnedServer)) { pinnedServerStr += pinnedServer + " "; } } pinnedServerStr = pinnedServerStr.trim(); } %> <% if (!disableTaskProperties) { %> <% } else { %> <% } %>
*
*
* "/>
<% Set properties = taskDescription.getXmlProperties(); if (properties != null && !properties.isEmpty()) { %> <% int i = 0; for (OMElement property : properties) { if (property != null) { String propName = property.getAttributeValue(new QName("", "name", "")); if (propName != null && !"".equals(propName)) { String value = property.getAttributeValue((new QName("", "value", ""))); boolean isLiteral = value != null && !"".equals(value); OMElement omValue = property.getFirstElement(); String textFieldStyle = ""; String textAreaStyle = "display:none;"; if (value == null) { value = ""; } String xmlString = ""; if (omValue != null) { xmlString = omValue.toString(); textAreaStyle = ""; textFieldStyle = "display:none;"; } %> <% i++; } } } %>
<% } %>
*
*
" onclick="tasksave('', '', '', '', '', '', '', document.taskcreationform); return false;"/> " onclick="document.location.href='index.jsp?ordinal=0';"/>
<% } catch (Throwable e) { request.getSession().setAttribute(TaskClientConstants.EXCEPTION, e); %> <% return; } %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy