overview

  • Ratings and Comments for All

    Any module can now take advantage of the resource ratings and comment systems. Check out core-classes/FlowBasis/Ratings and core-classes/FlowBasis/Comments for the implementations and look to core-classes/FlowBasis/Blogging for an example of how to incorporate these features into one of your modules.

    No comments.
    AverageNot yet rated.
    Your Rating
  • Goals

    The common question asked of me when I mention I'm building a web framework is, "Why build a new one?". I believe I can provide something of value to the software community, and I believe I need the flexibility of controlling the conventions of the base system to realize my vision. I want to provide a system that easily enables rich interaction between different components on both the client and the server, and I want there to be an expectation of a certain environment available wherever code is being run. Search, ratings, and widgets would be a few possible examples of this type of integration.

    Blogs, wikis, and a software release repository would be types of "modules". By software repository, I mean something that would track the latest release of QuoteBlizzard or FlowBasis and know the latest version numbers and download links.

    "Modules" tend to contain "resources" that should be searchable and/or rateable. Blogs have posts and comments. Wikis have user created pages. Software release repositories have projects. A developer should be able to create a custom module that tells FlowBasis, "Here are my resources," and FlowBasis should be able to incorporate them into the search engine and provide ratings tracking.

    "Modules" also tend to have information that would be nice to easily incorporate into other page views in the form of "widgets". A blog could publish "widgets" for its tag cloud or recent posts. A wiki could publish "widgets" for top-rated pages or most recently updated pages. A software release repository could expose a "widget" that displays the most recent software releases with a download link.

    Any page view can incorporate widget panels, and widget panels can be configured through an AJAX-y interface. For instance, you can add a widget panel to your main site page and through the browser (if you have permissions), you can add widgets by browsing through a list of available widget templates provided by modules, or configure existing widgets (such as change the URL on a feed listing widget or change the maximum number of displayed feed entries).

    No comments.
    AverageNot yet rated.
    Your Rating
  • JSON, JSON, Everywhere

    JSON stands for JavaScript Object Notation, and if you dig through the source, you'll quickly realize that JSON is the preferred format of choice for FlowBasis. JSON is easily usable from client-side javascript or within PHP on the server. It's the format objects are transmitted in from the client to the server and back again for remote procedure calls (AJAX stuff), and it's the format of objects saved in the FlowBasis object store.

    A sample JSON object declaration might look like (in Javascript, the quotes aren't required around "username" or "favoriteNumbers"):

    { "username" : "bob", "favoriteNumbers" : [42, 37, 100] }

    In PHP, this could be declared as:

    $bob = new stdClass;
    $bob->username = "bob";
    $bob->favoriteNumbers = array(42, 37, 100);

    and it could be converted to JSON with:

    $json = json_encode($bob);

    But, usually, the FlowBasis infrastructure will convert the PHP object into JSON where needed.

    No comments.
    AverageNot yet rated.
    Your Rating
  • Look, Ma! No SQL!

    Rather than rely on a SQL server for tracking users, blog posts, and such, FlowBasis uses a JSON object store for persisting, retrieving, and updating objects (see FlowBasis_Data_FileObjectStore for implementation). Relational databases have any number of niceties, including being well-understood, well-tested, and providing a known structure for data. However, databases are frequently very slow in shared hosting environments and mapping the objects we tend to use as programmers to relatational tables can be tedious. While the merits of SQL databases versus the free-form object store could be debated at length, I'll leave it at that for now.

    The object store provides a few basic methods: getObject, saveObject, and updateObject. Beyond that, there are a few additional methods for retrieving lists of objects and locking objects for synchronization. The default implementation of FlowBasis_Data_IObjectStore saves and loads everything to and from the file system, but the door is open for future implementations which use a database or the "cloud" for storage (though I imagine more intelligent use of caching would become necessary as the object store moves farther away from the local server).

    All that said, if you really want to use SQL with FlowBasis, you're welcome to use it. FlowBasis incorporates the open-source adodb library and provides a management panel for configuring connections and trying out SQL queries.

    No comments.
    Average
    Your Rating
  • General Concepts of FlowBasis

    Just to summarize a few general concepts available within FlowBasis...

    • Pages can contain controls which can contain other controls.
    • Pages and controls can communicate from browser to server via remote procedure calls (JSON-RPC).
    • Modules (blog, wiki, etc) contain resources (posts, comments, pages, etc).
    • Resources are indexed for searching.
    • Modules (blog, wiki, etc) or other sources can publish widgets (recent posts, tag cloud, html snippets) that can be embedded in other pages.
    • Resources can be rated.
    • Anything can publish events to the event manager. Anything can subscribe to events with an event handler.
    • Task handlers can be registered to perform tasks that must be done periodically in the background (like cleaning cache).
    • Installers manage adding and removing features/modules/whatever from the system.
    • Permissions define what users can do within modules (such as post an entry to a blog).
    • Users can have roles which grant them permissions (such as only admin and author could post an entry to a blog).
    • Roles can apply to specific contexts (user can be admin for whole site or just a particular blog).
    • Themes collaborate with pages and controls to determine the visual style of the site.
    No comments.
    AverageNot yet rated.
    Your Rating
  • Adding your content

    There are a few ways to add your content into a FlowBasis based site.

    • Add a file (regular old PHP, HTML, png, gif, whatever) within the "pages" folder.
    • Add a FlowBasis_UI_Page declaration in a PHP file with FlowBasis::setPageClass('NameOfPageClass') within the "pages" folder.
    • Use one of the built-in modules (currently blog and wiki).
    • Create your own module class.
    • Register a site path request handler with the routing manager and use your imagination from there.

    Over the next few days, I'll try to make a series of posts to give the general idea of what you can do with FlowBasis, so stay tuned...

    No comments.
    AverageNot yet rated.
    Your Rating