aspire: Implement folder child segments


DisplayNoteIMPURL=aspire:\\sql-explorer\\display-note-imp.html
DisplayNoteIMPURL.dataRequestName=GetNoteData
DisplayNoteIMPURL.masterPageRequestName=GetMasterPage
DisplayNoteIMPURL.masterPageURL=captestURL2

request.rn.classname=com.ai.htmlgen.DBHashTableFormHandler1
request.rn.maindatarequest.classname=com.ai.db.DBRequestExecutor2
request.rn.maindatarequest.db=reportsDB
request.rn.maindatarequest.stmt=\	
       select * from sql_statements \
       where statement_id = {statementId}

Where "rn" is the name of the data request.


###################################
# UpdateFolderSegmentIMPURL: (folderId)
###################################
UpdateFolderSegmentIMPURL=aspire:\\reports\\folder-views\\update-folder-segment.html
UpdateFolderSegmentIMPURL.dataRequestName=GetFolderData
UpdateFolderSegmentIMPURL.masterPageRequestName=GetMasterPage
UpdateFolderSegmentIMPURL.masterPageURL=captestURL2

request.GetFolderData.className=com.ai.htmlgen.DBHashTableFormHandler1
request.GetFolderData.maindatarequest.classname=com.ai.db.DBRequestExecutor2
request.GetFolderData.maindatarequest.db=reportsDB
request.GetFolderData.maindatarequest.stmt=\
       select *, folder_child_segment as aspire_annotation from folders \
       where folder_id = {folderId}

doc-title
doc-head
doc-menu
doc-content

You can get a copy of it here


folder_id
folder_name
parent_folder_id
public
owner_user_id
folder_short_description
folder_long_description
folder_child_segment
folder_last_updated_by
folder_last_updated_on

Read this article on design prinicples for a form


function gotoUpdateSegment()
{
var callingurl=
"/display?url=someurl&arg1={{somekey}}";

var targeturl = 
"/akc/display?url=sometargetURL&folderId={{folder_id}}";

var finalTargetUrl = 
targeturl + "&callingurl=" + escape(callingurl);

document.location=finalTargetUrl;
}

<input type="hidden" name="callingurl" value={{callingurl}}"/>

request.updateChildSegmentRequest.redirectUrl=/akc{callingurl.empty}

Take a look at the code for GeneralTranslator in aspire to understand 'empty'

In this case it will not url encode the substitution

Get some samples in brief and post them


<div class="pagemenu1">
<p class="header">Topic Menu</p>
<p><a href="http://www.npr.org">NPR</a>
</div>

<form name="mainform" action="/akc/update/updateChildSegmentRequest" method="POST">
<input type="hidden" name="folderId" value="{{folder_id}}"/>
<input type="hidden" name="callingurl" value="{{callingurl}}"/>
  <p class="formPrompt">Child HTML Segment</p>
  <p><textarea rows="18" name="childSegment" cols="60">
          {{aspire_annotation}}
     </textarea>
  </p>
  <p align="center">
      <input align="center" type="submit" 
         class="button" value="Change" name="B2">
  </p>
</form>

Notice the pass through of callingurl argument through the form


<!--tag_bgn capture doc-menu -->
{{folder_child_segment}}
<div class="pagemenu1">
....