Example data definition for a sample html page


###################################
# ShowExampleURLs: (arg1,arg2,...)
###################################
#basics
ShowExampleURLs=aspire:\\reports\\surls\\show-surls.html
ShowExampleURLs.dataRequestName=GetExampleURLData
ShowExampleURLs.masterPageRequestName=GetMasterPage
ShowExampleURLs.masterPageURL=captestURL2

#############################################
#Main data(arg1,arg2)
#############################################
request.GetExampleURLData.className=com.ai.htmlgen.DBHashTableFormHandler1
request.GetExampleURLData.maindatarequest.classname=com.ai.db.DBRequestExecutor2
request.GetExampleURLData.maindatarequest.db=reportsDB
request.GetExampleURLData.maindatarequest.stmt=select * from.....

#############################################
#GetExampleURLData: loop1(arg1, arg2, arg3)
#############################################
request.GetExampleURLData.className=com.ai.htmlgen.DBHashTableFormHandler1
#children specification for XML support
GetExampleURLData.loopnames=surlloop
GetExampleURLData.surlloop.eliminateLoop=yes

request.GetExampleURLData.surlloop.class_request.className=com.ai.htmlgen.GenericTableHandler6
request.GetExampleURLData.surlloop.query_request.className=com.ai.db.DBRequestExecutor2
request.GetExampleURLData.surlloop.query_request.db=reportsDB
request.GetExampleURLData.surlloop.query_request.stmt=select * from...

###################################
# file: tag-folders.properties
# based on: delete-folders.properties
# directory: /reports/tags/
# Module: Taga  folder
###################################

###################################
# TagFolderURL: Inner Master page version
# args: folderId(M) 
# ex: /akc/display?url=TagFolderURL&folderId=18
#     /akc/display?url=TagFolderURL&folderId=18&aspire_output_format=object-xml
###################################

TagFolderURL=aspire:\\reports\\tags\\tag-folder-view.html
TagFolderURL.dataRequestName=TFUDataRequest
TagFolderURL.masterPageRequestName=GetMasterPage
TagFolderURL.masterPageURL=captestURL2

#To help aspire_output_format=xml
TFUDataRequest.loopnames=tags,availabletags

#To eliminate html code tied to empty loops
TFUDataRequest.tags.eliminateLoop=yes
TFUDataRequest.availabletags.eliminateLoop=yes

request.TFUDataRequest.className=com.ai.htmlgen.DBHashTableFormHandler1
request.TFUDataRequest.maindatarequest.classname=com.ai.db.DBRequestExecutor2
request.TFUDataRequest.maindatarequest.db=reportsDB
request.TFUDataRequest.maindatarequest.stmt=
select * from folders f where 1=1 and f.folder_id = {folderId} and f.owner_user_id = {profile_user.quote}

request.TFUDataRequest.tags.class_request.className=com.ai.htmlgen.GenericTableHandler6
request.TFUDataRequest.tags.query_request.className=com.ai.db.DBRequestExecutor2
request.TFUDataRequest.tags.query_request.db=reportsDB
request.TFUDataRequest.tags.query_request.stmt=sp_getTagsForFolder {folderId}, {profile_user.quote}

request.TFUDataRequest.availabletags.class_request.className=com.ai.htmlgen.GenericTableHandler6
request.TFUDataRequest.availabletags.query_request.className=com.ai.db.DBRequestExecutor2
request.TFUDataRequest.availabletags.query_request.db=reportsDB
request.TFUDataRequest.availabletags.query_request.stmt=sp_getPossibleTagsForFolder {folderId}, {profile_user.quote}


###################################
# unTagFolder: 
# args: folderId, tagId, owner
# post: /akc/update?request_name=unTagFolder&folderId=..&tagId=..
# owner will be the logged in user 
###################################
request.unTagFolder.classname=com.ai.db.DBRequestExecutor2
request.unTagFolder.db=reportsDB
request.unTagFolder.query_type=update
request.unTagFolder.stmt=sp_removeTagForFolder {{folderId}}, {{tagId}}, {{profile_user.quote}}

request.unTagFolder.redirectURL=/akc/display?url=TagFolderURL&folderId={{folderId}}

###################################
# tagFolder: 
# args: folderId, tagId, owner 
# post: /akc/update?request_name=tagFolder&folderId=..&tagId=..
# owner will be the logged in user 
###################################
request.tagFolder.classname=com.ai.db.DBRequestExecutor2
request.tagFolder.db=reportsDB
request.tagFolder.query_type=update
request.tagFolder.stmt=tagFolder {{folderId}}, {{tagId}}, {{profile_user.quote}}

request.tagFolder.redirectURL=/akc/display?url=TagFolderURL&folderId={{folderId}}

<!--RLF_TAG BGN_LOOP availabletags -->
<p class="compact">{{aspire_rownum}}) {{tagname}} ({{tagid}}) 

<!--RLF_TAG END_LOOP availabletags -->

<!--RLF_TAG BGN_IF aspire.loops.tags=false if1 -->
<p class="pending">This folder contains no tags</p>
</p>
<!--RLF_TAG END_IF aspire.loops.tags=false if1 -->

<!--RLF_TAG BGN_IF whitespace(f_tagFolderId) if1 -->
<p>Some stuff</p>
<!--RLF_TAG END_IF whitespace(f_tagFolderId) if1 -->

<!--RLF_TAG BGN_IF !whitespace(f_tagFolderId) if1 -->
<p>Else stuff
<!--RLF_TAG END_IF !whitespace(f_tagFolderId) if1 -->

<!--RLF_TAG BGN_IF aspire.loops.publicitemsloop=false if1 -->
(p)No items available for display(/p)
<!--RLF_TAG END_IF aspire.loops.publicitemsloop=false if1 -->

where name of the loop is publicitemsloop.

You can look at some sample files from aspire account here


#To help aspire_output_format=xml
# this doesn't work
SatShowQuestionsForATestURLDataRequest.loopnames=questions,sections


# T H I S    W O R K S
request.SatShowQuestionsForATestURLDataRequest.loopnames=questions,sections

# this doesn't work
SatShowQuestionsForATestURL.loopnames=questions,sections

Here is a sample html page based on AKC


SatShowQuestionsForAUserTestURL.constraintRequestNames=SatLoginConstraint

#Reusable login constraint for App Sat
request.SatLoginConstraint.classname=com.ai.servlets.GeneralLoginConstraint
request.SatLoginConstraint.loginFlagname=profile_aspire_app_sat_login_flag
request.SatLoginConstraint.redirectToURL=/akc/display?url=SATShowUsersPublicURL&ownerUserId={ownerUserId}

###################################
# SatShowQuestionsForATestURL: Show questions for a test public url
# Allow to browse questions for a public test
# path: homepate/browse tests/click-on-thetest
# constraint: all users
#
# args: (testid, sectionid, ownerUserId)
# ex: /akc/display?url=SatShowQuestionsForATestURL&testid=1§ionid=1
#     /akc/display?url=SatShowQuestionsForATestURL&aspire_output_format=object-xml
###################################

Notice the path and the constraint on a url


<!--RLF_TAG BGN_IF f_usertest_status=4 if1 -->
<p class="pending">
This test is already submitted
</p>
<!--RLF_TAG END_IF f_usertest_status=4 if1 -->

Here is how to work with html form elements and forms


<!--RLF_TAG BGN_IF f_usertest_status="" if1 -->
<p>you can also do this</p>
<!--RLF_TAG END_IF f_usertest_status="" if1 -->

<!--RLF_TAG BGN_IF !f_usertest_status="" if1 -->
<p>you can also do this</p>
<!--RLF_TAG END_IF !f_usertest_status="" if1 -->

<!--RLF_TAG BGN_IF !f_alternate_correct_answer=f_alternate_chosen_answer.key if1 -->
<p class="pending">
Sorry Wrong Answer!!
</p>
<!--RLF_TAG END_IF f_alternate_correct_answer=f_alternate_chosen_answer.key if1 -->

More on the if expressions