Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Mockup
mvc-diagram
mvc-diagram
1Version2
Namemvc-diagram

Requests from users are processed by FarCry's built-in "smart controller" which automatically determines wiring based on the URL convention or the friendly URL sub-system. The COAPI always ends up calling a principal content type (a special type of class) that manages how we interact with the model and view. When thinking of views (or webskins) its important to realise that they are always executed in the context of a specific content type.

...

  1. Login to the Webtop and click on the Home Page dmHTML object in the site tree (the white page icon... not the blue dmNavigation object)
  2. Copy the objectid of this object to the ClipBoard (located at the bottom of the summary for the object or in version 6-0-16, under the Miscellaneous tab in the ObjectID section)  
  3. Now, locate the ./webskin/dmHTML folder in your project
  4. Take note of the current webskins in that folder.
  5. Now enter a url to call each of the webskins in that folder using the following format
    Code Block
    titleExample URLs Only
    http://localhost:8888/index.cfm?objectid=E689D66F-96FD-E9F6-B1AF64B8DAE78A69&view=displayPageStandard
    
    http://localhost:8888/index.cfm?objectid=E689D66F-96FD-E9F6-B1AF64B8DAE78A69&view=displayPage3Col
    
    http://localhost:8888/index.cfm?objectid=E689D66F-96FD-E9F6-B1AF64B8DAE78A69&view=displayTeaserStandard
    
  6. Discuss how this forms the basis of almost ALL web applications

...

Note
titleReloading/Restarting The Application To Recognise Webskin Changes

When a FarCry application starts it works out all the available webskins for every content type and stores them in memory. Every time you add create a new webskin file you need to reload the application in order for the system to recognise it. If you are logged in you can reload the application from the "Tray Menu" or by simply running a page with &updateapp=1 at the end of the URL. (Note: Your updateapp key may be set to a value other than 1. Check inside your farcryConstructor.cfm in your webroot to confirm).

Alternatively, if you only want to reload part of the application, go into the [ webtop / admin / developer utilities / reload application ] and simply select the options you wish to reload. This is a handy tab to have open at all times while your developing and constantly adding/updating webskins and metadata.

...

These are just a few of the regularly used webskin names within the FarCry framework. For a complete list of reserved webskin template names review: https://farcry.jira.com/wiki/display/FCDEV50/Webskin+Templates

Hooking Up The Webskin To Data

...

For a complete list of decorators and their uses, see:https://farcry.jira.com/wiki/display/FCDEV60/Summary+of+View+Decorators

Template metadata is always stored in a ColdFusion comment.

...

Mockup
webskin-composite
webskin-composite
1Version1
Namewebskin-composite
Note

FarCry doesn't prescribe a specific templating architecture - you can get pretty sophisticated in your approach or keep it dead simple. Fandango is a good best practice starting point.

...

You can call another view directly using the skin:view tag. skin:view is a real workhorse - we use it all the time.

skin:view example
Code Block
titleExample from ./dmHTML/displayPageHome.cfm

<div id="main">
	<div class="container_12">
		<div class="grid_12 content">
		<skin:view typename="#stobj.typename#" objectid="#stobj.objectid#" webskin="#url.bodyView#" />
		</div>
	</div>
</div>

View Inheritance

FarCry is an object oriented framework. All content types extend the core types component (an abstract class). Any views associated with types are automatically inherited by other content types, such as our dmHTML content type.

...

Looking at our dmHTML content type in Fandango, we have at least the following views available:

  • displayPageStandard
  • displayTeaserStandard
  • displayHeaderStandard
  • displayFooterStandard
  • displayBody
  • displaySimpleSearchResult

Webskin Tracer

The tray that appears at the bottom of the website when you are logged in, contains a marvellous developer utility called the "Webskin Tracer". You can activate it for any page by simply selecting the webskin tracer option.

...