Example data definition for a sample html page

satya - Thu Apr 26 2012 09:31:53 GMT-0400 (Eastern Daylight Time)

in the context of akc


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

satya - Thu Nov 15 2012 10:25:30 GMT-0500 (Eastern Standard Time)

Here is another example: more recent


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

satya - 4/27/2014 8:02:53 PM

Example of a loop


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

<!--RLF_TAG END_LOOP availabletags -->

satya - 4/27/2014 8:03:43 PM

Example of an If


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

satya - 4/27/2014 8:06:40 PM

Example of an if


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

satya - 5/15/2014 9:25:56 AM

Here is an empty loop


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

satya - 5/15/2014 9:35:37 AM

You can look at some sample files from aspire account here

You can look at some sample files from aspire account here

satya - 5/22/2014 10:45:04 AM

Setting the loopnames right


#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

satya - 6/1/2014 8:44:30 AM

Here is a sample html page based on AKC

Here is a sample html page based on AKC

satya - 6/9/2014 2:21:38 PM

You can apply consraints like this


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}

satya - 6/9/2014 2:36:45 PM

Another good documentation


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

satya - 6/10/2014 6:04:00 PM

You can also do this


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

satya - 6/10/2014 6:04:56 PM

Here is how to work with html form elements and forms

Here is how to work with html form elements and forms

satya - 6/10/2014 6:06:56 PM

You can also do this


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

satya - 6/10/2014 6:07:11 PM

And this


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

satya - 6/12/2014 1:07:41 PM

You can also dereference keys with if


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

satya - 6/12/2014 1:08:50 PM

More on the if expressions

More on the if expressions