History of LibertyServices
Version 8
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.
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.
For detailed instruction on how to create a Liberty Service, please read: CreatingServices
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.
content_load_sql_function
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 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.
content_preview_function
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.
content_edit_function
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).
content_store_function
Here you can store the content data in your serice tables.
content_expunge_function
Make sure the data from your tables is removed when a user removes the content it belongs to.
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.
content_edit_mini_tpl
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.
content_view_tpl
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.
content_nav_tpl
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.
content_icon_tpl
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.
content_body_tpl
insert a small template into the top of the
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.
For detailed instruction on how to create a Liberty Service, please read: CreatingServices
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:Sql Extensions
content_list_sql_functionAllows 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.
content_load_sql_function
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.
Functions
content_display_functionThis 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.
content_preview_function
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.
content_edit_function
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).
content_store_function
Here you can store the content data in your serice tables.
content_expunge_function
Make sure the data from your tables is removed when a user removes the content it belongs to.
Templates
content_edit_tab_tplThis 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.
content_edit_mini_tpl
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.
content_view_tpl
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.
content_nav_tpl
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.
content_icon_tpl
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.
content_body_tpl
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.
commerce_pre_purchase_function
Provides a way for any package to perform actions moments before a payment is made
commerce_post_purchase_function
Provides a way for any package to perform actions moments after a successful payment is made
Commerce Functions
This are made available via BitCommercePackagecommerce_pre_purchase_function
Provides a way for any package to perform actions moments before a payment is made
commerce_post_purchase_function
Provides a way for any package to perform actions moments after a successful payment is made