Packages are the name given to individual applications that run under the Salsa framework. Packages can have unique file naming conventions to take advantage of Salsa hooks and redirects, which we'll describe later. For the purpose of this tutorial, we will be creating a simple package that consists of just a SalsaScript file within it's own package directory.
If you are using WebDAV, this is just a matter of creating the folder on the server. If you are using Subversion, you will have to create the folder locally and then add the folder via Subversion.
There are three types of packages, which differ only by who has access to them. To change the package type from the default, create or edit the WEB-INF/package.xml file in your package directory. Package types cascade to subfolders, unless there is another package.xml file overriding that directory. This way, you don't need to have a package.xml file in every package.
By default, your package is only accessible to Campaign Managers inside the Salsa Headquarters. The general public does not have access to pages inside the package. Traditionally, the default package lives in the subdirectory 'hq/' of the main directory. It is accessible via the URL:
/salsa/hq/p/[filePath]
http://www.[node domain].org/o/[organization ID]/p/d/[filePath]
/salsa/admin/p/[filePath]
Now that your package is created, we can create a sample SalsaScript file to make sure everything is working right
<? print('Hello World!'); ?>
http://sandbox.salsalabs.com/o/8001/p/salsa/packageName/index.sjs
Where 8001 would be replaced with your organization number, and "packageName" would be replaced with the name of your package. The result should look like this:
Hello World!
For more code examples of the SalsaScript language, please check out our SalsaScript Introduction