Portal 2.0: Bringing Social, Web 2.0 and SOA together for the Enterprise

feelingmomInternet και Εφαρμογές Web

7 Δεκ 2013 (πριν από 3 χρόνια και 11 μήνες)

69 εμφανίσεις

Portal 2.0: Bringing Social, Web 2.0
and SOA together for the Enterprise
Thursday, April 9, 2009
Part One:
Overview
Built-in Collaboration Suite
Liferay Collaboration brings the best collaboration tools together in a single package with all
the benefits of Liferay’s group workspaces, including roles, permissions, page
management, and social computing features.
Message Boards, Blogs, Wikis
WebMail
Shared Calendars
Enterprise Chat
RSS Feeds
Tagging, Ratings, Comments
Building on a Tradition of Value
See
developer.cisco.com
,
www.webjunction.org
,
click.lavalife.com
Built-in Social Computing and Mashups
Liferay includes tools to help enterprises create functional social networks and easily deploy
widgets and mashups to meet business needs.
Build a
social network
for your enterprise with a single
plugin.
Find
knowledge and expertise
in your organization with
profiles.
Familiar social features: Friend List, Facebook-style Wall,
and Activity Tracker.
The
Activity Tracker API
makes it easy to integrate third
party portlets and applications.
Integrated
instant messaging

and presence for
compliance

persists across all pages.
Publish Liferay portlets to
Facebook, Myspace, iGoogle

or any website.
Building on a Tradition of Value
See
www.miniunited.com
,
www.thecradle.com
,
www.pjoon.com
Part Two:
Liferay’s Social Networking API
SocialActivity
A SocialActivity is any discrete action a user took that others might want to know
about. Out of the box, Liferay tracks:
Liferay Portal:
Blog Entries
Message Board posts
Calendar event creation
Wiki page edits
Adding of Friends
Document Library actions
Liferay Social Networking API
“World of Liferay” adds:
Wall posts
JIRA activity
SVN activity
SocialActivity
SocialActivityLocalService.addActivity()
Call the
addActivity()
method from within the business logic that generates the activity. This
simply adds an activity entry to the activities table. For example, in
BlogsEntryLocalServiceImpl.java
:
package com.liferay.portlet.blogs.service.impl;
...
public class BlogsEntryLocalServiceImpl ... {
public BlogsEntry addEntry(
...
// Social
if (!draft) {
socialActivityLocalService.addActivity(
userId, groupId, BlogsEntry.class.getName(), entryId,
BlogsActivityKeys.ADD_ENTRY, StringPool.BLANK, 0);
}
...
}
...
}
Liferay Social Networking API
SocialActivity
SocialActivityLocalService.addActivity()
public SocialActivity addActivity(
!
long userId:
the userId of the activity doer
!
long groupId:

the groupId (community or organization) of the activity doer
!
String className:
qualifies the type of the activity (to allow for specific interpretation)
!
long classPK:
identifies the object associated with this activity; e.g., the blog entry added
!
int type:
allows for multiple types of activity within a class; e.g. Blogs: addEntry or addComment
!
String extraData:
catch-all field for providing extra data to the interpreter; e.g. commentId
!
long receiverUserId:
the userId of the recipient of the activity; e.g., friend added
)
Liferay Social Networking API
SocialActivityInterpreter
SocialActivityInterpreterLocalServiceUtil.interpret()
Call the
interpret()
method over a Collection of activities to display them. For example, in the
social-activities
taglib (portal-web/docroot/html/taglib/ui/social_activities/page.jsp):
...
for (SocialActivity activity : activities) {
SocialActivityFeedEntry activityFeedEntry
= SocialActivityInterpreterLocalServiceUtil.interpret(activity, themeDisplay);
...
<td>
<%= activityFeedEntry.getTitle() %>
<%= timeFormatDate.format(activity.getCreateDate()) %>
</td>
...
<td>
<%= activityFeedEntry.getBody() %>
</td>
...
Liferay Social Networking API
SocialActivityInterpreter
{Custom}ActivityInterpreter
Create a custom *ActivityInterpreter class to determine how your activity will be displayed.
For example, in
BlogsActivityInterpreter.java
:
package com.liferay.portlet.blogs.social;
...
public class BlogsActivityInterpreter
extends BaseSocialActivityInterpreter
{
protected SocialActivityFeedEntry
doInterpret
(
SocialActivity activity, ThemeDisplay themeDisplay) ... {
...
// Check permissions
if (!BlogsEntryPermission.contains(
permissionChecker, activity.getClassPK(), ActionKeys.VIEW)) {
return null;
}
// Get userIds; Create Link, Activity Title, Body, etc.
}
private static final String[] _CLASS_NAMES = new String[] {
BlogsEntry.class.getName()
};
}
Liferay Social Networking API
SocialActivityInterpreter
{Custom}ActivityInterpreter
You could also create:
!
SalesForceActivityInterpreter
!
SharePointActivityInterpreter
!
SAPActivityInterpreter
!
YourCustomOrLegacyAppActivityInterpreter
Liferay Social Networking API
Activities
Jane
completed a
nightly batch process
on
HAL9000
.
Yesterday at 4:23 PM
Bryan
closed a $40,000
Liferay Subscription
with
ABC
Company
.
March 7, 2009 at 10:13 AM
Matt
uploaded a new version of
Portal Pricing Sheet
to
Sales Community
.
March 7, 2009 at 8:07 AM
Matt
and
Bryan
are now friends.
March 7, 2009 at 10:13 AM
SocialRequest
SocialRequestLocalServiceUtil.addRequest()
A SocialRequest is similar to a SocialActivity, but requires action by the other party.
The basic example is a request for someone to add you as a friend. In this case, call
the addRequest() method.
For example, in the WOL (World of Liferay) Summary portlet, you can request a friend:
Liferay Social Networking API
package com.liferay.wol.summary.portlet;
...
public class SummaryPortlet extends JSPPortlet {
...
public void addFriend() {
SocialRequestLocalServiceUtil.addRequest(
themeDisplay.getUserId(), 0, User.class.getName(),
themeDisplay.getUserId(), FriendsRequestKeys.ADD_FRIEND,
StringPool.BLANK, user.getUserId());
...
}
...
}
SocialRequest
SocialRequestInterpreterLocalServiceUtil.interpret()
... and in the Requests portlet, you can interpret, and accept a friend request:
Liferay Social Networking API
...
<%
for (int i = 0; i < requests.size(); i++) {
SocialRequest socialRequest = requests.get(i);
SocialRequestFeedEntry requestFeedEntry =
SocialRequestInterpreterLocalServiceUtil.interpret(socialRequest, themeDisplay);
%>
...
<%= requestFeedEntry.
getTitle()
%>
...
<%= requestFeedEntry.
getBody()
%>
...
<%
portletURL.setParameter("status", String.valueOf(SocialRequestConstants.
STATUS_CONFIRM
));
%>
...
<%
portletURL.setParameter("status", String.valueOf(SocialRequestConstants.
STATUS_IGNORE
));
%>
SocialRequestInterpreter
{Custom}RequestInterpreter
Create a Custom *RequestInterpreter class to interpret custom requests.
For example,
FriendsRequestInterpreter.java
:
Liferay Social Networking API
package com.liferay.wol.friends.social;
...
public class FriendsRequestInterpreter extends
BaseSocialRequestInterpreter
{
protected SocialRequestFeedEntry
doInterpret
(...) {
// Do Request presentation processing
}
protected boolean
doProcessConfirmation
(...) {
SocialRelationLocalServiceUtil.
addRelation
(...);
SocialActivityLocalServiceUtil.
addActivity
(...);
}
private static final String[] _CLASS_NAMES = new String[] {
User.class.getName()
};
}
SocialRelation
A SocialRelation basically model relationships between two users. They can either be
bi-directional (friends, co-workers, group members, etc.) or uni-directional (child,
parent, boss, employee).
In our last example, doProcessConfirmation actually adds a SocialRelation:
Liferay Social Networking API
package com.liferay.wol.friends.social;
...
public class FriendsRequestInterpreter extends
BaseSocialRequestInterpreter
{
...
protected boolean
doProcessConfirmation
(...) {
SocialRelationLocalServiceUtil.addRelation(
request.getUserId(), request.getReceiverUserId(),
SocialRelationConstants.TYPE_BI_FRIEND);
...
}
...
}
SocialRelation
A SocialRelation can also be deleted by calling:
SocialRelationLocalServiceUtil.deleteRelation(
long userId1, long userId2, int type
);
Liferay Social Networking API
Part Three:
Mashups and Scripting
Easy Sharing / Mashups
Liferay > Facebook
Google Gadgets > Liferay
Liferay > Web page (JS Widget)
Liferay > iGoogle
XML / XSL > Liferay
iPhone Site > Liferay
Flickr > Liferay
Google Maps > Liferay
IFrame / Web Proxy
Mashups and Scripting
Scripting Languages
!
Velocity
!
Ruby (uses JRuby)
!
PHP (uses Quercus)
!
Python (uses Jython?)
!
Groovy
... and you can access Liferay Java
APIs through these languages!
So you could create Social Networking portlets using Liferay’s Social API and Ruby, for
example.
Mashups and Scripting
Replace java.rb in sample-ruby portlet with:
(Tested in LP5.2.3)
require 'java'
include_class 'com.liferay.portal.service.OrganizationServiceUtil'
include_class 'com.liferay.portal.service.UserLocalServiceUtil'
include_class 'com.liferay.portlet.social.service.SocialActivityLocalServiceUtil'
include_class 'com.liferay.portlet.social.model.SocialActivityFeedEntry'
include_class 'com.liferay.portlet.social.service.SocialActivityInterpreterLocalServiceUtil'
$renderResponse.setContentType "text/html"
out = $renderResponse.getPortletOutputStream
out.println """
<b>Invoking Liferay Services</b>
<br />
"""
if ($userInfo != nil)
userId = $userInfo['liferay.user.id'].to_i
activitiesCount = SocialActivityLocalServiceUtil.getUserActivitiesCount(userId)
organizations = OrganizationServiceUtil.getUserOrganizations(userId)
activities = SocialActivityLocalServiceUtil.getUserActivities(userId, 0, activitiesCount)

out.println "<h3>You belong to #{organizations.size} organizations:</h3><ul>"
organizations.each do |organization|
out.println "<li>Organization Name: #{organization.getName()}</li>"
end
out.println "</ul><h3>You have #{activities.size} activities:</h3><ul>"
themeDisplay = $renderRequest.getAttribute("THEME_DISPLAY")
activities.each do |activity|
activityFeedEntry = SocialActivityInterpreterLocalServiceUtil.interpret(activity, themeDisplay);
out.println "<li>#{activityFeedEntry.getTitle}<br/><a href='#{activityFeedEntry.getLink}'>#{activityFeedEntry.getBody}</a></li>"

end
out.println "</ul>"
elsif
out.println "You do not belong to any organizations."
end
out.println Custom.navigation
Mashups and Scripting
Part Four:
Why Developers Like to Use Liferay
for Enterprise Social Networks
Liferay goes beyond providing a superficial Javascript layer for social networking
Liferay processes on the server side for more robustness and scalability
Single HTTP request rather than multiple
Also automatically exposes to Javascript (portlet sharing and JSON services)
Specifically for Social Networking:
Liferay for Developers
Pervasive compatibility—Liferay runs on all major app servers, databases and
operating systems. Minimizes new spending on infrastructure.
Can run PHP, Ruby, Python, and more—protect training and skills investments.
Pre-integrated with leading open source offerings.
Liberal MIT license is very flexible toward business use.
Liferay uses what you already use:
Liferay for Developers
0
10000
20000
30000
40000
50000
60000
70000
 of Downloads*
03/02
03/03
03/04
03/05
03/06
09/06
09/07
09/08
Date
JBoss Portal
Liferay Portal
*statistics taken from SourceForge.net
In its 10th year of development, Liferay Portal is today’s
most popular and widely downloaded open source portal.
Over 2.2 Million downloads and 75,000
downloads per month
~66% of downloads – Liferay Portal
~33% of downloads – Liferay IDE & Plug-ins
Over 17,000 registered community members
Over 50 active volunteer contributors
Liferay for Developers
IBM / Oracle Comparison
Significant Savings
Customers that deployed Liferay Portal to production systems can
save

an average of
93%

in the first year over retail pricing for solutions from
IBM
®
and Oracle
®
.
Liferay offers a nimble approach to implementation to provide
short-term ROI without compromising long-term viability.
Phased agile approach
to development: add capability as needed with
immediate feedback
Liferay provides
direct access
to highest levels of product development team
Assets
can be quickly reused and deployed (e.g. WebEx community)
Sponsored development
reduces maintenance costs
Website
Website
Intranet
Website
Intranet
Website
Intranet
EAI
EAI
Collab
Collab
Social
EAI
Implementation Agility
Agile development
Flexible, Easy Integration
Pervasive compatibility
—Liferay runs on all major app servers,
databases and operating systems. Minimizes new spending on
infrastructure.
SOA Approach:

Portal services can be easily integrated into ESB
components and portal can easily integrate other non-portal services
deployed to the ESB
Compliance to
open standards
: Portlet 2.0 (member), JSR-170
(content), JBI (ESB), WSRP 1.0/2.0, JSR-88
“Useable Infrastructure”:
Built-in application capability with EAI
framework to expand
Granular security and role-based authorization
Unlike other portals that maintain a simplified role-based permissions scheme, Liferay allows for
granular
, role-based
authorizations. Portal administrators can assign individual users or groups of users different "roles" that grant varying
levels of access and editing rights to specific communities, files, applications and tools.
Built-in content tagging
Most pieces of content within the portal are treated as “assets” and can be tagged to help better group them together. This
includes blog entries, message board threads, and even web content. Admins can then optionally manage the tags within the
portal using the Tags Admin Portlet, or even publish specific types of assets based on the tags that they do or do not have
using the Asset Publisher Portlet.
RSS and email subscriptions
In many cases, Liferay allows users to either subscribe to RSS feeds or via email. This includes things as specific as message
board threads, user blogs, user activities, etc.
Liferay Portal - Features
Features
Application Scripts
Unlike other portlets that require development and deployment, Application Scripts enable users to create
applications on-the-fly.
Dynamic Datasets
By leveraging a framework called Expandos, Liferay provides a service that allows the creation of dynamic datasets
without any change to the database schema. This data can be:
typed (boolean, Date, double, int, long, short, String, and arrays of all those)
associated with a specific entity (e.g. 'com.liferay.portal.model.User')
arranged into any number of "columns"
available to plugins
accessed from Velocity templates
accessed via Liferay's JSON API through AJAX
Liferay Portal - Features
Features
Multi-tenancy
Liferay provides the ability to host multiple sites on one deployment of Liferay Portal. In fact, adding another
site is as simple as a few mouse-clicks and does
not
require additional deployments or the assistance of a
System Administrator. Each community or organization can have its own:
Virtual host
Set of users
Content
Pages
Look-and-feel
Roles
Liferay Portal - Features
Features
Industry Attention
Named a “Visionary” in Gartner’s Magic Quadrant for Portal
Products
InfoWorld’s Best of Open Source Software (2007, 2008)
EContent 100 (2006, 2007, 2008)
CIO 100 Award (Goodwill Industries)

Liferay Portal was by far the most cost effective and efficient portal technology we considered.

– Steve Bergman, CIO
Goodwill Industries International

There are a number of well-known open source portal solutions, including JBoss, Metadot, and MindTouch Deki.
But when looking for enterprise strength, Liferay Portal stands apart.”
InfoWorld 2008
Liferay for Developers
For more information, please contact:
Alice Cheng
Liferay, Inc.
prliferay.com
Property of Liferay, Inc.
Please do not distribute.
Thursday, April 9, 2009