JBoss Portal SVN: r5909 - in trunk: registration/src/main/org/jboss/portal/registration wsrp/src/main/org/jboss/portal/test/wsrp/framework wsrp/src/main/org/jboss/portal/wsrp/consumer
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-19 21:25:10 -0500 (Tue, 19 Dec 2006)
New Revision: 5909
Modified:
trunk/registration/src/main/org/jboss/portal/registration/InvalidConsumerDataException.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
Log:
- Re-wrote (again) registration handling in Consumer. Should be good now.
- Implemented clone, destroy and getPortletProperties. Still need to implement setProperties. NOT TESTED AT ALL!!!
- Updated test producer to return a RegistrationContext on register. This needs to be fixed as well.
Modified: trunk/registration/src/main/org/jboss/portal/registration/InvalidConsumerDataException.java
===================================================================
--- trunk/registration/src/main/org/jboss/portal/registration/InvalidConsumerDataException.java 2006-12-20 00:56:54 UTC (rev 5908)
+++ trunk/registration/src/main/org/jboss/portal/registration/InvalidConsumerDataException.java 2006-12-20 02:25:10 UTC (rev 5909)
@@ -30,4 +30,23 @@
*/
public class InvalidConsumerDataException extends RegistrationException
{
+
+ public InvalidConsumerDataException()
+ {
+ }
+
+ public InvalidConsumerDataException(String message)
+ {
+ super(message);
+ }
+
+ public InvalidConsumerDataException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public InvalidConsumerDataException(Throwable cause)
+ {
+ super(cause);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2006-12-20 00:56:54 UTC (rev 5908)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2006-12-20 02:25:10 UTC (rev 5909)
@@ -31,6 +31,7 @@
import org.jboss.portal.test.wsrp.v1.consumer.behaviors.NullMarkupBehavior;
import org.jboss.portal.test.wsrp.v1.consumer.behaviors.SessionMarkupBehavior;
import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.ClonePortlet;
@@ -281,7 +282,7 @@
public RegistrationContext register(RegistrationData register) throws MissingParametersFault, OperationFailedFault, RemoteException
{
incrementBehaviorCallCount();
- return null;
+ return WSRPTypeFactory.createRegistrationContext("registration");
}
public ReturnAny deregister(RegistrationContext deregister) throws OperationFailedFault, InvalidRegistrationFault, RemoteException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2006-12-20 00:56:54 UTC (rev 5908)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2006-12-20 02:25:10 UTC (rev 5909)
@@ -94,7 +94,7 @@
}
protected Object performRequest(Object request, PortletInvocation invocation)
- throws ServiceDescriptionUnavailableException
+ throws ServiceDescriptionUnavailableException, PortletInvokerException
{
int retryCount = 0;
Object response = null;
@@ -159,7 +159,7 @@
* handled
*/
private ErrorResponse dealWithError(Exception error, PortletInvocation invocation, RuntimeContext runtimeContext)
- throws ServiceDescriptionUnavailableException
+ throws ServiceDescriptionUnavailableException, PortletInvokerException
{
log.error("The portlet threw an exception", error);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-12-20 00:56:54 UTC (rev 5908)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-12-20 02:25:10 UTC (rev 5909)
@@ -24,6 +24,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.InvokerUnavailableException;
import org.jboss.portal.portlet.NoSuchPortletException;
@@ -36,20 +37,29 @@
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.UserContext;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
import org.jboss.portal.wsrp.UserContextConverter;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.consumer.portlet.WSRPPortlet;
import org.jboss.portal.wsrp.consumer.portlet.info.WSRPPortletInfo;
+import org.jboss.portal.wsrp.core.ClonePortlet;
+import org.jboss.portal.wsrp.core.DestroyFailed;
+import org.jboss.portal.wsrp.core.DestroyPortlets;
+import org.jboss.portal.wsrp.core.DestroyPortletsResponse;
+import org.jboss.portal.wsrp.core.GetPortletProperties;
import org.jboss.portal.wsrp.core.GetServiceDescription;
-import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
import org.jboss.portal.wsrp.core.LocalizedString;
import org.jboss.portal.wsrp.core.ModelDescription;
import org.jboss.portal.wsrp.core.PortletDescription;
+import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.PropertyDescription;
+import org.jboss.portal.wsrp.core.PropertyList;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
import org.jboss.portal.wsrp.core.RuntimeContext;
@@ -62,9 +72,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
@@ -146,7 +158,7 @@
{
return new LinkedHashSet(getPortletMap().values());
}
- catch (ServiceDescriptionUnavailableException e)
+ catch (Exception e)
{
throw new InvokerUnavailableException(e.getMessage(), e.getCause());
}
@@ -203,22 +215,107 @@
public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
- throw new UnsupportedOperationException("createClone currently unsupported.");
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
+
+ registerIfNeeded();
+
+ // todo: deal with user context
+ ClonePortlet clonePortlet = WSRPTypeFactory.createClonePortlet(registrationContext,
+ WSRPUtils.convertToWSRPPortletContext(portletContext), null);
+ try
+ {
+ return WSRPUtils.convertToPortalPortletContext(getPortletManagementService().clonePortlet(clonePortlet));
+ }
+ catch (Exception e)
+ {
+ throw new PortletInvokerException("Couldn't clone portlet '" + portletContext.getId() + "'", e);
+ }
}
public List destroyClones(List portletIds) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
- throw new UnsupportedOperationException("destroyClone currently unsupported.");
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletIds, "Portlet identifiers");
+
+ registerIfNeeded();
+
+ DestroyPortlets destroyPortlets = WSRPTypeFactory.createDestroyPortlets(registrationContext,
+ (String[])portletIds.toArray(new String[0]));
+
+ try
+ {
+ DestroyPortletsResponse response = getPortletManagementService().destroyPortlets(destroyPortlets);
+ DestroyFailed[] failures = response.getDestroyFailed();
+ if (failures != null)
+ {
+ List result = new ArrayList(failures.length);
+ for (int i = 0; i < failures.length; i++)
+ {
+ DestroyFailed failure = failures[i];
+ result.add(new DestroyCloneFailure(failure.getPortletHandle(), failure.getReason()));
+ }
+ return result;
+ }
+ else
+ {
+ return Collections.EMPTY_LIST;
+ }
+ }
+ catch (Exception e)
+ {
+ throw new PortletInvokerException("Couldn't destroy clones.", e);
+ }
}
public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
- throw new UnsupportedOperationException("getProperties currently unsupported.");
+ ParameterValidation.throwIllegalArgExceptionIfNull(keys, "Portlet ids");
+
+ return getProperties(portletContext, (String[])keys.toArray(new String[0]));
}
+ private PropertyMap getProperties(PortletContext portletContext, String[] keys) throws PortletInvokerException
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
+
+ registerIfNeeded();
+
+ GetPortletProperties getPortletProperties = WSRPTypeFactory.createGetPortletProperties(registrationContext, portletContext.getId());
+ getPortletProperties.setNames(keys);
+
+ try
+ {
+ PropertyList response = getPortletManagementService().getPortletProperties(getPortletProperties);
+ Property[] props = response.getProperties();
+
+ if (props != null)
+ {
+ int propNumber = props.length;
+ PropertyMap result = new SimplePropertyMap(propNumber);
+
+ for (int i = 0; i < propNumber; i++)
+ {
+ Property prop = props[i];
+ String name = prop.getName();
+ String value = prop.getStringValue();
+ result.put(name, new StringValue(value)); // todo: is that all?!?
+ }
+
+ return result;
+ }
+ else
+ {
+ return new SimplePropertyMap();
+ }
+ }
+ catch (Exception e)
+ {
+ throw new PortletInvokerException("Couldn't get properties for portlet '" + portletContext.getId() + "'", e);
+ }
+ }
+
public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
- throw new UnsupportedOperationException("getProperties currently unsupported.");
+ return getProperties(portletContext, (String[])null);
}
public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
@@ -245,7 +342,7 @@
// Portlet-related methods ******************************************************************************************
- public Map getPortletGroupMap() throws ServiceDescriptionUnavailableException
+ public Map getPortletGroupMap() throws ServiceDescriptionUnavailableException, PortletInvokerException
{
if (useCache())
{
@@ -282,7 +379,7 @@
return (WSRPPortlet)getPortlet(portletId);
}
- private Map getPortletMap() throws ServiceDescriptionUnavailableException
+ private Map getPortletMap() throws ServiceDescriptionUnavailableException, PortletInvokerException
{
if (useCache())
{
@@ -376,7 +473,7 @@
}
private void updateCachesIfNeeded()
- throws ServiceDescriptionUnavailableException
+ throws ServiceDescriptionUnavailableException, PortletInvokerException
{
if (System.currentTimeMillis() > expirationTimeMillis || cachedPortletMap == null || portletGroups == null)
{
@@ -415,12 +512,13 @@
// Registration *****************************************************************************************************
- void handleInvalidRegistrationFault()
- throws ServiceDescriptionUnavailableException
+ void handleInvalidRegistrationFault() throws ServiceDescriptionUnavailableException, PortletInvokerException
{
log.debug("Trying to re-register after InvalidRegistrationFault");
- // get the service description again and try to register
- getServiceDescriptionAndRegisterIfNeeded();
+
+ // reset registration data and try again
+ resetRegistration();
+ registerIfNeeded();
}
RegistrationContext getRegistrationContext()
@@ -506,12 +604,11 @@
// Service description support methods ******************************************************************************
- public ServiceDescription getServiceDescriptionAndRegisterIfNeeded() throws ServiceDescriptionUnavailableException
+ private ServiceDescription getServiceDescriptionAndRegisterIfNeeded() throws ServiceDescriptionUnavailableException, PortletInvokerException
{
- GetServiceDescription request = getServiceDescriptionRequest();
-
// try initial registration if needed
registerIfNeeded();
+ GetServiceDescription request = getServiceDescriptionRequest();
request.setRegistrationContext(registrationContext);
final String producerId = getProducerId();
@@ -523,12 +620,6 @@
if (serviceDescription != null)
{
- boolean shouldRetry = informUserIfMissingRegistrationInfo(serviceDescription, producerId);
- if (shouldRetry)
- {
- serviceDescription = getServiceDescriptionAndRegisterIfNeeded();
- }
-
// do we need to call initCookie or not?
sessionHandler.setRequiresInitCookie(serviceDescription.getRequiresInitCookie());
@@ -542,16 +633,6 @@
throw new NullPointerException("null service description: deal with it!");
}
}
- catch (InvalidRegistrationFault e)
- {
- // our registration was not accepted, invalidate our registration data and retrieve registration data from producer
- registrationContext = null;
- registrationData = null;
- request.setRegistrationContext(null);
-
- // try again
- serviceDescription = getServiceDescriptionAndRegisterIfNeeded();
- }
catch (Exception e)
{
log.debug("Caught Exception in getServiceDescriptionAndRegisterIfNeeded:\n", e);
@@ -559,27 +640,66 @@
throw new ServiceDescriptionUnavailableException("Problem getting service description for producer "
+ producerId, cause == null ? e : cause);
}
+ }
- return serviceDescription;
+ /**
+ * Attempts to register if our producer configuration provides registration data and we don't have a valid
+ * RegistrationContext yet.
+ *
+ * @throws org.jboss.portal.portlet.PortletInvokerException
+ *
+ * @since 2.6
+ */
+ private void registerIfNeeded() throws PortletInvokerException
+ {
+ // no registrationContext = we might need to register
+ if (registrationContext == null)
+ {
+ // we don't have any registration data, check if need one and inform user if needed
+ if (registrationData == null)
+ {
+ checkRegistrationDataAgainstInitialServiceDescription();
+ }
+
+ try
+ {
+ registrationContext = getRegistrationService().register(registrationData);
+ if (registrationContext == null)
+ {
+ throw new PortletInvokerException("Received null response from producer '" + producerId + "'");
+ }
+
+ log.info("Successfully registered with handle: '" + registrationContext.getRegistrationHandle() + "'");
+ }
+ catch (Exception e)
+ {
+ resetRegistration();
+ throw new PortletInvokerException("Couldn't register with producer '" + producerId + "'", e);
+ }
+ }
}
/**
- * Extract required registration information from the service description and informs the user if we are not
- * registered and the Producer requires registration. This can happen if we haven't registered yet or after a retry
- * if our initial registration information was rejected.
+ * @throws ServiceDescriptionUnavailableException
*
- * @param serviceDescription
- * @param producerId
- * @return <code>true</code> if we should retry to get the service description, <code>false</code> otherwise
- * @throws ServiceDescriptionUnavailableException
- * if we need to inform the user of missing required registration data
+ * @throws PortletInvokerException
* @since 2.6
*/
- private boolean informUserIfMissingRegistrationInfo(ServiceDescription serviceDescription, String producerId)
- throws ServiceDescriptionUnavailableException
+ private void checkRegistrationDataAgainstInitialServiceDescription() throws PortletInvokerException
{
- if (serviceDescription.isRequiresRegistration() && registrationContext == null)
+ ServiceDescription serviceDescription;
+ try
{
+ serviceDescription = getServiceDescriptionService().getServiceDescription(getUnregisteredServiceDescriptionRequest());
+ }
+ catch (Exception e)
+ {
+ throw new PortletInvokerException("Couldn't access service description for producer '"
+ + getProducerId() + "'", e);
+ }
+
+ if (serviceDescription.isRequiresRegistration())
+ {
StringBuffer message = new StringBuffer("Producer '").append(producerId)
.append("' requires registration. Configuration for this producer might need to be updated to register.");
log.info(message);
@@ -588,61 +708,106 @@
if (registrationProperties != null)
{
PropertyDescription[] propertyDescriptions = registrationProperties.getPropertyDescriptions();
- if (propertyDescriptions != null)
+ Map descriptionsMap = getNamedMappingFrom(propertyDescriptions, false);
+ Property[] regProps;
+ if (registrationData != null)
{
- message.append("\nThe producer required the following registration information: ");
- for (int i = 0; i < propertyDescriptions.length; i++)
+ regProps = registrationData.getRegistrationProperties();
+ }
+ else
+ {
+ regProps = null;
+ }
+ Map propertiesMap = getNamedMappingFrom(regProps, true);
+
+ if (descriptionsMap.size() < propertiesMap.size())
+ {
+ resetRegistration();
+ throw new PortletInvokerException("The provided registration contains more information than required by producer '"
+ + producerId + "'");
+ }
+
+ StringBuffer missingProps = new StringBuffer();
+ for (Iterator descriptionNames = descriptionsMap.keySet().iterator(); descriptionNames.hasNext();)
+ {
+ String name = (String)descriptionNames.next();
+ Object prop = propertiesMap.get(name);
+ if (prop == null)
{
- PropertyDescription propertyDescription = propertyDescriptions[i];
- String name = propertyDescription.getName();
+ PropertyDescription propertyDescription = (PropertyDescription)descriptionsMap.get(name);
String type = propertyDescription.getType().toString();
LocalizedString nillableLabel = propertyDescription.getLabel();
String label = nillableLabel == null ? null : nillableLabel.getValue();
LocalizedString nillableHint = propertyDescription.getHint();
String hint = nillableHint == null ? null : nillableHint.getValue();
- message.append("propertyDescription =\n- name:\t").append(name).append("\n- type:\t")
- .append(type).append("\n- label:\t").append(label).append("\n- hint:\t").append(hint)
- .append("\n");
+ missingProps.append("Missing value for registration property named '").append(name).append("' with type '")
+ .append(type).append("' (label: '").append(label).append("', hint: '").append(hint)
+ .append("')\n");
}
}
- throw new ServiceDescriptionUnavailableException(message.toString(), null);
+
+ if (missingProps.length() > 0)
+ {
+ log.info(missingProps);
+ resetRegistration();
+ throw new PortletInvokerException("Provided registration data is invalid:\n" + missingProps);
+ }
}
else
{
- log.info("The producer didn't require any specific registration properties. Attempting to register with minimal information.");
+ log.info("The producer didn't require any specific registration properties.");
+ if (registrationData != null)
+ {
+ resetRegistration();
+ throw new PortletInvokerException("Registration data is available for producer '"
+ + producerId + "' when none is expected by the producer.");
+ }
+ log.info("Using default registration data for producer '" + producerId + "'");
registrationData = WSRPTypeFactory.createDefaultRegistrationData();
- return true;
}
}
- return false;
}
+ /** @since 2.6 */
+ private void resetRegistration()
+ {
+ registrationData = null;
+ registrationContext = null;
+ }
+
/**
- * Attempts to register if our producer configuration provides registration data and we don't have a valid
- * RegistrationContext yet.
- *
- * @throws ServiceDescriptionUnavailableException
- *
+ * @param propertiesOrDescriptions
+ * @param isProperty
+ * @return
+ * @since 2.6
*/
- private void registerIfNeeded() throws ServiceDescriptionUnavailableException
+ private Map getNamedMappingFrom(Object[] propertiesOrDescriptions, boolean isProperty)
{
- // producer configuration with registration data + no registrationContext = we need to register!
- if (registrationData != null && registrationContext == null)
+ if (propertiesOrDescriptions != null)
{
- RegistrationContext registrationContext;
- try
+ Map result = new HashMap(propertiesOrDescriptions.length);
+ for (int i = 0; i < propertiesOrDescriptions.length; i++)
{
- registrationContext = getRegistrationService().register(registrationData);
+ Object propertyOrDescription = propertiesOrDescriptions[i];
+ String name;
+ if (isProperty)
+ {
+ name = ((Property)propertyOrDescription).getName();
+ }
+ else
+ {
+ name = ((PropertyDescription)propertyOrDescription).getName();
+ }
+
+ result.put(name, propertyOrDescription);
}
- catch (Exception e)
- {
- throw new ServiceDescriptionUnavailableException("Couldn't register with producer '" + getProducerId() + "'", e);
- }
- // if we reach this point, registration was successful so remember the returned registration context
- log.info("Successfully registered with handle: '" + registrationContext.getRegistrationHandle() + "'");
- this.registrationContext = registrationContext;
+ return result;
}
+ else
+ {
+ return Collections.EMPTY_MAP;
+ }
}
private void setServiceDescriptionRequest(GetServiceDescription request)
19 years, 4 months
JBoss Portal SVN: r5908 - trunk/identity/src/resources/test/config
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2006-12-19 19:56:54 -0500 (Tue, 19 Dec 2006)
New Revision: 5908
Modified:
trunk/identity/src/resources/test/config/rhds-config.xml
trunk/identity/src/resources/test/config/standardidentity-config.xml
Log:
- updates for identity tests configuration (still mostly broken after recent changes)
Modified: trunk/identity/src/resources/test/config/rhds-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/rhds-config.xml 2006-12-19 23:28:04 UTC (rev 5907)
+++ trunk/identity/src/resources/test/config/rhds-config.xml 2006-12-20 00:56:54 UTC (rev 5908)
@@ -67,6 +67,7 @@
<implementation>LDAP</implementation>
<config/>
</module>
+
<module>
<type>UserProfile</type>
<implementation>PORTAL</implementation>
@@ -91,14 +92,8 @@
<implementation>LDAP</implementation>
<config/>
</module>
+ </modules>
- <!--For ldap configuration this is needed additionally to use ldap connection...-->
- <module>
- <type>ConnectionContext</type>
- <implementation>LDAP</implementation>
- <config/>
- </module>
- </modules>
<options>
<option-group>
<group-name>common</group-name>
@@ -111,5 +106,24 @@
<value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
</option>
</option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <!--This objectclasses should work with Red Hat Directory-->
+ <value>top</value>
+ <value>person</value>
+ <value>inetOrgPerson</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
</options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/identity/src/resources/test/config/standardidentity-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/standardidentity-config.xml 2006-12-19 23:28:04 UTC (rev 5907)
+++ trunk/identity/src/resources/test/config/standardidentity-config.xml 2006-12-20 00:56:54 UTC (rev 5908)
@@ -343,6 +343,10 @@
<value>hex</value>
</option>
<option>
+ <name>encodePasswordOnUpdate</name>
+ <value>false</value>
+ </option>
+ <option>
<name>roleContainerDN</name>
<value>ou=Roles,dc=example,dc=com</value>
</option>
19 years, 4 months
JBoss Portal SVN: r5907 - in trunk/identity/src/main/org/jboss/portal/identity: . auth ldap
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2006-12-19 18:28:04 -0500 (Tue, 19 Dec 2006)
New Revision: 5907
Modified:
trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java
trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
Log:
- implement LDAPUserImpl password validating/updating correctly
- fixed LDAPRoleImpl
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -82,7 +82,9 @@
public static final String HASH_ENCODING = "hashEncoding";
+ public static final String ENCODE_PASSWORD_ON_UPDATE = "encodePasswordOnUpdate";
+
public Set getValues(String optionGroup, String option);
public String getValue(String optionGroup, String option);
Modified: trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
===================================================================
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -31,6 +31,7 @@
import javax.naming.NamingException;
import javax.naming.ldap.InitialLdapContext;
import java.util.Hashtable;
+import java.util.Map;
/**
* Keeps configuration of connection to LDAP server
@@ -86,18 +87,22 @@
}*/
+ public Hashtable getEnvironment()
+ {
+ Hashtable env = new Hashtable();
+ env.put(Context.INITIAL_CONTEXT_FACTORY, this.getContextFactory());
+ env.put(Context.PROVIDER_URL, "ldap://" + getHost() + ":" + getPort());
+ env.put(Context.SECURITY_AUTHENTICATION, this.getAuthentication());
+ env.put(Context.SECURITY_PRINCIPAL, this.getAdminDN());
+ env.put(Context.SECURITY_CREDENTIALS, this.getAdminPassword());
+ return env;
+ }
-
public InitialLdapContext createInitialContext() throws IdentityException
{
try
{
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY, this.getContextFactory());
- env.put(Context.PROVIDER_URL, "ldap://" + getHost() + ":" + getPort());
- env.put(Context.SECURITY_AUTHENTICATION, this.getAuthentication());
- env.put(Context.SECURITY_PRINCIPAL, this.getAdminDN());
- env.put(Context.SECURITY_CREDENTIALS, this.getAdminPassword());
+ Hashtable env = getEnvironment();
return new InitialLdapContext(env, null);
}
catch (NamingException e)
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleImpl.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -24,6 +24,7 @@
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityException;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -33,9 +34,6 @@
{
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPRoleImpl.class);
- //TODO: make setters to update the state of the entry
-
- //TODO:only to make a fasade for implementing old Role interface
private IdentityContext identityContext;
private String dn;
@@ -44,6 +42,8 @@
private String displayName;
+ private LDAPRoleModule roleModule;
+
private LDAPRoleImpl()
{
@@ -90,10 +90,22 @@
public void setDisplayName(String name)
{
- this.displayName = name;
+ if (name == null)
+ {
+ throw new IllegalArgumentException("DisplayName is null");
+ }
+ try
+ {
+ getRoleModule().updateDisplayName(this, name);
+ this.displayName = name;
+ }
+ catch (IdentityException e)
+ {
+ log.debug("Unable to update role displayName: ", e);
+ }
}
- //TODO: fasade to MembershipModule.getUsers() method call - change this
+
// public Set getUsers()
// {
// try
@@ -108,7 +120,24 @@
// return null;
// }
+ protected LDAPRoleModule getRoleModule() throws IdentityException
+ {
+ if (roleModule == null)
+ {
+ try
+ {
+ this.roleModule = (LDAPRoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
+ }
+ catch (ClassCastException e)
+ {
+ throw new IdentityException("Not supported object as part of the context", e);
+ }
+ }
+ return roleModule;
+ }
+
+
//**************************
//*** Getter and Setters
//**************************
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModule.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -28,6 +28,9 @@
import javax.naming.directory.Attributes;
import javax.naming.directory.Attribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.DirContext;
import javax.naming.NamingException;
import javax.naming.NamingEnumeration;
import javax.naming.InitialContext;
@@ -56,7 +59,30 @@
super.startService(); //To change body of overridden methods use File | Settings | File Templates.
}
+ public void updateDisplayName(LDAPRoleImpl ldapr, String name) throws IdentityException
+ {
+ String attributeName = getDisplayNameAttributeID();
+ try
+ {
+ //TODO: maybe perform a schema check if this attribute is allowed for such entry
+
+ Attributes attrs = new BasicAttributes(true);
+ Attribute attr = new BasicAttribute(attributeName);
+ attr.add(name);
+ attrs.put(attr);
+
+ getConnectionContext().createInitialContext().modifyAttributes(ldapr.getDn(), DirContext.REPLACE_ATTRIBUTE,attrs);
+ }
+ catch (NamingException e)
+ {
+ throw new IdentityException("Cannot set role displayName value.", e);
+ }
+
+ }
+
+
+
protected LDAPRoleImpl createRoleInstance(Attributes attrs, String dn) throws IdentityException
{
LDAPRoleImpl ldapr = null;
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -91,7 +91,7 @@
{
throw new IdentityException("Role search failed.", e);
}
- return null;
+ throw new IdentityException("No role found with name: " + name);
}
public Set findRolesByNames(String[] names) throws IdentityException, IllegalArgumentException
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticGroupMembershipModuleImpl.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -378,10 +378,20 @@
}
- //TODO:don't forget to add this....
+ //TODO: Implement usage of conditions!
public Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter) throws IdentityException
{
- throw new UnsupportedOperationException("Not yet implemented");
+ //throw new UnsupportedOperationException("Not yet implemented");
+ Role role = getRoleModule().findRoleByName(roleName);
+ //if exception was thrown - propagate it, if not....
+ if (role != null)
+ {
+ return getUsers(role);
+ }
+ else
+ {
+ throw new IdentityException("Role not found with roleName: " + roleName );
+ }
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPStaticRoleMembershipModuleImpl.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -367,9 +367,19 @@
}
- //TODO:don't forget to add this....
+ //TODO: Implement usage of conditions!
public Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter) throws IdentityException
{
- throw new UnsupportedOperationException("Not yet implemented");
+ //throw new UnsupportedOperationException("Not yet implemented");
+ Role role = getRoleModule().findRoleByName(roleName);
+ //if exception was thrown - propagate it, if not....
+ if (role != null)
+ {
+ return getUsers(role);
+ }
+ else
+ {
+ throw new IdentityException("Role not found with roleName: " + roleName );
+ }
}
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserImpl.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -51,10 +51,19 @@
//In ldap implementation it acts as a userName
private String id;
- private String password;
+ //private String password;
//private String realEmail;
+ LDAPUserModule userModule;
+
+ /**
+ * internal
+ */
+ private String algorithm;
+
+ private String encoding;
+
private LDAPUserImpl()
{
@@ -65,10 +74,9 @@
*
* @param dn
* @param context
- * @param password - should contain already encrypted password from ldap
* @throws IdentityException
*/
- protected LDAPUserImpl(String dn, IdentityContext context, String id, String password) throws IdentityException
+ protected LDAPUserImpl(String dn, IdentityContext context, String id) throws IdentityException
{
if (dn == null)
{
@@ -81,10 +89,10 @@
throw new IllegalArgumentException("IdentityContext can't be null");
}
- if (password == null)
- {
- throw new IllegalArgumentException("Password can't be null");
- }
+// if (password == null)
+// {
+// throw new IllegalArgumentException("Password can't be null");
+// }
if (id == null)
{
@@ -92,7 +100,6 @@
}
this.identityContext = context;
- this.password = password;
//this.realEmail = email;
this.id = id;
@@ -100,57 +107,38 @@
public void updatePassword(String password)
{
- //TODO: somehow update the password to ldap?
- String algorithm = getHashAlgorightm();
- if (algorithm == null)
+ if (password == null)
{
- this.password = password;
+ throw new IllegalArgumentException("Password is null");
}
- else
+ try
{
- try
- {
- this.password = Tools.hashAndEncodeString(password,algorithm, getHashEncoding());
- }
- catch(Exception e)
- {
- log.error("Cannot update the password",e);
- }
+ getUserModule().updatePassword(this, password);
}
+ catch (IdentityException e)
+ {
+ log.debug("Password update failure: " + e);
+ }
}
public boolean validatePassword(String password)
{
-
- String algorithm = getHashAlgorightm();
- if (algorithm == null)
+ if (password == null)
{
- return this.password.equals(password);
+ throw new IllegalArgumentException("Password is null");
}
- else
+ try
{
- try
- {
- return this.password.equals(Tools.hashAndEncodeString(password,algorithm, getHashEncoding()));
- }
- catch(NoSuchAlgorithmException e)
- {
- log.error("Cannot validate the password",e);
- }
- return false;
+ return getUserModule().validatePassword(this,password);
}
+ catch (IdentityException e)
+ {
+ log.debug("Password validation failure: " + e);
+ }
+ return false;
}
- public String getPassword()
- {
- return this.password;
- }
- public void setPassword(String password)
- {
- this.password = password;
- }
-
//**************************
//*** Getter and Setters
//**************************
@@ -197,32 +185,21 @@
return (IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION);
}
- private String getHashAlgorightm()
+ protected LDAPUserModule getUserModule() throws IdentityException
{
- try
- {
- return getIdentityConfiguration().getValue(IdentityConfiguration.HASH_ALGORITHM);
- }
- catch(Exception e)
- {
- return null;
- }
- }
- private String getHashEncoding()
- {
- try
+ if (userModule == null)
{
- String enc = getIdentityConfiguration().getValue(IdentityConfiguration.HASH_ENCODING);
- if (enc != null)
+ try
{
- return enc;
+ this.userModule = (LDAPUserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
}
+ catch (ClassCastException e)
+ {
+ throw new IdentityException("Not supported object as part of the context - must be LDAPUserModule", e);
+ }
}
- catch(Exception e)
- {
- //nothing
- }
- return "hex";
+ return userModule;
}
+
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -31,11 +31,17 @@
import javax.naming.directory.Attributes;
import javax.naming.directory.Attribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.DirContext;
import javax.naming.NamingException;
import javax.naming.NamingEnumeration;
import javax.naming.InitialContext;
+import javax.naming.Context;
+import javax.naming.ldap.InitialLdapContext;
import java.util.NoSuchElementException;
import java.util.Map;
+import java.util.Hashtable;
/**
* Abstract LDAPUserModule that should be extended to provide compabitibility across identity modules
@@ -64,7 +70,49 @@
super.startService(); //To change body of overridden methods use File | Settings | File Templates.
}
- //TODO: add enabled
+ public void updatePassword(LDAPUserImpl ldapu, String password) throws IdentityException
+ {
+ String attributeName = getPasswordAttributeId();
+
+ try
+ {
+ //TODO: maybe perform a schema check if this attribute is allowed for such entry
+
+ Attributes attrs = new BasicAttributes(true);
+ Attribute attr = new BasicAttribute(attributeName);
+ attr.add(password);
+ attrs.put(attr);
+
+ getConnectionContext().createInitialContext().modifyAttributes(ldapu.getDn(), DirContext.REPLACE_ATTRIBUTE,attrs);
+ }
+ catch (NamingException e)
+ {
+ throw new IdentityException("Cannot set user password value.", e);
+ }
+
+ }
+
+ public boolean validatePassword(LDAPUserImpl ldapu, String password) throws IdentityException
+ {
+ Hashtable env =getConnectionContext().getEnvironment();
+ env.put(Context.SECURITY_PRINCIPAL, ldapu.getDn());
+ env.put(Context.SECURITY_CREDENTIALS, password);
+ try
+ {
+ InitialContext ctx = new InitialLdapContext(env, null);
+ if (ctx != null)
+ {
+ return true;
+ }
+ }
+ catch (NamingException e)
+ {
+ //
+ }
+ return false;
+ }
+
+
public LDAPUserImpl createUserInstance(Attributes attrs, String dn) throws IdentityException
{
LDAPUserImpl ldapu = null;
@@ -79,13 +127,13 @@
throw new IdentityException("LDAP entry doesn't contain proper attribute:" + getUidAttributeID());
}
- Attribute passwd = attrs.get(getPasswordAttributeId());
- if (passwd == null)
- {
- throw new IdentityException("LDAP entry doesn't contain proper attribute:" + getPasswordAttributeId());
- }
+// Attribute passwd = attrs.get(getPasswordAttributeId());
+// if (passwd == null)
+// {
+// throw new IdentityException("LDAP entry doesn't contain proper attribute:" + getPasswordAttributeId());
+// }
- ldapu = new LDAPUserImpl(dn,getIdentityContext(), uida.get().toString(), passwd.get().toString());
+ ldapu = new LDAPUserImpl(dn,getIdentityContext(), uida.get().toString());
log.debug("user uid: " + ldapu.getId());
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2006-12-19 20:26:59 UTC (rev 5906)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2006-12-19 23:28:04 UTC (rev 5907)
@@ -171,16 +171,17 @@
}
//TODO:testcase password behaviour
- String algorithm = getHashAlgorightm();
- if (algorithm == null)
- {
- attrs.put(getPasswordAttributeId(), password);
- }
- else
- {
- attrs.put(getPasswordAttributeId(), Tools.hashAndEncodeString(password,algorithm, getHashEncoding()));
- }
+// String algorithm = getHashAlgorightm();
+// if (algorithm == null)
+// {
+// attrs.put(getPasswordAttributeId(), password);
+// }
+// else
+// {
+// attrs.put(getPasswordAttributeId(), Tools.hashAndEncodeString(password,algorithm, getHashEncoding()));
+// }
+ attrs.put(getPasswordAttributeId(), password);
//
//email
//attrs.put(getEmailAttributeId(), realEmail);
@@ -190,10 +191,10 @@
log.debug("creating ldap entry for: " + dn + "; " + attrs);
ctx.createSubcontext(dn, attrs);
}
- catch (NoSuchAlgorithmException e)
- {
- throw new IdentityException("Failed to create user", e);
- }
+// catch (NoSuchAlgorithmException e)
+// {
+// throw new IdentityException("Failed to create user", e);
+// }
catch (NamingException e)
{
throw new IdentityException("Failed to create user", e);
19 years, 4 months
JBoss Portal SVN: r5906 - in docs/trunk/userGuide/en: images/intro modules
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2006-12-19 15:26:59 -0500 (Tue, 19 Dec 2006)
New Revision: 5906
Added:
docs/trunk/userGuide/en/images/intro/dashboard_assignportlets.gif
docs/trunk/userGuide/en/images/intro/dashboard_assignthemes.gif
docs/trunk/userGuide/en/images/intro/dashboard_configure.gif
docs/trunk/userGuide/en/images/intro/dashboard_createpage.gif
docs/trunk/userGuide/en/images/intro/dashboard_dnd.gif
docs/trunk/userGuide/en/images/intro/dashboard_selectpage.gif
docs/trunk/userGuide/en/images/intro/login_ss.gif
docs/trunk/userGuide/en/images/intro/portlet_assign.gif
docs/trunk/userGuide/en/images/intro/portlet_down.gif
docs/trunk/userGuide/en/images/intro/portlet_remove.gif
docs/trunk/userGuide/en/images/intro/portlet_up.gif
Modified:
docs/trunk/userGuide/en/images/intro/dashboard.jpg
docs/trunk/userGuide/en/modules/intro.xml
Log:
JBPORTAL-1164 - Document dashboards in User Guide
Modified: docs/trunk/userGuide/en/images/intro/dashboard.jpg
===================================================================
(Binary files differ)
Added: docs/trunk/userGuide/en/images/intro/dashboard_assignportlets.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/dashboard_assignportlets.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/dashboard_assignthemes.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/dashboard_assignthemes.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/dashboard_configure.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/dashboard_configure.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/dashboard_createpage.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/dashboard_createpage.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/dashboard_dnd.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/dashboard_dnd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/dashboard_selectpage.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/dashboard_selectpage.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/login_ss.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/login_ss.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/portlet_assign.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/portlet_assign.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/portlet_down.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/portlet_down.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/portlet_remove.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/portlet_remove.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/intro/portlet_up.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/intro/portlet_up.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/trunk/userGuide/en/modules/intro.xml
===================================================================
--- docs/trunk/userGuide/en/modules/intro.xml 2006-12-19 17:46:38 UTC (rev 5905)
+++ docs/trunk/userGuide/en/modules/intro.xml 2006-12-19 20:26:59 UTC (rev 5906)
@@ -219,6 +219,12 @@
admin/admin
]]>
</programlisting>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/intro/login_ss.gif" format="gif" align="center"
+ valign="middle"/>
+ </imageobject>
+ </mediaobject>
</para>
<para>
Once logged in, the top-right menu will change so you can then navigate to your personal dashboard and other
@@ -531,14 +537,154 @@
persisted... so the next time the user logs in to his dashboard, he will see the previous changes he made.
<mediaobject>
<imageobject>
- <imagedata fileref="images/intro/dashboard_dnd.jpg" format="jpg" align="center"
+ <imagedata fileref="images/intro/dashboard_dnd.gif" format="gif" align="center"
valign="middle"/>
</imageobject>
</mediaobject>
- <note>At the time of this release, functionality on Adding Pages, and Adding portlet windows, has not been
- added to the dashboarding area for users.
- </note>
+ While navigating any of the dashboard pages, a user will be able to drag and drop portlet windows to any
+ location, if the administrator allows this functionality. Changes made in this fashion will be persisted.
</para>
+ <sect2 id="dashboard_configure">
+ <title>Configuring your personal dashboard</title>
+ <para>
+ A user is able to configure his personal dashboard, by accessing the Configurator, using the top-right menu
+ item, labeled
+ <emphasis>Edit Content</emphasis>
+ . He should then see the main Configurator screen:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/intro/dashboard_configure.gif" format="gif" align="center"
+ valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ From this screen, a user is able to perform configuration actions on his dashboard, by first selecting the
+ page he would like to edit, using the page selector dropdown:
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/intro/dashboard_selectpage.gif" format="gif" align="center"
+ valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ The possible actions on a selected page are as follows:
+ <itemizedlist>
+ <listitem>
+ <xref linkend="dashboard_createpages"/>
+ </listitem>
+ <listitem>
+ <xref linkend="dashboard_assignportlets"/>
+ </listitem>
+ <listitem>
+ <xref linkend="dashboard_assignthemes"/>
+ </listitem>
+ <listitem>
+ <xref linkend="dashboard_deletepage"/>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <sect3 id="dashboard_createpages">
+ <title>Creating Pages</title>
+ <para>
+ A user is able to create new pages in his personal dashboard by simply entering a desired Page name in
+ the
+ <emphasis>Create New Page</emphasis>
+ dialogue.
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/intro/dashboard_createpage.gif" format="gif" align="center"
+ valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ <note>
+ <itemizedlist>
+ <listitem>Page names must be unique.</listitem>
+ <listitem>Page names cannot be blank.</listitem>
+ </itemizedlist>
+ </note>
+ Upon creating a new page, the Configurator will refresh and allow a user to customize the new page.
+ </para>
+ </sect3>
+ <sect3 id="dashboard_assignportlets">
+ <title>Managing Portlets</title>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/intro/dashboard_assignportlets.gif" format="gif" align="center"
+ valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ This section of the Configurator allows users to add, remove, and reorder portlets on a selected
+ dashboard
+ page.
+ </para>
+ <para>
+ <emphasis role="bold">Assigning portlets</emphasis>
+ to a page is accomplished by selecting which portlets you would like added to a page
+ from the
+ <emphasis>Available Content</emphasis>
+ list. (You may select multiple portlets by holding CTRL and clicking on the available portlets.) Once you
+ have selected which portlet you would like to assign to a specific column, click the
+ <imageobject>
+ <imagedata fileref="images/intro/portlet_assign.gif" format="gif"/>
+ </imageobject>
+ button next to the target column.
+ </para>
+ <para>
+ <emphasis role="bold">Removing portlets</emphasis>
+ from a page is accomplished by selecting which portlets you would like removed from a
+ specific column. (You may select multiple portlets by holding CTRL and clicking on the available
+ portlets.)
+ Once you
+ have selected which portlet you would like removed, click the
+ <imageobject>
+ <imagedata fileref="images/intro/portlet_remove.gif" format="gif"/>
+ </imageobject>
+ button next to the source column.
+ </para>
+ <para>
+ <emphasis role="bold">Sorting portlets</emphasis>
+ in a column is accomplished by selecting which portlets you would like to sort from a
+ specific column. (You may select multiple portlets by holding CTRL and clicking on the available
+ portlets.)
+ Once you
+ have selected which portlet you would like re-ordered, click the
+ <imageobject>
+ <imagedata fileref="images/intro/portlet_up.gif" format="gif"/>
+ </imageobject>
+ or
+ <imageobject>
+ <imagedata fileref="images/intro/portlet_down.gif" format="gif"/>
+ </imageobject>
+ button next to the source column.
+ </para>
+ </sect3>
+ <sect3 id="dashboard_assignthemes">
+ <title>Managing Theme and Layouts</title>
+ <para>
+ Using the Theme and Layout dropdowns, the configurator allows for theme and/or layout assignment to a
+ specific dashboard page. The user simply selects the desired theme and/or layout and presses
+ <emphasis>Select</emphasis>
+ to assign it to the page.
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/intro/dashboard_assignthemes.gif" format="gif" align="center"
+ valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </sect3>
+ <sect3 id="dashboard_deletepage">
+ <title>Deleting Pages</title>
+ <para>
+ Users may delete dashboard pages at any time, by scrolling to the bottom of the Configurator screen and
+ clicking the
+ <emphasis>Delete this page</emphasis>
+ button. We will note that users are not able to delete the default dashboard page.
+ <warning>
+ Deleted pages are NOT recoverable. This change is permanent!
+ </warning>
+ </para>
+ </sect3>
+ </sect2>
</sect1>
<sect1 id="adminportal">
<title>Admin Portal</title>
19 years, 4 months
JBoss Portal SVN: r5905 - in trunk/identity/src/main/org/jboss/portal/identity: auth db ldap
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2006-12-19 12:46:38 -0500 (Tue, 19 Dec 2006)
New Revision: 5905
Modified:
trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
Log:
- small fixes to ldap modules behaviour
Modified: trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2006-12-19 17:44:09 UTC (rev 5904)
+++ trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2006-12-19 17:46:38 UTC (rev 5905)
@@ -134,6 +134,11 @@
try
{
User user = getUserModule().findUserByUserName(getUsername());
+ //in case module implementation doesn't throw proper exception...
+ if (user == null)
+ {
+ throw new NoSuchUserException("UserModule returned null user object");
+ }
if (havingRole != null)
{
boolean hasTheRole = false;
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2006-12-19 17:44:09 UTC (rev 5904)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2006-12-19 17:46:38 UTC (rev 5905)
@@ -40,6 +40,7 @@
import java.util.Set;
import java.util.Iterator;
import java.util.HashMap;
+import java.util.Random;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -62,6 +63,8 @@
private String defaultSynchronizePassword;
+ private boolean randomSynchronizePassword = false;
+
protected void startService() throws Exception
{
//
@@ -217,6 +220,18 @@
{
user.updatePassword(getDefaultSynchronizePassword());
}
+ //really dummy password generation
+ //TODO: make something more sophisticated (risk of this part is documented)
+ else if (randomSynchronizePassword)
+ {
+ Random r = new Random();
+ StringBuffer password = new StringBuffer();
+ for (int i = 0; i < 10; i++)
+ {
+ password.append(r.nextDouble());
+ }
+ user.updatePassword(password.toString());
+ }
session = getCurrentSession();
session.save(hu);
return hu;
@@ -289,5 +304,16 @@
{
this.defaultSynchronizePassword = defaultSynchronizePassword;
}
+
+
+ public boolean isRandomSynchronizePassword()
+ {
+ return randomSynchronizePassword;
+ }
+
+ public void setRandomSynchronizePassword(boolean randomSynchronizePassword)
+ {
+ this.randomSynchronizePassword = randomSynchronizePassword;
+ }
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2006-12-19 17:44:09 UTC (rev 5904)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2006-12-19 17:46:38 UTC (rev 5905)
@@ -89,12 +89,13 @@
catch (NoSuchElementException e)
{
log.debug("No user found with name: " + userName, e);
+
}
catch (NamingException e)
{
throw new IdentityException("User search failed.", e);
}
- return null;
+ throw new NoSuchUserException("No user found with name: " + userName);
}
19 years, 4 months
JBoss Portal SVN: r5904 - trunk/identity/src/main/org/jboss/portal/identity
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2006-12-19 12:44:09 -0500 (Tue, 19 Dec 2006)
New Revision: 5904
Modified:
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
Log:
- fix of registering identity datasource modules as MBeans
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2006-12-19 17:42:51 UTC (rev 5903)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2006-12-19 17:44:09 UTC (rev 5904)
@@ -262,7 +262,12 @@
//register as an mbean
if (isRegisterMBeans() && (ds.getServiceName() != null))
{
- getServer().registerMBean(datasource, new ObjectName(ds.getServiceName()));
+ //getServer().registerMBean(moduleService, new ObjectName(module.getServiceName()));
+ JBossServiceModelMBean mbean = new JBossServiceModelMBean(datasource);
+ //serviceName = new ObjectName("portal:container=WebApp,id=" + portletAppMD.getId());
+ //mbeanServer.registerMBean(mbean, serviceName);
+ getServer().registerMBean(mbean, new ObjectName(ds.getServiceName()));
+
}
19 years, 4 months
JBoss Portal SVN: r5903 - in trunk: core/src/resources/portal-core-sar/conf identity/src/main/org/jboss/portal/identity/auth
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2006-12-19 12:42:51 -0500 (Tue, 19 Dec 2006)
New Revision: 5903
Added:
trunk/identity/src/main/org/jboss/portal/identity/auth/DBIdentityLoginModule.java
Modified:
trunk/core/src/resources/portal-core-sar/conf/login-config.xml
Log:
- dummy extension of DatabaseServerLoginModule class that inject "additionalRole" to anable authenticate against portal DB while using LDAP modules with IdentityLoginModules
Modified: trunk/core/src/resources/portal-core-sar/conf/login-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/login-config.xml 2006-12-19 17:29:13 UTC (rev 5902)
+++ trunk/core/src/resources/portal-core-sar/conf/login-config.xml 2006-12-19 17:42:51 UTC (rev 5903)
@@ -35,6 +35,21 @@
<application-policy name="portal">
<authentication>
+ <!--Uncomment this if you want to fall down to users kept in DB after LDAP authentication fails
+ This may be usefull if you want to use Admin user provided with portal database schema-->
+ <!--Note that this may lead to the security risk - with LDAP when storing user profile information
+ that are not mapped as attribute you may have LDAP user synchronized into DB with no password set.
+ Please see HibernateUserProfileImpl module options "synchronizeNonExistingUsers", "acceptOtherImplementations"
+ "defaultSynchronizePassword" or "randomSynchronizePassword" to manage this behaviour-->
+ <!--<login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule" flag="sufficient">
+ <module-option name="dsJndiName">java:/PortalDS</module-option>
+ <module-option name="principalsQuery">SELECT jbp_password FROM jbp_users WHERE jbp_uname=?</module-option>
+ <module-option name="rolesQuery">SELECT jbp_roles.jbp_name, 'Roles' FROM jbp_role_membership INNER JOIN jbp_roles ON jbp_role_membership.jbp_rid = jbp_roles.jbp_rid INNER JOIN jbp_users ON jbp_role_membership.jbp_uid = jbp_users.jbp_uid WHERE jbp_users.jbp_uname=?</module-option>
+ <module-option name="hashAlgorithm">MD5</module-option>
+ <module-option name="hashEncoding">HEX</module-option>
+ <module-option name="additionalRole">Authenticated</module-option>
+ </login-module>
+-->
<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">
<module-option name="unauthenticatedIdentity">guest</module-option>
<module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
Added: trunk/identity/src/main/org/jboss/portal/identity/auth/DBIdentityLoginModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/auth/DBIdentityLoginModule.java 2006-12-19 17:29:13 UTC (rev 5902)
+++ trunk/identity/src/main/org/jboss/portal/identity/auth/DBIdentityLoginModule.java 2006-12-19 17:42:51 UTC (rev 5903)
@@ -0,0 +1,85 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.portal.identity.auth;
+
+import org.jboss.security.auth.spi.DatabaseServerLoginModule;
+
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.callback.CallbackHandler;
+import java.util.Map;
+import java.util.Collections;
+import java.util.Arrays;
+import java.security.Principal;
+import java.security.acl.Group;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class DBIdentityLoginModule extends DatabaseServerLoginModule
+{
+ private String additionalRole;
+
+ public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
+ {
+ super.initialize(subject, callbackHandler, sharedState, options);
+
+ // Get data
+ additionalRole = (String)options.get("additionalRole");
+
+ // Some info
+ log.trace("additionalRole = " + additionalRole);
+ }
+
+
+ protected Group[] getRoleSets() throws LoginException
+ {
+ Group[] rolesGroup = super.getRoleSets();
+ if (additionalRole != null)
+ {
+ try
+ {
+ for (int i = 0; i < rolesGroup.length; i++)
+ {
+ Group group = rolesGroup[i];
+ if (group.getName().equals("Roles"))
+ {
+ group.addMember(createIdentity(additionalRole));
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ //just a try
+ log.error("Error when adding additional role: ", e);
+ }
+ }
+ return rolesGroup;
+ }
+
+ /** Subclass to use the PortalPrincipal to make the username easier to retrieve by the portal. */
+ protected Principal createIdentity(String username) throws Exception
+ {
+ return new UserPrincipal(username);
+ }
+}
19 years, 4 months
JBoss Portal SVN: r5902 - in trunk/wsrp/src/main/org/jboss/portal: test/wsrp/v1/producer wsrp/producer
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-19 12:29:13 -0500 (Tue, 19 Dec 2006)
New Revision: 5902
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
Log:
- Fixed test case: was using incorrect handle thus resulting in failure.
- Adjusted thrown exception when trying to setPortletProperties on POP.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java 2006-12-19 14:46:18 UTC (rev 5901)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java 2006-12-19 17:29:13 UTC (rev 5902)
@@ -34,8 +34,8 @@
import org.jboss.portal.wsrp.core.GetPortletProperties;
import org.jboss.portal.wsrp.core.GetPortletPropertyDescription;
import org.jboss.portal.wsrp.core.GetServiceDescription;
+import org.jboss.portal.wsrp.core.InconsistentParametersFault;
import org.jboss.portal.wsrp.core.ModelDescription;
-import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PortletContext;
import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
import org.jboss.portal.wsrp.core.PortletPropertyDescriptionResponse;
@@ -188,12 +188,13 @@
checkGetPropertiesResponse(portletManagementService.getPortletProperties(getPortletProperties), properties);
portletContext = WSRPTypeFactory.createPortletContext(handle);
+ setPortletProperties.setPortletContext(portletContext);
try
{
response = portletManagementService.setPortletProperties(setPortletProperties);
ExtendedAssert.fail("Setting properties on Producer-Offered Portlet should fail...");
}
- catch (OperationFailedFault expected)
+ catch (InconsistentParametersFault expected)
{
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2006-12-19 14:46:18 UTC (rev 5901)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2006-12-19 17:29:13 UTC (rev 5902)
@@ -301,7 +301,7 @@
}
catch (InvalidPortletIdException e)
{
- throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class, e);
+ throw (InconsistentParametersFault)WSRPUtils.createFaultFrom(InconsistentParametersFault.class, e);
}
catch (NoSuchPortletException e)
{
19 years, 4 months
JBoss Portal SVN: r5901 - in trunk: core/src/main/org/jboss/portal/core/portlet/user core/src/resources/portal-core-sar/META-INF core/src/resources/portal-core-sar/conf core/src/resources/portal-core-sar/conf/identity identity/src/main/org/jboss/portal/identity
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2006-12-19 09:46:18 -0500 (Tue, 19 Dec 2006)
New Revision: 5901
Added:
trunk/core/src/resources/portal-core-sar/conf/identity/identity-config.xml
trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml
Removed:
trunk/core/src/resources/portal-core-sar/conf/identity-config.xml
trunk/core/src/resources/portal-core-sar/conf/profile-config.xml
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
Log:
- fixed some user profile issues
- moved configuration files
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2006-12-19 14:30:14 UTC (rev 5900)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2006-12-19 14:46:18 UTC (rev 5901)
@@ -28,6 +28,7 @@
import org.jboss.portal.common.util.LocaleInfo;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.URLTools;
+import org.jboss.portal.common.p3p.P3PConstants;
import org.jboss.portal.core.aspects.controller.node.Navigation;
import org.jboss.portal.core.modules.MailModule;
import org.jboss.portal.core.portlet.PortletHelper;
@@ -696,7 +697,7 @@
try
{
user = userModule.createUser(uname, pass1);
- setProperty(user,User.INFO_USER_EMAIL_REAL, realEmail);
+ setProperty(user, P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, realEmail);
//user.setFakeEmail(fakeEmail);
setProperty(user,User.INFO_USER_EMAIL_FAKE, fakeEmail);
@@ -719,7 +720,7 @@
Locale locale = req.getLocale();
ResourceBundle bundle = getResourceBundle(locale);
String subject = bundle.getString("REGISTER_CONFIRMATIONEMAIL");
- mailModule.send(from, (String)getProperty(user,User.INFO_USER_EMAIL_REAL), subject, emailText);
+ mailModule.send(from, (String)getProperty(user,P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL), subject, emailText);
}
/*
@@ -773,9 +774,9 @@
private void fillContextWithUserProfile(User user, DelegateContext ctx)
{
- ctx.put("GIVENNAME", (String)getProperty(user, User.INFO_USER_NAME_GIVEN));
- ctx.put("FAMILYNAME", (String)getProperty(user, User.INFO_USER_NAME_FAMILY));
- ctx.put("REALEMAIL", (String)getProperty(user, User.INFO_USER_EMAIL_REAL));
+ ctx.put("GIVENNAME", (String)getProperty(user, P3PConstants.INFO_USER_NAME_GIVEN));
+ ctx.put("FAMILYNAME", (String)getProperty(user, P3PConstants.INFO_USER_NAME_FAMILY));
+ ctx.put("REALEMAIL", (String)getProperty(user, P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL));
ctx.put("FAKEEMAIL", (String)getProperty(user, User.INFO_USER_EMAIL_FAKE));
ctx.put("THEME", (String)getProperty(user, User.INFO_USER_THEME));
ctx.put("VIEWREALEMAIL", ((String)getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL)).equals("true") ? "checked=\"checked\"" : "");
@@ -886,17 +887,17 @@
//
if (givenName.trim().length() != 0)
{
- setProperty(user, User.INFO_USER_NAME_GIVEN, givenName);
+ setProperty(user, P3PConstants.INFO_USER_NAME_GIVEN, givenName);
}
if (familyName.trim().length() != 0)
{
- setProperty(user, User.INFO_USER_NAME_FAMILY, familyName);
+ setProperty(user, P3PConstants.INFO_USER_NAME_FAMILY, familyName);
}
if (realEmail.trim().length() != 0)
{
- setProperty(user, User.INFO_USER_EMAIL_REAL, realEmail);
+ setProperty(user, P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, realEmail);
}
if (fakeEmail.trim().length() != 0)
@@ -1104,7 +1105,7 @@
try
{
- givenName = (String)userProfileModule.getProperty(user, User.INFO_USER_NAME_GIVEN);
+ givenName = (String)userProfileModule.getProperty(user, P3PConstants.INFO_USER_NAME_GIVEN);
}
catch (IdentityException e)
{
@@ -1127,7 +1128,7 @@
try
{
- familyName = (String)userProfileModule.getProperty(user, User.INFO_USER_NAME_FAMILY);
+ familyName = (String)userProfileModule.getProperty(user, P3PConstants.INFO_USER_NAME_FAMILY);
}
catch (IdentityException e)
{
@@ -1153,8 +1154,8 @@
try
{
- givenName = (String)userProfileModule.getProperty(user, User.INFO_USER_NAME_GIVEN);
- familyName = (String)userProfileModule.getProperty(user, User.INFO_USER_NAME_FAMILY);
+ givenName = (String)userProfileModule.getProperty(user, P3PConstants.INFO_USER_NAME_GIVEN);
+ familyName = (String)userProfileModule.getProperty(user, P3PConstants.INFO_USER_NAME_FAMILY);
}
catch (IdentityException e)
{
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-19 14:30:14 UTC (rev 5900)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-19 14:46:18 UTC (rev 5901)
@@ -494,34 +494,11 @@
<!--<depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>-->
<attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
<attribute name="RegisterMBeans">true</attribute>
- <attribute name="ConfigFile">conf/identity-config.xml</attribute>
+ <attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
<attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
</mbean>
-
- <!-- Modules -->
- <!--<mbean
- code="org.jboss.portal.identity.db.DBUserModuleImpl"
- name="portal:service=Module,type=User"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute name="JNDIName">java:/portal/UserModule</attribute>
- <attribute name="SessionFactoryJNDIName">java:/portal/UserSessionFactory</attribute>
- </mbean>
<mbean
- code="org.jboss.portal.identity.db.DBRoleModuleImpl"
- name="portal:service=Module,type=Role"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute name="JNDIName">java:/portal/RoleModule</attribute>
- <attribute name="SessionFactoryJNDIName">java:/portal/UserSessionFactory</attribute>
- </mbean>
--->
- <mbean
code="org.jboss.portal.core.impl.mail.MailModuleImpl"
name="portal:service=Module,type=Mail"
xmbean-dd=""
Copied: trunk/core/src/resources/portal-core-sar/conf/identity/identity-config.xml (from rev 5895, trunk/core/src/resources/portal-core-sar/conf/identity-config.xml)
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity-config.xml 2006-12-18 19:14:55 UTC (rev 5895)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/identity-config.xml 2006-12-19 14:46:18 UTC (rev 5901)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+ <!--<!DOCTYPE identity-configuration PUBLIC
+ "-//JBoss Portal//DTD JBoss Identity Configuration 1.0//EN"
+ "http://www.jboss.org/portal/dtd/identity-config_1_0.dtd">-->
+
+<identity-configuration>
+ <datasources/>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Role</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Membership</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>profileConfigFile</name>
+ <value>conf/identity/profile-config.xml</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ </modules>
+ <options/>
+</identity-configuration>
\ No newline at end of file
Copied: trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml (from rev 5895, trunk/core/src/resources/portal-core-sar/conf/profile-config.xml)
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/profile-config.xml 2006-12-18 19:14:55 UTC (rev 5895)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml 2006-12-19 14:46:18 UTC (rev 5901)
@@ -0,0 +1,398 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+ <!--<!DOCTYPE profile PUBLIC
+ "-//JBoss Portal//DTD JBoss User Profile Configuration 1.0//EN"
+ "http://www.jboss.org/portal/dtd/profile-config_1_0.dtd">-->
+
+<profile>
+ <!--Database mapping - jbp_user table column mapping-->
+ <property>
+ <name>user.name.nickName</name>
+ <type>java.lang.String</type>
+ <access-mode>read-only</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Name</display-name>
+ <description xml:lang="en">The user name</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_uname</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>user.name.given</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Given Name</display-name>
+ <description xml:lang="en">The user given name</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_givenname</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>user.name.family</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Family name</display-name>
+ <description xml:lang="en">The user family name</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_familyname</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>user.business-info.online.email</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Email</display-name>
+ <description xml:lang="en">The user real email</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_realemail</value>
+ </database>
+ <ldap>
+ <value>mail</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.email.fake</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Fake email</display-name>
+ <description xml:lang="en">The user fake email</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_fakeemail</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.registration-date</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Registration date</display-name>
+ <description xml:lang="en">Registration date of user</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_regdate</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.email.view-real</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">View real email</display-name>
+ <description xml:lang="en">Is user real email displayed in public</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_viewrealemail</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.enabled</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Enabled</display-name>
+ <description xml:lang="en">User enabled state</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_enabled</value>
+ </database>
+ </mapping>
+ </property>
+
+ <!--Dynamic database store-->
+ <property>
+ <name>portal.user.location</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Location</display-name>
+ <description xml:lang="en">The user location</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.location</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.occupation</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Occupation</display-name>
+ <description xml:lang="en">The user occupation</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.occupation</value>
+ </database>
+ <ldap>
+ <value>title</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.extra</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Extra info</display-name>
+ <description xml:lang="en">Extra informtion about user</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.extra</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.signature</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Signature</display-name>
+ <description xml:lang="en">The user signature</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.signature</value>
+ </database>
+ <ldap>
+ <value>personalSignature</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.interests</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Interests</display-name>
+ <description xml:lang="en">The user interests</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.interests</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.locale</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Locale</display-name>
+ <description xml:lang="en">The user locale</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.locale</value>
+ </database>
+ <ldap>
+ <value>localityName</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.icq</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">ICQ</display-name>
+ <description xml:lang="en">The user ICQ id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.icq</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.aim</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">AIM</display-name>
+ <description xml:lang="en">The user AIM id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.aim</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.msnm</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">MSN</display-name>
+ <description xml:lang="en">The user MSN id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.msnm</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.yim</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">YIM</display-name>
+ <description xml:lang="en">The user YIM id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.yim</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.skype</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Skype</display-name>
+ <description xml:lang="en">The user skype id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.skype</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.homepage</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Homepage</display-name>
+ <description xml:lang="en">The user homepage</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.homepage</value>
+ </database>
+ <ldap>
+ <value>seeAlso</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.time-zone-offset</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Timezone</display-name>
+ <description xml:lang="en">Timezone in users location</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.time-zone-offset</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.theme</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Theme</display-name>
+ <description xml:lang="en">Portlat theme that user is using</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.theme</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.security.question</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Password Question</display-name>
+ <description xml:lang="en">Portal password recovery question</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.security.question</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.security.answer</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Password Answer</display-name>
+ <description xml:lang="en">Portal password recovery answer</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.security.answer</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.last-login-date</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Last login</display-name>
+ <description xml:lang="en">The date of users last login</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.last-login-date</value>
+ </database>
+ </mapping>
+ </property>
+</profile>
\ No newline at end of file
Deleted: trunk/core/src/resources/portal-core-sar/conf/identity-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity-config.xml 2006-12-19 14:30:14 UTC (rev 5900)
+++ trunk/core/src/resources/portal-core-sar/conf/identity-config.xml 2006-12-19 14:46:18 UTC (rev 5901)
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
- <!--<!DOCTYPE identity-configuration PUBLIC
- "-//JBoss Portal//DTD JBoss Identity Configuration 1.0//EN"
- "http://www.jboss.org/portal/dtd/identity-config_1_0.dtd">-->
-
-<identity-configuration>
- <datasources/>
- <modules>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Role</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Membership</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>profileConfigFile</name>
- <value>conf/profile-config.xml</value>
- </option>
- </config>
- </module>
- <module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- </modules>
- <options/>
-</identity-configuration>
\ No newline at end of file
Deleted: trunk/core/src/resources/portal-core-sar/conf/profile-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/profile-config.xml 2006-12-19 14:30:14 UTC (rev 5900)
+++ trunk/core/src/resources/portal-core-sar/conf/profile-config.xml 2006-12-19 14:46:18 UTC (rev 5901)
@@ -1,384 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
- <!--<!DOCTYPE profile PUBLIC
- "-//JBoss Portal//DTD JBoss User Profile Configuration 1.0//EN"
- "http://www.jboss.org/portal/dtd/profile-config_1_0.dtd">-->
-
-<profile>
- <!--Database mapping - jbp_user table column mapping-->
- <property>
- <name>portal.user.name.given</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Name</display-name>
- <description xml:lang="en">The user name</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_username</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.name.family</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Family name</display-name>
- <description xml:lang="en">The user family name</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_familyname</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.email.real</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Email</display-name>
- <description xml:lang="en">The user real email</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_realemail</value>
- </database>
- <ldap>
- <value>mail</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.email.fake</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Fake email</display-name>
- <description xml:lang="en">The user fake email</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_fakeemail</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.registration-date</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Registration date</display-name>
- <description xml:lang="en">Registration date of user</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_regdate</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.email.view-real</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">View real email</display-name>
- <description xml:lang="en">Is user real email displayed in public</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_viewrealemail</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.enabled</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Enabled</display-name>
- <description xml:lang="en">User enabled state</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_enabled</value>
- </database>
- </mapping>
- </property>
-
- <!--Dynamic database store-->
- <property>
- <name>portal.user.location</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Location</display-name>
- <description xml:lang="en">The user location</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.location</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.occupation</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Occupation</display-name>
- <description xml:lang="en">The user occupation</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.occupation</value>
- </database>
- <ldap>
- <value>title</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.extra</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Extra info</display-name>
- <description xml:lang="en">Extra informtion about user</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.extra</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.signature</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Signature</display-name>
- <description xml:lang="en">The user signature</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.signature</value>
- </database>
- <ldap>
- <value>personalSignature</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.interests</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Interests</display-name>
- <description xml:lang="en">The user interests</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.interests</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.locale</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Locale</display-name>
- <description xml:lang="en">The user locale</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.locale</value>
- </database>
- <ldap>
- <value>localityName</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.icq</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">ICQ</display-name>
- <description xml:lang="en">The user ICQ id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.icq</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.aim</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">AIM</display-name>
- <description xml:lang="en">The user AIM id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.aim</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.msnm</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">MSN</display-name>
- <description xml:lang="en">The user MSN id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.msnm</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.yim</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">YIM</display-name>
- <description xml:lang="en">The user YIM id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.yim</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.skype</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Skype</display-name>
- <description xml:lang="en">The user skype id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.skype</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.homepage</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Homepage</display-name>
- <description xml:lang="en">The user homepage</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.homepage</value>
- </database>
- <ldap>
- <value>seeAlso</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.time-zone-offset</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Timezone</display-name>
- <description xml:lang="en">Timezone in users location</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.time-zone-offset</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.theme</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Theme</display-name>
- <description xml:lang="en">Portlat theme that user is using</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.theme</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.security.question</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Password Question</display-name>
- <description xml:lang="en">Portal password recovery question</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.security.question</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.security.answer</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Password Answer</display-name>
- <description xml:lang="en">Portal password recovery answer</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.security.answer</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.last-login-date</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Last login</display-name>
- <description xml:lang="en">The date of users last login</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.last-login-date</value>
- </database>
- </mapping>
- </property>
-</profile>
\ No newline at end of file
Modified: trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2006-12-19 14:30:14 UTC (rev 5900)
+++ trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2006-12-19 14:46:18 UTC (rev 5901)
@@ -77,7 +77,7 @@
PropertyInfo property = getProfileInfo().getPropertyInfo(propertyName);
if (property == null)
{
- throw new IdentityException("Such property name is not supported");
+ throw new IdentityException("Such property name is not supported: " + propertyName);
}
else if (property.isMappedLDAP() && isLDAPSupported() && user instanceof LDAPUserImpl)
{
@@ -87,7 +87,19 @@
else if (property.isMappedDB())
{
log.debug("Delegating to DB module");
- return getDBModule().getProperty(user, propertyName);
+ Object o = getDBModule().getProperty(user, propertyName);
+
+
+ //if property is column it may be some Object - just convert to String for now
+ if(o != null && !(o instanceof String))
+ {
+ return o.toString();
+ }
+ else
+ {
+ return o;
+ }
+
}
throw new IdentityException("Cannot process property - incorrect profile or module configuration");
}
@@ -105,7 +117,7 @@
PropertyInfo property = getProfileInfo().getPropertyInfo(name);
if (property == null)
{
- throw new IdentityException("Such property name is not supported");
+ throw new IdentityException("Such property name is not supported: " + name);
}
else if (property.isMappedLDAP() && isLDAPSupported() && user instanceof LDAPUserImpl)
{
@@ -118,17 +130,18 @@
log.debug("Delegating to DB module");
- Object val = null;
+ Object val = propertyValue.toString();
//if property is dynamic convert value to String first
- if(property.getMappingDBType().equals(PropertyInfo.MAPPING_DB_TYPE_DYNAMIC))
- {
- val = propertyValue.toString();
- }
- else
- {
- val = propertyValue;
- }
+// if(property.getMappingDBType().equals(PropertyInfo.MAPPING_DB_TYPE_DYNAMIC))
+// {
+// val = propertyValue.toString();
+// }
+// else
+// {
+// val = propertyValue;
+// }
+
getDBModule().setProperty(user, name, val);
return;
}
@@ -140,6 +153,7 @@
}
}
+ //TODO: wrong coded - should merge properties from LDAP AND DB
public Map getProperties(User user) throws IdentityException, IllegalArgumentException
{
if (log.isDebugEnabled()) log.debug("getProperties");//: " + name + "/" + propertyValue)
19 years, 4 months
JBoss Portal SVN: r5900 - trunk/core/src/main/org/jboss/portal/core/portlet/dashboard
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-19 09:30:14 -0500 (Tue, 19 Dec 2006)
New Revision: 5900
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java
Log:
remove redundant casts
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java 2006-12-19 14:01:49 UTC (rev 5899)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java 2006-12-19 14:30:14 UTC (rev 5900)
@@ -114,7 +114,7 @@
op = "editPage";
}
- String errorMessage = (String)req.getParameter("errorMsg");
+ String errorMessage = req.getParameter("errorMsg");
// load portal + page for editting.
Portal portal = (Portal)portalObjectContainer.getObject(dashboardId).getChild(req.getUser().getUserName());
@@ -126,7 +126,7 @@
}
else
{
- page = (Page)portal.getDefaultPage();
+ page = portal.getDefaultPage();
}
// load insances this user has access to.
@@ -213,7 +213,7 @@
String editPage = actionRequest.getParameter("editPageSelect"); // the current page we're editting
if (editPage == null || "default".equalsIgnoreCase(editPage))
{
- page = (Page)portal.getDefaultPage();
+ page = portal.getDefaultPage();
}
else
{
@@ -237,7 +237,7 @@
}
Window window = page.createWindow(windowName);
- window.setInstanceRef((String)copyInstance[i]);
+ window.setInstanceRef(copyInstance[i]);
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, toRegion);
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" + Integer.MAX_VALUE);
}
@@ -268,7 +268,7 @@
for (int i = 0; i < removeWindows.length; i++)
{
- page.destroyChild((String)removeWindows[i]);
+ page.destroyChild(removeWindows[i]);
}
}
catch (Exception e)
@@ -323,7 +323,7 @@
{
String pageName = actionRequest.getParameter("pagename");
- PageContainer pageContainer = (PageContainer)page.getPortal();
+ PageContainer pageContainer = page.getPortal();
try
{
19 years, 4 months