Form HTML Template support

When you chose to use html-based generation for a Content form or Search source, you must supply the HTML markup that is used when the form is rendered. In the markup you provide, you can use a number of iKnowBase-specific tags, which are replaced with appropriate markup and information at runtime.

For getting started, use the Create new template button on the HTML tab; this will produce a sample template you can modify as needed.

Overview of iKnowBase-specific tags

Tag Description
<IKB:FORM> Renders a HTML form-tag with the appropriate information.
<IKB:FORMNAME> Renders the name of the HTML-form.
<IKB:LABEL> Renders the label for a form field.
<IKB:INPUT> Renders an input field for a form field.
<IKB:DIMENSION> Renders a dimension selector for a form field.
<IKB:FAVORITE> Renders a drop-down list of favorite dimensions for a form field.
<IKB:SPACE> Renders a non-breaking space.
<IKB:CALENDAR> Renders the calendar button for a form field.
<IKB:RADIO> Renders a radio button for a form field.
<IKB:CHECK> Renders a checkbox for a form field.
<IKB:SELECT> Renders a select list for a form field.
<IKB:BUTTON> Renders a button for the form.
<IKB:RELATED_OBJECT> Renders a button for selecting �related objects" for a form field.
<IKB:RELATED_IMAGE> Renders a button for selecting �related image" for a form field.
<IKB:CONDITIONAL> Works as an if-test, conditionally rendering or skipping the content, depending on document state.
<IKB:FILE> Renders a button to upload file content.
<IKB:FILELINK> Renders the current filename of file content.
<IKB:FILEURL> Renders the current link to file content.
<IKB:ATTACHMENT> Renders a button for adding attachments to the document being edited.
<IKB:TEXTAREA> Renders a textarea for a form field.
<IKB:ADDATTRIBUTE> Renders a drop down list for adding more attributes to the form at run time.
<IKB:DISPLAY_ADD_ATTR> Renders a list of dynamic attributes added to the form at run-time. Applicable to Search sources.
<IKB:PROMPT> Renders the prompt defined for the form field.
<IKB:DISPLAY> Renders a readable text value of a form field.
<IKB:CONDITIONAL> Conditionally either renders or skips the content of the tag, depending on the document context.
<IKB:MASTERSELECT> Renders a button for selecting the parent document for the current document.
<IKB:CONDITION> Renders the conditions defined for the search form field. Only applicable to Search sources.
<IKB:IMAGEVARIANT> Renders image variants defined in a form. Only applicable to HTML-based forms for both modes (insert and update)
<ORACLE> Executes a PL/SQL code fragment, and renders the output from the execution.

Generally, you can add any HTML-attribute to the iKnowBase tag, and it will be rendered as part of the output.

ikb:form

The <ikb:form> tag renders an HTML form-tag with the required attributes (action, method) set appropriately.

ikb:formname

The <ikb:formname> tag renders the form name, either as set in the setup of the RunForm portlet or using a default value of �form_".

ikb:label

The <ikb:label> tag will render the label of a form field, as specified in the forms configuration. The actual <ikb:label>-tag will be replaced with a <span> tag, while the value �IKB:PROMPT" inside the tag will be replaced with the actual value.

Example:

<IKB:LABEL id="-344" class="label">IKB:PROMPT</IKB:LABEL>

Renders as:

<span class="label">TheSpecifiedLabel</span>

ikb:input

The <ikb:input> tag renders a html text field that can be used for editing a form field.

Example:

<IKB:INPUT id="-344" />

ikb:dimension

The <ikb:dimension> tag renders an iconic button that will open a dimension selector for selecting more values for a form field. Use this along with <ikb:value>, which will show the already selected values.

Example:

<IKB:DIMENSION id="800" imagesrc="/ressurs/list.gif" class="ikbFormDimension" />
<IKB:VALUE id="800" class="iKBFormInput" />

ikb:favorite_select

The <ikb:favorite_select> tag renders a drop down list of the last recently used values for the dimension attribute. It is typically used with <ikb:dimension>, which allow for the selection of values not in the drop down list.

Example:

<IKB:FAVORITE_SELECT id="802"  size="1" />
<IKB:DIMENSION id="802" imagesrc="/ressurs/list.gif" />
<IKB:VALUE id="800" class="iKBFormInput" />

ikb:space

The <ikb:space> tag renders a non-breaking space, the HTML entity &nbsp;

Example:

<IKB:SPACE>

ikb:calendar

The <ikb:calendar> tag renders a button used to open a calendar for selecting date values.

Example:

<IKB:CALENDAR id="764" imagesrc="/ressurs/evita/cal/calendar.gif" buttonclass="ikbFormCalendarButton" />

ikb:radio

The <ikb:radio> tag renders a set of radio buttons, corresponding to the options of a form field. The content of the tag will be repeated for each value, with the placeholders <IKB:INPUT_ID> and <IKB:INPUT_PROMPT> being replaced with the actual ID and prompt for each value.

Example:

<IKB:RADIO id="802">
  <IKB:INPUT_ID>
  <span class="label">IKB:INPUT_PROMPT</span>
</IKB:RADIO>

ikb:check

The <ikb:check> tag renders a set of checkboxes, corresponding to the options of a form field. The content of the tag will be repeated for each value, with the placeholders <IKB:INPUT_ID> and <IKB:INPUT_PROMPT> being replaced with the actual ID and prompt for each value.

Example:

<IKB:CHECK id="-142">
  <IKB:INPUT_ID class="ikbCheck" maxlength="20" size="20">
  <span class="label">IKB:INPUT_PROMPT</span>
</IKB:CHECK>

ikb:select

The <ikb:select> tag renders a select box for a form field. The select box may allow either single or multiple select, depending on the specified options.

Examples of a single select box:

<IKB:SELECT id="803"  size="1" />

Example of a multi-select box.

<IKB:SELECT id="-161" class="ikbSelect" size="4" multiple/>

ikb:button

The <ikb:button> tag renders a button for one of the default actions of the form. Specify which type of button it is by using the id-attribute of the <ikb:button>-tag.

Id Description
SAVE When the user clicks on this button the information given in the form will be saved, and the form will close. Applicable to Forms.
APPLY When the user clicks on this button the information given in the form will be saved, and the form will remain open.Applicable to Forms.
NEXT When the user clicks on this button the changes will be saved and he will navigate to the next Form in the Task wizard. Applicable to Forms which are part of a Task wizard.
PREVIOUS When the user clicks on this button he the changes will be saved and he will navigate to the previous Form in the Task wizard. Applicable to Forms which are part of a Task wizard.
FINISH When the user clicks on this button the changes will be saved, and the Task wizard will close. Applicable to Forms which are part of a Task wizard.
SEARCH When the user clicks on this button the search will be performed with the search criteria given in the search form. Applicable to Search sources.
STORE When the user clicks on this button the search criterias will be stored. They can be used to support saved search functionality. Applicable to Search sources.
RESET When the user clicks on this button the changes performed in the form will be reset to the original values. Applicable to Forms and Search sources.

Example of a save button:

<IKB:BUTTON id="SAVE" class="ikbFormResetButton" value="Save" />

Example of a cancel button:

<IKB:BUTTON id="RESET" class="ikbFormResetButton" value="Cancel" />

Language support can be implemented by entering a NLS-string identification as the value of the tag:

<IKB:BUTTON id="RESET" value="#cs.reset#" />

ikb:related_object

The <ikb:related_object> tag renders an iconic button that will open a picklist for selecting related document objects for a form field. Use this along with <ikb:value>, which will show the already selected values.

Example:

<IKB:related_object id="800" imagesrc="/ressurs/list.gif" class="ikbFormDimension" />
<IKB:VALUE id="800" class="iKBFormInput" />

ikb:related_image

The <ikb:related_image> tag renders an iconic button that will open the image archive for selecting images for a form field. Use this along with <ikb:value>, which will show the already selected values.

Example:

<IKB:RELATED_IMAGE id="800" imagesrc="/ressurs/list.gif"  class="ikbFormDimension" />
<IKB:VALUE id="800" class="iKBFormInput" />

ikb:file

The <ikb:file> tag renders a �browse" button for uploading file content into a form field. Use along with <ikb:filelink>, which shows the current filename (if any).

Example:

<IKB:FILE id="675"  />

The <ikb:filelink> tag renders the filename of the current file of the document being edited.

Example:

<IKB:FILELINK id="675" />

ikb:fileurl

The <ikb:fileurl> tag renders the url to the current file of the document being edited. Can be used within a File attribute or a document file attribute

Example:

<img border="2" src="<IKB:FILEURL id="675" />"> 
<a href="<IKB:FILEURL id="675" />" title="This is an image">My title</a>

ikb:attachment

The <ikb:attachment> tag renders a �browse" button for uploading attachments to the document being edited.

Use along with <ikb:filelink>, which shows the current filename (if any).

Example:

<IKB:ATTACHMENT id="774"  />

ikb:textarea

The <ikb:textarea> tag renders a HTML <textarea>..</textarea> for a form field.

Example:

<IKB:TEXTAREA id="646" ROWS="rows" COLS="cols">IKB:VALUE</IKB:TEXTAREA>

ikb:imagevariant

The <ikb:imagevariant> tag renders image variants defined in a form. To defined image variants in a form, you should add scaling attributes for image variants. For optional variants, you should add request attributes as well. The image variants are rendered as checkboxes and attribute labels, for mandatory variants the checkboxes are disabled and checked. In update mode, you can access the generated image variants from links on the attribute labels.

Note: Images will not be upscaled to create image variants. If a variant is larger than the image itself, the image variant will not be available for selection in the form unless you have configured the variant to use the original image in such circumstances.

ikb:addattribute

The <ikb:addattribute> tag renders a select list of possible other attributes for the form. Use this for dynamic forms, where you want the user to be able to add other attributes to the form, at will.

Example:

<IKB:ADDATTRIBUTE id="-5"/>
<IKB:DISPLAY_ADD_ATTR id="-5"/>

ikb:display_add_attr

The <ikb:display_add_attr> tag renders a list of attributes added to the form at run-time. Use this for dynamic forms, where you want the user to be able to add other attributes to the form, at will.

Example:

<IKB:DISPLAY_ADD_ATTR id="-5"/>

ikb:prompt

The <ikb:prompt> tag renders the prompt defined for the form field.

Example:

<IKB:LABEL id="794">IKB:PROMPT</IKB:LABEL>

ikb:display

The <ikb:display> tag renders the value of a form field as a readable text.

Example:

<IKB:DISPLAY id="18">IKB:VALUE</IKB:DISPLAY>

ikb:conditional

The <ikb:conditional> tag conditionally either renders or skips the content of the tag, depending on the document context.

Example for �select folder", which is displayed only when uploading a document from a desktop productivity package (Microsoft Office):

<IKB:CONDITIONAL id="752"  />
  <IKB:DIMENSION id="752" imagesrc="/ressurs/list.gif" class="ikbFormDimension" />
</IKB:CONDITIONAL id="752">

Example for �select template", which runs only when a document is not uploaded from a desktop productivity package:

<IKB:CONDITIONAL id="753" />
  <IKB:SELECT id="753"  size="1" />
</IKB:CONDITIONAL id="753">

ikb:masterselect

The <ikb:masterselect> renders a button for selecting the parent document for the current document.

ikb:condition

The <ikb:condition> tag renders the conditions defined for the search form field.

Example:

<IKB:CONDITION id="-344" class=""/>

This tag is only applicable to search sources.

oracle

The <oracle> tag executes any PL/SQL code fragment, and renders the output produced by the executed code. The standard HTP-package supplied with the database may be used.

All valid PL/SQL commands are permitted, and you can call other functions that are implemented in packets or self-contained functions.

Note: Stored functions are preferred over in-place code due to maintenance issues.

You can also send context-based parameters.

Variable Description
:DOCUMENT_ID If the document exists, the document ID is sent.
:PARENT_ID DocumentID of the parent document, if the parent ID exists
:REFERENCE_PATH Identifier for the portlet instance
:STYLE_ID Identifier for the form definition
:TASK_ID Identifier for the task wizard definition, when applicable
:STEP_ID Identifier for the task step definition, when applicable
:LANGUAGE_ID The current language code (from user, form, session, ...)
:USER_ID Userid of the current user
:FORMNAME The formname
:BACK_URL The Back URL, as defined by Portal.

Example:

<ikb:form>
<table>
  <tr>
    <td>
      <p><ORACLE>
      Begin
          Htp.p('The time is now: '||to_char(sysdate,'hh24:mi'));
      End;
      </ORACLE></p>
    </td>
    <td>
      <p><ORACLE>
      Begin
          Htp.p( 'The number of sub-documents are: ' 
                  || subdocuments_count(:DOCUMENT_ID));
      End;
      </ORACLE></p>
    </td>
  </tr>
</table>
</ikb:form>