added methos for getting setting Sites Custom Attributes
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vo-management/usermanagement-core@125626 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5a6d648905
commit
9a646d8ac5
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.vomanagement.usermanagement;
|
package org.gcube.vomanagement.usermanagement;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -159,5 +160,19 @@ public interface GroupManager {
|
||||||
* @throws GroupRetrievalFault
|
* @throws GroupRetrievalFault
|
||||||
*/
|
*/
|
||||||
Boolean isVRE(long groupId) throws UserManagementSystemException, GroupRetrievalFault;
|
Boolean isVRE(long groupId) throws UserManagementSystemException, GroupRetrievalFault;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param groupId the LR groupId
|
||||||
|
* @param attributeKey the name of the attribute you want to read its value
|
||||||
|
* @return the attributeKey value if existing, null otherwise
|
||||||
|
*/
|
||||||
|
Serializable readCustomAttr(long groupId, String attributeKey) throws GroupRetrievalFault;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param groupId
|
||||||
|
* @param attributeKey the name of the attribute you want to save
|
||||||
|
* @param value the value
|
||||||
|
* @throws GroupRetrievalFault
|
||||||
|
*/
|
||||||
|
void saveCustomAttr(long groupId, String attributeKey, Serializable value) throws GroupRetrievalFault;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.vomanagement.usermanagement.impl;
|
package org.gcube.vomanagement.usermanagement.impl;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -361,6 +362,37 @@ public class LiferayGroupManager implements GroupManager {
|
||||||
public String getScope(long groupId) throws UserManagementSystemException, GroupRetrievalFault {
|
public String getScope(long groupId) throws UserManagementSystemException, GroupRetrievalFault {
|
||||||
return getInfrastructureScope(groupId);
|
return getInfrastructureScope(groupId);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Serializable readCustomAttr(long groupId, String attributeKey) throws GroupRetrievalFault {
|
||||||
|
try {
|
||||||
|
Group g = GroupLocalServiceUtil.getGroup(groupId);
|
||||||
|
if (g.getExpandoBridge().hasAttribute(attributeKey)) {
|
||||||
|
g.getExpandoBridge().getAttribute(attributeKey);
|
||||||
|
} else
|
||||||
|
return null;
|
||||||
|
} catch (PortalException e1) {
|
||||||
|
throw new GroupRetrievalFault("Group not existing (I think you better check)", e1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void saveCustomAttr(long groupId, String attributeKey, Serializable value) throws GroupRetrievalFault {
|
||||||
|
try {
|
||||||
|
Group g = GroupLocalServiceUtil.getGroup(groupId);
|
||||||
|
g.getExpandoBridge().setAttribute(attributeKey, value);
|
||||||
|
} catch (PortalException e1) {
|
||||||
|
throw new GroupRetrievalFault("Group not existing (I think you better check)", e1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue