Mojavi Project

Developing new paths

Archive for July, 2008

July-25-08

Are you insured

posted by admin

With the elections starting to heat up many of the candidates are promising to fix our health care system and a few of the top candidates have mentioned socialized medicine. This has gotten may stirred up over what can be done to fix our health system. My vote would be less government and more competition. Our system while not perfect at least allows the market to help decide health insurance costs and keep prices in check. Many American are looking for ways to get better health care at a competitive cost. There are more and more sites that are offering a free health insurance quote to those that visit their site.

Sites like BUPA is one such site that offers not only free health insurance quotes but also disease state information for their customers. At their site you can find options for private health insurance where you can get different levels of coverage. You can find options that cover both inpatient and outpatient services and possibly coverage for a pre-existing condition. There are people available to talk to help you find the right coverage for you.

Tags:
July-18-08

Relax

posted by admin

A comedian by the name of Brian Regan does a bit on yoga tapes that he listened to try and get into shape. He starts out explaining one of the yoga positions for men where the instructor asks the participants to take the bottom of their right foot and placing on the small of their back, then take your left foot and throw it over your neck like a scarf and “relax” As he continues he explains the relaxation pose where the men are instructed to set back on the balls of their feet and “relax.” The he claims ” I can hear my feet bones cracking” which is quite funny when you see the act. It is quite hilarious and really does paint the picture of what it takes to do yoga. While it is funny exercising is something that we all should do on a regular basis and doing yoga is an activity that can help stretch and tone your muscles.
Many people will swear by the benefits of yoga to not only the physical but spiritual well being of the individual. Many men have this image as Brian points out in his comedy show that yoga looks painful and not you typical exercise routine. You can find yoga videos that are targeted specifically for men to help you learn the correct poses and the benefit that this type of exercise can bring.

Tags:
July-18-08

Migrating from Mojavi 2

posted by admin

Migrating From Mojavi 2.0

Moved To: Migrating From Mojavi 2

By Tyler Tompkins

Note: This document will be changing frequently as I add more information, and rearrange to create a more logical order and progression of the said information.

* Prerequisites
* First Things First
* The Context
* Translating your Renderer
* View
* Actions
* Configuration
* References

Prerequisites

You should have a decent grasp of Mojavi2 and PHP5 before trying to upgrade to Mojavi3.

If you want a quick crash course of Mojavi 3, see Creating Your First Module 2.
First Things First

Before you begin transferring your applications over from Mojavi2, make sure whatever host you’re using supports PHP5. You can figure out if your host supports PHP5 by running

phpinfo();

Furthermore, you need to download and install the Mojavi3 package, which can be attained by going to this location.
The Context

Probably the most important new and powerful aspect of Mojavi3 is the Context object. Once I figured out what this thing did, I fell in love with it. Basically, it is a sort of catalyst/storage object that allows you to access:

* The $request object via getRequest()
* The $controller object via getController()
* The $user object via getUser()
* The Current Action/Module names via getModuleName() and getActionName()
* And finally the Current module’s directory

More or less, most classes that are exposed to the user/developer (you) are going to have a getContext() function, which will allow you to access this object. And with the recent addition of cascading calls, you can perform operations that you were unable to in php4, for example:

The Old Way:

$obj =& $request->getAttribute(’myobj’);
$anotherobj =& $obj->doSomethingSpecial();
$anotherobj -> execute();

The New Way:

$this->getContext()->getRequest()->getAttribute(’myobj’)->doSomethingSpecial()->execute();

Okay, so maybe that wasn’t the best example, as it is rather lengthy, but you get my point, 1 line vs 3 lines, and no possible mistakes when dealing with large objects like copying them over without references, etc.

This subsection is to be continued….
Translating your Renderer

Mojavi2 used ‘renderers’ to translate the API of one templating system into a generic API that would easily allow a developer to switch out one templating system for another. For example, the Smarty templating engine uses $smarty->assign() to allow you to set a variable, while patTemplate, another templating system, uses $pat->addVar(). In Mojavi 2, you would then write or use an existing renderer, which you would then invoke to display your output.

Note: This was done typically through a filter, which would create the renderer object, then assign it to your $request via

$request->setAttribute(’MyRenderer’,$rendererObj))

Mojavi3 uses largely the same methodology, but instead of getting the renderer directly from the $request object within each of your views, it simply extends the View class.

For example:

abstract class SmartyView extends View
{
…..

function __construct()
{
$this->engine = $this->getContext()->getRequest()->getAttribute(’MySmartyObj’);
}

public function setAttribute($name, $value)
{
$this->engine->assign($name, $value);
}

…..
}

Note: the use of

$this->engine = $this->getContext()->getRequest()->getAttribute(’MySmartyObj’);

was simply the best solution I could come up with for getting any object from within the view, you could also have done the following just as easily:

$this->engine = new Smarty();

View

The Mojavi3 View is mostly an abstract class, which provides a skeleton of functions to work with, thus providing the unified API as was achieved in Mojavi2 (It’s unified because you are forced to comply with the naming conventions implemented by the abstract class View.)

Now, instead of intitializing your Renderer object (as you would in Mojavi2) you simply extend View, and initialize that. Like shown above:

abstract class SmartyView extends View
{

is what our new View would look like. To put this new View type into action, we extend it when declaring views for our modules. For example:

class DoSomeActionSuccessView extends SmartyView
{

}

As you can see, this is much more fluid than pulling the renderer out of $request with every new View, it’s also a lot less code that you have to copy and paste, and thus less code to maintain. You may also have noticed that the naming scheme is different for the Views, instead of naming the file DoSomeActionView_success.class.php you would now name it DoSomeActionSuccessView.class.php, and name the class likewise(In Mojavi2 we just named our view classes DoSomeActionView, in Mojavi3 it’s DoSomeActionSuccessView replacing ‘Success’ with your application’s state).

This subsection is to be continued….
Actions

Actions in Mojavi3 are fairly similiar to those of Mojavi2, with a few enhancement and semantic tweaks here and there. Listed Below:

* When returning a VIEW_SUCCESS in Mojavi2, now return the View class constant corresponding to your application state, ie: View::Success, or View::Error
* When checking for view types supporting execution (getRequestMethods) instead of returning REQ_POST etc, return Request::Post etc.
* There is a new return type for getRequestMethods(), Request::All, which serves all request methods.
* The root Action class which all your actions extend now has a getContext() method, which allows you access to the context object.

Configuration

Mojavi3 configurations are done, by default, using .ini files. This simple and straightforward configuration makes configuring mojavi very easy. The base syntax of these ini files is as follows:

[SECTION]

; a comment…..
ConfigKey = “%MO_APP_DIR%/my/config/value”

Because some people might not like ini files, Mojavi3 was created in such a way that you could write your own configuration handlers. For example, if you wanted to use xml files to configure your mojavi, you could write a configuration handler, plug it in, and start using your custom configuration styles.

This subsection is to be continued….
References

To find out more about PHP5 in general go here: Where can I go to learn more?

July-15-08

Getting your blog seen

posted by admin

Growing your blog can be a hard buy enjoyable task. There are more and more people coming online to start their own blogs to communicate with family, to use as an outlet, or to create their own presence online. Blogs are very easy to start and very inexpensive. If you can type on a keyboard then you can have your own outlet to the world for anyone to read and comment on. Many new bloggers need to understand that they are opening themselves up to the entire world and if they produce something that does not agree with the masses they may not like the feedback they receive through comments or other blog posts. Trying these blogs one can see the diversity on what you can do online.

Tags:
July-14-08

Insurance online

posted by admin

There are several things you need to consider when purchasing life insurance. There are two main types called term and whole life insurance. The type you choose will depend on your risk profile and if you are looking to provide an investment tool, or just get some insurance to protect your family in case of an accident. Term life will usually be cheaper and have a shorter term and have no residual value.

For whole Life insurance you can usually get a decent return so that your premiums will stay constant over the life of the policy. On some policies you can even use any net capital return to help reinvest and purchase more insurance coverage. Shopping for insurance is now easier than ever with sites like Insuranceportalonline.com to help you compare different policies and types of insurance.

July-12-08

Get your voice heard

posted by admin

Many artists are making the crossover to voiceovers to increase their income as well as increase their audience. Many singers are already trained in the technical and fundamental aspects of vocal technique, the leap to doing voiceovers is quite natural. At Voices.com they provide a venue where artists can upload their voice projects for such companies as NBC, Disney, and Apple computers. They are helping to provide the avenue where those seeking to get into voiceover work can connect with those seeking out individuals for certain projects.

Record your projects and create your account to be available for some major companies that are looking for individuals to complete various

Tags:
Technology Blogs - BlogCatalog Blog Directory