Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 68 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
68
Dung lượng
820,2 KB
Nội dung
Chapter 7 [ 389 ] 6. Press the Select Tags button or input tag and press the Add Tags button if you need to add tags. Alternatively, you can search tags by clicking on the Suggestions button. 7. Click on the Save button. Then you can view the bookmarks under the folder with the entry name, URL, a number of visits, priority, and the Actions button with a set of actions such as Edit, Permissions, and Delete. Note that when editing an entry, you would be able to change the folder, either by selecting another folder or by removing the current folder. Conguration In short, the Bookmarks portlet provides a way for users to store the names and URLs of websites. After a bookmark is created, you can click on the link to open the site in a new browser window. To view recent entries, you can simply click on the Recent Entries tab. Similarly, to view entries that you have created, simply click on the My Entries tab. The bookmarks will appear with the entry name, URL, number of visits, number of priority, modied date, and the Actions button with a set of action icons such as Edit, Permissions, and Delete. More interestingly, the number of visits will be updated dynamically when the site has been visited through the URL link in the Bookmarks portlet. Assigning permissions There are four levels of permission actions in the portlet Bookmarks: Permissions on the portlet, permissions on bookmarks, permission on folders, and permissions on entries. The following table shows permissions on the portlet Bookmarks. The role Community Member is set up with all the permissions (marked as 'X'): View, Conguration, and Access in Control Panel, while the role Guest is set up with the permission action View. By default, the roles Community Member has the permission action View (marked as '*') as well as those of the role Guest. Action Description Community Guest View Ability to view the portlet X, * X, * Conguration Ability to congure the portlet X Access in Control panel Ability to access the portlet in the Control Panel X Roll Out to Other Teams [ 390 ] The following table shows permissions on bookmarks. The role Community Member has the ability to set up the permission (marked as 'X'): Add Entry and Add Folder. These permission actions are unsupported for the role Guest. Action Description Community Guest Add Entry Ability to add Bookmark entry X Add Folder Ability to add Bookmark folder X The following table shows permissions on folders. The role Community Member has the ability to set up permissions (marked as 'X'): Access, Add Entry, Add Sub Folder, View, Permissions, Update, and Delete. The permissions actions Add Entry, Add Sub Folder, and Update are unsupported for the role Guest. By default, the roles Community Member has the permission actions View and Add Entry (marked as '*'), while the role Guest only has the permission action View. Action Description Community Guest Access Ability to access bookmarks folders X X Add Entry Ability to add a Bookmark entry X,* Add Sub Folder Ability to add a Bookmark sub folder X View Ability to add Bookmark folders X,* X,* Permissions Ability to assign permissions on Bookmark folders X X Update Ability to update the Bookmarks folders X Delete Ability to delete the Bookmarks folders X X The following table shows permissions on entries. The role Community Member may set up all permissions (marked as 'X'): View, Update, Permissions, and Delete, while the role Guest may set up the permission View. By default, the roles Community Member and Guest have the permission action View (marked as '*'). Action Description Community Guest View Ability to add Bookmark entries X,* X,* Permissions Ability to assign permissions on Bookmark entries X Update Ability to update Bookmarks entries X Delete Ability to delete Bookmarks entries X Note that you would able to assign permissions on an individual entry or on all entries scoped into the portal instance and groups. Denitely, permissions would be assigned via the roles–regular roles, community roles, or organization roles. Chapter 7 [ 391 ] What's happening? As you can see, the portlet Bookmarks denes a set of folders to hold entries, as shown in following gure. Each folder can have many sub folders. Thus the folders form a hierarchy. Each folder can have many entries. Each entry can have one URL and zero to one comment. More interestingly, entries can be classied by categories, entries can have many tags associated–thus end users can group entries in their own way. The portal has default settings for the portlet Bookmarks in the following le $PORTAL_ROOT_HOME/WEB-INF/liferay-portlet.xml which is as shown next: <indexer-class>com.liferay.portlet.bookmarks.util.BookmarksIndexer</ indexer-class> <open-search-class>com.liferay.portlet.bookmarks.util. BookmarksOpenSearchImpl</open-search-class> <portlet-data-handler-class>com.liferay.portlet.bookmarks.lar. BookmarksPortletDataHandlerImpl</portlet-data-handler-class> <control-panel-entry-category>content</control-panel-entry-category> <control-panel-entry-weight>4.0</control-panel-entry-weight> <asset-renderer-factory>com.liferay.portlet.bookmarks.asset. BookmarksEntryAssetRendererFactory</asset-renderer-factory> The preceding code shows that the portlet Bookmarks will appear in the category Content of the Control Panel, position 4. The framework via the tag asset- renderer-factory allows registering custom asset types so that generic portlets like Asset Publisher can be used to publish them. Thus we could publish bookmark entries through the Asset Publisher portlet. Meanwhile, the tag indexer-class value is called to create or update a search index for the portlet Bookmarks, while the tag open-search-class is called to get search results in the Open-Search standard. The tag portlet-data-handler-class species export and import capabilities on bookmarks. Roll Out to Other Teams [ 392 ] Note that bookmarks content folders and entries are scoped into a group. This means that when portlets are added to a group, either public or private pages, they act as completely the same portlets. For instance, when the portlet Bookmarks is added to a page for example, "Home", of the Guest community, it will use the default scope. If you add the portlet Bookmarks to a second page, say "Welcome", it will show the same data as that of the rst page. When the portlet Bookmarks is added to a page, it will get scoped immediately into the group that the current page belongs to. You don't have the exibility to switch groups in this case. But this limitation could be solved through the Control Panel. In the Control Panel, you are able to switch the content of the portlet Bookmarks to different groups. Directory portlet The directory portlet provides the ability to display a list of users registered on the portal. The directory portlet displays personal information for individual users and also gives listings of available organizations and user groups. You can nd users by basic search. You just input the search criteria and click on the Search button. Similarly, you can nd users by an advanced search, for example, First Name, Middle Name, Last Name, Screen Name, and Email Address. You just click on the Advanced link rst, and then input search criteria for the advanced search, and then click on the Search button. Moreover, you can nd users by available organizations as well as that of user groups. • Users: Finding users by basic search and advanced search. • Organizations: Viewing users who are members of organizations; nding organizations by basic search and advanced search. The inputs for advanced search include Name, Street, City, Zip, Type (Any, Regular Organization, Location), Country, and Region. • User Groups: Viewing users who are members of user groups, nding User Groups by basic search. Setup As you can see, the Directory portlet (portlet ID 11) allows us to view a list of users registered on the portal. Note that there are two permission actions Conguration and View on the portlet Directory being unsupported for the role Guest. It means the Guest user would be unable to view the portlet Directory. Therefore, make sure that the Directory portlet would be used by non-guest users. Chapter 7 [ 393 ] Invitation portlet The Invitation portlet allows us to invite friends to come and see our websites or portal pages. The following is a simple set of steps to invite friends by the Invitation portlet. 1. Locate a page "Home" of Guest community and go to Add | More under the dock bar menu. 2. Add the Invitation portlet in the page "Home" of the Guest community where you want to invite friends, if the portlet is not there. 3. Click on the Invite Friends link. 4. Enter up to 20 e-mail addresses of friends you would like to invite; enter one e-mail address per line. 5. Click on the Invite Friends button. Setup As you can see, the Invitation portlet (portlet ID 100) allows us to invite friends to come and see our websites or portal pages. To change the e-mail setup, simply click on the More | Conguration | Setup | Current icon at the top-right of the portlet. To manage setup archives, simply click on the More | Conguration | Setup | Archived icon at the top-right of the portlet. Of course, you would be able to set permissions to what users can access. To do so, simply click on the More | Conguration | Permissions icon at the top-right of the portlet. To share the portlet, simply click on the More | Conguration | Sharing icon at the top-right of the portlet. Note that there are two permission actions (Conguration and View) on the portlet Invitation, which are supported for the role Guest, and the permission View was assigned to both the role Community Member and Guest. Therefore, the Guest user could be able to view the portlet Invitation. What's happening? The number of e-mail addresses of friends you would like to invite is congurable, since the portal has set the following property in portal.properties. invitation.email.max.recipients=20 invitation.email.message.body=com/liferay/portlet/invitation/ dependencies/email_message_body.tmpl invitation.email.message.subject=com/liferay/portlet/invitation/ dependencies/email_message_subject.tmpl Roll Out to Other Teams [ 394 ] Of course, you can change the number of recipient and override this property in portal-ext.properties. E-mail notication settings for invitation are congurable. As you can see, the subject and body of the message are specied as TMPL les. Obviously, you could customize these setting via overriding TMPL les in portal- ext.properties . By the way, you can congure the same via the web UI at More | Conguration | Setup | Current. Summary This chapter rst introduced communities portlet, mentioned how to add a community, and how to manage (edit, delete, search, join, leave) communities and teams. Then it discussed how to add and manage the pages and users within a community, how to assign permissions on communities, and how to show what's different between an organization and a community. How to employ community virtual hosting is also introduced. Furthermore, it discussed how to use stage, preview, and publish websites, and managed staging workow. Scheduling and remote publishing were also addressed in detail. Finally, it introduced how to use community tools; for example, my communities, bookmarks, invitations, directories, and so on. In the next chapter, we're going to introduce CMS and WCM. CMS and WCM In the intranet website "bookpub.com" of the enterprise "Palm Tree Publications", we have to manage a huge number of images and documents, a lot of web content called Journal articles, and much more, to publish web content. This task can be made easier with a Content Management System (CMS) and Web Content Management (WCM). In fact, WCM is a kind of CMS. A CMS includes a set of portlets—Document Library and Image Gallery—to aggregate and manage images and documents. WCM includes the Web Content Management portlet to create and publish articles, as well as article templates and structures; the Web Content Display portlet to publish an article, the Web Content List portlet to display a dynamic list of all the journal articles for a given community, the Asset Publisher portlet to publish any piece of content, the Nested Portlets to drag-and-drop portlets into other portlets, XSL content portlet, and much more. This chapter will rst introduce you to managing and publishing images. Then it will discuss how to manage and publish documents. Finally, it will focus on web content called articles creation, management, and publishing. By the end of this chapter, you will have learned how to: • Manage folders and images in Image Gallery • Assign permissions on folders and images • Manage folders and documents in Document Library • Assign permissions on folders and documents • Publish documents • Manage structures, templates, feeds, and web content in Web Content Management • Assign permissions on articles, templates, structures, and feeds • Publish web content • Employ other WCM tools CMS and WCM [ 396 ] The Image Gallery portlet In order to let small teams manage web content and publish web content easily, we should rst use web content. Before creating web content, we have to prepare a set of images and documents. Let's take a look at managing images rst. The portlet Image Gallery provides the ability to manage your images and organize them in folders. The images can also be accessed and uploaded using WebDAV. The portlet can be found in the Control Panel under the section Content or also placed in a page. First of all, let's use the Image Gallery portlet in a page. As an administrator of the enterprise "Palm Tree Publications", you may create a page called CMS at the Guest Community and then add the Image Gallery portlet in the page CMS. Furthermore, you may create folders such as "Home" and "Liferay" and sub-folders, for example, "Book", in order to hold a set of images. At the same time, you need to group all images into different folders to make your task easy-to-use and easy-to-manage. Managing folders First of all, we need to create a folder called "Home", which contains a number of images. Let's do it as follows: 1. Log in as an Admin rst, then go to Go To | liferay.com under the dock bar menu. 2. Go to Add | Page under the dock bar menu, and add a page called CMS at the Guest community private pages if the page is not there. 3. Go to Add | More…, and add the Image Gallery portlet in the page CMS of the Guest community where you want to manage images, if the Image Gallery portlet is not there. 4. Click on the Add Folder button. Chapter 8 [ 397 ] 5. Enter the name "Home" and the description "Images folder for Guest community". 6. Set Permissions by clicking on the Congure link. To congure additional permissions, click the More link. Here we just use default settings. By default, the checkbox Public is disabled. 7. Click on the Save button to save the inputs, or click on the Cancel button to discard the inputs. Adding sub-folders Let's say that we need to create a sub-folder named "Book" under the folder "Home", where it will contain a set of images for "Liferay Books". Let's do it by following these steps: 1. Locate the folder "Home", click on the link of the folder "Home", for example, the name. 2. Click on the Add Subfolder button. 3. Enter the name for example, "Book" and the description for example, "Images folder for books". 4. Set Permissions by clicking on the Congure link. To congure additional permissions, click on the More link. Here we just use default settings. By default, the checkbox Public is disabled. 5. Click on the Save button to save the inputs. Of course, you can create other folders as siblings of the folder "Home". After adding a folder "Liferay", you would be able to view folders, as shown in following screenshot. First, go back to the root by clicking on the CMS link located in the breadcrumbs. The folders are displayed with the columns: Folder, Number of Folders, Number of Images and the Actions button with a set of icons: Edit, Permissions, Delete, Add Subfolder, Add Image, and Access from my desktop. CMS and WCM [ 398 ] Obviously all folders' or sub-folders' names form a folder tree. The names of folders or sub-folders must be unique at the same level in the folder tree. However, the names can be the same at different levels. As you can see, the right-side box shows the current folder, that is, the root in this case, with the name Image Home plus the presentation icon folder_empty.png if the folder is empty or folder_full_image.png if the folder isn't empty, and a set of action icons, for example, Permissions, Add Folder, Add Image, and Access from My Desktop. Note that you would be able to nd the icons folder_empty.png and folder_full_image.png at $PORTAL_ROOT_HOME/html/ themes/${theme.name}/images/file_system/large; where ${theme.name} should be classic, control_panel, and any custom themes. Updating folders Folders and sub-folders are editable. For example, you may need to change the description of the folder "Liferay" from "Images Folder for Liferay" to "Images Folder for Integration". Let's do it by following these steps: 1. Locate the folder, for example "Liferay", that you want to edit. 2. Click on Edit icon from the Actions button located next to the folder. 3. Maintain the value of the name and update the description of the selected folder "Images Folder for Liferay" with the value "Images Folder for Integration". 4. Click on the Save button to save the changes. Of course, you can update the name as well. For example, you can update the name "Liferay" with the value "Liferay-Integration". [...]... of portal- ext.properties image.hook.impl=com .liferay. portal. image.DLHook However, if you think that File System Hook is much better, you could add the following line at the end of portal- ext.properties image.hook.impl=com .liferay. portal. image.FileSystemHook When using File System Hook, the default file system root directory was set as follows in portal. properties image.hook.file.system.root.dir=$ {liferay. home}/data/images... 16M, add the following lines in the options file [mysqld] max_allowed_packet=16M [ 409 ] CMS and WCM Customizing default images By the way, there are a set of default images you may want to override Of course, you would be able to customize the portal in many ways without involving any Java code image.default.spacer=com /liferay/ portal/ dependencies/spacer.gif image.default.company.logo=com /liferay/ portal/ dependencies/company_... property com liferay. portal. upload.UploadServletRequestImpl.max.size, default value 10485 76 0 0=1024*1024*100 The property ig.image.extensions sets image file extensions A file extension of * will permit all file extensions The property ig.image.thumbnail.max.dimension sets the maximum thumbnail height and width in pixels [ 4 06 ] Chapter 8 Of course, you can override the preceding properties in portal- ext.properties... image.default.company.logo=com /liferay/ portal/ dependencies/company_ logo.png image.default.organization.logo=com /liferay/ portal/ dependencies/ organization_logo.png image.default.user.female.portrait=com /liferay/ portal/ dependencies/ user_female_portrait.png image.default.user.male.portrait=com /liferay/ portal/ dependencies/user_ male_portrait.png As shown in the preceding code, the property image.default.spacer... images Let's say that you are going to add documents " 470 1_01_3rdDraft pdf" and " 470 1_01_3rdDraft.doc" under the folder "Books" Let's do it by following these steps: 1 Locate the folder "Books", click on the link of the folder "Books",that is, the name 2 Click on the Add Document icon 3 Click on the Browse icon to find files 470 1_01_3rdDraft .pdf and 470 1_01_3rdDraft.doc 4 Click on the Upload Files icon... ${class.path} equal to /com /liferay/ portal/ dependencies under the folder $PORTAL_ ROOT_HOME/WEB_INF/classes first, and then put customized images as the same image filename in the class path ${class.path} • Override properties with a class path ${class.path} plus customized image file names in portal- ext.properties first, and then create the class path ${class.path} under the folder $PORTAL_ ROOT_HOME/WEB_INF/classes... (portlet ID 31) has specified $PORTAL_ ROOT_HOME/WEB-INF /liferay- portlet.xml WebDAV-related tags as follows: image_gallery com .liferay. portlet.imagegallery.webdav IGWebDAVStorageImpl Similarly, the portlet Web Content (portlet ID 20) has specified WebDAV-related tags in $PORTAL_ ROOT_HOME/WEB-INF /liferay- portlet.xml as... images in the database, and it also stores the content of images in the database Why you ask? The portal has used Database Hook by default in portal. properties image.hook.impl=com .liferay. portal. image.DatabaseHook The preceding code shows that the content of images would be hooked via the database The portal will use this to persist for images Besides Database Hook, there are another two hooks available... path ${class.path} equal to /com /liferay/ portal/ dependencies under the folder $PORTAL_ ROOT_ HOME/WEB_INF/classes, copy PalmTree_logo.png to ${class.path}, and rename PalmTree_logo.png to company_logo.png [ 410 ] Chapter 8 For the second option, let's say that the class path ${class.path} is equal to com/ ext/dependencies/, you could add the following line at the end of portal- ext properties, create the... data of the same portlet How to customize the scope feature? The portal has default settings for the portlet Image Gallery as follows in $PORTAL_ ROOT_HOME/WEB-INF /liferay- portlet.xml content 3.0 com .liferay. portlet.imagegallery.asset IGImageAssetRendererFactory . way. The portal has default settings for the portlet Bookmarks in the following le $PORTAL_ ROOT_HOME/WEB-INF /liferay- portlet.xml which is as shown next: <indexer-class>com .liferay. portlet.bookmarks.util.BookmarksIndexer</ indexer-class> <open-search-class>com .liferay. portlet.bookmarks.util. BookmarksOpenSearchImpl</open-search-class> <portlet-data-handler-class>com .liferay. portlet.bookmarks.lar. BookmarksPortletDataHandlerImpl</portlet-data-handler-class> <control-panel-entry-category>content</control-panel-entry-category> <control-panel-entry-weight>4.0</control-panel-entry-weight> <asset-renderer-factory>com .liferay. portlet.bookmarks.asset. BookmarksEntryAssetRendererFactory</asset-renderer-factory> The. image and document) allowed is set in the property com. liferay. portal. upload.UploadServletRequestImpl.max.size , default value 10485 76 0 0=1024*1024*100. The property ig.image.extensions sets. invite is congurable, since the portal has set the following property in portal. properties. invitation.email.max.recipients=20 invitation.email.message.body=com /liferay/ portlet/invitation/ dependencies/email_message_body.tmpl invitation.email.message.subject=com /liferay/ portlet/invitation/ dependencies/email_message_subject.tmpl Roll