Socialbookmarking

The buzzword Web 2.0 summarizes all functions that improve interaction with the website visitor. This includes the division of social bookmarking offered on sites like http://del.icio.us/, http://www.mister-wong.de/ or http://www.technorati.com/ as a free internet service. To make it easy for the website user to bookmark your web page the module was created. The output of this module can be seen on the top of the page near the printer symbol.

1. Configuration

To use this module shipped with the release package at first no configured must be created. To include the module into a web page two configuration files must be adopted:

  • /APF/config/modules/socialbookmark/actions/{CONTEXT}/{ENVIRONMENT}_actionconfig.ini: The configuration file DEFAULT_actionconfig.ini contains the action definition for the actions used to deliver the bookmark images. This action reads the images stored in the folder /apps/modules/socialbookmark/pres/image and sends them to the browser. Please note that this application can only be included in front controller applications due to the fact that the deliverance of the images does not work otherwise. This configuration file must be copied to the folder /APF/config/modules/socialbookmark/actions/{CONTEXT}, where {CONTEXT} is the context of the present application. If the environment variable is set to a value different to DEFAULT the file must be renamed as well.
  • /APF/config/modules/socialbookmark/{CONTEXT}/{ENVIRONMENT}_bookmarkservices.ini: The file DEFAULT_bookmarkservices.ini contains the definitions of the bookmark services. Each service is defined in a seperate section that must contain the following values:
    APF template
    [Mr. Wong] BookmarkService.BaseURL = "http://www.mister-wong.de/index.php?action=addurl" BookmarkService.Param.URL = "bm_url" BookmarkService.Param.Title = "bm_description" BookmarkService.Display.Title = "Bookmark @ Mr. Wong" BookmarkService.Display.Image = "bookmark_mister_wong" BookmarkService.Display.ImageExt = "png"
    This configuration file must be copied to the folder /APF/config/modules/socialbookmark/{CONTEXT}, where {CONTEXT} is the context of the present application. If the environment variable is set to a value different to DEFAULT the file must be renamed as well.

More configuration files are not necessary.

2. Usage

There are two flavours to display the previously configured bookmark services: usage of the SocialBookmarkBarManager or the taglib. The SocialBookmarkBarManager must be created as a service object.

PHP code
$bm = &$this->getServiceObject('APF\modules\socialbookmark\biz\SocialBookmarkBarManager'); $bm->setImageWidth($this->getAttributes('width')); $bm->setImageHeight($this->getAttributes('height')); $bm->setUrl($this->getAttribute('url')); $bm->setTitle($this->getAttribute('title')); return $bm->getBookmarkCode();

Dealing with the taglib is more easy. This tag needs to have the attributes width and height. To use the tag it must be announced using the <core:addtaglib /> directive:

APF template
<core:addtaglib class="APF\modules\socialbookmark\pres\taglib\SocialBookmarkBarTag" prefix="social" name="bookmark" /> <social:bookmark [width=""] [height=""] [url=""] [title=""] [target=""] />

Comments

Do you want to add a comment to the article above, or do you want to post additional hints? So please click here. Comments already posted can be found below.
There are no comments belonging to this article.