Download III. Requirements - Utah AIDS Foundation

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

URL redirection wikipedia , lookup

Transcript
Vérité Content Management System (VMS™)
Please check COPYRIGHT for copyright and license information.
Please check VERSION for version information.
I. INDEX
I Index
II Introduction - What is VMS™?
III Requirements
1. Installation
1.1 Database Setup
1.2 Web page(s) Installation
2.
2.1
2.2
2.3
Learning about Templates
How templates work
Template macros
Using plug-ins (plugins.conf)
3.
3.1
3.2
3.3
3.4
Learning User Access Rights (UAR)
UAR for web pages
UAR for templates
UAR for administration
Groups
4. How to create a web page
4.1 Creating main web pages
4.2 Creating sub pages
5.
5.1
5.2
5.3
Using Media Management
Why do we use Media Management, What is it?
Adding Content
Organizing Content
6. Advanced Features
6.1 PHP/Coldfusion/ASP/JSP Parsing
6.2 Programming your own plug-ins
7.
7.1
7.2
7.3
7.4
7.5
Programming Aspects
Query Object
Page Object
Database Layout
Global Environment
Other VMS PHP functions
8. Macros
8.1 Macro Index
9.
Contact & Author Information
II. Introduction - What is VMS™?
VMS™ stands for Verite Content Management System (the C is silent). VMS is a content management
system for your web page, meaning it controls all the aspects of your web page, yet still allows you to be
very flexible in what your web page can do. VMS renders web pages as the user requests them. The web
pages VMS creates can be easily developed using VMS's WYSIWYG (What You See Is What You Get) editor.
Simply put this allows anyone, without any knowledge of HTML, JavaScript, or other programming
languages, to create web pages. The only programming knowledge that is required is for those who work
with the templates. Once your company’s templates are created they can easily be re-used on other web
pages.
VMS is very versatile in that it also allows dynamic web page programming (using Java, JSP, ASP, PHP,
ColdFusion, etc.) to be put directly into your web page. So if you have existing web-applications, VMS can
integrate with them easily.
III. Requirements
VMS™ Requires:






Linux (all processors) (2.0.X +)
Apache 1.3.X or Roxen Web Server
PHP 4.0.2+
One of the following SQL compliant databases:
o MySQL (recommended)
o MsSQL
o Oracle
o PostgreSQL
5 Megabytes of hard disk space
Zend Loader (if you have a closed source copy)
1. Installation
VMS™ installation is very simple.
Step 1. Un-tar vms-VERSION.tgz
Step 2. Copy or integrate the database/* files
MySql pre-built databases exist, as well as text dumps for easy insertion into Oracle or
MsSql databases. The database must first be accessible for VMS to run.
Step 3. Copy the contents of program/* into your web directory
Step 4. Modify webdirectory/paths.conf and webdirectory/library/config/vms.conf to meet your
implementation’s settings.
Step 5. Create templates that meet the qualifications (read the template section)
Step 6. Login to your backend via http://www.your_server.com/admin/. Login and follow the instructions.
1.1 Database Setup
This shows how to setup a VMS™ database (described in step 2)
The directory database/mysql/* contains MySql formatted database files. They can be simply copied into
your MySql database directory under the database name "vms".
MySql easy installation: Execute these commands in the Linux shell from the directory where you un-tared
the VMS application files.
* mkdir /var/lib/mysql/data/vms
* cp -a database/mysql/* /var/lib/mysql/database/vms
Other databases:
Use the text files in database/other/ to set up your database. Beta 2.0 does not have a simple way of doing
this, you will most likely have to go ahead and create the database in the exact format VMS needs then text
dump the files in there to integrate. A map of the database is contained in the file database/database.map.
1.2 Web page Setup
The file index.php contained in program/ is the main web page. This file can be copied to wherever you
need VMS to reside, although the paths.conf file must exist in the same directory as index.php or the
program will not function.
Please note: paths.conf does not contain ANY sensitive information and is safe to reside on your webdirectory.
It is recommended, however, that you copy all files and directories (including library/*, admin/*, index.php,
and, paths.conf) to the web-directory where VMS resides.
Also Note: The directory admin/ contains web page files and MUST be web accessible from the main VMS
files, although you can move (or rename) the directory to wherever you wish.
2. Learning about Templates
Templates, in their simplest forms, are outlines that VMS™ uses to put the header, footer, navigational
menu and content on your web page. They are also what binds you to use a certain layout. (Keep in mind
that the number of templates you are allowed to use is limitless). Templates are developed as kind of a
HTML blueprint. Templates use MACROS to show where in the web page an item goes. A macro found in
a template uses a tag similar to the one shown here:
<@MACRO_NAME option=”first option” option=”second option”@>Inputting Text <@/MACRO_NAME@>
As you might notice, macros look very similar to HTML tags, but contain a @ symbol around the tag.
Macros are further defined later on in this section.
2.1. How Templates Work
Here is an example on how a template might work; if you know HTML code this will make sense. If you are
not familiar with HTML you should read www.w3c.org/MarkUp/
Example 2.1.1:
<html>
<body>
<table border=”0” cellpadding=”0” cellspacing=”0”>
<tr>
<td colspan=”2”>
<@template name=”header1”@><@/template@>
</td>
</tr>
<tr>
<td>
<@template name=”menu1”@><@/templateu@>
</td>
<td>
</tr>
<tr>
</table>
</body>
</html>
<@content name=”current_page”@><@/content@>
</td>
<td colspan=”2”>
<@template name=”footer1”@><@/template@>
</td>
</tr>
You might be curious as to what <@template@> ,<@menu@> and the rest do. A definition of macros, as
well as descriptions of each macro, can be found at the end of this document, for now I will deal with the
concept of templates. Templates as you can see above give an outline of how the html document will
work. When you create a page with VMS™ you pick a pre-built template that defines how the page will look
(or at least the layout). Any HTML programmer can build templates. Once a template is integrated into
the VMS system and the content is entered into the wysiwyg editor, the content is wrapped in the template
formatting when viewed on the front end of the site.
Templates, using macros, can also include sub-templates. Sub-templates are partial templates, in that they
do not contain the code for a COMPLETE page, just code for a portion of a page. We do this provide
greater organization and to make portions of templates more easily modifiable. Sub-templates are not
required. To find out how to use sub-templates, look for “template” in the macro section.
2.2 Template Macros
Template Macros work by when VMS is parsing a page and finds a “Macro” it replaces the tag with the data
the macro requests. For example, the tags <@template name=”template1”><@/template> would be
replaced by the sub-template named “template1”. Whenever you upload a template into the VMS system
through the administrative back-end you can access it from another template using the “template” macro.
There are many macros that are described at the end of this document.
3. Learning User Access Rights (UAR)
(to be completed)
4. How to create a web page
(to be completed)
5. Using Media Management
(to be completed)
6. Advanced Features
This section specifically deals with using dynamic content with-in the system. This also covers how you can
use your own plug-ins to achieve effects with the Content Management System.
6.1 PHP/Coldfusion/ASP/JSP Parsing
The Verite Content Management System is very versatile in that it can use other programming languages
embedded within VMS™ pages. The following languages are supported under the platforms specified:
PHP – Windows 98, NT, 2000, Linux, Solaris
Coldfusion – Windows 2000, Linux, Solaris (requires CFServer http://www.allaire.com)
ASP – Linux (using Chili!Soft http://www.chilisoft.com)
JSP – Linux (using tomcat)
It is possible that these languages can be supported in other operating systems, but we as of now have not
tested the implementation beyond what is listed above. VMS takes advantage of several technologies in
order to achieve multi-language parsing. One of these is the use of CGI Compiled parsers that each of
these languages support, and the other is APACHE DSO Modules that each of these languages can
leverage. VMS is written in PHP and natively supports all PHP code. Other languages, such as JSP, ASP
etc, require the assistance of a parser (whether CGI or DSO). If a parser for another language is enabled,
it can be integrated with VMS so that VMS will send the HTML (and any other dynamic language code) to
the parser for it to process. The result is returned then displayed on the page. VMS can also parse code in
multiple languages and allows you to specify the order in which the code is parsed.
Simply put, when you put ASP code, for example, and set the program to parse for this, it loads up the
language’s corresponding CGI (or DSO) program and runs the code through it. If a page were to contain
both ASP and JSP code, the CGI (or DSO) for each language would run through the code in the order that
you specify. This is how VMS achieves “multi-language” support. VMS also passes all of the environment
variables from VMS into the parser for use when parsing the dynamic web page.
6.2 Programming your own Plug-ins
Plug-ins allow you to program your own macros. The file plugins.conf (contained in the config/ directory)
contains a list of macros and each macro’s corresponding plug-in file. To program your own plug-ins all
you need to do is create a PHP document with a function called “plugin_main” that calls for two arguments.
The first argument is an array called “options”. This is an array containing of all the options the user
specified inside the macro tag. For example, this macro: <@some_macro option=”hello”
option=”goodbye”@> test <@/some_macro@>, when parsed by VMS, would send an array, as the first
argument, to the function in the PHP document that controls the macro named “some_macro”. In this
array, options[0] would be “hello” and options[1] would be “goodbye”.
The second argument returned to the function by VMS is the content between the macro tags, or in the
case above “test”.
The plug-in can use information from these two arguments and from global variables, some of which are
listed here:
$page_id
Gives the current database page id of the page the person is attempting to use.
$menu_nav_id
Gives the current database page id of where the menu navigation will begin.
$menu_exp_id
Gives the current database page id of any page’s to ignore on menu navigation
(comma delimited list)
$name
Name of VMS system
$sys_email
System administrators email
$sql
Current open SQL connection (could be any type). You can also use the Query object to
make query calls to the database
$menu_cur_id
When looping in a certain navigational structure this will give the current id we’re on in
the loop process.
$menu_loop_rec Loop recursively down the navigiational structure (boolean)
$private[]
A hash array used for plug-ins to store global variables for other plug-ins to access.
Please note you must use ‘global’ and define each of these variables before you can use them in the plug-in.
7. Programming Aspects
This portion of the document covers VMS common classes and objects you can use when developing plugins. All of these can be used inside plug-ins.
The first couple sections cover objects you can use inside VMS to simplfy your development. The next
sections cover how VMS works on a programming level, and how you can access global variables and
modify global variables. Please be aware, all database calls should go through the “Query” object. Unless
you are doing something proprietary.
7.1 Query Object
The Query object exists in order to have a common API to access the database the customer is using. The
Query class will automatically make connections, handle threading, handle disconnecting and handle
running the SQL statement. All you are required to provide is the SQL statement. The returning result is an
object that allows you to pull columns, rows, whole records, tables, inserted id’s, etc.. Pretty much anything
you could need.
Syntax for involking a Query:
$newQuery = new QueryObj(“ SQL Statement “);
The return is a object called $newQuery (or whatever you’ve named it in your plugin).
From here you can access the following variables:
Grabbing a Row of Records:
$newQuery->table[row_number]
The above you provide the row number you wish to attain. The resulting returned value is a hash array for
each column name. You can also use integer amounts to go through column names (i.e. 0 would be
column 1).
Grabbing Individual Records:
$newQuery->table[row_number][“column_name”]
The above would produce a single entry from the database.
Grabbing the Next Record:
$newQuery->next_record();
The above would return a table[] array (exact to the one listed above). This is the next record it found in
the database.
Grabbing the Previous Record:
$newQuery->previous_record();
Same as next_record() but works in reverse. If it’s at the beginning of the array it returns record 0.
Rewinding the Record:
$newQuery->rewind_record();
Rewinds the record set to 0, and returns record 0.
Going to a specified Record:
$newQuery->goto_record(record_number);
Points the record index to the specified record_number.
Pulling a specific Record:
$newQuery->pull_record(record_number);
Points the record index to the specified record_number, then the resulting table array is returned.
Involking another SQL Statement:
$newQuery->sql_query(“ SQL Statement “);
This will do another sql query in the same object existance, the old one will be erased.
Reconnecting:
$newQuery->sql_connect();
This will attempt to re-establish a connection with the SQL server.
Disconnecting:
$newQuery->sql_disconnect();
This will attempt to disconnect the connection with the SQL server.
Please note that in order to change records you need not do UPDATE sql statements, simply assigning a
value in the table array in the QueryObj will automatically change the entry in the SQL database. The
update statement is formed and ran automatically the the approriate SQL standard.
For example:
// connects to the sql server and grabs “some_record” from “some_table”
$newQuery = new QueryObj (“select some_record from some_table”);
// this will grab “some_record” on the first row and store it into the variable “value”
$value = $newQuery->table[0][“some_record”];
// sets $value equal to 2
$value = 2;
// This will change the record in the database
$newQuery->table[0][“some_record”] = $value;
8. Macros
Macros are talked about earlier in this document, but were only briefly touched on. This portion is intended
to give you a better understanding of what macros VMS has and what they do.
8.1 Macro Index
content
get_link
loop

title
Replaces the macro with the content of the webpage.
This returns the link of the webpage specified.
The title specified in web-title on the vms system


amount
CONTENT
Loops the contents of this for a specified amount.
amount to loop for.
what you wish to loop, this can contain macros.
RETURN
the text buffers of what was looped

menu_nav


start_nav
Order
*menu_text
This automatically outputs the text name of the
next navigational page it finds. This should only
be used inside menu_nav.
*menu_url
template
This is the same as a loop statement, except it
loops only the amount of times of the navigation
on each loop increment, it changes the navigational id
so macros menu_url and menu_text will work.
Starting navigational id, you can statically set this.
This can either be ascending, descending or a semi
colon delimited list of id numbers that you’d like the
menu to uphold too.

id
title
This automatically outputs the http url of the
next navigational page it finds. This should only
be used inside menu_nav.
Open up and display a certain template.
The identification number of the template.
returns the title of the web page.
mail





To
From
Reply-To
Subject
CONTENT
This is an email macro.
Who the email will be sent to.
Who you want the email to say it’s from
a reply to address
Subject of message
This is the messages body.
* these macros must exist within menu_nav
DYNAMIC IMAGING
*background

bgcolor
create_image

width

height

type

CONTENT

RETURN
*load_image




type
filename
place_at_x
place_at_y
Sets the background color on a dynamic image.
a hexidecimal value
First function you execute to create an image.
Width of the image
Height of the image
Type of image (gif,jpeg,png)
Put your options for creating a image with-in here.
This macro will return the path of the image created.
Loads a jpeg,gif,png into the image you’re using.
Type of image (gif,jpeg,png)
File name or location of file, this can also be a http://
Where to place it at in the image (x coordinate)
Where to place it at in the image (y coordinate)
*string






fontsize
angle
start_x
start_y
color
font


align
CONTENT





Color
Start_x
Start_y
End_x
End_y
*line
This places a text string within the image
This is a pixel font size, default 11
This is the angle you wish to use
Where you wish to start the text (x coordinate)
Where you wish to start the text (y coordinate)
a hexidecimal value of the color of the text
This is a name of a true type font to use, this ttf font
must reside within library/media/fonts
Alignment, center, right, left
This contains the text you wish to use. This can
Contain macros with-in it as well.
Creates a line in the image
The color of the line specified.
Starting x
Starting y
Ending x
Ending y
*Any macro with this astrek must be used inside the create_image macro in order for the properties to work
correctly.
10. Contact & Support Information
VMS Information can be obtained by going to http://www.verite.com/etools/ and clicking on ‘VMS’.
You can also reach contact information from there as well. Support information is also available.
VMS was developed by Verite Multimedia. Please read the COPYRIGHT and VERSION for licencing
Authors:
Steven Smith – Graphics and Layout Design
Bryan Bateman – Project Management and Interface
Trevor Linton – Programming and Interface