aspire: Implement folder child segments

satya - Friday, April 03, 2009 5:33:34 PM

Nature of the new url


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

satya - Friday, April 03, 2009 5:39:21 PM

Example of a data request


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.

satya - Friday, April 03, 2009 5:48:06 PM

Here is another example


###################################
# 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}

satya - Friday, April 03, 2009 5:57:19 PM

General structure of the html page


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

satya - Friday, April 03, 2009 5:59:27 PM

You can get a copy of it here

You can get a copy of it here

satya - Friday, April 03, 2009 6:03:38 PM

Structure of a folder


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

satya - Saturday, April 04, 2009 11:13:40 AM

Read this article on design prinicples for a form

Read this article on design prinicples for a form

satya - Sunday, April 05, 2009 11:59:04 AM

You can use 'escape' like this to pass in a url to serverside


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;
}

satya - Sunday, April 05, 2009 12:01:03 PM

Then you can store it in a form field to use it as a passthrough like this


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

satya - Sunday, April 05, 2009 12:13:39 PM

Here is how you can redirect a url after update to where it came from


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

satya - Sunday, April 05, 2009 12:14:06 PM

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

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

satya - Sunday, April 05, 2009 12:14:33 PM

In this case it will not url encode the substitution

In this case it will not url encode the substitution

satya - Sunday, April 05, 2009 12:50:08 PM

Revisit how if statements work in aspire

Get some samples in brief and post them

satya - Sunday, April 05, 2009 1:16:21 PM

Here is an example of a parent folder segment


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

satya - Sunday, April 05, 2009 1:21:16 PM

Here is the example of the update form


<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>

satya - Sunday, April 05, 2009 1:21:53 PM

Notice the pass through of callingurl argument through the form

Notice the pass through of callingurl argument through the form

satya - Sunday, April 05, 2009 1:23:02 PM

Here is where the child segment is inserted


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