print Creating a Scorpio development environment

Setting up the article sites

We will need to create a couple of sites to run the article system from. For this example, I am going to use article.local and admin.article.local. You can use whatever you like, just be sure to substitute the values where necessary.

Change to the websites folder:

cd /home/sites/scorpio/websites

And create two new folders: article.local and admin.article.local:

mkdir article.local admin.article.local

Copy the controllerMap.xml file from the baseArticleSite to article.local. This will give us our controllers.

cp baseArticleSite/controllerMap.xml article.local/

Now we must create the config file:

nano article.local/config.xml

Which needs the following content:

Save the changes and exit nano (Ctrl+O Ctrl+X).

Now we do the same for the admin site:

cp baseArticleAdminSite/controllerMap.xml admin.article.local/
nano admin.article.local/config.xml

With that done, we can update our apache vhosts file with the new sites information:

nano /etc/httpd/conf.d/vhosts.conf

Save the changes, exit nano and do a configtest and graceful restart of apache if the config is OK.

service httpd configtest
service httpd graceful

Now we need to update the hosts file so that we can access the sites from our local machine. Add the following line to the hosts file and save the changes.

nano /etc/hosts
127.0.0.1	article.local	admin.article.local

The final step is to update the site config in the admin system. Browse to admin.SITE.local and go to the Sites applet under Site Editor. You will need to create entries for article.local and admin.article.local taking care to specify the correct parent site (baseArticleSite and baseArticleAdminSite respectively). Save the new records. If you have not done so already, add site.local and admin.site.local as well.

With that done, go to the Plugin Manager applet and select "New". You need to locate the config.xml file in the scorpio/classes/article folder. This config.xml file contains the details for configuring the controller information in the admin system. Ensure that the default sites are set accordingly: Admin Site should be admin.article.local and the customer site should be article.local.

Check that the active flag is set to yes and save the changes.

You can now logout from that admin system and browse to admin.article.local. You can login using whatever user accounts you set up on admin.site.local however those accounts may not have permissions so for now you should probably use the root account.

Once logged in you should be able to see under "Plugins" that the article system is now listed. If you browse to other sections you should see that quite large chunks of the main admin system have been disabled - including Site Editor and User Management. This is all down to the controllerMap.xml file. You can enable controllers using the Controller Map Builder in the main site admin (admin.site.local).

In another browser window browse to article.local. You should see the article systems default view. Unless you added articles, there will be no categories or content. You can add it as you like.

How come you can login using other details?

Scorpio uses a hierarchy of overrides from config files to actual sites. You can override specific templates or entire controllers and models on a per-site basis. This allows you to create a single application and readily retheme it by creating a new set of views. Checkout Madagasgar.com and this site (scorpio.madagasgar.com). All that is different are the view files and the theme. The application itself is exactly the same - though controllers could be overridden or re-engineered or specific functionality added quite easily and without affecting any other site.

This overriding though extends to the databases. By default a single "system" database is used for all sites. You can configure users with site specific access or general access; or if you really need a specific system database create a new entry for the site in question and override the database config for the system database. That way you can run specific sites on a specific database without worrying about permissions or traffic or conflicts.

Need to update other article databases via the dbUpdate script? No problem! Simply point the dbUpdate script to use the config file for the site in question and the updates will be applied to that database.