Your welcome Brian,

 

Your component was the key to the parser as I needed the overall structure. For others, I’m going to try and pull out my company’s specific code into maybe a sample app after I finish two other projects. When done I’ll distribute here. Thanks,

 

Phil

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Kotek
Sent: Sunday, January 22, 2006 3:00 PM
To: [email protected]
Subject: Re: [CFCDev] UI and encapsulation

 

Hi Philip, thanks for the plug! This is twice in a week that someone here has posted about something I've written that has helped them out. It's gratifying to know that others are finding my ramblings helpful!

Your technique sounds very interesting, I'll have to try this out myself. If anyone goes forward with tests or examples of this that they can post, please do as I'm sure it will help out many others or provide a fertile breeding ground for ideas.

Regards,

Brian

On 1/20/06, Duba, Phillip <[EMAIL PROTECTED]> wrote:

I can't give the full parser out, but I've attached the XmlUtils.cfc that I use to load the XML into a Structure and I'll explain what I do. The application is Fusebox 4.1 and the XmlUtils.cfc is the component that Brian Kotek built in his Builder.com article in 2003 at http://builder.com.com/5100-6386-5057635.html without his recurseXMLObject function and with my XmlToStruct one. Now, I defined the structure of the XML as follows:

Application

- Page

-- Query

-- Group

--- Field

 

Each tag has its own attributes that the parser uses to determine what functionality to include or execute.

 

I divided the building of the page into a few different sections:

- Generate queries to get the information needed which is based off the DestinationTable and DestinationField attributes of the Field tags. This is executed for the whole application not just those needed for the page.

- Build default Attribute variables based on the Field tags and using the information returned in the queries above. I set <CFPARAM> tags since these things may have been submitted from a previous page.

- Build the queries defined for the Page the user is currently on with a standard columns of Value, Display (, DependentValue for those driven from another form)

- Build _javascript_ functionality for each Field on the Page the user is currently on.

- Build Hidden form variables based on all Attribute values not related to Fields on the Page the user is currently on.

- Loop through each Group/Field combination for the Page the user is on building the Label and form control in accordance with the attributes provided. There's a CFC call for each one which contains a CFSWITCH/CFCASE that is for the Type attribute of the Field. If a query is required for the Select type, it is passed in as well.


Now, since it is built using Fusebox, each one of the above bullets is done in its own Fuseaction and combined at the end of the page building using Fusebox's content variables. Separating them into their own Fuseactions enabled me to include only those areas needed to display the page in question. For example, I have a Form, Control, Print, and File pages defined in a Type attribute of the Page. So for Print and File, I don't need the _javascript_ or Hidden Form variables so they aren't included in the building of the "page". Outside of that, each area just loops over the needed arrays in the Structure and does a bunch of StructKeyExists() to check to make sure things that are needed are there and process accordingly if they are not. I know I'm the first person to ever do this and I won't be the last, but that's how I attacked my problem. This application arose from getting requests to build the same type of wizard-based application over and over for each customer of ours. We've built the parser and some redimentary tools for building the XML filet and are now modifying our tool set to make the building of the XML document easier. Thanks,

 

Phil


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Baz
Sent: Friday, January 20, 2006 12:48 PM


To: [email protected]
Subject: RE: [CFCDev] UI and encapsulation

 

 

Hey Phil,

 

I'd be curious to take a look at a complete example of this, with the parser and everything… is that possible?

 

Cheers,

Baz

 

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Duba, Phillip
Sent: Friday, January 20, 2006 12:43 PM
To: [email protected]
Subject: RE: [CFCDev] UI and encapsulation

 

Here's what I use in the application I was referring to in yesterday's thread on this same/similar subject (hope this goes through) :

 

<Field Label="Some form Label" Type="Text,Select,Radio,etc." Required="Page/Group" DestinationTable="TableName" DestinationField="FieldName" ChildFields="ChildField1,ChildField2" ParentField="ParentField1" Size="" MaxLength="" Datasouce="QueryName" Validation="Date,Numeric" />

 

Ok now to answer questions that will come up with what do things mean:

-          ChildFields: these are form fields dependent on this one. They are only available in select boxes and the selected value of this field drives the available options of the Child form fields

-          ParentField: the field whose selection drives the available options of this select box

-          Required: Validation necessary for form submittal. The Page indicates the field is required to submit the form. The Group indicates that if other members of the Group (a parent-tag to field) are filled in, then this field is required to submit the form.

-          Datasource: a parent field called Query is defined with a name attribute and that's what is here.

 

I hope that help or at least gets you thinking on how you might want to implement a schema yourself. This XML is built using web-based tools that a user (administrator in this case) has access tools to defined pages/groups/fields of this wizard-based application. Thanks,

 

Phil

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Seth Petry-Johnson
Sent: Friday, January 20, 2006 12:32 PM
To: [email protected]
Subject: Re: [CFCDev] UI and encapsulation

 

Baz:  I've never actually done this before, I'm just spouting off ideas from the top of my head :)

 

And just to make sure we're on the same page, I wasn't suggesting that the XML itself display the form.  Rather, I was suggesting that XML be used to describe the form's metadata and a rendering component would read the XML and create the actual HTML form tags.  [I couldn't tell from your question if I'd made that sufficiently clear or not, so I thought I'd clarify just in case]

 

On 1/20/06, Baz <[EMAIL PROTECTED]> wrote:

Hey Seth,

 

Can I see an example of some XML you have generated to display a form?

 

Curious,

Baz

 

 



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting ( www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected] ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting ( www.cfxhosting.com).


An archive of the CFCDev list is available at www.mail-archive.com/[email protected] ----------------------------------------------------------


You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting ( www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]



¹²ryqzºn‰zŠqzsz¶¢ºn‰}½…n¶…jD¾º¢Ãszjº®o\¶Ã²[1]rz…–Šjn·™jŠ¢}½Î

(��޲��r��y�hq�z��{.n�+���zwZ�隊[hq�z�s:'z���+a����l�{.n�+���}�^��-��.n7�����j)ADB ޾++�v�P��w��s:'z��jwl��h�םo �\z,�)�� h�ا��&Qv�r�z����7��+-�Ưj)ZnW�� 0���j�!����o�}�^���Ήޢ�

Reply via email to