Liferay's objects are being encapsulated into assets (documents, web contents, blog entries are being encapsulated in the new asset concept) and it allows the portal objects to be treated in a consistent way.
There are several portlets that are designed to work with this kind of objects and you may be interested in doing this with your custom objects.
I have been working with the Calendar Events to add this functionallity for Liferay 6.0, and this blog entry is the result of that experience. This will allow us to tag and categorize calendar events, so that we can search them much easier, create them not only from the calendar but from the asset publisher and track the creation from several places.
If you have created a custom object (for example "school_teacher") and you want to convert it into an asset, these are the steps to follow:
In YourObjectLocalServiceImpl.java, in every CRUD (create, read, update and delete) method, add a call to its respective asset method through the assetEntryLocalService object
BlogsEntryLocalServiceImpl example:
public void deleteEntry(BlogsEntry entry) throws PortalException, SystemException {
[...]
// Asset
assetEntryLocalService.deleteEntry( BlogsEntry.class.getName(), entry.getEntryId());
[...]
}
To make your content available in the Asset Publisher Portlet you have to follow these steps
Create the following classes:
YourObjectAssetRendererFactory (extends BaseAssetRendererFactory)
YourObjectAssetRenderer (extends BaseAssetRenderer)
In liferay-portlet.xml add this line to your portlet:
<asset-renderer-factory>com.liferay.portlet.your_portlet.YourObjectAssetRendererFactory</asset-renderer-factory>
In portal-web/yourPortlet create /asset/full_content.jsp with the content you want to see in Asset Publisher
And that's all! :)
Regards
Juan Fernández
[Update]
[/Update]