Expand my Community achievements bar.

Forms IVS - Order of form designs

Avatar

Level 2

Hi there,

We have around 200 forms being tested in Forms IVS.  The forms are named sequentially with numbers F001, F002, F003, and so on.  The problem we have is the forms are not listed in IVS in any order.  Not too much of an issue when you have 5 forms, but having 200 is proving a royal pain for our testers trying to locate forms in the list.

There is no way of ordering the forms in the list.  I have checked the modified time of the file, the size, the name, when it was addded to the forms folder - none of this has any effect on how the forms are listed.  They just list in a random order.

This is proving a headache for our testers and wasting a lot of our time.  We cannot reduce the number of forms in IVS and we need to test them in a specific order.

Can anyone please asdvise on what basis/criteria the form designs are listed in Forms IVS.

Thanks in advance.

Paul.

RHEL 4.7

JBoss 4.2.0

LiveCycle ES 8.2 Update 1

6 Replies

Avatar

Level 10

I'm not exactly sure how it's ordered in that list, but we give the source for FormsIVS, so you could implement a specific order if you needed to.

Jasmin

Avatar

Former Community Member

Paul,

     The source for FormsIVS is NOT available.  I have been asking Adobe for it for a very long time.  However, you can easily modify the jsp files that comprise the UI for formsIVS.  you will need to simply modify the testForms.jsp file ( it is in the root of the FormsIVS in the FormsIVS.war file ).  I have an example, I would be happy to email you.  I modified it so that it will automatically sort in reverse chronological based on modified file timstamp.  and then I have javascript sort features that will allow you to sort ( ascending / descending ) base on form name.

i have attached the file to this post.  I am pretty sure you can just drop in into your deployed FormsIVS.

best of luck

regards.

Avatar

Former Community Member

let me try attaching that file again.

regards,

Jim

Avatar

Former Community Member

unable to attach source file.....  here is the source....you may need to tweak or modify slightly to get it to work again.

jim

=======================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.io.*,com.adobe.formServer.webSamples.*,com.adobe.formServer.webSamples.App.AppFactory,java.util.*" %>
<%
    boolean bShowPlatform = false;
    String sShowPlatform = (String) application.getAttribute("showPlatform");
    bShowPlatform = new Boolean(sShowPlatform).booleanValue();
   
    boolean bExpertMode = false;
    String sExpertMode = (String) application.getAttribute("expertMode");
    bExpertMode = new Boolean(sExpertMode).booleanValue();
    ServletContext oContext = getServletConfig().getServletContext();
    App oApp = AppFactory.create(null, oContext, request, response);

    String[] formFiles = new String[0];
    String[] dataFiles = new String[0];
    LinkedHashMap prefMap = null;
   
    try {
        formFiles = oApp.listFiles (oApp.m_sContentRootURI);
        dataFiles = oApp.listFiles (oApp.m_sDataDirectory);
        prefMap = oApp.listPreferences();
  } catch (Exception oException ) {
    throw new ServletException( oException.getMessage() );
  }

    // create a filename filter object to only return xdp templates   
    FilenameFilter filter = new FilenameFilter() {
        public boolean accept(File dir,String name){return name.endsWith(".xdp");}           
    };
       
    // retrieve the templates directory   
    File dir = new File(oApp.m_sContentRootURI);
    // retrieve all the file in the templates dir
    File[] files = dir.listFiles(filter);
   
    // quick check to see if there are any xdp templates in content root directory that was specified    in preferences
    if (dir.exists() && (files.length > 0)) {
            // do nothing if everything ok
    } else {
            out.println("<h2 style='color:red; font-size:20px'> UNABLE TO LOCATE ANY XDP TEMPLATES IN CONTENT ROOT DIRECTORY.<br> PLEASE RECHECK <i style='color:blue;'>CONTENT ROOT URI</i> SETTING IN PREFERENCES</h2>");
    }

%>
<html>
 
<head>
<title>Installation Verification Sample - Test form designs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
  @import url("ivs.css");
  @import url("cont.css" );
  @import url("icons.css");
</style>
<script type="text/javascript">
    App = new Object();
    App.CLIENT_EJB = <%=App.CLIENT_EJB%>;
    App.CLIENT_EJB_LOCAL = <%=App.CLIENT_EJB_LOCAL%>;
    App.CLIENT_SOAP = <%=App.CLIENT_SOAP%>;
    App.CLIENT_PLATFORM = <%=App.CLIENT_PLATFORM%>;
    App.CLIENT_PLATFORM_SOAP = <%=App.CLIENT_PLATFORM_SOAP%>;
    function getForm(action, clientType) {        
        if (document.formGet.formName.selectedIndex >= 0 ) {
            document.formGet.GenerateCSS.value = "0";
            document.formGet.clientType.value = clientType;
              document.formGet.actionType.value = "";
            document.formGet.action = action;
            document.formGet.submit();
        } else {
            alert("Select a form design to render");
        }
    }
   
    function issueCSSGeneration(action) {
        if (document.formGet.formName.selectedIndex >= 0 ) {
                if(document.formGet.runPerf.checked == true){
                    alert("Performance check is not enabled while CSS generation");
                }
                document.formGet.GenerateCSS.value = "1";
                document.formGet.clientType.value = <%=App.CLIENT_EJB%>;
                document.formGet.actionType.value = "";
                document.formGet.action = action;
                document.formGet.submit();
        } else {
                alert("Select a form to generate CSS");
        }
    }
   
    function setCSSGenButtonVisibility(){
        var elem = document.getElementById('CSSGenButton');
        var outputType = document.formGet.preference.options[document.formGet.preference.selectedIndex].value;
       
        if(!(document.formGet.formName.selectedIndex >= 0)){
            elem.style.display = 'none';
        } else {
        if(outputType == 'AUTO' || outputType == 'XHTML' || outputType == 'MSDHTML' || outputType == 'HTML4'
            || outputType == 'AHTML' || outputType == 'StaticHTML' || outputType == 'NoScriptXHTML')
        {       
            elem.style.display = 'block';
        } else {
            elem.style.display = 'none';
        }
    }
    }
   
    function generatePrefs() {
   
        var prefs = new OptionMap();
        <%
        Object[] prefSet = prefMap.entrySet().toArray();
        for (int i=0; i < prefSet.length; i++) {
            Map.Entry e = (Map.Entry) prefSet[i];
            %>
            prefs.add("<%=e.getKey()%>", "<%=e.getValue()%>");
            <%
        }
        %>

        if (document.formGet.formName.selectedIndex >= 0 ) {           
            var sFormName = document.formGet.formName.options[document.formGet.formName.selectedIndex].value;           
            if (sFormName.indexOf(".xdp") >= 0) {
                // remove PDFMerge and nativePDF
                prefs.remove("PDFMerge");
                prefs.remove("NativePDF");
            }
            if (sFormName.indexOf(".pdf") >= 0) {
                // remove HTML transformations
                prefs.remove("AUTO");
                prefs.remove("MSDHTML");
                prefs.remove("XHTML");
                prefs.remove("HTML4");
                prefs.remove("AHTML");
                prefs.remove("StaticHTML");
                prefs.remove("NoScriptXHTML");

                // remove LayoutXML
                prefs.remove("Layout");
            }
            if (sFormName.indexOf(".swf") >= 0) {
                prefs.remove("PDFMerge");
                prefs.remove("NativePDF");
                prefs.remove("AUTO");
                prefs.remove("MSDHTML");
                prefs.remove("XHTML");
                prefs.remove("HTML4");
                prefs.remove("AHTML");
                prefs.remove("StaticHTML");
                prefs.remove("NoScriptXHTML");
                prefs.remove("Layout");
            }
        }
       
        <%if (!bExpertMode) { %>
            //remove NativePDF
            prefs.remove("NativePDF");
            //remove LayoutXML
            prefs.remove("Layout");
        <%}%>
       
        document.formGet.preference.length = 0;
        for (var i = 0; i < prefs.map.length; i++) {
            if (prefs.map[i] != null) {
                document.formGet.preference.options[document.formGet.preference.options.length] = prefs.map[i];
            }
        }
        setCSSGenButtonVisibility();
    }
   
    function OptionMap_add(key, value) {
        this.map[this.map.length] = new Option(value, key);
        this.map.length++;
    }
   
    function OptionMap_remove (key) {
        if (key == null) return;       
        for (var i = 0; i < this.map.length; i++) {
            if (this.map[i] != null && this.map[i].value == key) {
                this.map[i] = null;
                break;
            }
        }
    }
       
    //OptionMap object
    function OptionMap() {
        this.map = new Array();
    }
    OptionMap.prototype.add = OptionMap_add;
    OptionMap.prototype.remove = OptionMap_remove;   
   
    function init() {
        generatePrefs();
    }
</script>
</head>

<body onload="init();">

<div class="crumb">
    <h2><a href="home.jsp" target="mainFrame">Home</a> &gt; Test forms</h2>
</div>

<div class="title">
    <h3>Test Form Designs</h3>
</div>

<form method="get" id="formGet" name="formGet" action="GetFormServlet">
    <input type="hidden" id="clientType" name="clientType" />
    <input type="hidden" id="actionType" name="actionType" />
   
    <div class="formTopLevelContainer">
   
        <div class="subTitleLevel1">File selection</div>
       
        <div class="formContainerLevel1">
            <span class="instruction">Select a form design and a data file(optional) to render.</span>
            <span class="indent2">
            <span class="formRowFloat">
                <span class="label3"><label for="dataName">Data files (optional)</label></span>
                <span class="field3">
                    <select size="15%" name="dataName" id="dataName" class="fieldtext">
                        <option value="None" selected="selected">None</option>
                        <% for (int i=0; i < dataFiles.length; i++) {
                                  if (dataFiles[i] == null)
                                      break;
                                if (dataFiles[i].indexOf(".xml") >= 0 ||
                                    dataFiles[i].indexOf(".pdf") >= 0 ||
                                    dataFiles[i].indexOf(".fdf") >= 0 ||
                                    dataFiles[i].indexOf(".xfdf") >= 0 ||
                                    dataFiles[i].indexOf(".xdp") >= 0)
                                { %>
                        <option value="<%=dataFiles[i]%>"><%=dataFiles[i]%></option>
                        <% } %> <% } %>
                    </select>
                </span>
            </span>
            <span class="formRowFloat">
                <span class="label3">Form designs
                         <a href="#" title="Ascending Sort Templates" onclick="sortSelect(0);"><img src='images/ascending.gif' border='0'></a>
                      <a href="#" title="Descending Sort Templates" onclick="sortSelect(1);"><img src='images/descending.gif' border='0'></a>
                            Alphabetic Sort<input type='checkbox' id='alphabeticSortCheckbox'>
                </span>
                <span class="field3">
                    <select size="15%" name="formName" id="formName" class="fieldtext" onchange="generatePrefs()">
                        <option value=''></option>
                    </select>
                </span>
            </span>
            </span>
        </div>
       
        <div class="subTitleLevel1">Output format selection</div>
       
        <div class="formContainerLevel1">
            <input type="hidden" id="GenerateCSS" name="GenerateCSS" value="0"/>
            <div class="instruction">Select the output format of the rendered form.</div>
            <div class="formRow">
                <div class="label"><label for="preference">Output format:</label></div>
                <div class="field">
                    <select id="preference" name="preference" onchange="setCSSGenButtonVisibility()">
                        <option selected value="REACH">Auto Detect HTML</option>
                    </select>
                </div>
            </div>
        </div>
       
        <div class="subTitleLevel1">Issue request</div>
       
        <div class="formContainerLevel1">
            <span class="instruction">Render the form by selecting one of the following methods.</span>
            <span class="formRow">
                <span class="label"><label for="viaEJB"></label></span>
                <span class="field">
                    <span><input type="button" name="EJB" class="button" value="Use EJB" title="EJB" onclick="getForm('GetFormServlet',App.CLIENT_EJB)" /> </span>
                    <span><input type="button" name="Web Service" class="button" value="Use WebService" title="Web Service" onclick="getForm('GetFormServlet',App.CLIENT_SOAP)" /></span>       
                    <% if (bShowPlatform)
                    { %>           
                        <span><input type="button" name="viaPlatform" class="button" value="Platform" title="Platform" onclick="getForm('GetFormServlet',App.CLIENT_PLATFORM)" /> </span>
                        <span><input type="button" name="viaPlatformSOAP" class="button" value="Platform WebService" title="Platform WebService" onclick="getForm('GetFormServlet',App.CLIENT_PLATFORM_SOAP)" /> </span>
                    <% } %>
                </span>
            </span>
           
            <span class="formRow">
                <span class="label">Request Options:</span>
                <span class="field">           
                <span class="fieldGroup">
                    <input name="runPerf" type="checkbox" class="checkRadio" id="runPerfCheck" value="true"/>
                    <span class="checkRadioText"><label for="runPerfCheck">Enable performance test</label></span>
                </span>                               
                </span>
            </span>
           
            <span class="instruction"><b>Note:</b> When a rendered result is returned, submissions from it will cause the
            submitted data to appear in the data directory (provided it is a writable
            location). That data could then be used in subsequent operations.</span>
           
            <div id="CSSGenButton">
                <br/>
                <div class="instruction">Generate CSS button generates the CSS file for the selected form design. This CSS file can be used as a template for supplying custom styles for the selected form design.</div>
                <span class="label"><label for="genCSS"></label></span><div><input type="button" value="Generate CSS" onclick="issueCSSGeneration('GetFormServlet')" /> </div>
            </div>

        </div>
    </div>
</form>

    <script type="text/javascript">
        // declare javascript custom object and array to hold template info
        function Template(name, modified, formattedDate){
            this.name = name;
            this.modified = modified;
            this.formattedDate = formattedDate;
        } // end fx
        var templatesArray = new Array();<%
        File f = null;
        for (int i=0; i < files.length; i++) {
            // create local var
            f = files[i];
            // create javascript element
            out.println("templatesArray["+i+"] = new Template('" + f.getName() + "','" + f.lastModified() + "','" + new Date(f.lastModified()) + "');");
        }%>
       
        function populateTemplatesDropDown() {
           
            var selectToPopulate = document.getElementById('formName');
            selectToPopulate.options.length = 0;
            var optObj;           
            for(var i=0; i < templatesArray.length; i++) {
                var template = templatesArray[i];
                optObj = document.createElement('option');
          optObj.text = template.name;
          optObj.value = template.name;
          optObj.title = template.formattedDate;
          selectToPopulate.options.add(optObj);
            }
        }
       
        templatesArray.sort(sortModifiedDescendingHandler);
        populateTemplatesDropDown();
   
        function sortSelect(direction) {
            // 0 = ascending
            // 1 = descending
            if (document.getElementById('alphabeticSortCheckbox').checked) {
                if (direction == 0) {
                    templatesArray.sort(sortNameAscendingHandler);
                } else {
                    templatesArray.sort(sortNameDescendingHandler);                           
                }               
            } else {               
                if (direction == 0) {
                    templatesArray.sort(sortModifiedAscendingHandler);
                } else {
                    templatesArray.sort(sortModifiedDescendingHandler);
                }               
            }
            populateTemplatesDropDown();
        }
       
        function sortNameAscendingHandler(thisObject,thatObject) {   
            if (thisObject.name.toUpperCase() > thatObject.name.toUpperCase())    {       
                return 1;   
            }    else if (thisObject.name.toUpperCase() < thatObject.name.toUpperCase())    {
                return -1;
            }
            return 0;
      }
   
        function sortNameDescendingHandler(thisObject,thatObject) {   
            if (thisObject.name.toUpperCase() > thatObject.name.toUpperCase())    {
                return -1;
            }    else if (thisObject.name.toUpperCase() < thatObject.name.toUpperCase())    {
                return 1;
            }
            return 0;
      }
   
         function sortModifiedAscendingHandler(thisObject,thatObject) {   
            if (thisObject.modified > thatObject.modified)    {       
                return 1;   
            }    else if (thisObject.modified < thatObject.modified)    {
                return -1;
            }
            return 0;
      }
   
        function sortModifiedDescendingHandler(thisObject,thatObject) {   
            if (thisObject.modified > thatObject.modified)    {
                return -1;
            }    else if (thisObject.modified < thatObject.modified)    {
                return 1;
            }
            return 0;
      }
    </script>

</body>

</html>

Avatar

Former Community Member

Attach it with a txt extension and you should be OK

Paul

Avatar

Former Community Member

change ext to .jsp to use.....let me know how it goes