adobe photo shop font download

cs5 web premium cheapest adobe photoshop 7 free download adobe photoshop cs3 v10 download for windows buy cheap download adobe acrobat pdf writer free download for adobe distiller pc

adobe reader download mac osx

cheap adobe photoshop adobe after effects download adobe reader tar gz download buy cheap find free adobe download adobe 8 download

adobe download interuption

photoshop elements buy cheap download adobe reader version 5 download adobe acrobat 9 cheap internet explorer crashes upon adobe download free adobe acrobat software download

download adobe photoshop cs3 rapidshare

buy cheap adobe dreamweaver adobe acrobat 8 update download adobe photoshop cs3 iso file download cheap free adobe 8 download adobe fine reader free download

adobe flash video exporter download

adobe fireworks cheap adobe pagemaker download full free adobe acrobat 7 pro download buy cheap adobe illustrator cs 2 download for windows adobe illustrator crack download

download adobe documents

buy cheap creative suite 4 adobe master collection torrent download where to download adobe acrobat buy cheap adobe photoshop album download free download adobe illustrator cs3 mac

free adobe photoshop software download

Adobe Creative Suite 5.5 buy cheap how do i download adobe reader for free adobe version 5 download cheap download madden 2005 strategy guides to adobe reader for safe and secure free adobe flash download

unable to download adobe acrobat reader

Adobe Flash CS5.5/a> download adobe illustrator cs download adobe acrobat megaupload cheapest freeware adobe acrobat download free software download adobe reader

adobe live motion download

buy cheap Adobe After Effects CS5.5 free safe download of adobe acrobat reader download free adobe acrobat cheapest download a older version of flash player adobe free to download adobe illustrator

adobe photoshop cs 3 download

adobe software cheap download adobe acrobat reader free adobe reader slowenian download cheapest adobe acrobat 6 full download adobe acrobat 6 pro download

free trial download adobe photoshop mac

creative suite 5 cheapest download record adobe flash movie adobe patch download cheapest internet explorer crashes upon adobe download adobe flashplayer active x download

get free download of adobe flash cs3

buy online adobe incopy adobe photoshop download discount software download adobe 9 free cheap acrobat reader adobe download download the adobe photoshop cs2 book for digital photographers

adobe reader kostenloser download

adobe creative suite 5 cheap adobe 7 free download adobe premiere download cheapest adobe acrobat download vista where to download adobe acrobat

download trial version of adobe acrobat 8 professional

cheap photoshop lightroom 3 download stand alone adobe flash adobe flash palyer download cheap adobe acrobat viewer download free adobe professional download

adobe download

buy online cs5 master collection free download adobe acrobat reader professional 6 cracked adobe indesign cs2 mac download cheap adobe pdf printer download download adobe premiere pro cs3

free adobe acrobat writer download

buy online adobe premiere pro adobe cs3 patch download free adobe flshplayer 9 download buy online free adobe premiere download adobe acrobat pdf writer download

adobe illustrator and download

adobe web premium buy online download free edition adobe photoshop instructions on how to download documents on to adobe reader buy online adobe illustrator cs download adobe flash player downloader free download hunter grabber

ColdFusion-ORM: Collections


In this post, I will digress a bit and introduce you to a lighter feature of ColdFusion-ORM – COLLECTIONS.

What are collections?
Consider the same tables we have been using – Art and Artists.  Say, in the Artist object, you just need an array/struct of Art names instead of an array/struct of the Art objects, then use collections.

Task:
Example to demonstrate collections in ColdFusion-ORM

Previous Related Posts:
Getting Started with ORM
ColdFusion-ORM: Using CRUD Functions
ColdFusion-ORM: Define One-to-Many and Many-to-one relationships

Stuff that you would learn:
- how to create a collection as an array
- how to create a collection as a struct
- how to create a sorted collection

Steps to Run the example:
-  This example needs the cfartgallery datasource. This is shipped with ColdFusion by default.
-  Create a directory say "ormcollections" under webroot.
-  Create the following files – Application.cfc, Artists.cfc and index.cfm.
-  Run the URL http://localhost:8500/ormcollections/index.cfm

In this example, I have put comments only in Artsists.cfc.  Please read the previous posts if need information about the other files.

Application.cfc

component
{
    //Name for the application
    this.name = "ORM_Collections";

    //ormenabled should be set to true so that ORM is enabled for this application
    this.ormenabled = "true";

    /*
    Set the datasource that needs to be used by the ORM Functions.
    You can also set this in the ormsettings struct
    */
    this.datasource = "cfartgallery";
}

Artists.cfc


component persistent="true"
{

    property name="artistid" generator="increment";
    property name="firstname";
    property name="lastname";
    property name="address";
    property name="city";
    property name="state";
    property name="postalcode";
    property name="email";
    property name="phone";
    property name="fax";
    property name="thepassword";

/*
Artists have many arts.  Using Collections, the name of the arts created by
each artist can be retrieved as a string array.  Note that the art names
is picked from the table and you don’t require the ART component.  This also means
that you get an array of strings and not an array of persistent objects.

For doing this, first of all, set fieldtype="collection".

type: can be "array" or "struct". Defaults to array.  If type=array, the art
names are retrieved as an array of names.  If type=struct, the art names are
retrieved as key-value pairs.

table: The name of the table in which the collection needs to be retrieved from.

fkcolumn: The name of the foriegn key. If not specified, will be figured
out by inspecting the database.

elementcolumn: The name of the table column which should be the retrieved as
the values of the array/struct. In this case, the names of the arts (Art->artname).

elementtype: The datatype of the table column used in elementcolumn.

orderby: Specify the sort order.  The string should be specified in the format
"<column_name_1> <sort_order>, <column_name_2> <sort_order>, ...". <column_name>
should be the name of the column name of the table. <sort_order> is "desc" or "asc".
*/

    property name="ArtNamesAsArray" fieldtype="collection" table="Art"
    fkcolumn="artistid" type="array" elementtype="string" elementcolumn="artname"
    orderby="artname desc";

/*
Here is one more property which retrieves artnames but it retrieves it as a struct.

Two additional attributes are requried to defined for this collection type - structkeycolumn and
structkeytype in addition to the attributes used for fieldtype="collection" for type="array".

Structkeycolumn: Specify the column name of the table which should be used for the keys of the struct.
This column should be unique for the records that are retrieved. Here, the column artid is used.  

Structkeytype: The type of the column that is used in structkeycolumn.
*/

    property name="ArtNamesAsStruct" fieldtype="collection" table="Art" fkcolumn="artistid"
    type="struct" elementtype="string" elementcolumn="artname" structkeytype="int"
    structkeycolumn="artid" orderby="artid";
}


index.cfm

<!---
This example will teach you Collections.
- how to create a collection as an array
- how to create a collection as a struct
- how to create a sorted collection

cfartgallery datasource is used for this application.
Artists table is one of the table in cfartgallery which contains a list of
artists records. Arts is one other table which contains a list of arts created
by artists.  Artists has a one-to-many relationship with Arts records.  

Artists and Arts tables are used in this example.
--->

<cfscript>
    /*
      Load the artists
    */
    artists = EntityLoad("Artists");

    WriteOutput("<b>Display the Artist name and the name of their arts which we got as an array<br /></b>");

    for (i=1;i<=ArrayLen(artists);i++)
    {
        artist = artists[i];

        /*Retrieve the Names of the Arts created by the artist
          The Art-Names are retrieved as an array
        */
        artNameArray = artist.getArtNamesAsArray();

        /*
          Display the Artist Name and their arts
        */
        WriteOutput("<b>" & artist.getFirstName() & " " & artist.getLastName() & "</b> has created ");
        if (ArrayLen(artNameArray))
        {
            for (j=1;j<=ArrayLen(artNameArray);j++)
            {
                WriteOutput('<i>' & artNameArray[j] & '</i>, ');
            }
        }
        else
        {
            WriteOutput("<i>none</i>");
        }
        WriteOutput("<br>");
    }
    WriteOutput("<br>");
    /*
      In the above section, retrieving art names as a array is shown.  The following section retrieves the
      art names as a struct
    */
    WriteOutput("<b>Display the Artist name and his arts which we got as struct<br /></b>");

    for (i=1;i<=ArrayLen(artists);i++)
    {
        artist = artists[i];

        /*
          Retrieve the names of arts.  The Art Names are retrieved as a struct
          The keys of the struct are the IDs of the respective arts.
        */
        artNameStruct = artist.getArtNamesAsStruct();

        /*
        Display the Artist Name and their arts.
        */
        WriteOutput("<b>" & artist.getFirstName() & " " & artist.getLastName() & "</b> has created ");
        artNameKeyArray = StructKeyArray(artNameStruct);
        if (ArrayLen(artNameKeyArray))
        {
            for (j=1;j<=ArrayLen(artNameKeyArray);j++)
            {
                /*
                  Art ID is a integer.  Hence using the java method to retrieve the value of the struct member
                */
                WriteOutput('<i>' & artNameStruct.get(javacast("int", artNameKeyArray[j])) & '</i>, ');
            }
        }
        else
        {
            WriteOutput("<i>none</i>");
        }
        WriteOutput("<br>");
    }
</cfscript>

Adobe ColdFusion Builder Team blog!!


The Adobe ColdFusion Builder team have started a new blog – http://blogs.adobe.com/cfbuilder/ where the team blogs about the features of the new Adobe ColdFusion Builder, tips and tricks, and more.  There are quite a few interesting posts out there already.  Do check it out.