Created by: spiderr, Last modification: 21 Aug 2010 (15:54 UTC) by Will
Liberty Services add functionality to the Liberty CMS Engine. Services do things like, add categorization, user ratings, attach additional data, to any content being managed by Liberty. Typical types of content in bitweaver are wiki pages, blog posts, articles, etc. So Liberty Services adds extra features to any of these content types, or a content type you create as a developer.

Note: Content is created in bitweaver Packages. If you are not familiar with what a Package is or how the bitweaver application framework works, please first read the following pages: Bitweaver Framework and bitweaverPackage

The really exciting part of Liberty Services is that they can be easily extended. Which means it is easy for developers to add core functionality to the content management engine. Any Package can add to Liberty Services.

There are many bitweaver packages that do nothing except add functionality to the Liberty CMS Engine. Some examples are QuotaPackage, GatekeeperPackage, PigeonholesPackage, CategoriesPackage, PdfPackage, and GeoPackage. All these add features to all content being managed by Liberty.

How To Create A Liberty Service

Tutorial: CreatingServices

Liberty Services Features Reference

R2 Liberty Service GUIDs

The following is a list of Liberty Service GUIDs found in Liberty:LibertyServices.php. This are all in use by various packages. If you are creating a service you will either have to associate your services with one of these or create a new one for your service. If you plan to associate your service with one of these be aware that ONLY ONE package can be associated with each service. For example, both the CategoriesPackage and PigeonholesPackage use the Liberty Service GUID: LIBERTY_SERVICE_CATEGORIZATION, therefore both CAN NOT be installed at the same time! If another package you want to use already uses one of these you should create a new Service GUID in LibertySystem.php for your service.

Liberty Service GUID
Packages Using
LIBERTY_SERVICE_CATEGORIZATIONcategorizationCategoriesPackage PigeonholesPackage

Service Options

This is a list of the available service methods developers can register their own service functions to. These assume some knowledge of how bitweaver Packages work:

Note that these functions all take a $pObject and $pParamHash arguments where $pObject is the content object being worked on and $pParamHash is a hash of options. SQL functions may return a hash with select_sql, where_sql, join_sql and bind_vars set to effect the sql query being built.

Sql Extensions

Allows the extension of existing SQL while getList() is called. table aliases are kept constant throughout so you can easily join pertinent data to the existing SQL when getList() is called from any package. You can also insert some select_sql as well, to limit the selection critieria.
This is basically the same as content_list_sql_function but it's called during the load() process. the output should be virtually the same.


This function is called during the load process of the content, i.e. while the page is being loaded before the display function. this is good for things that should happen early on but the sql function is called too soon.
This function is called during the displaying of the content, i.e. while the page is being loaded. this means, you can add more sophisticated queries and checks in here, if there is no possibility to do this with the SQL functions above.
This function is called on list pages such as when you're viewing the list of wiki pages or the list of articles.
This function is called on history listing pages when you are viewing a history of changes.
This function is called when a page is being editied and a user hits preview. it's mostly there for you to make any selections the user has made persistent during the preview phase.
When a user wants to edit content, this function is called. it allows you to generate data for any templates you need to fill in the edit page (more below).
Here you can store the content data in your serice tables.
Similar to content_store_function, this service is called after a comment object is completely stored.
Make sure the data from your tables is removed when a user removes the content it belongs to.
Modify the user's permissions for a content object. Generally intended for extending permissions. But this gives access to the user's permission hash for manipulation in whichever way.
Verify user has permission to access content. intended use is to fatal out if not.


This template is displayed as a seperate tab when a user is editing content. this is useful for services that might contain several lines of code and want to have their own section when a user edits a page. This template is only available when the user is editing data.
This template is displayed above the content listing and is the the ideal position for adding a filter or some other means of content listing limitation.
This template is added to the available sort options. This only makes sense if the content_list_actions_tpl is in use as well.
The contents of this template are displayed within the listing near the action icons for every individual listing entry. Ideal to display relevant service information such as rating or status.
This template is displayed as a seperate tab when a user is on a page where they can upload files. the point of this template is to then display files that were uploaded or placed on the server in a method other than uploaded through bitweaver, e.g.: via ftp.
This template is displayed during the edit process and is particularly useful when you have a single dropdown to display, since it's displayed below the textarea a user uses to edit the content. This template is only available when the user is editing data.
This template is appended to the bottom of the page, like a list of pages in the same category. This is only visible when the full content is loaded i.e.: when an article is being read but not just viewed on the front page.
You can use this to insert a narrow template at the top of a page. this can be useful to display the path to an object or the status of a page. This is only visible when the full content is loaded i.e.: when an article is being read but not just viewed on the front page.
insert an icon in the list of existing icons in the top right on a page. This will enable you to get your users to link to a template in your own package and deal with certain needs that way.
insert a small template into the top of the
part of the content. this template will be visible in listings such as the articles front page as well.
insert a small template into each row of a list. Like in a list of wiki pages or board topics. This is for displaying list services in data lists instead of using body which is for abbreviated content lists like recent blog posts are recent articles, see content_body_tpl above.

Users Services Functions

These are made available via UsersPackage
This function is called after a new user registers and their information is validated. Technically it is called on the first time a user logs in, so no matter the validation requirement, instant approval, email verification, etc, this service is not called until the new user is considered valid by bitweaver. This function is great for creating package specific user information.

Users Services Templates

this template lets you append form information to the user registration form.

Commerce Functions

This are made available via BitCommercePackage
Provides a way for any package to perform actions moments before a payment is made
Provides a way for any package to perform actions moments after a successful payment is made