SlatwallDocs
  • Developers
    • Getting Started
    • Configuration
    • Frontend Development
    • Reference
  • Users
    • Administrator Overview
    • Product Management
    • Promotions
    • Price Groups
    • Order Management
    • Accounts
    • Warehouse
    • Config
    • Tools
    • User Account information
  • Integrations
    • Shipping Integration
    • Payment Integration
    • Mura
  • Google Group
  • Professional Support
  • getSlatwall.com

Getting Started

This section provides basic details about Slatwall & how to get started!

  • Overview
  • Download / Install
  • File Structure
  • Updating From Version 2.x
  • Updating Slatwall
  • Connecting Slatwall to Custom App

Overview

Slatwall is an extremely powerful and robust digital commerce management system. It is designed to work in a multitude of different business situations, and helps to centralize your commerce activity by integrating into existing systems. Slatwall easily operates as an eCommerce shopping cart for your website but it can also do a lot more like Inventory Mangement, Vendor Ordering, Subscription Management, etc.

These docs should provide all of the information you need to get up and running with Slatwall. Broken up into two sections, the first helps developers get slatwall up and running, and the second focuses on users, the admin, and how to use it.

It's important to note that these docs are part of the Slatwall core which means they get updated as new versions of Slatwall are rolled out. The most current version of the docs can always be found at docs.getslatwall.com, but your version spefic docs can be found in the slatwall admin under Help / Tools > Docs.

If you have a question that can't be answered by these docs you can post it to the google group (link in the top navigation above) where the community provides free support. In addition, ten24 offers professional support, maintenance agreements, and professional services for Slatwall. More information about these contracts can be obtained by contacting ten24 (www.ten24web.com/contact/).

Download / Install

Requirements

  • CFML Server Version: Coldfusion 9.0.1 or Railo 4.0.1.003
  • Database Engine: MySQL, Microsoft SQL or Other*
  • Operating System: Windows, Mac OSX, Linux

*Slatwall is built on top of Java's Hibernate. Theoretically any of the databases that Hibernate supports should work, but as of right now only MS SQL & MySQL are tested with every release. Use other engines at your own risk.

 

Selecting Install Style

 

You can install Slatwall a handful of different ways. Selecting the correct option really depends on your situation and how you intend to use Slatwall. At its core you can think of Slatwall as your back-office commerce management solution. Slatwall by itself does not have any CMS built in, so if you planing to be building a public facing eCommerce website we hightly recommend selecting an option that includes a CMS.

Standalone
This is a good option for anyone who already has a CFML engine like Adobe Coldfusion or Railo running on your server, and either don't plan to use a CMS or plan to implement a custom CMS that we don't already have an integration built for.
Integrated w/Mura
Mura is one of the most powerful open source content management systems on the market. If you plan to roll out a public facing eCommerce site, we highly recommend this option.

Installing

Standalone
  1. Download the Slatwall application from github here: www.github.com/ten24/slatwall
  2. The file should be downloaded as a .zip file that you will need to unzip.
  3. Once the application is unzipped, place it in your web root and configure it to run either via IIS or Apache.
  4. Create a datasource called 'Slatwall' in your CFIDE or Railo administrator, and point it to a fresh database.
  5. Navigate to the site in your browser and follow the steps on the screen.

 

Integrated w/Mura

 

  1. Download the Slatwall-Mura Connector Plugin from github here: www.github.com/ten24/slatwall-mura
  2. The file that is downloaded will be a .zip file, that can be installed as a plugin into mura.
  3. Open your Mura Administrator and Navigate to Settings > Plugins.
  4. Select the .zip file that you just downloaded and click the "Deploy" link.
  5. On the next page you will be presented with some settings for how you would like accounts to sync. By default we set it up so that system users sync with Slatwall but site users do not, which means that admins will exist in both systems, but the customer accounts created don't also get created in Mura.
  6. On this page you also need to select the sites that you would like to deploy on. At least 1 site needs to be selected.
  7. Once you have all your settings in place, press "Update". This step may take a couple minutes as the plugin installs the latest version of Slatwall in the root folder of Mura.
  8. Now that the plugin is installed you can got to Modules > Plugins > Slatwall.
  9. Optional: Review the Mura Integration Overview to learn more about how Slatwall interacts with Mura.

 

File Structure

Folder & File Description
admin/
  controllers/
  layouts/
  views/
Holds the primary administrative web application. This directory consists of 3 sub-directories; controllers, layouts & views. The majority of the admin application runs through the /views/entity directory so if you are interested in learning about how we layout our administrative views, this would be a good place to start.

It's important to note that this directory is a FW/1 subsystem, and for more information on how FW/1 subsystems work please visit the wiki here: FW/1 Wiki
assets/ The assets directory holds some of the core CSS & Images for the application
config/
  dbdata/
  resourceBundles/
  scripts/
  configApplication.cfm
  configApplication.cfm
  configCustomTags.cfm
  configFramework.cfm
  configORM.cfm
  lastFullUpdate.txt.cfm
The config folder holds all of the data, and setup that Slatwall uses to set itself up. This folder should never be modified, if you would like to make instance level configuration changes they should be done in the /custom/config direcotry.
 
  • dbdata/ - contains XML documents with the default data that gets inserted into the DB on install
  • resourceBundles/ - contains internationlization files for using slatwall in multiple languages
  • scrips/ - contains files that run during full updates to manipulate the database if needed.
  • configxxx.cfm - These files define the Hibachi setup information.
  • lastFullUpdate.txt.cfm - This file is written to every time an update reload is done. If your application is having issues you can delete this file so that the next request forces a reload.
custom/
  config/
    resourceBundles/
  model/
    dao/
    service/
    validation/
Any customizations to how the application functions can be defined in this directory. Any code added here will not be overridden when the application is updated. You will notice that the folder structure mirrors the the same folder structure from the root.
frontend/ The frontend directory was previously used as the primary subsytem used by public facing websites in versions 2.3 and previous. This folder is deprecated so please use the 'public' subsystem for all new development.
integrationServices/ This directory is the primary place where you can extend the Slatwall application to fit your businesse needs. It contains a handful of integrations that we provide, and in addition you can add new directorys to this folder in order to extend / customize the application.
meta/ Contains a lot of meta information about the application, including these docs. It also has our Test suites, and some tools like snipits and dictionaries that can be used in your IDE or Text Editor
model/
  dao/
  entity/
  process/
  service/
  transient/
  validation/
This is the beating heart of Slatwall, and contains all of the businesse logic that makes up Slatwall (with the exception of the /org/Hibachi directory). It is strongly suggested that you explore these sub-directories and especially the /entity directory as it maps out the entire database structure.
  • dao/ - Used by the services as the go-between from service to database.
  • entity/ - All of the persistent data entities are stored here.
  • process/ - Contains transient objects used by the "Process" service methods. Typically these objects are used to validate non-persistent data before it gets used in the application
  • service/ - The services in this directory control how the entities are managed.
  • transient/ - Contains objects that only exist for a single request, and pass data around the application.
  • validation/ - Contains all validation json files for all entities & process objects that get used both server-side & client-side.
org/
  Hibachi/
The org directory is where we store all libaries, frameworks, etc. that are independintly managed. The primary external library is /Hibachi which is a framework developed by ten24 that sits on top of FW/1 to provide abstract ORM features for Rapid Application Development.
tags/ This directory holds some CF Custom tags that are used by Slatwall specifically in the admin and integrationServices

* Folder is save to make changes within, without fear of being overwritten during update.
* Folder is not needed, but recommended
* Folder is deprecated.

Updating From Version 2.x

If you are currently running Slawtall version 2.3 or newer as a plugin to Mura, please follow these steps to migrate to the latest version.

  1. Make a backup of Site Files & Database
  2. In Mura admin, update the core mura files to the latest version of Mura
  3. In the Mura admin, Delete the slatwall plugin (this step will NOT delete your data)
  4. Download the new Mura Connector Plugin from either www.getslatwall.com/download/, or directly from it's github repository: github.com/ten24/slatwall-mura
  5. Install the plugin that you have downloaded into your Mura Application.
  6. NOTE: If you are updating and plan to have your legacy frontend views work (see below) then you probably want to set the setting of "Create Default Pages and Templates" to "No" when installing the plugin.

When this new Mura integration plugin gets installed, it will automatically download and install the latest stable release of slatwall directly in your Mura root folder. The new connector plugin serves as a go-between from Mura to Slatwall and is required now that Slatwall is a standalone application and not itself a plugin for Mura.

IMPORTANT: The old 2.x version of Slatwall used a "frontend" subsystem to do all of the listing displays, product detail, checkout, my-account, etc. This subsystem has been DEPRECATED in version 3.0 for the new "public" subsystem that functions differently. We highly recommend reading up on the "frontend development" portion of these docs to learn how the new API functions. If you do not wish to update the forms & displays for an existing site, you can tell the Mura integration to Inject the Legacy Views (ie: frontend subsystem). To do that follow these steps

Legacy Frontend Setup

  1. In the Slatwall admin go to "Config >> Integrations".
  2. Open the "Mura" integration.
  3. In the settings tab edit the "Inject Legacy Views" setting
  4. Change the value to 'yes' and save.
  5. In your mura root open up the file: /config/cfapplication.cfm
  6. Add a line at the bottom with this:
    <cfset this.customtagpaths = listAppend(this.customtagpaths, "{FullSystemPathToSlatwall}/Slatwall/tags") />

Updating Slatwall

Once you have Slatwall installed, it is important to keep it up to date with the latest releases.  This ensures that you are always up to date with any new features & functionality as well as security bugs that have been fixed.  The good news is that Slatwall makes this extreamly easy.

  1. Backup your Site Files & Database
  2. Log into the admin
  3. Navigate to Tools / Help >> Update Slatwall
  4. You will see the current version you are on as well as the available versions to update to
  5. From the dropdown you can select either the latest stable release, or latest bleeding edge release.  In addition you can also define a custom branch on github that you would like to update to by typing the name in.
    Version Description
    Stable This version should be used by all production sites.
    Bleeding Edge This version should only be used when testing on development server a new feature that is planned to be in a future release.
    Custom This should only be used by advanced users, and when explicitly asked to update to a custom branch from the support forums.
     
  6. Select the appropriate option and click the "Update" button.
  7. Be patient because this can take several minutes.  Once the action is complete you should be redirected to the main dashboard with an "Update Successful Message"
  8. You can verify that your version of Slatwall was updated by navigating to Tools / Help >> About and reviewing the version number

 

IMPORTANT DEVELOPER NOTE:  If you have made any changes to files in your slatwall instance that are outside of the "Update Safe" folders defined in the File Structure docs, there is a very high chance that those changes will be overridden so please take extream caution and always backup your work.  You should never need to make a change to Slatwall that is outside of the "Update Safe" folders.  If you don't know how to make your necessary customization inside the "Update Safe" folders, please post a question to the google group.

Connecting Slatwall to Custom App

If you would like to get Slatwall connected to your larger CFML based application, follow these short, simple steps:

First: Tell Slatwall about your App

  1. Drop the Slatwall directory somewhere inside of your application.
  2. Add the following file to Slatwall:
    /custom/config/configApplication.cfm
  3. Then add parent application's name to that file, so that Slatwall and your application share the same application scope (don't worry all of Slatwall is namespaced):
    this.name="myappname";
  4. You will probably want to add another line in this file to define your apps datasource (again all table names are namespaced):
    this.datasource.name="mydatasourcename";

Now tell your app about Slatwall

  1. Inside of your application file, you will need to add a mapping as well as enable ORM, and tell the ORM about the Slatwall entity directories. It should look something like this:
    this.mappings["/Slatwall"] = "fullSystemPathToSlatwall";
    this.ormEnabled = true;
    this.ormSettings.cfclocation = ["/Slatwall/model/entity","/Slatwall/integrationServices"];
    this.ormSettings.dbcreate = "update";
    this.ormSettings.flushAtRequestEnd = false;
    this.ormsettings.eventhandling = true;
    this.ormSettings.automanageSession = false;
    

Now that the two applications know about each other, you can navigate to the Slatwall directory in your browser to make sure it works. As you can imagine, there are a number of other configurations that can be set for Slatwall, so please review the App Config Files documentation.

Next, lets setup your app to talk with ours

The good news is that for both client side & server side, there is a single API to integrate with Slatwall: the "Slatwall Scope." The Slatwall Scope serves two functions: to pull information from Slatwall to process logic on your side, or display to users, and to accept information from the application & users by listening for actions. Set up Slatwall Scope using the steps below.

  1. You will want to add the following code to the onRequestStart() or something that runs on every request.
    if (!structKeyExists(application, "slatwallFW1Application")) {
    	application.slatwallFW1Application = createObject("component", "Slatwall.Application");
    }
    application.slatwallFW1Application.bootstrap();
    
  2. Now that the setupGlobalRequest() has been called, the SlatwallScope is available via request.slatwallScope to be used to pull any information out of slatwall, or manually call service functions.
  3. Next we want to setup the second half of the API that listens for actions from the user. That is done by adding
    if(structKeyExists(form, "slatAction")) {
    	request.slatwallScope.doAction( form.slatAction );
    } else if (structKeyExists(url, "slatAction")) {
    	request.slatwallScope.doAction( url.slatAction );
    }
    
  4. Lastly, we recommend at the top of your application templates you add the following to provide a consistent API on both client side and server side.
    $.slatwall = request.slatwallScope;
    #$.slatwall.renderJSObject()#
    

The second line gives you client side access to the entire Slatwall api to pull objects back a JSON, and can be great for running functions like adding items to the cart, or updating you product listings via AJAX.


Configuration

There are a lot of buttons to press, and knobs to turn... lets find out what they do.

  • Overview
  • App Config Files

Overview

Slatwall is extremely configurable -- unlike other eCommerce management solutions, Slatwall enables developers to completely override almost every aspect of the application if desired. This includes things like application settings, resource bundles, validation and even any of the services or dao's that are core to the application. 

App Config Files

In the /custom/config directory of Slatwall, 5 important files allow for an override of the default settings, and give you controle over how the application functions. Normally, this folder is empty unless  Slatwall was installed via a connector, like the Mura connector.  In that case there may be some files that were automatically written to link Slatwall with that application.

Any config files added to the custom folder will be pulled into the application and override the defaults defined by Slatwall. The files will be loaded up in the order below.

/config/custom/configApplication.cfm

/config/custom/configFramework.cfm

/config/custom/configMappings.cfm

/config/custom/configCustomTags.cfm

/config/custom/configORM.cfm

These files allow you to designate all of the application level configurations that are avalable for ORM. The most common reason to add these files is to enable secondary cache for ORM which can be done with this simple 1 liner.


Frontend Development

Time to get your hands dirty and start building your dreams.

  • The SlatwallScope
  • Frontend Display Templates
  • Public API: slatAction
  • Results, Errors & Validation
  • Formatting Values

The SlatwallScope

Overview

One of the most important objects to understand, especially for frontend development, is the SlatwallScope. It operates as the primary progromatical interface for getting information both in and out of Slatwall. The SlatwallScope is created on every request and stored in request.slatwallScope, however by convention a reference to this will be stored in every template as $.slatwall.

Request Objects

The SlatwallScope contains all of the contextual information for that page request including all of the current request objects like the session, account, and cart. In addition when you are on specific "detail" pages the slatwall will also contain those request objects like the product, productType or brand. The convention for accessing these objects is very simple, and follows the following example syntax:

Method Description
$.slatwall.getAccount() Returns the current account object.
$.slatwall.account() Shorthand for returning the current account object, the result is the exact same as above.
$.slatwall.account( 'firstName' ) Shorthand for returning a specific property of the object, this is the exact same as doing $.slatwall.getAccount().getFirstName().
$.slatwall.account( 'firstName', 'John' ) Shorthand for setting a specific property of the object which can then later be persisted to the database. This is the exact same as doing $.slatwall.getAccount().setFirstName('John')

The request objects that get set in the SlatwallScope are:

$.slatwall.getAccount()
$.slatwall.getBrand()
$.slatwall.getCart()
$.slatwall.getProduct()
$.slatwall.getProductList()
$.slatwall.getProductType()
$.slatwall.getSession()

Request Helpers

In addtion to the request objects there are some helper methods that will get you some quick insights about the request

Method Return Type Description
$.slatwall.getLoggedInFlag() Boolean Returns true / false if the current request is a logged in account. If it isn't then $.slatwall.getAccount() will just return a new account object that has not been persisted to the database.
$.slatwall.getLoggedInAsAdminFlag() Boolean Similar to the method above, but returns true / false if the current account that is logged in belongs to any of the admin permission groups.

Custom Request Values

The SlatwallScope also has the ability to store custom request values directly inside of it. This can be very useful for setting custom values, and then calling them back up somewhere else in the request.

Method Arguments Return Type Description
$.slatwall.hasValue( key ) key (string) Boolean Returns true / false if a value has been set for that key.
$.slatwall.getValue( key ) key (string) Any Returns the value of a key that was set.
$.slatwall.setValue( key, value ) key (string)
value (any)
Void Shorthand for returning a specific property of the object, this is the exact same as doing $.slatwall.getAccount().getFirstName().

General Entity Access

All of the objects that have been described above like account, cart, ect are actually a specific type of object called an "Entity". Entities are just objects that get saved to the database. However there are a lot more entities in the Slatwall database that you may want to read, update, delete and save. Again the SlatwallScope provides a consistent API for working with all of the entities. The easiest way to know what entities are available as well as their properties is just to open the /Slatwall/model/entity directory.

Method Arguments Return Type Description
$.slatwall.newEntity( entityName ) entityName (string) Object Returns a new entity that when saved will turn into a single row in the database. For example you could call: $.slatwall.newEntity( 'Product' )
$.slatwall.getEntity( entityName, entityID, [returnNewOnNotFoundFlag] ) entityName (string)
entityID (string)
returnNewOnNotFoundFlag (boolean)
Object || Null Loads an entity by it's ID property. If the ID is not found in the database, and returnNewWhenNotFoundFlag is true then you will get the same result as newEntity(). For example you could call: $.slatwall.getEntity( 'Product', '22d919cefca3bafd8c6f35d792287683', true)
$.slatwall.saveEntity( entity, [data] ) entity (object)
data (struct)
Object Calling this method will persist the object to the database so that it is saved as long as it passes 'save' context validation. The data argument will allow a structure of property values to be populated into the entity before saving. For example you could call: $.slatwall.saveEntity( $.slatwall.newEntity('brand'), {brandName="Nike", brandWebsite="www.nike.com"} ) Keep in mind, that because Slatwall runs on a persistent ORM framework, and you make changes to an existing entity that was pulled out of the database those changes will be saved even WITHOUT calling saveEntity(), however calling saveEntity() will ensure that it passes validation.
$.slatwall.getEntity( entityName, entityID, [returnNewOnNotFoundFlag] ) entityName (string) Boolean This will delete the entity from the database so long as it passes 'delete' context validation. It will return true / false based on if the object passed validation.
$.slatwall.getSmartList( entityName, [data] ) entityName (string)
data (struct)
Object This will return a SmartList of all of a specific type of entity. The data argument allows you to pass in specific values for filtering, sorting, paging, ranges & searching. For example you can call $.slawall.getSmartList('product', {orderBy="productName"}).

Frontend Display Templates

Concept

If you are building out a public facing shopping cart, the core of that experience is going to be driven by some type of content management system (CMS) or perhaps a custom application.  However when you break it down there are only a handful of template types that you are likely going to setup.

  • Product Listing
  • Product Detail
  • Shopping Cart
  • Checkout
  • My Account

These templates work by pulling data out of the SlatwallScope, which by convention should be setup as $.slatwall (it can also be found in request.slatwallScope). Then they submit form values or links with a paramater called "SlatAction" that defines public api methods to pass data into Slatwall.

Examples

Slatwall ships with a set of example templates like the list above (and a couple additional). These templates can and should be modified to fit whatever type of shopping experience you are looking for. In order to make it as easy as possible to get you up and running, we heavily document via comments the inside of these example fiels. You can find these templates in: /public/views/templates/ but it will be important not to use them directly from that location but to instead copy them into your desired look and feel. The example templates use the Twitter Bootstrap UI conventions, but Twitter Bootstrap is not required for any of them to work.

Important: If you are using one of our connector plugins for a common CMS platform then these templates were likely already copied over to that application on install. For Mura CMS they should be in you /templates folder and for contentbox they should be in your /layouts directory.  For more information on this view the docs for your specific CMS in the Integrations section.

Public API: slatAction

Overview

The frontend of your site will pass data back to Slatwall typically by using the frontend action paramater called 'slatAction'. This lets Slatwall know that you would like to trigger some type of action, and it can be passed as either a URL paramater or FORM paramater. For example the 'addToCart' action could either be called as:

<input type="hidden" name="slatAction" value="public:cart.addOrderItem" />

Or via a URL paramater as:

<a class="?slatAction=public:cart.addOrderItem">Add To Cart</a>

 

Chaining Together slatAction's

One of the great features about slatActions is that they are able to be chained together. A common use case for this is to create a new account and then directly after log that account in. An example of a chained actions would look like this:

<input type="hidden" name="slatAction" value="public:account.create,public:account.login" />

 

Redirects

Sometimes after calling an action you will want to redirect the user to a specific url. There are three different paramaters that can be used to facilitate this behavior.

Warning: Using redirects can sometimes have unintended consequences because as soon as the redirect happens you will lose all server side validation, success & failure information.

Best Practice: To avoid loosing the data, whenever possible, it is best to change either the form action you are posting to, or the url that you are getting to be the page that you would like the user to end up on after the action is complete. Because actions are called before any rendering you will then be able to display the results on that new page.

If you do need to use a redirect, then you can use the following paramaters again as either a URL paramater or hidden form field.

redirectURL
The url will be redirected to regardless of the outcome from the action that was called.
sRedirectURL
The url will only be redirected to if the action was a success. If you have chained multiple actions together it will be redirected to if ALL actions were successful.
fRedirectURL
The url will only be redirected to if the action was a failure. If you have chained multiple actions together it will be redirected to if ANY action failed.

Example as a form:

<input type="hidden" name="sRedirectURL" value="www.mysite.com/order-confirmation/" />

Results, Errors & Validation

Public Action Results

Whenever you submit a slatAction(s) to the public api, the SlatwallScope will return the success / failure of that action.  You can easily get those value by calling one of the following methods on the slatwallScope.

Method Arguments Return Type Description
$.slatwall.getCalledActions() none Array Returns an array of all actions that were called.
$.slatwall.getFailureActions() none Array Returns an array of all failed actions that were called.
$.slatwall.getSuccessfulActions() none Array Returns an array of all sucessful actions which were called.
$.slatwall.hasFailureAction( action ) action (string) Boolean Returns an array of all sucessful actions which were called.
$.slatwall.hasSuccessfulAction( action ) action (string) Boolean Returns an array of all sucessful actions which were called.

 

Displaying Error Messages

Slatwall makes it easy to display error messages that come back from unsuccessful actions. When a public slatAction is called there will always be an object in the SlatwallScope that the action is acting on. For example when calling ?slatAction=public:cart.addOrderItem, the object that is being acted on is $.slatwall.cart(). This means that when the action is completed any errors that might have been encountered such as validation errors can be found in $.slatwall.cart().getErrors() which will return a struct of error messages.

We've made the outputting of those errors simple, in the public tag library you will find: <sw:ErrorDisplay />. In the example above if you would like to output any errors that the cart object has after attem

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.