Difference between revisions of "Developer Tutorials"

From Contensive Wiki
Jump to: navigation, search
Line 152: Line 152:
 
4. Click OK to save and exit the editor. <br />
 
4. Click OK to save and exit the editor. <br />
  
: The add-on is now in the Add-on Collection. You can test this by opening the Admin Navigator on the left: Manage Add-ons >> Sample Collection >> click on Sample Addon
+
: The add-on is now in the Add-on Collection. You can test this by opening the Admin Navigator on the left: Manage Add-ons >> Sample Collection >> click on Sample Addon <br />
 +
 
 +
==Exporting and Installing an add-on Collection==
 +
 
 +
This tutorial shows you how to export a Collection to a collection file, then install that collection to a different site. You should already have created a new developer site on your workstation and created an add-on collection. <br />
 +
 
 +
'''Steps to export an add-on collection:''' <br />
 +
 
 +
1. Install the Collection Exporter Tool. <br />
 +
 
 +
: Go to the admin site and open the navigator Tools, open the Add-on Manager, check the install checkbox next to the Collection Exporter. Click OK to install the tool. When it installs, you can find it under Tools in the Navigator. <br />
 +
 
 +
2. Open the Collection Exporter and select your new collection. Click Export Collection. In a few seconds you get a link to download the collection file. <br />
 +
 
 +
3. Right click the link and download the file to your local drive. This file is the collection zip file. It contains all the code and settings for the add-ons and the collection you created. <br />
 +
 
 +
4. If your collection uses a dotnet assembly you have created on your workstation, the assembly DLL file needs to be added to the collection zip file manually. <br />
 +
 
 +
: The latest copy of the assembly can be found in the \Addons folder of your Contensive installation, at \program files (x86)\kma\Contensive by default. Copy the file(s) and paste it into the collection zip file. <br />
 +
 
 +
'''Steps to install a collection file on a new site''' <br />
 +
 
 +
1. Create a new development site on your workstation. <br />
 +
 
 +
2. On the new site, run the Add-on Manager. The add-on manager is on the Navigator directly under Manage Add-ons. <br />
 +
 
 +
3. Open the tab labeled "Add Manually", select your new add-on collection zip file and click OK. In a few seconds it will come with basic instructions, and your collection will be installed on the navigator. <br />

Revision as of 17:42, 22 June 2015

Creating a Development Website

This tutorial takes you through the steps required to create a website on your development workstation. You can use websites like these to create and modify functionality before transferring to other environments, like QA, UAT or production.

You should already have your workstation configured with IIS and Contensive. If you wish to use PHP to control the Contensive framework, it should already be installed.

Creating a New Site

1. Start Contensive Application Manager.

Click the start button > all programs > Contensive > Application Manager

2. Click the Local node on the Application Manager.

On the left side of the Contensive Application Manager, you first see the Enterprise node at the top. Under it, you should at least see a grey Local node. Click it to connect to your Local Contensive server. This node represents the Contensive applications running on your local machine. If you already have applications running, a [plus] sign will appear that you can open to see each application.

3. Add an application to the local Contensive Server.

To add a application, right click the Local node and select "Add/Import Site"This will start a wizard that include up to eleven dialog boxes.

4. Select a Site Name.

Select a one word name for your application. It must be unique to this server and it can not contain any spaces or special characters. For this demonstration I will use MySampleSite as the site name.
In most cases when creating a new development site, this is the only screen you will have to change. All the following screens you can leave the default and just hit Continue.

5. Enter the type of Site.

You can hit OK and accept the default in most development site cases.
Enter which type of page you prefer using, php or asp. The site is created entirely within Contensive SMS, but scripting technologies are used create and control the Contensive Framework. In most installations, there is only one scripted host page created for each site. Having a host page written in a familiar technology gives you a very versatile, very rapid environment to handle emergencies.

6. Pick the IP Address.

You can hit OK and accept the default in most development site cases.
Set to 127.0.0.1 for development sites. They are not typically viewed from other machines. If you will need to others to view the site from other machines, pick an IP address on your machine.

7. Pick a Domain name.

You can hit OK and accept the default in most development site cases.
For development sites, the domain can be simply the Site Name from the earlier step. Contensive will configure your computer's host file so on your local machine you can just type the site name and the browser will use the local site. For sites on public machines, enter the primary domain for the site.

8. Enter the HTML documents folder.

You can hit OK and accept the default in most development site cases.
This is the folder where the web server will look for the host page created in an earlier step.

9. Enter the content files folder.

You can hit OK and accept the default in most development site cases.
This is where Contensive will store a majority of your content.

10. Enter an ODBC connection string.

You can hit OK and accept the default in most development site cases.
A blank ODBC connection will cause the wizard to create a new site.

11. Enter the ODBC DSN file folder.

You can hit OK and accept the default in most development site cases.
This is a location to store the ODBC information about the new connection that will be created automatically.

12. Enter the database file folder.

You can hit OK and accept the default in most development site cases.
This is the folder where Contensive will store the new database file created for the site.

13. Enter an SMTP Email server.

You can hit OK and accept the default in most development site cases.
If you have an SMTP email server configured on your machine you can include it here. Contensive SMS has extensive email features. Be aware if you configure the SMTP server that if you add email features to your development site, it may send email to the users you configure.

14. Enter your email address as the Admin Email address. The site will begin building itself. That will take less than 5 minutes.

You can hit OK and accept the default in most development site cases.
You can skip this if you do not plan to enable email on your development workstation.

At this point, you should have a running website on your local IIS server that uses Contensive SMS to create pages.

Accessing Your Site And Updating Your Username and Password

1. Open a browser and go to http://MySampleSite/admin (where MySampleSite is the site name you used in Creating Your Website, step 4).

You should see the Login box.

2. The default username and password are:

username: root
password: contensive
When you log in, be sure to edit the record and change them as you need. This log in account will expire in 7 days.

3. To edit the default user account, open the Navigator on the left to Manage Users >> click on People.

You will see a list of the users configured for the site. If it is a new site, there will be only the root user. To edit the user account, click the edit icon in the left-most column of the row. You are now editing the user account. Click on the Permissions tab and update your username and password. You can also update the name field in the details tab if you wish.

Creating a New Add-On

This tutorial shows you how to create a new Contensive Add-on.

The purpose of an Add-on is to hold all the elements of a site feature (like the code, javascript, css, html, etc.) together in one element that can used on the site. It may be placed on a page, handle an ajax call, run as a process in the background, etc.

You should already have created a new developer site on your workstation.

Steps to create an add-on:

1. On the Admin Navigator on the left, Open Manage Add-ons >> Advanced >> click on Add-ons.

You will see a list of all the Add-ons installed on the site.

2. Click the Add button to create a new Add-on.

You will see a new add-on record. Set the name. I will use "Sample Add-on" and in the HTML Content box, enter "Hello World"
In the Placement tab, check "Place on Pages" and "Admin Navigator"

3. Click OK at the top of the page to save the Add-on and exit the edit page.

4. Execute the new add-on.

On the Admin navigator on the left Open Manage Add-ons >> Advanced >> Add-ons With No Collection >> click on Sample Add-on. You should see the words Hello World in bold on the left pane.

5. Add the add-on to a website page.

Go to the public home of your website and turn on Quick Edit. Place the cursor in the page editor where you want your add-on and select it from the Add-ons drop down. A green icon will appear when you place the add-on in the copy. Click OK to save and close the editor. Your add-on will run here and show "Hello World" where you placed the icon.

Creating a New Add-On Collection

This tutorial shows you how to create a new Add-on Collection. The Collection we will create here will include one add-on. The purpose of an Add-on Collection is to gather all the elements of an application feature into one single location that can be exported and installed on other sites. You should already have created a new add-on.

Steps to create an add-on collection:

1. On the Admin Navigator on the left, open: Manage Add-ons >> Advanced >> click on Add-on Collections.

You will see a list of all the Add-on Collections installed on the site.

2. Click the Add button to create a new Add-on Collection. You will see a new add-on collection record. Set the name. I will use "Sample Collection". Click OK at the top of the page to save the Add-on Collection and exit the edit page.

Steps to add an add-on to the add-on collection:

1. On the Admin navigator on the left, open: Manage Add-ons >> Advanced >> click on Add-ons.

2. Edit the add-on you want to include in the collection. In this case I will edit the add-on I created in the earlier tutorial, names "Sample Add-on"

3. In the field marked "Collection", select the add-on collection you just created. In this case I will select "Sample Collection"

4. Click OK to save and exit the editor.

The add-on is now in the Add-on Collection. You can test this by opening the Admin Navigator on the left: Manage Add-ons >> Sample Collection >> click on Sample Addon

Exporting and Installing an add-on Collection

This tutorial shows you how to export a Collection to a collection file, then install that collection to a different site. You should already have created a new developer site on your workstation and created an add-on collection.

Steps to export an add-on collection:

1. Install the Collection Exporter Tool.

Go to the admin site and open the navigator Tools, open the Add-on Manager, check the install checkbox next to the Collection Exporter. Click OK to install the tool. When it installs, you can find it under Tools in the Navigator.

2. Open the Collection Exporter and select your new collection. Click Export Collection. In a few seconds you get a link to download the collection file.

3. Right click the link and download the file to your local drive. This file is the collection zip file. It contains all the code and settings for the add-ons and the collection you created.

4. If your collection uses a dotnet assembly you have created on your workstation, the assembly DLL file needs to be added to the collection zip file manually.

The latest copy of the assembly can be found in the \Addons folder of your Contensive installation, at \program files (x86)\kma\Contensive by default. Copy the file(s) and paste it into the collection zip file.

Steps to install a collection file on a new site

1. Create a new development site on your workstation.

2. On the new site, run the Add-on Manager. The add-on manager is on the Navigator directly under Manage Add-ons.

3. Open the tab labeled "Add Manually", select your new add-on collection zip file and click OK. In a few seconds it will come with basic instructions, and your collection will be installed on the navigator.