Exporting HTML files using AwareIM data & Displaying sam

Contains tips for configurators working with Aware IM
Post Reply
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Exporting HTML files using AwareIM data & Displaying sam

Post by tford »

Concepts described in this post can be used in a number of different ways. The notes include learnings about AwareIM capabilities while using AwareIM data to create XML files to be used by the following tools:

Flash Calendar Pro
http://www.usflashmap.com/products/flas ... ar_pro.htm

Fusion Charts
http://www.fusioncharts.com/

I will post more details about creating appropriate XML files for these two Flash / XML tools at a later date. The scope of this post will be to demonstrate some of the "building blocks" you will need to understand.

This BSV will show:
A- How to write HTML file to an AwareIM subdirectory using AwareIM data

B- Displaying the HTML files in various ways
1) iFrame displayed in a Form
2) iFrame displayed in a Query
3) using DISPLAY URL

Building Blocks BSV details:
1- Add System Settings attributes:
a) DisplayURLPrefix_Temp - Plain Text 150
b) ExportPath_Temp - Plain Text 150


2- Create BO name City with attributes:
a- Name - Plain Text
b- Country - Plain Text
c- HtmlExportPath - Plain Text 150 - Calculated
d- iFrame - Plain Text 200 - Calculated

3- Create Document: "HTML_Country" of Text Document type.

Contents of the document (just to show writing basic HTML with AwareIM data):


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<font color=red><strong>City: <<City.Name>></strong></font>
<br>
Country: <<City.Country>></strong></font>
</html>



4- City BO rules:
a- City.iFrame=`<iframe src='`+SystemSettings.DisplayURLPrefix_Temp+City.Name+`.htm' width='810' height='610'></iframe>`

b- City.HtmlExportPath=SystemSettings.ExportPath_Temp+City.Name+'.htm'

c- EXPORT DOCUMENT HTML_Country TO FILE City.HtmlExportPath

5- Make a form for City BO: City iFrame
a- No Caption
b- No buttons
c- Only 1 attribute shown: An HTML cell with the value: <<City.iFrame>>
Click "Hide Label"

6- Create 3 processes. Each have City BO as Process Input:
a- "ShowUrl_NewTab"
DISPLAY URL SystemSettings.DisplayURLPrefix_Temp+City.Name+'.htm' NEW TAB

b- "ShowUrl_NewWindow"
DISPLAY URL SystemSettings.DisplayURLPrefix_Temp+City.Name+'.htm' IN NEW

c- "ViewCity_iFrame_Form"
VIEW City USING 'City iFrame'


7- Create Query: "One City iFrame Query" on City BO

FIND City WHERE City.ID=ThisCity.ID

In "Display Results" dialog:

a) only display iFrame attribute. Make the column name "None"

Uncheck ALL boxes in the lower part of the screen... the "Other" box.


8- Create query "City List"

FIND ALL City

Show attributes: Name, Country

Show the following Operations next to each instance:
--> 3 Process from #6 above
--> Query from #7 above

9- Visual Perspective: Administrator

--> in Main frame, show the Query "City List"




Misc Notes:

10) You will need to create a subdirectory:
C:\AwareIM4\Tomcat\webapps\AwareIM\Temp

Note that as new builds are installed, this directory (and any files in in are deleted. You will need to copy them off and same them & replace them in the proper place after the new build installation.


11) when you run the BSV, initialize System Settings & set the following attributes:

ExportPath_Temp: C:\AwareIM4\Tomcat\webapps\AwareIM\Temp\

DisplayURLPrefix_Temp: Temp/




12- Running the BSV:

a- now, run a test
b- add a few instances of City BO
c- Click "Home" to redisplay the City List query
d- click on the various Operations to show various ways to use the HMTL that was generated by AwareIM using AwareIM data.


These concepts will be shown later to create XML files that will be consumed by the Fusion Chart SWFs and Flash Calendar Pro SWF.
Tom - V8.8 build 3137 - MySql / PostGres
himanshu
Posts: 723
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Post by himanshu »

Hi Tom,

It is very nice Tip you share.

Keep it up!

Gives new ways to present the data.

VERY GOOD
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Click here to download sample BSV.

Remove .bin extension after download.
Tom - V8.8 build 3137 - MySql / PostGres
Libero
Posts: 12
Joined: Sat Jul 31, 2010 5:22 pm

XML create and export

Post by Libero »

"I will post more details about creating appropriate XML files for these two Flash / XML tools at a later date" any news about this ?
I was playing with the trial and have successfully installed Fusionchart, I can the the exported HTMl files as well. How to have AwareIm create and export the needed XML files for Fusionchart now ?

Many thanks,

George
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Hi George,

Sorry that never got posted. I have other priorities right now and can't take the time to complete the example for posting. My code is integrated in another BSV at the moment.
Tom - V8.8 build 3137 - MySql / PostGres
Libero
Posts: 12
Joined: Sat Jul 31, 2010 5:22 pm

Post by Libero »

No way to have it as a bsv at least ? :?

Thanks,

George
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Sorry George, but the BSV that the code is in has intellectual property that I am not premitted to release.
Tom - V8.8 build 3137 - MySql / PostGres
Libero
Posts: 12
Joined: Sat Jul 31, 2010 5:22 pm

Post by Libero »

Ok, thanks for the first part of the tutorial.
RocketRod
Posts: 907
Joined: Wed Aug 06, 2008 4:22 am
Location: Melbourne

Exporting xml files

Post by RocketRod »

Libero its actually quite straight forward. In general terms as I don't have a BSV I can give you, this is what I did. I'm sure there are other ways to do it as well.

1. Set up two documents one for the html page and one for the associated data xml file.
2. Make both document type 'Text document'.
3. Import a sample file of each of the above for the chart you wish to use.
4. Replace the appropriate parts of the imported text file with a LIST function or <<BO.Field>> type expressions using the BO that holds the data.
For example, I replaced the following line like this in my Gantt chart data xml file...

<task name='Planned' processId='1' start='01/09/2010' end='05/09/2010' id='1' color='8BBA00' height='10' topPadding='5' animation='0'/>

with this

LIST(BO.Child,'','S1','StartDate','M1','EndDate','E1')

where BO.S1 =` <task name='Planned' processId='1' start='`
BO.StartDate=01/09/2010
BO.M1=`'end='`
Bo.EndDate=05/09/2010
BO.E1=`' id='1' color='8BBA00' height='10' topPadding='5' animation='0'/>`

5. Just write a process to output the two files using EXPORT DOCUMENT TO FILE.
6. You can also include in the documents expressions such as <<BO.Field>> for say the heading to display on the chart.
7. I also added the users login name to the exported filenames so each user would be running their own version of the chart. In the html text document you of course would then replace the data file name with something like <<LoggedInRegularUser.LoginName>>Data.xml so that the html file is looking for freddata.xml.

Hope this sets you on the right path. Let me know if you need additional pointers. I have successfully produced gantt charts using this process which are the most difficult ones.

Cheers Rod
Libero
Posts: 12
Joined: Sat Jul 31, 2010 5:22 pm

Post by Libero »

Many thanks Rod ! U have followed your advice and successfully build a full running FusionChart system using my own BO :)

Cheers !
RocketRod
Posts: 907
Joined: Wed Aug 06, 2008 4:22 am
Location: Melbourne

Post by RocketRod »

No problems. Glad I could help you.

Cheers Rod
Post Reply