Dynamic page - file editor_kaba.xml not found

Hello,

I have a problem with generating a dynamic page as described in the manual in the section “Dynamic Page Layout - Programming Dynamic Pages”.

The file “editor_kaba.xml” does not exist in the whole directory of cis…

Layout:


                Iterator iter = phases.iterator();
                Phase phase;
                m_ColumnProperties = new String[phases.size()];
                int pos = 0;

                while(iter.hasNext())
                {
                    phase = (Phase)iter.next();

                    xml.append("<coltable0 width=\"" + (100 / phases.size()) + "%\">");
                    xml.append("  <itr>");
                    xml.append("    <label name=\"" + phase.getDefinitionDescription() + "\" asplaintext=\"true\"/>");
                    xml.append("  </itr>");
                    xml.append("  <itr>");
                    xml.append("    <field valueprop=\"rating" + phase.getIdAsString() + "\" displayonly=\"true\"/>");
                    
                    if(phase.isCurrentPhase()
                        && isTodayCreated(phase)
                        && (m_Op == GUIConstants.NEW || m_Op == GUIConstants.EDIT))
                    {
                        xml.append("    <hdist width=\"10\"/>");
                        xml.append("    <button name=\"...\" method=\"doCalculateBI\" />");
                    }
                    
                    xml.append("  </itr>");
                    xml.append("</coltable0>");

                    m_ColumnProperties[pos] = "rating" + phase.getIdAsString();
                    pos++;
                }   
        
        IDynamicPageMgmt dpMgmt = m_sessionContext.getDynamicPageMgmt();
        dpMgmt.addDynamicPage(xml.toString(), "problemRating");

Exception:

java.lang.Error: Could not read resource path /cis/config/editor_kaba.xml
	at com.softwareag.cis.gui.generate.MixEditorXML.readCombinedXML()Ljava.lang.String;(Unknown Source)
	at com.softwareag.cis.gui.generate.HTMLGenerator.refreshXMLConfig()V(Unknown Source)
	at com.softwareag.cis.gui.generate.HTMLGenerator.generateHTML(Ljava.lang.String;)Ljava.lang.String;(Unknown Source)
	at com.softwareag.cis.server.InteractionSession.addDynamicPage(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;)V(Unknown Source)
	at com.softwareag.cis.server.InteractionSession.addDynamicPage(Ljava.lang.String;Ljava.lang.String;)V(Unknown Source)

Thanks for any advice in advance.

H. Johannes

Hello,
you have to create the mentioned file “editor_kaba.xml” by yourself.
You have to follow the following steps for a very brief example of a button control element that can be used throughout your application for confirmation purposes:
1.) Declare your own editor library in the file webapps\cis\cis\config\controllibraries.xml for the extension/namespace “kaba”.


<controllibraries>
	<library package="com.softwareag.cis.demolibrary"
	         prefix="demo">
	</library>
	<library package="com.pintexx.guiserver.controls"
	         prefix="pin">
	</library>
	<library package="com.myproject.handler"
	         prefix="kaba">
	</library>
</controllibraries>

2.) Write the editor_kaba.xml file, e.g. :


<?xml version="1.0" encoding="UTF-8"?>
<!--
Dynamic extension of editor.xml file.
-->
<controllibrary>
  <editor>
  <tag name="kaba:okButton">
    <taginstance/>
    <protocolitem/>
  </tag>
  <tagsubnodeextension control="page" newsubnode="kaba:okButton"/>

  </editor>
</controllibrary>

3.) Write the corresponding handler class:


package com.myproject.handler;

import org.xml.sax.AttributeList;

import com.softwareag.cis.gui.generate.IMacroTagHandler;
import com.softwareag.cis.gui.protocol.ProtocolItem;

/**
 * Controlelement fuer OK-Button samt Methodenaufruf onOK()
 *
 */
public class OKBUTTONHandler implements IMacroTagHandler  {

public void generateXMLForStartTag(String arg0, AttributeList attList, StringBuffer xml, ProtocolItem pi) {

    xml.append(" <button textid='common.ok' method='onOK' " +
                "   image='image_ok.gif' width='100' height='20'> ");
    xml.append(" </button>");

    pi.suppressFurtherCodegenEntries();
	
}

	public void generateXMlForEndTag(String arg0, StringBuffer arg1) {
	}

}

4.) Use the new created controlelement in your layout.xml file (excerpt only)


...  
<itr align="left">
            <hdist width="100">
            </hdist>
            <kaba:okButton>
            </kaba:okButton>
            <hdist width="5">
            </hdist>
        </itr>
...

What I forgot to mention:
It is wise to include in the XML layout file an appropriate namespace declaration for your new created control element kaba:okButton/.
You might need it later.

<page model="com.myproject.myAdapter" xmlns:kaba="http://www.kaba.com/2006" >

Thanks for the answer, but I think there must be an easier way, too (like explained in the online documentation).

For testing, I created the wanted editor_kaba.xml (contains only the xml and an empty controllibrary tag).

Now, the page is displayed, but in the subpage-control occurs the following error:

The log looks as following:

I thought that the examples in the online documentation would work… If this is not the case, I obviously must try the solution with the IMacroTagHandler…

Hello,
are you sure that the following is a valid path to your file ContactLocationEditAdapter.xml?


/layouts//xmldata/default/com.abc.def.gui.adapter.ContactLocationEditAdapter.xml

I doubt it.

I don’t think so, too…

But I don’t know how the path is generated by CIS. The adapter which contains the subpage is named ContactLocationEditAdapter. I can’t explain why CIS accesses to the file ContactLocationEditAdapter.xml…