Nate Lewis > FWS-V2 > FWS::V2

Download:
FWS-V2-1.13091122.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 1.13091122   Source  

NAME ^

FWS::V2 - Framework Sites version 2

VERSION ^

Version 1.13091122

SYNOPSIS ^

    use FWS::V2;
    my $fws = FWS::V2->new( DBName        => 'myDB',
                            DBUser        => 'theUser',
                            DBPassword    => 'superSecret',
                            DBHost        => 'localhost',
                            DBType        => 'MySQL');

DESCRIPTION ^

FWS::V2 is the utility counterpart to the web based content management development platform provided at www.frameworksites.com. The web based version of this module is derived from this source with additional web specific features and packaging. The web based version enables the FWS to function on most any modern hosting environment, be upgraded in real time via the web based FWS administration, and control shared plugins between all of your installations even on different servers.

Using this version is ideal for accessing any plugin feature, or data stored within a FWS installation from a standalone script. Examples of this would be scripts to do site maintenance, imports, exports, mass data updates, data mining, 3rd party data synchronization, web services, APIs... and more!

The syntax and usage of the FWS::V2 is identical to the web based element and plugin development available within the FWS web based administration. Code from either is interchangeable between both distributions of FWS::V2 and the web based distribution of FWS available from www.frameworksites.com.

PACKAGE DEPENDENCE ^

Wait a second... why does FWS V2 seem to have its own home grown methods that are already in popular well established packages????

One of the main goals of FWS is to have a bundled, autonomous version of the FWS that can be picked up and sat on almost any major ISP or Linux hosting environment without any care for what is present on the server. Packages the FWS does use have been carefully picked and validated to be supported on most all major ISPs. For more information on this bundled web optimized version visit http://www.frameworksites.com

SUBROUTINES/METHODS ^

new

Construct a FWS version 2 object. Like the highly compatible web optimized distribution this will initiate access to all the FWS methods to access data, file, session, formatting and network methods. You can pass a variety of different parameters which could be required depending on what methods you are using and the context of your usage. MySQL and SQLite are supported with FWS 2, but MySQL should always be used if it is available. On medium or high traffic sites and sites with any significance of a data footprint, you will see quite a bit of latency with SQLite.

Example of using FWS with MySQL:

    #
    # Create FWS with MySQL connectivity
    #
    use FWS::V2;
    my $fws = FWS::V2->new(       DBName          => "theDBName",
                                  DBUser          => "myUser",
                                  DBPassword      => "myPass");

Example of using FWS with SQLite:

    #
    # create FWS with SQLite connectivity
    #
    use FWS::V2;
    my $fws = FWS::V2->new(      DBType          => "SQLite",
                                 DBName          => "/home/user/your.db");

Any variable passed or derived can be accessed with the following syntax:

    print $fws->{'someParameter'}."\n";

With common uses of FWS, you should never need to change any of these settings. If for some reason, although it is NOT recommended you can set any of these variables with the following syntax:

    $fws->{'someParameter'} = 'new settings';

Required Parameters

Non-Required Parameters

Non-required parameters for FWS installations can be added, but depending on the scope of your task they usually are not needed unless your testing code, or interacting with web elements that display rendered content from a stand alone script.

DERIVED VARIABLES AND METHODS ^

Accessable after setFormValues() is called

Accessable after setSiteFiendly() is called

Accessable after setSession() is called

Accessable after setSiteValues() is called

Accessable after processLogin() is called

WEB BASED RENDERING ^

Overview

To use the web based rendering you can use this module, or the current web optimized version that is available from http://www.frameworksites.com. When using this module as opposed to the web based version you still need to run the FWS core upgrade to receive the admin modules to your local installation. Any time running an FWS core upgrade you of course not have your core updated, only the admin elements and supporting JavaScript and files..

Simple Web Rendering Sequence

    #
    # Load FWS
    #
    use FWS::V2;
    $fws = new ( 
        #....  FWS Settings ...
    );
    
    #
    # add any plugins we have installed
    #
    $fws->registerPlugins();
    
    #
    # Get the form values
    #
    $fws->setFormValues();
    
    #
    # Connect to the DB
    #
    $fws->connectDBH();
    
    #
    # Page descisions and friendly url conversions
    #
    $fws->setSiteFriendly();
    
    #
    # Run any init scripts if needed
    #
    $fws->runInit();
    
    #
    # Set session and or get session vars
    #
    $fws->setSession();
    
    #
    # Set site values based on any information we have collected, created or changed
    #
    $fws->setSiteValues();
    
    #
    # Do login procedures
    #
    $fws->processLogin();
    
    #
    # Run Internal Admin Actions
    #
    $fws->runAdminAction();
    
    #
    # Display the content we just created
    #
    $fws->displayContent();

For a more robust version of this sequence use the go.pl file creation for manual installation located on http://www.frameworksites.com

FWS PLUGINS ^

registerPlugins

Any plugin that is actived via the plugin list in developer menu will attempt to be loaded.

    #
    # register all plugins applied to this instance
    #
    $fws->registerPlugins();

registerPlugin

Apply a plugin to an installation without using the GUI, to force an always on state for the plugin. If server wide plugins are being added for this instance they will be under the FWS::V2 Namespace, if not they can be added just as the plugin name.

    #
    # register plugins that are available server wide 
    #
    $fws->registerPlugin('FWS::V2::SomePlugin');
    
    #
    # register some plugin added via the FWS 2.1 Plugin manager
    #
    $fws->registerPlugin('somePlugin');

Additionally if you want to check if a plugin is active inside of element or scripts you can use the following conditional:

    #
    # check to see if ECommerce is loaded and active
    #
    if ($fws->{plugins}->{ECommerce} eq '1') {     print "ECommerce is installed!\n" }
    else {                                         print "No ECommerce for you!\n" }

AUTHOR ^

Nate Lewis, <nlewis at gnetworks.com>

BUGS ^

Please report any bugs or feature requests to bug-fws-v2 at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FWS-V2. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc FWS::V2

You can also look for information at:

LICENSE AND COPYRIGHT ^

Copyright 2013 Nate Lewis.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: