sábado, 23 de julio de 2011

Liferay

API: http://docs.liferay.com/portal/6.0/javadocs/

Liferay supports 5 different types of plugins out-of-the-box. They are:

Portlets
Themes
Layout
Templates
Webs
Hooks

REGISTRAR VARIOS USUARIOS -HOOK
http://www.apuntesdejava.com/2010/09/liferay-registrando-varios-usuarios.html

LIFERAY Y VAADIN MULTIPLE SESSIONS
https://vaadin.com/forum/-/message_boards/view_message/943637

SESSION SHARING
http://longgoldenears.blogspot.com/2008/03/liferay-session-sharing-demystified.html

http://www.liferay.com/es/community/wiki/-/wiki/Main/Session+Sharing

¿Qué es Liferay Sync?

Liferay Sync es una herramienta diseñada para Liferay Portal 6.1 CE y EE que permite a sus usuarios publicar y acceder a documentos y archivos desde diferentes dispositivos, incluyendo entornos de escritorio Windows y Mac OS, y plataformas móviles basadas en iOS. Cuando un usuario añade o modifica un documento, Liferay Sync es capaz de sincronizar ese archivo con otros dispositivos que trabajen en las diferentes plataformas soportadas, posibilitando su visualización o su modificación desde esos entornos de forma nativa. Liferay Sync se integra totalmente con Liferay Portal, lo que permite aprovechar sus características avanzadas de autenticación, control de versiones, flujo de aprobaciones y herramientas de colaboración social desde cada uno de los entornos soportados. Liferay Sync ofrece la posibilidad de acceder a documentos aún estando sin conexión, encargándose de su sincronización automática una vez la conexión ha sido reestablecida.



EJB APPLICATION

http://somosunosbarbaros.blogspot.com/2009/10/acceder-desde-una-aplicacion-swing-ejb3.html

Web Services
http://www.liferay.com/es/community/wiki/-/wiki/Main/Web+Service+samples

CAS
http://translate.google.com.co/translate?hl=es&langpair=en%7Ces&u=http://blog.csdn.net/dl88250/article/details/2794943

Integración BD con excel

There is no API available. But you can do it via coding. You just have to create a small portlet which reads rows of sheet in which details are there and insert using Liferay's API. The API method is UserLocalServiceUtil.addUser( )

For reading the excel sheet you can make use of POI or JExcel.

Inserción de datos por medio del API

Since, you are fetching data from an external system, you can use Liferay API to create users.
This way, you will not be required to write SQL statements, no password security concern and no need to know what all tables are involved.

UserLocalServiceUtil.addUser() -- takes in individual parameters, a very long list
UserLocalServiceUtil.addUser() -- takes in User object

UserService servicio = UserServiceUtil.getService ();
service.getUserById (identificador de usuario);

If you look at the database table users_ or at service.xml file, you can find which fields are unique. Off the top of my head, userId, screen name and email address are unique.

Have you looked at the methods in UserLocalServiceUtil?
Check if a method is returning a User object or a List. It seems it's companyId + screenName that's unique.
(companyId can be thought of as Liferay instance.)

e.g.
public static com.liferay.portal.model.User getUserByContactId(
long contactId)

public static com.liferay.portal.model.User getUserByEmailAddress(
long companyId, java.lang.String emailAddress)

public static com.liferay.portal.model.User getUserByFacebookId(
long companyId, long facebookId)

public static com.liferay.portal.model.User getUserById(long companyId,
long userId)

public static com.liferay.portal.model.User getUserByScreenName(
long companyId, java.lang.String screenName)

UserLocalServiceUtil.search(companyId, firstName, middleName, lastName, screenName, emailAddress, active, params, andSearch, start, end, sort)

UserLocalServiceUtil.searchCount(companyId, firstName, middleName, lastName, screenName, emailAddress, active, params, andSearch)

I thought that the search or the searchCount methods would give me results which would help me identify whether the user I am going to insert exists already in Liferay database or not.

-----------------------------------------------------------------------

You don't need a DynamicQuery. These are the methods you are looking for in the classes that Dirk points out:

long[] UserServiceUtil.getRoleUserIds(long roleId)

or

long[] UserLocalServiceUtil.getRoleUserIds(long roleId)
List<User> UserLocalServiceUtil.getRoleUsers(long roleId)

Remember that the methods in the classes XXXLocalServiceUtil are not checking the permissions of the current user.

EDIT: If you are looking for all users with a given role within a given community:

long companyId= _X_; //Perhaps CompanyThreadLocal.getCompanyId() if you don't have it anywhere else?
Role role=RoleLocalServiceUtil.getRole(companyId, "Example Role");
Group group=GroupLocalServiceUtil.getGroup(companyId, "Example Community");
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.
getUserGroupRolesByGroupAndRole
(groupId, role.getRoleId());
for(UserGroupRole userGroupRole:userGroupRoles){
User oneUser=userGroupRole.getUser();
}





Inserción de datos por medio de Web Services

You can use Liferay's web services to insert users. This approach has been taken by many users.

Please see the Liferay Portal Administrator's Guide, pp 244-247 for instructions on accessing Liferay's web services. You can generate a client from the WSDL very easily using any modern IDE (I've done it on both Eclipse and NetBeans) or Apache's wsdl2java utility. From there, just call the web service via a batch process whenever you want to insert a user.


Referencias
http://www.liferay.com/es/community/forums/-/message_boards/message/2625709
http://www.liferay.com/es/web/francisco.fernandez/blog

No hay comentarios: