Using Basic Applications (email_autoresponse)

Business Case:

Company want a serving central support service to customer and business. Company using this service to manage customer more appropriate with complete record of customer needs and expectation. Company also want to know how well Customer has been served by Company and by who. Company want to provide support services to customer by an email. Using this service, the requested information will be responsed automatically as appropriate or directly to the responsible people for response or just as information for the responsible people.


Business Solution:

---


Implementation:

Using emil_autoresponse to classify received email and response as appropriate.





Example:

<?xml version="1.0" encoding="UTF-8"?>
<configuration id="email_autoresponse">
<section name="core">
<!-- Process Configuration-->
<config name="process">
<config name="type">email_autoresponse</config>
<config name="name">CIISONLINE_COM_AUTORESPONSE</config>
<config name="start"></config>
<config name="end"></config>
</config>

<!--Mail Connection-->
<config name="connections">
<config name="mail">
<config name="type">Mail</config>
<config name="host">imap.gmail.com</config>
<config name="user">ciisonline.com</config>
<config name="password"></config>
<config name="crypto">ssl</config>
<config name="port">993</config>
<config name="service">imap</config>

<config name="mailboxes">
<config name="source">inbox</config>
<config name="handled">handled</config>
<config name="unhandled">unhandled</config>
</config>
</config>
</config>

<!--Recognizer-->
<config name="recognizer">
<config name="minLetters">5</config>
<config name="maxLetters">7</config>
<config name="brain">
<config name="type">TextBrain</config>
<config name="fact">Application/Email/Recognizers/responder.fact</config>
<config name="knowledge">Application/Email/Recognizers/responder.knowledge</config>
</config>
</config>

<!--Responder-->
<config name="responder">
<config name="default">Default</config>
<config name="directory">Application/Email/Responder/</config>
<config name="names">
<config name="Default">
<!--#THE RESPONDER CONFIGURATION#-->
<config name="type">Application_Email_Responder_Body</config>
<config name="use_template">1</config>
<config name="mail">
<config name="from">ciisonline.net@gmail.com</config>
<config name="fromname">CIISONLINE NET</config>
<config name="replyto">ciisonline.net@gmail.com</config>
<config name="replytoname">CIISONLINE NET</config>
<config name="rpath">ciisonline.net@gmail.com</config>
<config name="body" xml:space="preserve">
Hello {toname},

Thanks You
{fromname}
</config>
</config>
</config>
<config name="OrderForm">
<!--#THE RESPONDER CONFIGURATION#-->
<config name="type">Application_Email_Responder_Body</config>
<config name="use_template">1</config>
<config name="mail">
<config name="from">ciisonline.net@gmail.com</config>
<config name="fromname">CIISONLINE NET</config>
<config name="replyto">ciisonline.net@gmail.com</config>
<config name="replytoname">CIISONLINE NET</config>
<config name="rpath">ciisonline.net@gmail.com</config>
<config name="body">OrderForm</config>
<config name="bodyfile"></config>
<config name="altbody"></config>
<config name="altbodyfile"></config>
</config>
</config>
<config name="ProductInfo">
<!--#THE RESPONDER CONFIGURATION#-->
<config name="type">Application_Email_Responder_Mime</config>
<config name="use_template">1</config>
<config name="mail">
<config name="from">ciisonline.net@gmail.com</config>
<config name="fromname">CIISONLINE NET</config>
<config name="replyto">ciisonline.net@gmail.com</config>
<config name="replytoname">CIISONLINE NET</config>
<config name="rpath">ciisonline.net@gmail.com</config>
<!--<config name="mime"></config>-->
<config name="mimefile">Application/Email/Mimes/html.eml</config>
</config>
</config>
<config name="ProductCatalog">
<!--#THE RESPONDER CONFIGURATION#-->
<config name="type">Application_Email_Responder_Mime</config>
<config name="use_template">1</config>
<config name="mail">
<config name="from">ciisonline.net@gmail.com</config>
<config name="fromname">CIISONLINE NET</config>
<config name="replyto">ciisonline.net@gmail.com</config>
<config name="replytoname">CIISONLINE NET</config>
<config name="rpath">ciisonline.net@gmail.com</config>
<!--<config name="mime"></config>-->
<config name="mimefile">Application/Email/Mimes/message.eml</config>
</config>
</config>
</config>
</config>

<!--Control-->
<config name="control">
<config name="sleepingduration">1000</config>
<config name="errorsthreshold">10</config>
</config>

<!--Response-->
</section>
</configuration>

How to Execute Worker Process?

It is easy to execute Worker Process. Just create the manifest of the process and then call that manifest using Worker Engine. Manifest is the configuration file of specific process that you have created and placed on Worker.



On selected manifest,click Start to start manifest, Stop to stop manifest, Run to resume process, Idle to pause process.

You can also start manifest using command line: /System/Worker/core/start.php worker=\&process=. As for example: /System/Worker/core/start.php worker=Developer\&process=default.cfg.

You can also using telnet to connect the Nest to maintain Worker runtime (Start, Stop, Run and Idle).

Note:
Worker can only perform a process at a time. Your request to execute new process will terminate if Worker is performing a process. You can has unlimited Worker on a single LightArmy platform.

How to Execute Queen Process?

It is easy to execute Queen Process. Just create the manifest of the process and then install that manifest on Queen. Manifest is the configuration file of specific process that you have created and placed on Queen.



Select manifest(s) you want/need and then click 'Install'. You can see your process(es) under Loaded Processes List Page if successfully and in Error Processes List Page if fail.







You can also using telnet to connect the Nest to maintain Queen runtime (Start, Stop, Run and Idle) and its process(es) (Install, unload, and delete).

Note:
Queen can perform many processes at a time. You can has many Queens in a single LightArmy platform.

How To Access Web Service?

There is a simple rule to access web page:
../index.php?t=Service&c=<container>&p=<config file name>&<service parameters>

<container> is the container name of service.
<config file name> is the basename of service config file.
<service parameters> is parameters of your service.

If you want to access wsdl, just add parameter wsdl without value at the end of query.

The rule above is only true if:

  • Dynamic Page Id is off
  • Secure URL is off

How To Access Web Page?

There is a simple rule to access web page:
../index.php?t=Page&c=<container>&p=<config file name>&<page parameters>

<container> is the container name of page.
<config file name> is the basename of page config file.
<page parameters> is parameters of your page.

The rule above is only true if:

  • Dynamic Page Id is off
  • Secure URL is off

Rich Basic Applications for Real Enterprise Applications

LightArmy provides basic applications as proof of concept and as basis for application development. Below are all basic applications grouped by its category.


Page category basic applications:
Delegation
Delegation is suppose to provide a way on delegating tasks.

Escalation
Escalation is supposed to provide a way on escalating tasks.

Change Date
Change Date is supposed to change the recording date of data.

Web-based Administration
Provided a way to manage and administer using web-based application.

Note
Note is supposed to help create note. Note available on any application that use LightArmy.

ToDo
ToDo is supposed to help create todo. ToDo available on any application that use LightArmy. ToDo can be delegated to another user.

News
News is supposed to help create news.

Message
Message is supposed to help create message between users.

Bookmark
Bookmark is supposed to help create bookmark.

Web Service category basic applications:
Account
Account is web service to provide Account service.

Channel
Channel is web service to provide HTTP Channel service.

Login
Login is web service to provide Login service.

Logout
Logout is web service to provide Logout service

PublicKey
PublicKey is web service to provide PublicKey service.

Queen Processes (Continue Processing) category basic applications:
ant_workerlaunch
Worker Launcher will launch worker(s) to do a specified process by that worker.

email_autoresponse
Email Autoresponse takes an incoming email message from a mailbox, and sends the response using bayesian recognizer pattern to determine the response to 'replyto'/or sender.

email_mimesender
Email MIME Sender takes an incoming message from a topic 'source' on the 'mainmq' stomp connection in an xml of MIME or a MIME.

email_notify
Email Notify takes an incoming message from a queue 'source' queue notify and emails it to the destination.

email_qmimesender
Email MIME Sender takes an incoming message from a queue 'source' in an xml of MIME or a MIME.

email_qsender
Email Sender takes an incoming message from a queue 'source', and sends it using the parameters 'body','to','from','subject', 'cc','bcc', and 'replyto'.

email_sender
Email Sender takes an incoming xml message from a topic 'source' on the 'mainmq' stomp connection , and sends it using the parameters 'body','to','from','subject', 'cc','bcc', and 'replyto'.

email_scheduled
Email Scheduled processes scheduled email to be sent in a specified of time.

file_receiver
Message Logger takes an incoming message from a topic 'source' on the 'mainmq' stomp connection and writes it to a directory, declared in 'directory' with a unique filename based on the message ID with an extension declared in 'extension'.

file_sender
File Sender scans directories declared in the comma separated list 'directory' for files with an extension declared in 'extension', takes their contents, and sends them to the topic 'destination' on the 'mainmq' stomp connection. If no extension is declared, all files in the directory will be sent out. If you wish to send files with no extension only, then set 'requirext' to which will send any file without an extension.

jabber_receive
Jabber Connector allows a Queen to integrate with a Jabber Connection to allow for very convenient message reception, injection, and forwarding. The process listens for messages on both the STOMP connection and the Jabber Connection. When a message comes in from the STOMP connection's 'source' topic, the client will send an Instant Message to all users declared in the comma separated value list 'jabberers'. You can declare individual people in the list by their
jabber ids: foo@bar.com/Gaz,bar@gaz.com/Foo
You can also add the string 'roster' to the 'jabberers' list, and the client will generate a roster of all users which the client can see, and will send the message to those users, in addition to any statically declared users. The client should not double-send messages to a user defined as a static entry who is also within the visible users group.
When a message comes into the client from any users, that message will be forwarded to all the topics defined in the comma separated values list of destination topics. The code is also designed to allow users to declare within an IM to the client different topics to send the message to.

kannel_queuebroadcast
Kannel Queue Broadcast takes an incoming message from a queue box 'incoming' on the 'queue router', process service request and sends broadcast to 'outgoing'.

kannel_queuedeliverystatus
Kannel Queue Delivery Status takes an incoming message from a queue 'delivery' on the 'queue router' and update the status of related sent message.

kannel_queuesender
The Kannel Queue Sender takes an incoming message from a queue 'outgoing' on the 'queue router' and sends it.

kannel_queueservice
Kannel Queue Service takes an incoming message from a queue box 'incoming' on the 'queue router', process service request and sends to 'outgoing' .

kannel_stompbroadcast
Kannel Stomp Broadcast takes an incoming message from a topic 'incoming' on the 'mainmq' stomp connection, process service request and sends broadcast to 'outgoing' .

kannel_stompdeliverystatus
Kannel STOMP Delivery Status takes an incoming message from a queue 'delivery' on the 'mainmq' stomp connection and update the status of related sent message.

kannel_stompsender
Kannel STOMP Sender takes an incoming message from a topic 'outgoing' on the 'mainmq' stomp connection and sends it.

kannel_stompservice
Kannel Stomp Service takes an incoming message from a topic 'incoming' on the 'mainmq' stomp connection, process service request and sends to 'outgoing' .

message_bridge
Bridging Process takes an incoming message from a topic 'source' on the 'mainmq' stomp connection and resends it to a topic 'destination' on the 'sendmq' stomp connection.

message_databank
Database Logger takes an incoming message from the 'source' topic over the 'mainmq' stomp connection and logs it to the 'maindb.tables' table in the 'maindb' database.

message_transformer
Message Transformer takes an incoming XML message from a topic 'source' on the 'mainmq' stomp connection and uses PHP5's XSL Functions to transform the message using the XSL File declared in 'transformer', then resends the message to the topic 'destination' on the 'sendmq' stomp connection.

queue_router
Queue Router takes an incoming message from a queue 'source' and resends it to pass to the selectors for message distribution.

queue_notifyrouter
Queue Notify Router takes an incoming message from a queue 'source' and resends it to pass to the selectors for message distribution.

queue_sender
Queue Sender takes an incoming message from a queue 'source' and resends it to the destination.

scheduledtasks_execute
Scheduled Tasks executes scheduled tasks at predefined time or interval time.

sms_notify
SMS Notify takes an incoming message from a queue 'source' and SMS it to the destination.

sms_scheduled
SMS Scheduled processes scheduled SMS to be sent at predefined time.

stomp_receiver
Stomp Receiver takes an incoming message from a topic 'source' on the 'mainmq' stomp connection and writes it to a queue.

Worker Processing (One-time Processing) category basic applications:
gc_cache (Cache Garbage Collector)
This class is designed to monitor cache directory or directories, take cleanup as necessary.

gc_log(Log Garbage Collector)
This class is designed to monitor log directory or directories, take cleanup as necessary.

gc_session(Session Garbage Collector)
This class is designed to monitor session information, take cleanup as necessary.

xml_transformer (XML Transformer)
XML Transformer will transform an xml to another xml using xslt.

backup_database
Database Backup do backup data from database table/query to another table in the same/different database, and filesystem in any file format,ie: xml, json, dif, excel, tab, & csv.
You need to configure both the source and destination, the type and definition of each. The type specify the exact type of source and destination. The destination specify the instance of corresponding type specified. The valid value for source type are sql, table, or database. The valid value for destination type are filesystem or database. For filesystem destination type, you need to define content type. Content type define the file format. You can specify some characteristics of file format. Each format has its own set of characters /attributes. You can specify the file extension for all formats. If you not specify at format level, the exporter extension setting will take place.

backup_sysfiles
This class is designed to backup files and depending on settings, have selection criteria.

restore_database
Database Importer do restore data to database table from another table in the same/different
database, and filesystem in any file format,ie: xml, json, dif, excel, tab, & csv.
You need to configure both the source and destination, the type and definition of each. The type specify the exact type of source and destination. The destination specify the instance of corresponding type specified. The valid value for source type are sql, table, or database. The valid value for destination type are filesystem or database. For filesystem destination type, you need to define content type. Content type define the file format. You can specify some characteristics of file format. Each format has its own set of characters /attributes. You can specify the file extension for all formats. If you not specify at format level, the exporter extension setting will take place.

restore_databaseupdate
Database Update do update data in database table from another table in the same/different
database, and filesystem in any file format,ie: xml, json, dif, excel, tab, & csv.
You need to configure both the source and destination, the type and definition of each. The type specify the exact type of source and destination. The destination specify the instance of corresponding type specified. The valid value for source type are sql, table, or database. The valid value for destination type are filesystem or database. For filesystem destination type, you need to define content type. Content type define the file format. You can specify some characteristics
of file format. Each format has its own set of characters /attributes. You can specify the file extension for all formats. If you not specify at format level, the exporter extension setting will take place.

restore_sysfiles
This class is designed to restore files, and depending on settings, have selection criteria.

restore_sysfilesupdate
This class is designed to update files, and depending on settings, have selection criteria.

buffer_processor(queue)
Buffer Queue Processor processes unsent queue to resend.

file_cdownloader
File Curl Downloader is designed to download file from http or ftp server to local file utilizing curl. Unlimited files (depend on server resource) can be processed concurrently.

file_sdownloader
File Stream Downloader is designed to download file from http or ftp server to local file utilizing stream. Unlimited files (depend on server resource) can be processed concurrently.

file_syncronize
File Synchronize will synchronize local files with server using file exchange protocol.

csv_export
This class is designed to export csv file to another format. Based on its settings, can export a single file or folder with exceptions. The destination file(s) can either xml, dif, json, excel, or tab of filesystem. You can also export to database.

database_export
Database Exporter do export data from database table/query to another table in the same/different database, and filesystem in any file format,ie: xml, json, dif, excel, tab, & csv.
You need to configure both the source and destination, the type and definition of each. The type specify the exact type of source and destination. The destination specify the instance of corresponding type specified. The valid value for source type are sql, table, or database. The valid value for destination type are filesystem or database. For filesystem destination type, you need to define content type. Content type define the file format. You can specify some characteristics of file format. Each format has its own set of characters /attributes. You can specify the file extension for all formats. If you not specify at format level, the exporter extension setting will take place.

database_import
Database Importer do import data to database table from another table in the same/different database, and filesystem in any file format,ie: xml, json, dif, excel, tab, & csv.
You need to configure both the source and destination, the type and definition of each. The type specify the exact type of source and destination. The destination specify the instance of corresponding type specified. The valid value for source type are sql, table, or database. The valid value for destination type are filesystem or database. For filesystem destination type, you need to define content type. Content type define the file format. You can specify some characteristics of file format. Each format has its own set of characters /attributes. You can specify the file extension for all formats. If you not specify at format level, the exporter extension setting will take place.

database_update
Database Updater do update data in database table from another table in the same/different database, and filesystem in any file format,ie: xml, json, dif, excel, tab, & csv.
You need to configure both the source and destination, the type and definition of each. The type specify the exact type of source and destination. The destination specify the instance of corresponding type specified. The valid value for source type are sql, table, or database. The valid value for destination type are filesystem or database. For filesystem destination type, you need to define content type. Content type define the file format. You can specify some characteristics of file format. Each format has its own set of characters /attributes. You can specify the file extension for all formats. If you not specify at format level, the exporter extension setting will take place.

dif_export
This class is designed to export data interchange format (dif) file to another format. Based on its settings, can export a single file or folder with exceptions. The destination file(s) can either xml, json, excel, csv, or tab of filesystem. You can also export to database.

excel_export
This class is designed to export excel file to another format. Based on its settings, can export a single file or folder with exceptions. The destination file(s) can either xml, dif, json, csv, or tab of filesystem. You can also export to database.

files_import
This class is designed to import files, and depending on settings, have selection criteria.

files_export
This class is designed to export file (s) to another location. Based on its settings, can export a single file or folder with exceptions.

files_update
This class is designed to update data files, and depending on settings, have selection criteria.

json_export
This class is designed to export json file to another format. Based on its settings, can export a single file or folder with exceptions. The destination file(s) can either xml, dif, excel, csv, or tab of filesystem. You can also export to database.

tab_export
This class is designed to export tab file to another format. Based on its settings, can export a single file or folder with exceptions. The destination file(s) can either xml, dif, json, excel, or csv of filesystem. You can also export to database.

xml_export
This class is designed to export xml file to another format. Based on its settings, can export a single file or folder with exceptions. The destination file(s) can either dif, json, excel, csv, or tab of filesystem. You can also export to database.

ant_monitor
The Ant Runtime Monitor checks ants specified in configuration for validity of its runtime data.

Kannel Handlers(SMS/WAP Service Handler)
queue_handler
The Queue Kannel Handler use to define queues of kannel service utilizes queue, log storage and their usage.

stomp_handler
The STOMP Kannel Handler use to define queues of kannel service utilizes stomp supported queue server, log storage and their usage.

direct_smsreply
The SMS Reply Direct is used to directly reply sms request.

Another basic applications:
Kannel
Kannel is a way to integrate kannel (SMS/WAP Gateway) with System securely.

Notify
Notify is provided as general notification function by utilizing queue and queen. Notify is message-based notification function. Now day, there are three types of subscriber: queue, email and SMS. These types are extensible. Subscriber of Queue can be push or pull. Subscriber of email is only push. Subscriber of SMS is only push.

Using Basic Applications (email_mimesender, email_qmimesender & email_scheduled)

In this chapter, we will solve business problem using provided library and utilize provided basic applications.

Business Case:
Business has built a shopisticated approach to maintain customers loyalty. Completely, management know how important of this loyalty to keep business still exists and growth. Company maintain comprehansive customer information. Detail information about the management and Owner is recorded. Consistently, Company sends personalize greeting card utilize email to customer (owner, managements, and family) as appropriate. If necessary, Company also giving a gift to customer. There are some staffs dedicated to do this job. As Company grow and the numbers of customers also significanly grow, the job becomes difficult to manage manually. So many events missed to handle or some handled inappropriate. Company worries of this situation and start looking for the most effective and effisient solution.

Business Solution:
Develop automation system to do check event and process the sending of personalized greeting card to appropriate customer. System will informing of any defined feedback to the responsible people. Feedback ranging from system status to the work performed by system.

Implementation:
Using emil_mimesender or email_qmailsender and email_sechduled to do check and do send the greeting as appropriate.

Deploy Worker Process

It is easy to deploy Worker Process. Just putting configuration file and its corresponding processor file on an instance of Worker.

Deploy Queen Process

It is easy to deploy Queen Process. Just putting configuration file and its corresponding processor file on an instance of Queen.

Deploy Web Service

It is easy to deploy Web Service. Just putting the configuration file and its corresponding service processor file, and language file(is any) on an appropriate container. The container must have type of Service.

Deploy Web Page

It is easy to deploy Web Page. Just putting the configuration file and its corresponding page processor file, page view file (if any), and language file(is any) on an appropriate container. The container must have type of Page.

Create Worker Process

Process Rendering is applicable to queen processes (for continues processes), worker processes (one-time processes), and kannel handlers. Process will be rendered using config file called manifest and its process_type class file. Process should be install in its appropriate entity (queen, worker or kannel). Config file is rendering control that define what should be used and how to render the process. process_type class file is used to perform the defined process.

Below is as an example:

configuration file:

        <configuration id="ant_monitor">
                <section name="core">
                        <!-- Process Configuration-->
                        <config name="process">
                                <config name="type">ant_monitor</config>
                                <config name="name">AntMonitor</config>
                                <config name="start">#TIMESTAMP FIRST TIME FOR EXECUTION#</config>
                                <config name="end">#TIMESTAMP LAST TIME FOR EXECUTION#</config>
                        </config>

                        <!--Worker Location -->
                        <config name="location">#LOCATION OF WORKERS#</config>
                        <config name="ants">#ANTS#</config>
                        <config name="exceptionants">#EXCEPTION ANTS#</config>
                </section>
        </configuration>


processor file:

class ant_monitor extends workerProcess {
        /**
        * An array containing all of our acceptable file extensions
        *
        * @var                array
        */
        private        $nestClient = null;
       
        /**
        * index postion pointer
        *
        * @var                integer
        */
        private $index = null;
       
        /**
        * config object
        *
        * @var                object
        */
        private $configobj = null;
       
        /**
        * The construct function for our object.
        *
        * @param object $worker
        *
        * @return        void
        */
        public function __construct(&$worker){
                parent::__construct($worker);               
               
                if (!class_exists('NestClient'))
                        include(CIISONLINE_System::GetSystemDir().'Nest'.DIRECTORY_SEPARATOR.'client.php');
               
                $this->nestClient = new NestClient();
                $this->configobj = new CIISONLINE_Config_XML();
        }
       
        /**
        * Configure processWorker (e.g.: Turns our config options into stored array data).
        *
        * @return        void
        */
        public function configure(){
                $this->data = null;
               
                $DIRECTORY_SEPARATOR = DIRECTORY_SEPARATOR;
               
                $exceptionants = array();
                if (isset($this->config->exceptionants) && $this->config->exceptionants!='') {
                        $exceptionants = explode(',', $this->config->exceptionants);
                }
               
                $exceptionants[] = $this->worker->path;
               
                if (isset($this->config->location) && $this->config->location!='') {
                        $dir = explode(',', $this->config->location);
                       
                        foreach ($dir as $directory) {
                                $directory = realpath($directory);
                                if (is_dir($directory)) {
                                        if (substr($directory,-strlen($DIRECTORY_SEPARATOR))!=$DIRECTORY_SEPARATOR) $directory .= $DIRECTORY_SEPARATOR;
                                        foreach (scandir($directory) as $ant) {
                                                if (in_array($ant, array('.','..','.svn'))) continue;
                                                if (!is_dir($directory.$ant) || in_array($directory.$ant.$DIRECTORY_SEPARATOR,$exceptionants)) continue;
                                                $this->data[] = $directory.$ant.$DIRECTORY_SEPARATOR;
                                        }
                                }
                        }
                }
                if (isset($this->config->ants) && $this->config->ants!='') {
                        $ants = explode(',', $this->config->ants);
                        foreach($ants as $ant) {
                                $ant = realpath($ant);
                                if (is_dir($ant)) {
                                        if (substr($ant,-strlen($DIRECTORY_SEPARATOR))!=$DIRECTORY_SEPARATOR) $ant .= $DIRECTORY_SEPARATOR;
                                        if (in_array($ant,$exceptionants)) continue;
                                        $this->data[] = $ant;
                                }
                        }
                }
               
                if (count($this->data)>0) $this->index=0; else $this->index=-1;
        }
       
        /**
        * If you overload workerProcess's onInit function, be sure to call
        * onInit through workerProcess with the line:
        *                 parent::onInit($config, $filename);
        *
        * If you neglect to do this, the workerProcess will load improperly and therefore
        * not work correctly within a worker.
        *
        * @param        object                $config                        The configseed configuration handler
        * @param        string                $filename                The config file which generated this
        *                                                                                 instance
        *
        * @return         void
        */
        public function onInit($config, $filename) {
                parent::onInit($config, $filename);
               
                $this->metrics['process.status'] = 'OK';
                $this->configure();
        }
       
        /**
        * If you overload workerProcess's onReconfigure function, be sure to call
        * onReconfigure through workerProcess with the line:
        *                 parent::onReconfigure($config, $filename);
        *
        * If you neglect to do this, the workerProcess will reload improperly and
        * therefore stop working correctly within a worker.
        *
        * @param        object                $config                        The configseed configuration handler
        * @param        string                $filename                The config file which generated this
        *                                                                                 instance
        *
        * @return         void
        */
        public function onReconfigure($config, $filename) {
                parent::onReconfigure($config, $filename);
       
                $this->metrics['process.status'] = 'OK';
                $this->configure();
        }
       
       
        /**
        * A required static breadcrumb which tells configseed what congiruation
        * options we should have.
        *
        * This is where you should mark options from your configuration file as
        * either required (Necessary for your object to work) or optional (not
        * necessary to functionality, but rather more fine-tune configuration).
        *
        * Be sure to call both workerProcess::docConfig() with
        * their proper options to ensure that you build an accurate map of options.
        *
        * @param        object                $config                        The configuration object
        *
        * @return        void
        */
        static public function docConfig(&$config) {
                workerProcess::docConfig($config);
                $config->addOption('required', 'location','An absolute paths to workers');
        }

        /**
        * evaluate if data has been set.
        *
        * @return        true/false
        */
        public function isEmptyData(){
                return ((isset($this->data) && $this->index>=0)?false:true);
        }
       
        /**
        * evaluate if cursor data is in the end position
        *
        * @return        true/false
        */
        public function isEndData(){
                if (isset($this->data)) return (($this->index==count($this->data))?true:false);
        }
       
        /**
        * evaluate if cursor data is in the first position.
        *
        * @return        true/false
        */
        public function isFirstData(){
                if (isset($this->data)) return (($this->index==0)?true:false);
        }
       
        /**
        * process the current data as expectced
        *
        * @return        true/false
        */
        public function processCurrentData(){
               
                if (isset($this->data) && $this->index>=0 && !$this->isEndData()) {
                       
                        $DIRECTORY_SEPARATOR = DIRECTORY_SEPARATOR;
                        $path = $this->data[$this->index];
                        $ant = 'worker';
                       
                        $antconfig = $path.'configuration'.$DIRECTORY_SEPARATOR.'worker.conf';
                       
                        if (!file_exists($antconfig)) {
                                $ant = 'queen';
                                $antconfig = $path.'configuration'.$DIRECTORY_SEPARATOR.'queen.conf';
                        }
                       
                        if (!file_exists($antconfig)) return;
                       
                        $config = $this->configobj;
                        $config->load($antconfig,'core');
                       
                        $host = isset($config->connections->nest->host)?$config->connections->nest->host:'';
                        $port = isset($config->connections->nest->port)?$config->connections->nest->port:'';
                        $id = isset($config->connections->nest->id)?$config->connections->nest->id:'';
                        $password = isset($config->connections->nest->password)?$config->connections->nest->password:'';
                       
                        if ($host=='' || $port=='' || $id=='' || $password=='') return;
                       
                        $this->nestClient->Open($host,$port);
                        $this->nestClient->Authenticate($id,$password,$ant);
                       
                        // state 2: authenticated. if authenticated then the worker not running
                       
                        if (($state=$this->nestClient->getState())==2) {
                                // offline status
                                if (isset($config->runtime) && (string)$config->runtime!='') {
                                        $runtime = $config->runtime;
                                } else {
                                        $runtime = $path.'runtime'.$DIRECTORY_SEPARATOR;
                                }
                               
                                if (substr($runtime,-strlen($DIRECTORY_SEPARATOR))!=$DIRECTORY_SEPARATOR) $runtime .= $DIRECTORY_SEPARATOR;
                               
                                if (is_dir($runtime)) {
                                        $runtimedirs = array('command','response');
                                        foreach ($runtimedirs as $runtimedir) {
                                                if (is_dir($runtime.$runtimedir)) {
                                                        foreach (scandir($runtime.$runtimedir) as $runtimefile) {
                                                                if (in_array($runtimefile,array('.','..'))) continue;
                                                                if (is_dir($runtime.$runtimedir.$DIRECTORY_SEPARATOR.$runtimefile))
                                                                        CIISONLINE_Environment::RemoveDir($runtime.$runtimedir.$DIRECTORY_SEPARATOR.$runtimefile.$DIRECTORY_SEPARATOR);
                                                                else @unlink($runtime.$runtimedir.$DIRECTORY_SEPARATOR.$runtimefile);
                                                        }
                                                }
                                        }
                                }
                        }
                       
                        $this->nestClient->Close();
                       
                        $this->worker->controller->service();
                       
                        CIISONLINE_Environment::Log()->info('', null, null, (__CLASS__), LOGGER_APPLICATION_CATEGORY, "Scan $antconfig $ant.");
                        $this->metrics['transactions.count']++;
                }
               
        }
       
        /**
        * moving to the next data
        *
        * @return        true/false
        */
        public function moveNextData(){
                if (isset($this->data) && $this->index>=0 && !$this->isEndData()) {
                        ++$this->index;
                        return true;
                }
                return false;
        }
       
        /**
        * moving to the previous data
        *
        * @return        true/false
        */
        public function movePrevData(){
                if (isset($this->data) && $this->index>=0) {
                        if ($this->index>0) --$this->index;
                        return true;
                }
                return false;
        }
       
        /**
        * moving to the first data
        *
        * @return        true/false
        */
        public function moveFirstData(){
                if (isset($this->data) && $this->index>=0) {
                        $this->index=0;
                        return true;
                }
                return false;
        }
       
        /**
        * moving to the last data
        *
        * @return        true/false
        */
        public function moveLastData(){
                if (isset($this->data) && $this->index>=0) {
                        $this->index=count($this->data)-1;
                        return true;
                }
                return false;
        }
       
        /**
        * moving to some position of data
        *
        * @return        void
        */
        public function moveToData($offset){
                if (isset($this->data) && $this->index>=0 && $offset>=0 && $offset<count($this->data)) {
                        $this->index=$offset;
                        return true;
                }
                return false;
        }
       
        /**
        * The construct function for our object.
        *
        * @return        void
        */
        public function __destruct(){
                parent::__destruct();
                unset($this->nestClient);
                unset($this->configobj);
        }

        /**
        * Rutine to execute at the end processing end data.
        *
        * @return        void
        */
        public function onEndData(){
                $this->metrics['process.status'] = 'OK';
                $this->configure();
        }
}


Create Queen Process

Process Rendering is applicable to queen processes (for continues processes), worker processes (one-time processes), and kannel handlers. Process will be rendered using config file called manifest and its process_type class file. Process should be install in its appropriate entity (queen, worker or kannel). Config file is rendering control that define what should be used and how to render the process. process_type class file is used to perform the defined process.

Below is as an example:

configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration id="stomp_receiver">
        <section name="core">
                <!-- Process Configuration-->
                <config name="process">
                        <config name="type">stomp_receiver</config>
                        <config name="name">StompReceiver</config>
                        <config name="start">#TIMESTAMP FIRST TIME FOR EXECUTION#</config>
                        <config name="end">#TIMESTAMP LAST TIME FOR EXECUTION#</config>
                </config>
                <!--STOMP Connection-->
                <config name="connections">
                        <config name="mainmq">
                                <config name="type">STOMP</config>
                                <config name="host">#IP TO YOUR STOMP SERVER#</config>
                                <config name="port">#PORT TO YOUR STOMP SERVER#</config>
                                <config name="username">#USERNAME TO LOG IN WITH#</config>
                                <config name="password">#PASSWORD TO LOG IN WITH#</config>
                        </config>
                </config>
                       
                <!--Receive Topics-->
                <config name="source">#TOPIC TO LISTEN ON#</config>
               
                <config name="box">#BOX To PUT THE MESSAGE#</config>
                       
                <!--Queue Configuration-->
                <config name="queue">
                               
                        <config name="selectors">
                                <config name="{#SELECTOR NAME#}">
                                        <config name="selector">
                                                <config name="type">#TYPE OF SELECTORS#</config>
                                                <config name="{}">#{}#</config>
                                        </config>
                                        <config name="storage">
                                                <config name="type">#STORAGE TYPE#</config>
                                                <config name="{}">{}</config>
                                        </config>
                                </config>
                        </config>
                </config>
               
        </section>
</configuration>


processor file:

class stomp_receiver extends queenProcess {
        /**
        * queue
        *
        * @var                object
        */
        private $queue;
       
        /**
        * destination queue box
        *
        * @var                string
        */
        private $queueBox;
       
        /**
        * Configure process.
        *
        * @return        void
        */
        public function configure() {
                $this->passage->mainmq->subscribe($this->config->source);
                $this->queueBox = isset($this->config->box)?$this->config->box:'';
               
                if (isset($this->config->system)) {
                        $system = $this->config->system;
                       
                        if (isset($system->queue->config)) {
                                $file = isset($system->queue->config->file)?$system->queue->config->file:'';
                                if ($file!='' && $file==basename($file))
                                        $file = CIISONLINE_System::GetSystemDir()
                                                .'Configuration'.DIRECTORY_SEPARATOR.$file;
                               
                                $section = isset($system->queue->config->section)?
                                                        $system->queue->config->section:null;
                               
                                if (file_exists($file)) {
                                        $sysQueueConfig = new CIISONLINE_Config_XML($file,$section);
                                        $sysQueueConfig = $sysQueueConfig->getConfig();
                                       
                                        CIISONLINE_Queue::$sysQueueConfig = $sysQueueConfig->router;
                                }
                        }
                }
               
                if (isset($this->config->queue)) {
                        if (isset($this->config->queue->ref)) {
                                $queueConfig = CIISONLINE_Queue::getRefConfig($this->config->queue->ref);
                        } else if (isset($this->config->queue->router))
                                $queueConfig = CIISONLINE_Queue::parseQueueConfig($this->config->queue->router);
                        else $queueConfig = false;
                       
                        if ($queueConfig!==false
                                && false!==($this->queue = CIISONLINE_Queue::createQueue($queueConfig))) {
                               
                        } else {
                                $this->queen->controller->terminateProcesses($this);
                        }
                } else {
                        $this->queen->controller->terminateProcesses($this);
                }
        }
       
        /**
        * If you overload queenProcess's onInit function, be sure to call
        * onInit through queenProcess with the line:
        *                 parent::onInit($config, $filename);
        *
        * If you neglect to do this, the queenProcess will load improperly and therefore
        * not work correctly within a queen.
        *
        * @param        object        $config        The configseed configuration handler
        * @param        string        $filename        The config file which generated this instance
        *
        * @return         void
        */
        public function onInit($config, $filename) {
                parent::onInit($config, $filename);

                $this->metrics['process.status'] = 'OK';
                $this->configure();
        }
       
        /**
        * If you overload queenProcess's onReconfigure function, be sure to call
        * onReconfigure through queenProcess with the line:
        *                 parent::onReconfigure($config, $filename);
        *
        * If you neglect to do this, the queenProcess will reload improperly and
        * therefore stop working correctly within a queen.
        *
        * @param        object        $config        The configseed configuration handler
        * @param        string        $filename        The config file which generated this instance
        *
        * @return         void
        */
        public function onReconfigure($config, $filename) {
                parent::onReconfigure($config, $filename);
               
                $this->metrics['process.status'] = 'OK';
                $this->configure();
        }
       
        /**
        * A required static breadcrumb which tells configseed what configuration
        * options we should have.
        *
        * This is where you should mark options from your configuration file as
        * either required (Necessary for your object to work) or optional (not
        * necessary to functionality, but rather more fine-tune configuration).
        *
        * Be sure to call both queenProcess::docConfig() and passage::docConfig() with
        * their proper options to ensure that you build an accurate map of options.
        *
        * @param        object        $config        The configuration object
        *
        * @return        void
        */
        static public function docConfig(&$config) {
                queenProcess::docConfig($config);
                CIISONLINE_Passage::docConfig('mainmq', 'STOMP', $config);
                $config->addOption('required', 'source', 'The topic to listen to');
                $config->addOption('optional', 'box',        'The queue box to store');
        }

        /**
        * This function waits for a message then logs it to the directory
        * which is specified in the configs. If it cannot store the file, it
        * logs an alert message.
        *
        * @param        object        $conn        The STOMP connection
        * @param        object        $msg        The STOMP frame
        *
        * @return        boolean        true        We want to ack the reception of the message, so we return true
        */
        public function STOMP_OnMessage($conn, $msg){
               
                $message = new CIISONLINE_Queue_Message($msg->headers,$msg->body);
               
                if ((string)$this->queueBox!='')
                        $this->queue->putMessage($message,$this->queueBox);
                else
                        $this->queue->putMessage($message);
               
                CIISONLINE_Environment::Log()->info('', null, null, (__CLASS__)
                                , LOGGER_APPLICATION_CATEGORY, 'Stomp_Receiver: Writing a file to ' . $filename);
               
                $this->metrics['transactions.count']++;       
                $this->lastexecution = time();
                return true;       
        }
}


Web Service Sample

Service should be rendered in a Container with type of Service. Service will be rendered using: config file, service processor class file, and language file.Config file is rendering control that define what should be used and how to render the service. Service processor class file is used to process the request and render the defined service. Language file is used as language source of rendered service.

Below is as an example:

configuration file:

<?xml version="1.0" encoding="UTF-8"?>
        <service name="LogoutService" id="LogoutService" >
                <processor PageSecurityCode="0" CanPublic="false" RunEndResponse="false" Authenticate="fase">
                </processor>
        </service>


service processor file:

class LogoutService extends CIISONLINE_ServiceProcessor{
       
        /**
        * LogoutService::Logout($pAccount) Returns status true/false.
        *
        * @return boolean
        **/
        function Logout($pAccount) {
               
                if (GetSystemConfig('bBehaveAsLoginService')) {
                        /*do logout all instance using loginservice & itself*/
                        $this->LogoutSites($pAccount);
                        /*do logout itself*/
                        SetLogoutUserActivityLoginStatus(
                                $pAccount,GetSystemConfig('sLocalUserCode')
                                ,GetSystemConfig('sInstanceLocalUserCode'));
                } else if (GetSystemConfig('bUseLoginService')) {
                        /*do logout itself*/       
                                SetLogoutUserActivityLoginStatus($pAccount,
                                GetSystemConfig('sLocalUserCode'),GetSystemConfig('sInstanceLocalUserCode'));
                } else {
                        return (0);
                }
               
                return (1);
        }
       
        private function LogoutSites($pAccount) {
                $cacheFile = CIISONLINE_System::GetCacheDir().$pAccount.'.sites.login';
                if (!file_exists($cacheFile)) return;
               
                $sites = new CIISONLINE_Config_XML($cacheFile,'sites');
                $sites = $sites->GetConfig();
                if (is_object($sites) && count($sites)>0) {
                        foreach ($sites as $site=>$logoutsvc) {
                                try {
                                        $soapClient = new SoapClient($logoutsvc);
                                        $soapClient->Logout($pAccount);
                                } catch (Exception $e) {
                                }
                        }
                }
                unlink($cacheFile);
               
        }
       
}


Web Page Sample

Page should be rendered in a Container with type of Page. Page will be rendered using: configuration file, page processor class file, view html file, language file, and plugin as needed. Configuration file is rendering control that define what should be used and how to render the page. Page processor class file is used to process the request and render the defined output. View html file is used to forming the output together with page processor class file. Language file is used as language source of rendered page. Plugin can be used as additional components of rendered page.


Example is rendering dynamic and sortable grid of this screenshot:



configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<page name="_CurActvsList" id="_CurActvsList" >
        <processor PageSecurityCode="18"
                sOnlyTemplateFileName="ADM__CurActvsList.html" CanPublic="false">
               
                <PageActionSelectionScript><![CDATA[
                        switch ((string)GetCurrentPageConfig("sForm")) {
                        case "CurActvsList":
                                CIISONLINE_ADM__CurActvsList::CurActvsListAction                                                 (GetCurrentPageConfig("sAction"));
                        }
                ]]></PageActionSelectionScript>

                <TemplateProcessingScript><![CDATA[
                        CIISONLINE_ADM__CurActvsList::CurActvsList_Show();
                ]]></TemplateProcessingScript>

                <ResponseProcessingScript><![CDATA[
                        ResponseWrite (PrintVar("main"));
                ]]></ResponseProcessingScript>
               
                <IncludeFile>PageClass/ADM_Header.php</IncludeFile>
                <IncludeFile>PageClass/ADM_Footer.php</IncludeFile>
                <IncludeFile>PageClass/ADM__CurActvsList.php</IncludeFile>
               
                <TemplateSpaceHolder name="Header">ADM_Header.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Footer">ADM_Footer.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space01">Space01.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space02">Space02.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space03">Space03.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space04">Space04.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space05">Space05.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space06">Space06.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space07">Space07.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space08">Space08.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space09">Space09.html</TemplateSpaceHolder>
                <TemplateSpaceHolder name="Space10">Space10.html</TemplateSpaceHolder>
                       
        </processor>
</page>


page processor file:

class CIISONLINE_ADM__CurActvsList extends CIISONLINE_PageProcessor{
        static function MenuPath_Show() {
       
        }
       
        protected static function CommonSetVar() {
                /* Common Javascript Setting Value */
                CommonSetVar();
                /*-------------------------------*/
               
                SetVar ("msg_reallytodeleteCurActvs",
                        ToHTML(GetTextLanguage("sCurActvsListMsgReallyToDeleteActivities")));
        }
       
        static function Search_Show() {

                SetVar ("CurActvsListSearchTitle",
                ToHTML(GetTextLanguage("sCurrentActivitiesCurActvsListSearchTitle")));
                SetVar ("KeywordsCaption",
                        ToHTML(GetTextLanguage("sCurrentActivitiesKeywordsTitle")));
                SetVar ("LoginCaption",
                        ToHTML(GetTextLanguage("sCurrentActivitiesLoginColumnTitle")));
                SetVar ("ModuleIdCaption",
                        ToHTML(GetTextLanguage("sCurrentActivitiesModuleIdColumnTitle")));
                SetVar ("ModifiedTimeCaption",
                ToHTML(GetTextLanguage("sCurrentActivitiesModifiedTimeColumnTitle")));
               
                SetVar ("ds_keywords", ToHTML(GetParam("ds_keywords")));
                SetVar ("ds_moduleid", ToHTML(GetParam("ds_moduleid")));
                SetVar ("ds_login", ToHTML(GetParam("ds_login")));
                SetVar ("ds_modifiedtime", ToHTML(GetParam("ds_modifiedtime")));
                SetVar ("SearchButton",
                        ToHTML(GetTextLanguage("sCurrentActivitiesSearchButtonTitle")));
               
                /* Common Javascript Setting Value */
                self::CommonSetVar();
                /*-------------------------------*/
               
                Parse ("CurActvsSearchForm", false);
        }

        static function CurActvsListAction($sAction) {
               
                $fldNumDisplayedRows = GetParam("DisplayedRows");
               
                if ((string)$sAction == "delete"
                        && (string)$fldNumDisplayedRows!=""
                        && is_numeric($fldNumDisplayedRows)) {
                        if ($fldNumDisplayedRows>0){
                                $sListCurActvsListAction = ListToGetSelectedSQLListOfHTTPRequest2(
                                        $fldNumDisplayedRows,"caid",",","Text"
                                        );
                        }
                }
       
                if (isset($sListCurActvsListAction)
                                && (string)$sListCurActvsListAction!="") {
                        switch ($sAction) {
                        case "delete":
                                $sSQL = "delete from ".GetTableConfig("sCurrentActvsTbNm")
                                        ." where "
                                        .GetTableConfig("sCurrentActvsTbColPrefix")."01 in (".
                                                $sListCurActvsListAction.")";
                                ExecuteSQL2 ($sSQL);
                                $sError = ProcessError();
                                if ((string)$sError!="") {
                                        SetCurrentPageConfig ("sPageErrorMessage",
                                                ToHTML(GetTextLanguage("sErrorExecutingDatabaseCommand"))
                                                .GetSystemConfig("sHTMLMessageSeparator"));
                                        OnPageAccessErrorLogWrite ($sError);
                                }
                        }
                }
        }
       
        /*===============================
        * Display Grid Form
        *-------------------------------*/
        static function CurActvsList_Show() {
       
                $sFileName = GetParam("sFileName");
                if ((string)$sFileName=="")
                        $sFileName = GetFullURLAddress(
                                        GetCommandNameConfig("sCurActvsListPageCommandName"),"");
               
                $sFormParams = "ds_keywords=".ToURL(GetParam("ds_keywords"))
                        ."&ds_moduleid=".ToURL(GetParam("ds_moduleid"))
                        ."&ds_modifiedtime=".ToURL(GetParam("ds_modifiedtime"))
                        ."&ds_login=".ToURL(GetParam("ds_login"))."&rspp=".ToURL(GetParam("rspp"))."&";
               
                $sMenuPath = "";
                if ((string)GetParam("MenuPath")=="") {
                        $sMenuPathParams = $sMenuPath;
                } else {
                        $sMenuPathParams = GetParam("MenuPath").",".$sMenuPath;
                }
                $sMenuPathParams = "MenuPath=".ToURL($sMenuPathParams)."&";
               
                $sPageErrorMessage = GetCurrentPageConfig("sPageErrorMessage");
                if ($sPageErrorMessage=="") {
                        SetVar ("ActionMessage", "");
                        /* Info Successfull Access */
                        OnPageAccessInfoLogWrite ("");
                } else {
                        SetVar ("message", ($sPageErrorMessage));
                        Parse ("ActionMessage", false);
                }
               
                /* Common Javascript Setting Value */
                self::CommonSetVar();
                /*-------------------------------*/
                $sCurrentActvsTbNm = GetTableConfig("sCurrentActvsTbNm");
                $sCurrentActvsTbColPrefix = GetTableConfig("sCurrentActvsTbColPrefix");
               
                $sWhere = "";
               
                $pkeywords = GetParam("ds_keywords");
                if ((string)$pkeywords != "") {
                        if ((string)$sWhere != "") $sWhere = " AND ";
                        $sWhere .= "(c.".$sCurrentActvsTbColPrefix."02 like '%"
                                .str_replace("'", "''",$pkeywords)
                                ."%' or c.".$sCurrentActvsTbColPrefix."03 like '%"
                                .str_replace("'","''",$pkeywords) ."%') ";
                }
               
                $pModuleId = GetParam("ds_moduleid");
                if ((string)$pModuleId != "") {
                        if ((string)$sWhere != "") $sWhere .= " AND ";
                        $sWhere .= "c.".$sCurrentActvsTbColPrefix."07=".ToSQL($pModuleId, "Text");
                }
               
                $pLogin = GetParam("ds_login");
                if ((string)$pLogin != "") {
                        if ((string)$sWhere != "") $sWhere .= " AND ";
                        $sWhere .= "c.".$sCurrentActvsTbColPrefix."03=".ToSQL($pLogin, "Text");
                }
               
                $pModifiedTime = GetParam("ds_modifiedtime");
                if ((string)$pModifiedTime != "" && isDisplayDateTimeString($pModifiedTime)) {
                        if ((string)$sWhere != "") $sWhere .= " AND ";
                        $sWhere .= "c.".$sCurrentActvsTbColPrefix."13<"
                                .ToSQL(DisplayDateToValue($pModifiedTime), "Date");
                }
               
                $oPaging = new CIISONLINE_Paging(
                        "FormCurActvsList","CheckAllCurActvs","DListCurActvsList"
                        ,"CurActvsListNoRecords","CurActvsListNavigator","");
               
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."01"
                        ,"curactv_id","ActivityIdColumn",""
                        ,GetTextLanguage("sCurrentActivitiesActivityIdColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."02"
                        ,"curactv_accountid","AccountIdColumn",""
                        ,GetTextLanguage("sCurrentActivitiesAccountIdColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."03"
                        ,"curactv_login","LoginColumn",""
                        ,GetTextLanguage("sCurrentActivitiesLoginColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."04"
                        ,"curactv_logintime","LoginTimeColumn",""
                        ,GetTextLanguage("sCurrentActivitiesLoginTimeColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."05"
                        ,"curactv_loginfrom","LoginFromColumn",""
                        ,GetTextLanguage("sCurrentActivitiesLoginFromColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."06"
                        ,"curactv_loginstatus","LoginStatusColumn",""
                        ,GetTextLanguage("sCurrentActivitiesLoginStatusColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."07"
                        ,"curactv_moduleid","ModuleIdColumn",""
                        ,GetTextLanguage("sCurrentActivitiesModuleIdColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."08"
                        ,"curactv_page","PageColumn",""
                        ,GetTextLanguage("sCurrentActivitiesPageColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."09"
                        ,"curactv_sessionid","SessionIdColumn",""
                        ,GetTextLanguage("sCurrentActivitiesSessionIdColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."10"
                        ,"curactv_accessas","AccessAsColumn",""
                        ,GetTextLanguage("sCurrentActivitiesAccessAsColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."11"
                        ,"curactv_loginouttime","LogTimeColumn",""
                        ,GetTextLanguage("sCurrentActivitiesLogTimeColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."12"
                        ,"curactv_createdtime","CreatedTimeColumn",""
                        ,GetTextLanguage("sCurrentActivitiesCreatedTimeColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."13"
                        ,"curactv_modifiedtime","ModifiedTimeColumn",""
                        ,GetTextLanguage("sCurrentActivitiesModifiedTimeColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."14"
                        ,"curactv_logouttime","LogoutTimeColumn",""
                        ,GetTextLanguage("sCurrentActivitiesLogoutTimeColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."15"
                        ,"curactv_useragent","UserAgentColumn",""
                        ,GetTextLanguage("sCurrentActivitiesUserAgentColumnTitle"));
                $oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."16"
                        ,"curactv_instanceid","InstanceColumn",""
                        ,GetTextLanguage("sCurrentActivitiesInstanceColumnTitle"));
                $oPaging->AddKeyColumn(0);
                $oPaging->AddDynamicDataColumn("Prmcuractv_curactv_id","\");
                $oPaging->AddStaticDataColumn("curactv_URLLink"
                        ,GetFullURLAddress(GetCommandNameConfig("sCurActvViewPageCommandName"),""));
               
                $oPaging->AddColumnFilter(7,"MaxLength25");
               
                $oPaging->SQLDataFrom=$sCurrentActvsTbNm." c";
               
                $oPaging->SQLDataOrder = " order by c.".$sCurrentActvsTbColPrefix."02 Asc";
               
                $oPaging->FormTitle = GetTextLanguage("sCurrentActivitiesFormTitle");
                $oPaging->AddTitle("DeleteCommand"
                                ,GetTextLanguage("sCurrentActivitiesDeleteCommandTitle"));
                $oPaging->AddTitle("ExportCommand"
                        , GetTextLanguage("sCurrentActivitiesExportCommandTitle"));
               
                $oPaging->FormAction=GetFullURLAddress(
                        GetCommandNameConfig("sCurActvViewPageCommandName"), "");
                $oPaging->FormParams=$sFormParams;
                $oPaging->TransitParams="rspp=".ToURL(GetParam("rspp"))."&";
                $oPaging->AddParams("MenuPathParams", ($sMenuPathParams));
                $oPaging->AddParams("FileName",$sFileName);
                $oPaging->AddParams("CurActvsExportLink"
                        ,GetFullURLAddress(GetCommandNameConfig("sCurActvsExportPageCommandName"), ""));
               
                $oPaging->ProcessSorting();
                $sOrder = $oPaging->GetSQLSortOrder();
               
                $oPaging->WhereInSQLDataFrom=false;
                $oPaging->SQLSelection=$oPaging->BuildSQLSelection(false,$sWhere,$sOrder);
                $oPaging->SQLCountSelection=$oPaging->BuildSQLCountSelection(false,$sWhere);
               
                $oPaging->RecordsPerPage=GetCurrentUserRecordsPerPageSetting(
                        GetUserConfigPreferenceConst("iUserConfigNumActivitiesPerPageListPage")
                                ,GetSystemConfig("iDefNumActivitiesPerPage"));
                $oPaging->CalculatePagesCount();
                $oPaging->CurrentPage=$oPaging->GetPageParam();
                $oPaging->DisplayedIDsListName="caidList";
               
                $oPaging->NumberOfPagesToList = GetCurrentUserConfig("iNumDisplayedPageNavigator");
                               
                $oPaging->DataList_Show();
               
                unset($oPaging);
        }
}


page view file:

<!--BeginFormCurActvsList-->
<form method="POST" Action="{FileName}" name="CurActvsList" id="CurActvsList" accept-charset="UTF-8">
<table class="FormTABLE" width="100%">
        <!--BeginActionMessage-->
        <tr>
        <td class="FormMessageTD" colspan="11">
                <font class="FormMessageFONT">{message}</font></td>
        </tr>
        <!--EndActionMessage-->
        <tr>
        <td class="FormHeaderTD" colspan="11">
                <a name="CurActvs" id="CurActvs"><font class="FormHeaderFONT">{FormTitle}</font></a></td>
        </tr>
        <tr>
        <td class="ColumnTD" nowrap>
                <font class="ColumnFONT"><!--BeginCheckAllCurActvs-->
                <input type="checkbox" name="caidall" id="caidall" value="ON"                                 onclick="checkboxselection2('caid','{DisplayedRows}','CurActvsList');">
                <!--EndCheckAllCurActvs--></font></td>
        <td class="ColumnTD" nowrap>
                <a href="{FileName}{FormParams}FormCurActvsList_Sorting=1
                &FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{ActivityIdColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=2
                &FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{AccountIdColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=3
                &FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{LoginColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=4
                &FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{LoginTimeColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=5
                &FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{LoginFromColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=7
                &FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{ModuleIdColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=8&
                FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{PageColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=10&
                FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{AccessAsColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=13&
                FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{ModifiedTimeColumn}</font></a></td>
        <td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=16&
                FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{InstanceColumn}</font></a></td>
        </tr>
        <!--BeginDListCurActvsList-->
        <tr>
        <td class="DataTD" nowrap>
                <font class="DataFONT">
<input type="checkbox" name="caid{counter}" id="caid{counter}" value="{curactv_id}">
                &nbsp;</font></td>
        <td class="DataTD" nowrap>
                <a href="{curactv_URLLink}{FormParams}{MenuPathParams}curactv_id={Prmcuractv_curactv_id}">
                <font class="DataFONT">{curactv_id}</font></a></td>
        <td class="DataTD" nowrap><font class="DataFONT">{curactv_accountid}</font></td>
        <td class="DataTD" nowrap><font class="DataFONT">{curactv_login}</font></td>
        <td class="DataTD" nowrap> <font class="DataFONT">{curactv_logintime}</font></td>
        <td class="DataTD" nowrap><font class="DataFONT">{curactv_loginfrom}</font></td>
        <td class="DataTD" nowrap> <font class="DataFONT">{curactv_moduleid}</font></td>
        <td class="DataTD" nowrap> <font class="DataFONT" width="100%">{curactv_page}</font></td>
        <td class="DataTD" nowrap> <font class="DataFONT">{curactv_accessas}</font></td>
        <td class="DataTD" nowrap> <font class="DataFONT">{curactv_modifiedtime}</font></td>
        <td class="DataTD" nowrap> <font class="DataFONT">{curactv_instanceid}</font></td>
        </tr>
        <!--EndDListCurActvsList-->
        <!--BeginCurActvsListNoRecords-->
        <tr><td colspan="11" class="DataTD"><font class="DataFONT">{NoRecords}</font></td></tr>
        <!--EndCurActvsListNoRecords-->
        <tr>
        <td colspan="11" class="ColumnTD">
                <table width="100%">
                <tr>
                <td align="left" nowrap>
                        <a href="javascript:gotopage('{CurActvsExportLink}');">
                                <font class="ColumnFONT">{ExportCommand}</font></a>&nbsp;
        <!--BeginBulkFooterOperation-->
        <a href="javascript:del();"><font class="ColumnFONT">{DeleteCommand}</font></a>&nbsp;
        <!--EndBulkFooterOperation-->
        </td>
        </tr>
        <tr>
        <td align="right" nowrap>
<!--BeginCurActvsListNavigator-->
<a href{CurActvsListNavigatorFirstPage}
                        ="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={FirstPage}#CurActvs">
<font class="ColumnFONT">{First}</font></a>
<a href{CurActvsListNavigatorFirstPage}
                        ="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={PrevPage}#CurActvs">
<font class="ColumnFONT">{Previous}</font></a>
<font class="ColumnFONT">[
                <!--BeginCurActvsListNavigatorPages-->
        <a href{NavigatorPageSwitch}
                ="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={NavigatorPageNumber}#CurActvs">
                <font class="ColumnFONT">{NavigatorPageNumberView}</font></a>&nbsp;
                <!--EndCurActvsListNavigatorPages-->
                {NumberOfPages} {CurActvsListNavigatorPagesCount} ]</font>
                <a href{CurActvsListNavigatorLastPage}
                        ="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={NextPage}#CurActvs">
                <font class="ColumnFONT">{Next}</font></a>
                <a href{CurActvsListNavigatorLastPage}
                        ="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={LastPage}#CurActvs">
<font class="ColumnFONT">{Last}</font></a>
<!--EndCurActvsListNavigator-->
</td>
                </tr>
                </table>
</td>
</tr>
<input type="hidden" name="FormName" id="FormName" value="CurActvsList">
<input type="hidden" name="FormAction" id="FormAction" value="">
<input type="hidden" name="caidList" id="caidList" value="{caidList}">
<input type="hidden" name="DisplayedRows" id="DisplayedRows" value="{DisplayedRows}">
</table>
</form>
<!--EndFormCurActvsList-->


page language file:

<?xml version="1.0" encoding="UTF-8"?>
        <language page="CurActvsList">
                <category name="label" >
                        <title name="sCurrentActivitiesFormTitle">Current Activities</title>
                        <title name="sCurrentActivitiesActivityIdColumnTitle">Activity ID</title>
                        <title name="sCurrentActivitiesAccountIdColumnTitle">Account ID</title>
                        .....
                        .....
                        <title name="sCurrentActivitiesCurActvsListSearchTitle">Search</title>
                        <title name="sCurrentActivitiesKeywordsTitle">Keywords</title>
                        <title name="sCurrentActivitiesSearchButtonTitle">Search</title>
                </category>
                <category name="error_message" >
                        <title name="sCurActvsListMsgReallyToDeleteActivities">Really To Delete?</title>
                </category>
        </language>



CommentLuv Enabled

Followers