Seam SVN: r12814 - in modules/security/trunk/impl/src/main/java/org/jboss/seam/security: permission and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 10:37:17 -0400 (Wed, 26 May 2010)
New Revision: 12814
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
rethrow IllegalArgumentException and NPE
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java 2010-05-26 14:29:52 UTC (rev 12813)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java 2010-05-26 14:37:17 UTC (rev 12814)
@@ -43,7 +43,7 @@
//identityManager.deleteRole(originalRole);
}
- if (identityManager.roleExists(role))
+ if (identityManager.roleTypeExists(role))
{
return saveExistingRole();
}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java 2010-05-26 14:29:52 UTC (rev 12813)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java 2010-05-26 14:37:17 UTC (rev 12814)
@@ -84,7 +84,7 @@
protected void initProperties()
{
- recipientProperty = new AnnotatedBeanProperty<PermissionRecipient>(userPermissionClass, PermissionRecipient.class);
+ /*recipientProperty = new AnnotatedBeanProperty<PermissionRecipient>(userPermissionClass, PermissionRecipient.class);
targetProperty = new AnnotatedBeanProperty<PermissionTarget>(userPermissionClass, PermissionTarget.class);
actionProperty = new AnnotatedBeanProperty<PermissionAction>(userPermissionClass, PermissionAction.class);
@@ -108,7 +108,7 @@
PermissionRecipientType.class);
}
}
-
+ */
if (!recipientProperty.isSet())
{
throw new RuntimeException("Invalid userPermissionClass " + userPermissionClass.getName() +
@@ -699,7 +699,7 @@
if (targets != null)
{
- target = identifierCache.get(roleTargetProperty.getValue(permission));
+ //target = identifierCache.get(roleTargetProperty.getValue(permission));
if (target != null)
{
//actionSet = metadata.createActionSet(target.getClass(),
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 14:29:52 UTC (rev 12813)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 14:37:17 UTC (rev 12814)
@@ -281,15 +281,17 @@
}
catch (IllegalArgumentException ex)
{
- throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ throw new IllegalArgumentException(buildInvokeMethodErrorMessage(method, obj, args), ex.getCause());
}
catch (InvocationTargetException ex)
{
throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
}
catch (NullPointerException ex)
- {
- throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ {
+ NullPointerException ex2 = new NullPointerException(buildInvokeMethodErrorMessage(method, obj, args));
+ ex2.initCause(ex.getCause());
+ throw ex2;
}
catch (ExceptionInInitializerError e)
{
15 years, 11 months
Seam SVN: r12813 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 10:29:52 -0400 (Wed, 26 May 2010)
New Revision: 12813
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
oops
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 14:29:29 UTC (rev 12812)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 14:29:52 UTC (rev 12813)
@@ -293,7 +293,7 @@
}
catch (ExceptionInInitializerError e)
{
- throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), e);
}
}
15 years, 11 months
Seam SVN: r12812 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 10:29:29 -0400 (Wed, 26 May 2010)
New Revision: 12812
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
separate catch blocks for each exception
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 14:21:29 UTC (rev 12811)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 14:29:29 UTC (rev 12812)
@@ -275,35 +275,38 @@
{
return method.invoke(obj, args);
}
- catch (Throwable ex)
+ catch (IllegalAccessException ex)
{
- StringBuilder message = new StringBuilder(String.format(
- "Exception invoking method [%s] on object [%s], using arguments [",
- method.getName(), obj));
- if (args != null) for (int i = 0; i < args.length; i++) message.append((i > 0 ? "," : "") + args[i]);
- message.append("]");
-
- if (ex instanceof InvocationTargetException) ex = (Exception) ex.getCause();
-
- if (ex instanceof IllegalAccessException ||
- ex instanceof IllegalArgumentException ||
- ex instanceof InvocationTargetException ||
- ex instanceof NullPointerException ||
- ex instanceof ExceptionInInitializerError)
- {
- throw new RuntimeException(message.toString(), ex);
- }
- else if (ex instanceof RuntimeException)
- {
- throw (RuntimeException) ex;
- }
- else
- {
- throw new RuntimeException(ex);
- }
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
}
+ catch (IllegalArgumentException ex)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
+ catch (InvocationTargetException ex)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
+ catch (NullPointerException ex)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
+ catch (ExceptionInInitializerError e)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
}
+ private String buildInvokeMethodErrorMessage(Method method, Object obj, Object... args)
+ {
+ StringBuilder message = new StringBuilder(String.format(
+ "Exception invoking method [%s] on object [%s], using arguments [",
+ method.getName(), obj));
+ if (args != null) for (int i = 0; i < args.length; i++) message.append((i > 0 ? "," : "") + args[i]);
+ message.append("]");
+ return message.toString();
+ }
+
private Method getSetterMethod(Class<?> clazz, String name)
{
Method[] methods = clazz.getMethods();
15 years, 11 months
Seam SVN: r12811 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 10:21:29 -0400 (Wed, 26 May 2010)
New Revision: 12811
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
fix exception
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 13:30:13 UTC (rev 12810)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 14:21:29 UTC (rev 12811)
@@ -6,6 +6,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
+import java.lang.ExceptionInInitializerError;
/**
* A convenience class for working with an annotated property (either a field or method) of
@@ -274,7 +275,7 @@
{
return method.invoke(obj, args);
}
- catch (Exception ex)
+ catch (Throwable ex)
{
StringBuilder message = new StringBuilder(String.format(
"Exception invoking method [%s] on object [%s], using arguments [",
@@ -288,7 +289,7 @@
ex instanceof IllegalArgumentException ||
ex instanceof InvocationTargetException ||
ex instanceof NullPointerException ||
- ex instanceof ExceptionInInitializerException)
+ ex instanceof ExceptionInInitializerError)
{
throw new RuntimeException(message.toString(), ex);
}
15 years, 11 months
Seam SVN: r12810 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 09:30:13 -0400 (Wed, 26 May 2010)
New Revision: 12810
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
more fixes...
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 13:26:51 UTC (rev 12809)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 13:30:13 UTC (rev 12810)
@@ -292,6 +292,14 @@
{
throw new RuntimeException(message.toString(), ex);
}
+ else if (ex instanceof RuntimeException)
+ {
+ throw (RuntimeException) ex;
+ }
+ else
+ {
+ throw new RuntimeException(ex);
+ }
}
}
15 years, 11 months
Seam SVN: r12809 - in modules/security/trunk/impl/src/main/java/org/jboss/seam/security: permission and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 09:26:51 -0400 (Wed, 26 May 2010)
New Revision: 12809
Removed:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/TypedBeanProperty.java
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
exception messages
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-05-26 13:06:16 UTC (rev 12808)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-05-26 13:26:51 UTC (rev 12809)
@@ -79,9 +79,8 @@
public EntityProperty(Class<?> cls, Class<IdentityProperty> annotationClass, PropertyType pt)
{
- super();
- this.pt = pt;
- scan(cls, annotationClass);
+ super(cls, annotationClass);
+ this.pt = pt;
}
public boolean isMatch(IdentityProperty p)
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java 2010-05-26 13:06:16 UTC (rev 12808)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java 2010-05-26 13:26:51 UTC (rev 12809)
@@ -83,7 +83,7 @@
}
protected void initProperties()
- {
+ {
recipientProperty = new AnnotatedBeanProperty<PermissionRecipient>(userPermissionClass, PermissionRecipient.class);
targetProperty = new AnnotatedBeanProperty<PermissionTarget>(userPermissionClass, PermissionTarget.class);
actionProperty = new AnnotatedBeanProperty<PermissionAction>(userPermissionClass, PermissionAction.class);
@@ -643,17 +643,17 @@
if (targets != null)
{
- target = identifierCache.get(targetProperty.getValue(permission));
+ //target = identifierCache.get(targetProperty.getValue(permission));
if (target != null)
{
- actionSet = metadata.createActionSet(target.getClass(),
- actionProperty.getValue(permission).toString());
+ //actionSet = metadata.createActionSet(target.getClass(),
+ // actionProperty.getValue(permission).toString());
}
}
else
{
- actionSet = metadata.createActionSet(target.getClass(),
- actionProperty.getValue(permission).toString());
+ //actionSet = metadata.createActionSet(target.getClass(),
+ // actionProperty.getValue(permission).toString());
}
if (target != null && (action == null || (actionSet != null && actionSet.contains(action))))
@@ -702,14 +702,14 @@
target = identifierCache.get(roleTargetProperty.getValue(permission));
if (target != null)
{
- actionSet = metadata.createActionSet(target.getClass(),
- roleActionProperty.getValue(permission).toString());
+ //actionSet = metadata.createActionSet(target.getClass(),
+ // roleActionProperty.getValue(permission).toString());
}
}
else
{
- actionSet = metadata.createActionSet(target.getClass(),
- roleActionProperty.getValue(permission).toString());
+ //actionSet = metadata.createActionSet(target.getClass(),
+ // roleActionProperty.getValue(permission).toString());
}
if (target != null && (action == null || (actionSet != null && actionSet.contains(action))))
@@ -736,8 +736,8 @@
private Principal lookupPrincipal(Map<String,Principal> cache, Object permission, boolean isUser)
{
- Principal principal = resolvePrincipal(isUser ? recipientProperty.getValue(permission) :
- roleProperty.getValue(permission), isUser);
+ Principal principal = null; //resolvePrincipal(isUser ? recipientProperty.getValue(permission) :
+ //roleProperty.getValue(permission), isUser);
String key = (isUser ? "u:" : "r:") + principal.getName();
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 13:06:16 UTC (rev 12808)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 13:26:51 UTC (rev 12809)
@@ -268,39 +268,31 @@
}
}
- private Object invokeMethod(Method method, Object obj, Object... args) throws Exception
+ private Object invokeMethod(Method method, Object obj, Object... args)
{
try
{
return method.invoke(obj, args);
}
- catch (Exception e)
+ catch (Exception ex)
{
- if (e instanceof InvocationTargetException)
+ StringBuilder message = new StringBuilder(String.format(
+ "Exception invoking method [%s] on object [%s], using arguments [",
+ method.getName(), obj));
+ if (args != null) for (int i = 0; i < args.length; i++) message.append((i > 0 ? "," : "") + args[i]);
+ message.append("]");
+
+ if (ex instanceof InvocationTargetException) ex = (Exception) ex.getCause();
+
+ if (ex instanceof IllegalAccessException ||
+ ex instanceof IllegalArgumentException ||
+ ex instanceof InvocationTargetException ||
+ ex instanceof NullPointerException ||
+ ex instanceof ExceptionInInitializerException)
{
- InvocationTargetException ite = (InvocationTargetException) e;
- throw (Exception) ite.getCause();
+ throw new RuntimeException(message.toString(), ex);
}
- else if (e instanceof RuntimeException)
- {
- throw (RuntimeException) e;
- }
- else
- {
- StringBuilder sb = null;
- if (args != null)
- {
- sb = new StringBuilder();
- for (Object arg : args)
- {
- sb.append((sb.length() > 0 ? "," : ":") + arg);
- }
- }
- throw new IllegalArgumentException(
- String.format("Exception invoking method [%s] on object [%s], with arguments [%s].",
- method.getName(), obj, sb != null ? sb.toString() : ""));
- }
- }
+ }
}
private Method getSetterMethod(Class<?> clazz, String name)
Deleted: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/TypedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/TypedBeanProperty.java 2010-05-26 13:06:16 UTC (rev 12808)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/TypedBeanProperty.java 2010-05-26 13:26:51 UTC (rev 12809)
@@ -1,114 +0,0 @@
-package org.jboss.seam.security.util;
-
-import java.beans.Introspector;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-public class TypedBeanProperty
-{
- private Field propertyField;
- private Method propertyGetter;
- private Method propertySetter;
-
- private String name;
-
- private boolean isFieldProperty;
- private boolean set = false;
-
- public TypedBeanProperty(Class<?> cls, Class type)
- {
- // First check declared fields
- for (Field f : cls.getDeclaredFields())
- {
- if (f.getGenericType().equals(type))
- {
- setupFieldProperty(f);
- set = true;
- return;
- }
- }
-
- // Then check public fields, in case it's inherited
- for (Field f : cls.getFields())
- {
- if (f.getGenericType().equals(type))
- {
- setupFieldProperty(f);
- set = true;
- return;
- }
- }
-
- // Then check public methods (we ignore private methods)
- for (Method m : cls.getMethods())
- {
- if (m.getGenericReturnType().equals(type))
- {
- String methodName = m.getName();
-
- if ( m.getName().startsWith("get") )
- {
- this.name = Introspector.decapitalize( m.getName().substring(3) );
- }
- else if ( methodName.startsWith("is") )
- {
- this.name = Introspector.decapitalize( m.getName().substring(2) );
- }
-
- if (this.name != null)
- {
- this.propertyGetter = Reflections.getGetterMethod(cls, this.name);
- this.propertySetter = Reflections.getSetterMethod(cls, this.name);
- isFieldProperty = false;
- set = true;
- }
- else
- {
- throw new IllegalStateException("Invalid accessor method, must start with 'get' or 'is'. " +
- "Method: " + m + " in class: " + cls);
- }
- }
- }
- }
-
- private void setupFieldProperty(Field propertyField)
- {
- this.propertyField = propertyField;
- isFieldProperty = true;
- this.name = propertyField.getName();
- }
-
- public void setValue(Object bean, Object value)
- {
- if (isFieldProperty)
- {
- Reflections.setAndWrap(propertyField, bean, value);
- }
- else
- {
- Reflections.invokeAndWrap(propertySetter, bean, value);
- }
- }
-
- public Object getValue(Object bean)
- {
- if (isFieldProperty)
- {
- return Reflections.getAndWrap(propertyField, bean);
- }
- else
- {
- return Reflections.invokeAndWrap(propertyGetter, bean);
- }
- }
-
- public String getName()
- {
- return name;
- }
-
- public boolean isSet()
- {
- return set;
- }
-}
\ No newline at end of file
15 years, 11 months
Seam SVN: r12808 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 09:06:16 -0400 (Wed, 26 May 2010)
New Revision: 12808
Removed:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/Reflections.java
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
more enhancements
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 11:55:06 UTC (rev 12807)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 13:06:16 UTC (rev 12808)
@@ -3,12 +3,15 @@
import java.beans.Introspector;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
/**
* A convenience class for working with an annotated property (either a field or method) of
- * a JavaBean class.
+ * a JavaBean class. By providing an isMatch() method in a concrete implementation
+ * of this class, annotations may be matched on their attribute values or other
+ * conditions.
*
* @author Shane Bryzak
*/
@@ -24,20 +27,30 @@
private boolean isFieldProperty;
private boolean set = false;
- protected AnnotatedBeanProperty()
- {
- // noop
- }
+ private Class<?> targetClass;
+ private Class<T> annotationClass;
+ private boolean scanned = false;
+ /**
+ * Default constructor
+ *
+ * @param cls The class to scan for the property
+ * @param annotationClass The annotation class to scan for. Specified attribute
+ * values may be scanned for by providing an implementation of the isMatch() method.
+ */
public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass)
{
- scan(cls, annotationClass);
- }
+ this.targetClass = cls;
+ this.annotationClass = annotationClass;
+ }
- protected void scan(Class<?> cls, Class<T> annotationClass)
- {
+ /**
+ * Scans the target class to locate the annotated property
+ */
+ private void scan()
+ {
// First check declared fields
- for (Field f : cls.getDeclaredFields())
+ for (Field f : targetClass.getDeclaredFields())
{
if (f.isAnnotationPresent(annotationClass) &&
isMatch(f.getAnnotation(annotationClass)))
@@ -50,7 +63,7 @@
}
// Then check public fields, in case it's inherited
- for (Field f : cls.getFields())
+ for (Field f : targetClass.getFields())
{
if (f.isAnnotationPresent(annotationClass) &&
isMatch(f.getAnnotation(annotationClass)))
@@ -63,7 +76,7 @@
}
// Then check public methods (we ignore private methods)
- for (Method m : cls.getMethods())
+ for (Method m : targetClass.getMethods())
{
if (m.isAnnotationPresent(annotationClass) &&
isMatch(m.getAnnotation(annotationClass)))
@@ -82,8 +95,8 @@
if (this.name != null)
{
- this.propertyGetter = Reflections.getGetterMethod(cls, this.name);
- this.propertySetter = Reflections.getSetterMethod(cls, this.name);
+ this.propertyGetter = getGetterMethod(targetClass, this.name);
+ this.propertySetter = getSetterMethod(targetClass, this.name);
this.propertyType = this.propertyGetter.getGenericReturnType();
isFieldProperty = false;
set = true;
@@ -91,63 +104,246 @@
else
{
throw new IllegalStateException("Invalid accessor method, must start with 'get' or 'is'. " +
- "Method: " + m + " in class: " + cls);
+ "Method: " + m + " in class: " + targetClass);
}
}
}
+
+ scanned = true;
}
+ /**
+ * This method must be provided by a concrete implementation of this class. It
+ * may be used to scan for an annotation with one or more particular attribute
+ * values.
+ *
+ * @param annotation The potential match
+ * @return true if the specified annotation is a match
+ */
protected abstract boolean isMatch(T annotation);
- private void setupFieldProperty(Field propertyField)
+ /**
+ * This method sets the property value for a specified bean to the specified
+ * value. The property to be set is either a field or setter method that
+ * matches the specified annotation class and returns true for the isMatch()
+ * method.
+ *
+ * @param bean The bean containing the property to set
+ * @param value The new property value
+ * @throws Exception
+ */
+ public void setValue(Object bean, Object value) throws Exception
{
- this.propertyField = propertyField;
- isFieldProperty = true;
- this.name = propertyField.getName();
- this.propertyType = propertyField.getGenericType();
- }
-
- public void setValue(Object bean, Object value)
- {
+ if (!scanned) scan();
+
if (isFieldProperty)
{
- Reflections.setAndWrap(propertyField, bean, value);
+ setFieldValue(propertyField, bean, value);
}
else
{
- Reflections.invokeAndWrap(propertySetter, bean, value);
+ invokeMethod(propertySetter, bean, value);
}
}
-
- public Object getValue(Object bean)
+
+ /**
+ * Returns the property value for the specified bean. The property to be
+ * returned is either a field or getter method that matches the specified
+ * annotation class and returns true for the isMatch() method.
+ *
+ * @param bean The bean to read the property from
+ * @return The property value
+ * @throws Exception
+ */
+ public Object getValue(Object bean) throws Exception
{
+ if (!scanned) scan();
+
if (isFieldProperty)
{
- return Reflections.getAndWrap(propertyField, bean);
+ return getFieldValue(propertyField, bean);
}
else
{
- return Reflections.invokeAndWrap(propertyGetter, bean);
+ return invokeMethod(propertyGetter, bean);
}
}
+ /**
+ * Returns the name of the property. If the property is a field, then the
+ * field name is returned. Otherwise, if the property is a method, then the
+ * name that is returned is the getter method name without the "get" or "is"
+ * prefix, and a lower case first letter.
+ *
+ * @return The name of the property
+ */
public String getName()
{
+ if (!scanned) scan();
return name;
}
+ /**
+ * Returns the annotation type
+ *
+ * @return The annotation type
+ */
public T getAnnotation()
{
+ if (!scanned) scan();
return annotation;
}
+ /**
+ * Returns the property type
+ *
+ * @return The property type
+ */
public Type getPropertyType()
{
+ if (!scanned) scan();
return propertyType;
}
+ /**
+ * Returns true if the property has been successfully located, otherwise
+ * returns false.
+ *
+ * @return
+ */
public boolean isSet()
{
+ if (!scanned) scan();
return set;
}
+
+ private void setupFieldProperty(Field propertyField)
+ {
+ this.propertyField = propertyField;
+ isFieldProperty = true;
+ this.name = propertyField.getName();
+ this.propertyType = propertyField.getGenericType();
+ }
+
+ private Object getFieldValue(Field field, Object obj)
+ {
+ try
+ {
+ return field.get(obj);
+ }
+ catch (Exception e)
+ {
+ if (e instanceof RuntimeException)
+ {
+ throw (RuntimeException) e;
+ }
+ else
+ {
+ throw new IllegalArgumentException(
+ String.format("Exception reading [%s] field from object [%s].",
+ field.getName(), obj), e);
+ }
+ }
+ }
+
+ private void setFieldValue(Field field, Object obj, Object value)
+ {
+ field.setAccessible(true);
+ try
+ {
+ field.set(obj, value);
+ }
+ catch (Exception e)
+ {
+ if (e instanceof RuntimeException)
+ {
+ throw (RuntimeException) e;
+ }
+ else
+ {
+ throw new IllegalArgumentException(
+ String.format("Exception setting [%s] field on object [%s] to value [%s]",
+ field.getName(), obj, value), e);
+ }
+ }
+ }
+
+ private Object invokeMethod(Method method, Object obj, Object... args) throws Exception
+ {
+ try
+ {
+ return method.invoke(obj, args);
+ }
+ catch (Exception e)
+ {
+ if (e instanceof InvocationTargetException)
+ {
+ InvocationTargetException ite = (InvocationTargetException) e;
+ throw (Exception) ite.getCause();
+ }
+ else if (e instanceof RuntimeException)
+ {
+ throw (RuntimeException) e;
+ }
+ else
+ {
+ StringBuilder sb = null;
+ if (args != null)
+ {
+ sb = new StringBuilder();
+ for (Object arg : args)
+ {
+ sb.append((sb.length() > 0 ? "," : ":") + arg);
+ }
+ }
+ throw new IllegalArgumentException(
+ String.format("Exception invoking method [%s] on object [%s], with arguments [%s].",
+ method.getName(), obj, sb != null ? sb.toString() : ""));
+ }
+ }
+ }
+
+ private Method getSetterMethod(Class<?> clazz, String name)
+ {
+ Method[] methods = clazz.getMethods();
+ for (Method method: methods)
+ {
+ String methodName = method.getName();
+ if ( methodName.startsWith("set") && method.getParameterTypes().length==1 )
+ {
+ if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ }
+ throw new IllegalArgumentException("no such setter method: " + clazz.getName() + '.' + name);
+ }
+
+ private Method getGetterMethod(Class<?> clazz, String name)
+ {
+ Method[] methods = clazz.getMethods();
+ for (Method method: methods)
+ {
+ String methodName = method.getName();
+ if ( method.getParameterTypes().length==0 )
+ {
+ if ( methodName.startsWith("get") )
+ {
+ if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ else if ( methodName.startsWith("is") )
+ {
+ if ( Introspector.decapitalize( methodName.substring(2) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ }
+ }
+ throw new IllegalArgumentException("no such getter method: " + clazz.getName() + '.' + name);
+ }
}
\ No newline at end of file
Deleted: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/Reflections.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/Reflections.java 2010-05-26 11:55:06 UTC (rev 12807)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/Reflections.java 2010-05-26 13:06:16 UTC (rev 12808)
@@ -1,401 +0,0 @@
-package org.jboss.seam.security.util;
-
-import java.beans.Introspector;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Reflections
-{
-
- public static Object invoke(Method method, Object target, Object... args) throws Exception
- {
- try
- {
- return method.invoke( target, args );
- }
- catch (IllegalArgumentException iae)
- {
- String message = "Could not invoke method by reflection: " + toString(method);
- if (args!=null && args.length>0)
- {
- message += " with parameters: (" + Strings.toClassNameString(", ", args) + ')';
- }
- message += " on: " + target.getClass().getName();
- throw new IllegalArgumentException(message, iae);
- }
- catch (InvocationTargetException ite)
- {
- if ( ite.getCause() instanceof Exception )
- {
- throw (Exception) ite.getCause();
- }
- else
- {
- throw ite;
- }
- }
- }
-
- public static Object get(Field field, Object target) throws Exception
- {
- boolean accessible = field.isAccessible();
- try
- {
- field.setAccessible(true);
- return field.get(target);
- }
- catch (IllegalArgumentException iae)
- {
- String message = "Could not get field value by reflection: " + toString(field) +
- " on: " + target.getClass().getName();
- throw new IllegalArgumentException(message, iae);
- }
- finally
- {
- field.setAccessible(accessible);
- }
- }
-
- public static void set(Field field, Object target, Object value) throws Exception
- {
- try
- {
- field.set(target, value);
- }
- catch (IllegalArgumentException iae)
- {
- // target may be null if field is static so use field.getDeclaringClass() instead
- String message = "Could not set field value by reflection: " + toString(field) +
- " on: " + field.getDeclaringClass().getName();
- if (value==null)
- {
- message += " with null value";
- }
- else
- {
- message += " with value: " + value.getClass();
- }
- throw new IllegalArgumentException(message, iae);
- }
- }
-
- public static Object getAndWrap(Field field, Object target)
- {
- boolean accessible = field.isAccessible();
- try
- {
- field.setAccessible(true);
- return get(field, target);
- }
- catch (Exception e)
- {
- if (e instanceof RuntimeException)
- {
- throw (RuntimeException) e;
- }
- else
- {
- throw new IllegalArgumentException("exception setting: " + field.getName(), e);
- }
- }
- finally
- {
- field.setAccessible(accessible);
- }
- }
-
- public static void setAndWrap(Field field, Object target, Object value)
- {
- boolean accessible = field.isAccessible();
- try
- {
- field.setAccessible(true);
- set(field, target, value);
- }
- catch (Exception e)
- {
- if (e instanceof RuntimeException)
- {
- throw (RuntimeException) e;
- }
- else
- {
- throw new IllegalArgumentException("exception setting: " + field.getName(), e);
- }
- }
- finally
- {
- field.setAccessible(accessible);
- }
- }
-
- public static Object invokeAndWrap(Method method, Object target, Object... args)
- {
- try
- {
- return invoke(method, target, args);
- }
- catch (Exception e)
- {
- if (e instanceof RuntimeException)
- {
- throw (RuntimeException) e;
- }
- else
- {
- throw new RuntimeException("exception invoking: " + method.getName(), e);
- }
- }
- }
-
- public static String toString(Method method)
- {
- return Strings.unqualify( method.getDeclaringClass().getName() ) +
- '.' +
- method.getName() +
- '(' +
- Strings.toString( ", ", method.getParameterTypes() ) +
- ')';
- }
-
- public static String toString(Member member)
- {
- return Strings.unqualify( member.getDeclaringClass().getName() ) +
- '.' +
- member.getName();
- }
-
- public static Class classForName(String name) throws ClassNotFoundException
- {
- try
- {
- return Thread.currentThread().getContextClassLoader().loadClass(name);
- }
- catch (Exception e)
- {
- return Class.forName(name);
- }
- }
-
- /**
- * Return's true if the class can be loaded using Reflections.classForName()
- */
- public static boolean isClassAvailable(String name)
- {
- try
- {
- classForName(name);
- }
- catch (ClassNotFoundException e) {
- return false;
- }
- return true;
- }
-
- public static Class getCollectionElementType(Type collectionType)
- {
- if ( !(collectionType instanceof ParameterizedType) )
- {
- throw new IllegalArgumentException("collection type not parameterized");
- }
- Type[] typeArguments = ( (ParameterizedType) collectionType ).getActualTypeArguments();
- if (typeArguments.length==0)
- {
- throw new IllegalArgumentException("no type arguments for collection type");
- }
- Type typeArgument = typeArguments.length==1 ? typeArguments[0] : typeArguments[1]; //handle Maps
- if (typeArgument instanceof ParameterizedType)
- {
- typeArgument = ((ParameterizedType) typeArgument).getRawType();
- }
- if ( !(typeArgument instanceof Class) )
- {
- throw new IllegalArgumentException("type argument not a class");
- }
- return (Class) typeArgument;
- }
-
- public static Class getMapKeyType(Type collectionType)
- {
- if ( !(collectionType instanceof ParameterizedType) )
- {
- throw new IllegalArgumentException("collection type not parameterized");
- }
- Type[] typeArguments = ( (ParameterizedType) collectionType ).getActualTypeArguments();
- if (typeArguments.length==0)
- {
- throw new IllegalArgumentException("no type arguments for collection type");
- }
- Type typeArgument = typeArguments[0];
- if ( !(typeArgument instanceof Class) )
- {
- throw new IllegalArgumentException("type argument not a class");
- }
- return (Class) typeArgument;
- }
-
- public static Method getSetterMethod(Class clazz, String name)
- {
- Method[] methods = clazz.getMethods();
- for (Method method: methods)
- {
- String methodName = method.getName();
- if ( methodName.startsWith("set") && method.getParameterTypes().length==1 )
- {
- if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
- {
- return method;
- }
- }
- }
- throw new IllegalArgumentException("no such setter method: " + clazz.getName() + '.' + name);
- }
-
- public static Method getGetterMethod(Class clazz, String name)
- {
- Method[] methods = clazz.getMethods();
- for (Method method: methods)
- {
- String methodName = method.getName();
- if ( method.getParameterTypes().length==0 )
- {
- if ( methodName.startsWith("get") )
- {
- if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
- {
- return method;
- }
- }
- else if ( methodName.startsWith("is") )
- {
- if ( Introspector.decapitalize( methodName.substring(2) ).equals(name) )
- {
- return method;
- }
- }
- }
- }
- throw new IllegalArgumentException("no such getter method: " + clazz.getName() + '.' + name);
- }
-
- /**
- * Get all the getter methods annotated with the given annotation. Returns an empty list if
- * none are found
- */
- public static List<Method> getGetterMethods(Class clazz, Class annotation)
- {
- List<Method> methods = new ArrayList<Method>();
- for (Method method : clazz.getMethods())
- {
- if (method.isAnnotationPresent(annotation))
- {
- methods.add(method);
- }
- }
- return methods;
- }
-
- public static Field getField(Class clazz, String name)
- {
- for ( Class superClass = clazz; superClass!=Object.class; superClass=superClass.getSuperclass() )
- {
- try
- {
- return superClass.getDeclaredField(name);
- }
- catch (NoSuchFieldException nsfe) {}
- }
- throw new IllegalArgumentException("no such field: " + clazz.getName() + '.' + name);
- }
-
- /**
- * Get all the fields which are annotated with the given annotation. Returns an empty list
- * if none are found
- */
- public static List<Field> getFields(Class clazz, Class annotation)
- {
- List<Field> fields = new ArrayList<Field>();
- for (Class superClass = clazz; superClass!=Object.class; superClass=superClass.getSuperclass())
- {
- for (Field field : superClass.getDeclaredFields())
- {
- if (field.isAnnotationPresent(annotation))
- {
- fields.add(field);
- }
- }
- }
- return fields;
- }
-
- public static Method getMethod(Annotation annotation, String name)
- {
- try
- {
- return annotation.annotationType().getMethod(name);
- }
- catch (NoSuchMethodException nsme)
- {
- return null;
- }
- }
-
- public static Method getMethod(Class clazz, String name)
- {
- for ( Class superClass = clazz; superClass!=Object.class; superClass=superClass.getSuperclass() )
- {
- try
- {
- return superClass.getDeclaredMethod(name);
- }
- catch (NoSuchMethodException nsme) {}
- }
- throw new IllegalArgumentException("no such method: " + clazz.getName() + '.' + name);
- }
-
- /**
- * Check to see if clazz is an instance of name
- */
- public static boolean isInstanceOf(Class clazz, String name)
- {
- if (name == null)
- {
- throw new IllegalArgumentException("name cannot be null");
- }
- for (Class c = clazz; c != Object.class; c = c.getSuperclass())
- {
- if (instanceOf(c, name))
- {
- return true;
- }
- }
- return false;
- }
-
- private static boolean instanceOf(Class clazz, String name)
- {
- if (name.equals(clazz.getName()))
- {
- return true;
- }
- else
- {
- boolean found = false;
- Class[] interfaces = clazz.getInterfaces();
- for (int i = 0; i < interfaces.length && !found; i++)
- {
- found = instanceOf(interfaces[i], name);
- }
- return found;
- }
-
- }
-
-}
15 years, 11 months
Seam SVN: r12807 - in modules/security/trunk: impl/src/main/java/org/jboss/seam/security/management and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 07:55:06 -0400 (Wed, 26 May 2010)
New Revision: 12807
Modified:
modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityManager.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
rewrite AnnotatedBeanProperty stuff
Modified: modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityManager.java
===================================================================
--- modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityManager.java 2010-05-26 09:33:30 UTC (rev 12806)
+++ modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityManager.java 2010-05-26 11:55:06 UTC (rev 12807)
@@ -2,6 +2,7 @@
import java.util.List;
+import org.picketlink.idm.api.Credential;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentityType;
import org.picketlink.idm.api.Role;
@@ -13,7 +14,7 @@
*/
public interface IdentityManager
{
- boolean createUser(String username, String password);
+ boolean createUser(String username, Credential credential);
boolean deleteUser(String username);
@@ -21,7 +22,7 @@
boolean disableUser(String username);
- boolean changePassword(String username, String password);
+ boolean changePassword(String username, Credential credential);
boolean isUserEnabled(String username);
@@ -35,14 +36,22 @@
boolean userExists(String username);
- boolean roleExists(String username);
+ boolean roleTypeExists(String roleType);
- List<String> getUsers();
+ boolean createGroup(Group group);
- List<String> getUsers(String filter);
+ boolean deleteGroup(Group group);
- List<String> getRoles();
+ boolean addToGroup(String username, Group group);
+ boolean removeFromGroup(String username, Group group);
+
+ List<String> findUsers();
+
+ List<String> findUsers(String filter);
+
+ List<String> getRoleTypes();
+
List<String> getGrantableRoles();
/**
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-05-26 09:33:30 UTC (rev 12806)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-05-26 11:55:06 UTC (rev 12807)
@@ -12,7 +12,6 @@
import org.jboss.seam.security.annotations.management.IdentityProperty;
import org.jboss.seam.security.annotations.management.PropertyType;
import org.jboss.seam.security.util.AnnotatedBeanProperty;
-import org.jboss.seam.security.util.AnnotatedBeanProperty.AttributeValue;
import org.picketlink.idm.api.Credential;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentityType;
@@ -36,26 +35,20 @@
private static final String DEFAULT_RELATIONSHIP_TYPE_MEMBERSHIP = "MEMBERSHIP";
private static final String DEFAULT_RELATIONSHIP_TYPE_ROLE = "ROLE";
-
- private static final AttributeValue NAME_ATTRIBUTE = new AttributeValue("value", PropertyType.NAME);
- private static final AttributeValue VALUE_ATTRIBUTE = new AttributeValue("value", PropertyType.VALUE);
- private static final AttributeValue TYPE_ATTRIBUTE = new AttributeValue("value", PropertyType.TYPE);
- private static final AttributeValue RELATIONSHIP_FROM_ATTRIBUTE = new AttributeValue("value", PropertyType.RELATIONSHIP_FROM);
- private static final AttributeValue RELATIONSHIP_TO_ATTRIBUTE = new AttributeValue("value", PropertyType.RELATIONSHIP_TO);
-
+
private Logger log = LoggerFactory.getLogger(JpaIdentityStore.class);
// The following entity classes are configurable
private Class<?> identityObjectEntity;
- private Class<?> identityObjectRelationshipEntity;
- private Class<?> identityObjectCredentialEntity;
- private Class<?> identityObjectAttributeEntity;
- private Class<?> identityRoleTypeEntity;
+ private Class<?> relationshipEntity;
+ private Class<?> credentialEntity;
+ private Class<?> attributeEntity;
+ private Class<?> roleTypeEntity;
// The following entity classes may be determined automatically
- private Class<?> identityObjectTypeEntity;
- private Class<?> identityObjectRelationshipTypeEntity;
- private Class<?> identityObjectCredentialTypeEntity;
+ private Class<?> identityTypeEntity;
+ private Class<?> relationshipTypeEntity;
+ private Class<?> credentialTypeEntity;
private AnnotatedBeanProperty<IdentityProperty> identityNameProperty;
@@ -80,6 +73,23 @@
private String relationshipTypeMembership = DEFAULT_RELATIONSHIP_TYPE_MEMBERSHIP;
private String relationshipTypeRole = DEFAULT_RELATIONSHIP_TYPE_ROLE;
+ private class EntityProperty extends AnnotatedBeanProperty<IdentityProperty>
+ {
+ private PropertyType pt;
+
+ public EntityProperty(Class<?> cls, Class<IdentityProperty> annotationClass, PropertyType pt)
+ {
+ super();
+ this.pt = pt;
+ scan(cls, annotationClass);
+ }
+
+ public boolean isMatch(IdentityProperty p)
+ {
+ return p.value().equals(pt);
+ }
+ }
+
@Inject
public void init()
{
@@ -89,56 +99,61 @@
"Error initializing JpaIdentityStore - identityObjectEntity not set");
}
- if (identityObjectRelationshipEntity == null)
+ if (relationshipEntity == null)
{
throw new IdentityManagementException(
"Error initializing JpaIdentityStore - identityObjectRelationshipEntity not set");
}
- identityNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectEntity, IdentityProperty.class, NAME_ATTRIBUTE);
- identityTypeProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectEntity, IdentityProperty.class, TYPE_ATTRIBUTE);
+ identityNameProperty = new EntityProperty(identityObjectEntity,
+ IdentityProperty.class, PropertyType.NAME);
+ identityTypeProperty = new EntityProperty(identityObjectEntity,
+ IdentityProperty.class, PropertyType.TYPE);
+
if (!String.class.equals(identityTypeProperty.getPropertyType()))
{
// If the identity type property isn't a String, it must be a related entity
- identityObjectTypeEntity = (Class<?>) identityTypeProperty.getPropertyType();
- identityTypeNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectTypeEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ identityTypeEntity = (Class<?>) identityTypeProperty.getPropertyType();
+
+ identityTypeNameProperty = new EntityProperty(identityTypeEntity,
+ IdentityProperty.class, PropertyType.NAME);
}
- relationshipNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectRelationshipEntity, IdentityProperty.class, NAME_ATTRIBUTE);
- relationshipFromProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectRelationshipEntity, IdentityProperty.class, RELATIONSHIP_FROM_ATTRIBUTE);
- relationshipToProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectRelationshipEntity, IdentityProperty.class, RELATIONSHIP_TO_ATTRIBUTE);
- relationshipTypeProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectRelationshipEntity, IdentityProperty.class, TYPE_ATTRIBUTE);
+ relationshipNameProperty = new EntityProperty(relationshipEntity,
+ IdentityProperty.class, PropertyType.NAME);
+ relationshipFromProperty = new EntityProperty(relationshipEntity,
+ IdentityProperty.class, PropertyType.RELATIONSHIP_FROM);
+
+ relationshipToProperty = new EntityProperty(relationshipEntity,
+ IdentityProperty.class, PropertyType.RELATIONSHIP_TO);
+
+ relationshipTypeProperty = new EntityProperty(relationshipEntity,
+ IdentityProperty.class, PropertyType.TYPE);
+
if (!String.class.equals(relationshipTypeProperty.getPropertyType()))
{
- identityObjectRelationshipTypeEntity = (Class<?>) relationshipTypeProperty.getPropertyType();
- relationshipTypeNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectRelationshipTypeEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ relationshipTypeEntity = (Class<?>) relationshipTypeProperty.getPropertyType();
+ relationshipTypeNameProperty = new EntityProperty(relationshipTypeEntity,
+ IdentityProperty.class, PropertyType.NAME);
}
// If a credential entity has been configured, scan it
- if (identityObjectCredentialEntity != null)
+ if (credentialEntity != null)
{
- credentialTypeProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectCredentialEntity, IdentityProperty.class, TYPE_ATTRIBUTE);
+ credentialTypeProperty = new EntityProperty(credentialEntity,
+ IdentityProperty.class, PropertyType.TYPE);
if (!String.class.equals(credentialTypeProperty.getPropertyType()))
{
- identityObjectCredentialTypeEntity = (Class<?>) credentialTypeProperty.getPropertyType();
- credentialTypeNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectCredentialTypeEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ credentialTypeEntity = (Class<?>) credentialTypeProperty.getPropertyType();
+ credentialTypeNameProperty = new EntityProperty(credentialTypeEntity,
+ IdentityProperty.class, PropertyType.NAME);
}
- credentialValueProperty = new AnnotatedBeanProperty<IdentityProperty>(
- identityObjectCredentialEntity, IdentityProperty.class, VALUE_ATTRIBUTE);
+ credentialValueProperty = new EntityProperty(credentialEntity,
+ IdentityProperty.class, PropertyType.VALUE);
}
// otherwise assume that the credential value is stored in the identityObjectEntity
else
@@ -162,42 +177,42 @@
public Class<?> getIdentityObjectRelationshipEntity()
{
- return identityObjectRelationshipEntity;
+ return relationshipEntity;
}
public void setIdentityObjectRelationshipEntity(Class<?> identityObjectRelationshipEntity)
{
- this.identityObjectRelationshipEntity = identityObjectRelationshipEntity;
+ this.relationshipEntity = identityObjectRelationshipEntity;
}
public Class<?> getIdentityObjectCredentialEntity()
{
- return identityObjectCredentialEntity;
+ return credentialEntity;
}
public void setIdentityObjectCredentialEntity(Class<?> identityObjectCredentialEntity)
{
- this.identityObjectCredentialEntity = identityObjectCredentialEntity;
+ this.credentialEntity = identityObjectCredentialEntity;
}
public Class<?> getIdentityObjectAttributeEntity()
{
- return identityObjectAttributeEntity;
+ return attributeEntity;
}
public void setIdentityObjectAttributeEntity(Class<?> identityObjectAttributeEntity)
{
- this.identityObjectAttributeEntity = identityObjectAttributeEntity;
+ this.attributeEntity = identityObjectAttributeEntity;
}
public Class<?> getIdentityRoleTypeEntity()
{
- return identityRoleTypeEntity;
+ return roleTypeEntity;
}
public void setIdentityRoleTypeEntity(Class<?> identityRoleTypeEntity)
{
- this.identityRoleTypeEntity = identityRoleTypeEntity;
+ this.roleTypeEntity = identityRoleTypeEntity;
}
public String getUserIdentityType()
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 09:33:30 UTC (rev 12806)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 11:55:06 UTC (rev 12807)
@@ -5,8 +5,6 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.Map;
/**
* A convenience class for working with an annotated property (either a field or method) of
@@ -14,7 +12,7 @@
*
* @author Shane Bryzak
*/
-public class AnnotatedBeanProperty<T extends Annotation>
+public abstract class AnnotatedBeanProperty<T extends Annotation>
{
private Field propertyField;
private Method propertyGetter;
@@ -26,35 +24,23 @@
private boolean isFieldProperty;
private boolean set = false;
- public static class AttributeValue
+ protected AnnotatedBeanProperty()
{
- private String name;
- private Object value;
-
- public AttributeValue(String name, Object value)
- {
- this.name = name;
- this.value = value;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Object getValue()
- {
- return value;
- }
+ // noop
}
- public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass, AttributeValue... attributes)
+ public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass)
{
+ scan(cls, annotationClass);
+ }
+
+ protected void scan(Class<?> cls, Class<T> annotationClass)
+ {
// First check declared fields
for (Field f : cls.getDeclaredFields())
{
if (f.isAnnotationPresent(annotationClass) &&
- attributesMatch(f.getAnnotation(annotationClass), attributes))
+ isMatch(f.getAnnotation(annotationClass)))
{
setupFieldProperty(f);
this.annotation = f.getAnnotation(annotationClass);
@@ -66,8 +52,8 @@
// Then check public fields, in case it's inherited
for (Field f : cls.getFields())
{
- if (f.isAnnotationPresent(annotationClass) &&
- attributesMatch(f.getAnnotation(annotationClass), attributes))
+ if (f.isAnnotationPresent(annotationClass) &&
+ isMatch(f.getAnnotation(annotationClass)))
{
this.annotation = f.getAnnotation(annotationClass);
setupFieldProperty(f);
@@ -79,8 +65,8 @@
// Then check public methods (we ignore private methods)
for (Method m : cls.getMethods())
{
- if (m.isAnnotationPresent(annotationClass) &&
- attributesMatch(m.getAnnotation(annotationClass), attributes))
+ if (m.isAnnotationPresent(annotationClass) &&
+ isMatch(m.getAnnotation(annotationClass)))
{
this.annotation = m.getAnnotation(annotationClass);
String methodName = m.getName();
@@ -108,34 +94,10 @@
"Method: " + m + " in class: " + cls);
}
}
- }
+ }
}
- private boolean attributesMatch(T annotation, AttributeValue[] attributes)
- {
- Class<?> cls = annotation.getClass();
- for (AttributeValue attrib : attributes)
- {
- try
- {
- Field f = cls.getField(attrib.getName());
- if (!f.get(annotation).equals(attrib.getValue()))
- {
- return false;
- }
- }
- catch (IllegalAccessException e)
- {
- return false;
- }
- catch (NoSuchFieldException e)
- {
- return false;
- }
- }
-
- return true;
- }
+ protected abstract boolean isMatch(T annotation);
private void setupFieldProperty(Field propertyField)
{
15 years, 11 months
Seam SVN: r12806 - in modules/security/trunk: impl/src/main/java/org/jboss/seam/security/management and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-26 05:33:30 -0400 (Wed, 26 May 2010)
New Revision: 12806
Modified:
modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
Log:
implement some of the JpaIdentityStore configuration
Modified: modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java
===================================================================
--- modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java 2010-05-26 08:59:51 UTC (rev 12805)
+++ modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java 2010-05-26 09:33:30 UTC (rev 12806)
@@ -3,8 +3,10 @@
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import org.picketlink.idm.api.Credential;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentityType;
import org.picketlink.idm.api.Role;
@@ -80,19 +82,12 @@
boolean supportsFeature(Feature feature);
/**
- * Creates a new user with the specified username and password.
+ * Creates a new user with the specified username and credential.
* @return true if the user was successfully created.
*/
- boolean createUser(String username, String password);
-
+ boolean createUser(String username, Credential credential, Map<String,?> attributes);
+
/**
- * Creates a new user with the specified username, password, first name and last name.
- *
- * @return true if the user was successfully created.
- */
- boolean createUser(String username, String password, String firstname, String lastname);
-
- /**
* Deletes the user with the specified username.
* @return true if the user was successfully deleted.
*/
@@ -116,10 +111,10 @@
boolean isUserEnabled(String username);
/**
- * Changes the password of the specified user to the specified password.
- * @return true if the user's password was successfully changed.
+ * Updates the credential of the specified user.
+ * @return true if the user's credential was successfully changed.
*/
- boolean changePassword(String username, String password);
+ boolean updateCredential(String username, Credential credential);
/**
* Returns true if the specified user exists.
@@ -250,9 +245,9 @@
List<IdentityType> listGroupMembers(Group group);
/**
- * Authenticates the specified user, using the specified password.
+ * Authenticates the specified user, using the specified credential.
*
* @return true if authentication is successful.
*/
- boolean authenticate(String username, String password);
+ boolean authenticate(String username, Credential credential);
}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-05-26 08:59:51 UTC (rev 12805)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-05-26 09:33:30 UTC (rev 12806)
@@ -2,10 +2,18 @@
import java.io.Serializable;
import java.util.List;
+import java.util.Map;
import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Instance;
import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import org.jboss.seam.security.annotations.management.IdentityProperty;
+import org.jboss.seam.security.annotations.management.PropertyType;
+import org.jboss.seam.security.util.AnnotatedBeanProperty;
+import org.jboss.seam.security.util.AnnotatedBeanProperty.AttributeValue;
+import org.picketlink.idm.api.Credential;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentityType;
import org.picketlink.idm.api.Role;
@@ -24,19 +32,124 @@
private static final String DEFAULT_USER_IDENTITY_TYPE = "USER";
private static final String DEFAULT_ROLE_IDENTITY_TYPE = "ROLE";
- private static final String DEFAULT_GROUP_IDENTITY_TYPE = "GROUP";
+ private static final String DEFAULT_GROUP_IDENTITY_TYPE = "GROUP";
+ private static final String DEFAULT_RELATIONSHIP_TYPE_MEMBERSHIP = "MEMBERSHIP";
+ private static final String DEFAULT_RELATIONSHIP_TYPE_ROLE = "ROLE";
+
+ private static final AttributeValue NAME_ATTRIBUTE = new AttributeValue("value", PropertyType.NAME);
+ private static final AttributeValue VALUE_ATTRIBUTE = new AttributeValue("value", PropertyType.VALUE);
+ private static final AttributeValue TYPE_ATTRIBUTE = new AttributeValue("value", PropertyType.TYPE);
+ private static final AttributeValue RELATIONSHIP_FROM_ATTRIBUTE = new AttributeValue("value", PropertyType.RELATIONSHIP_FROM);
+ private static final AttributeValue RELATIONSHIP_TO_ATTRIBUTE = new AttributeValue("value", PropertyType.RELATIONSHIP_TO);
+
private Logger log = LoggerFactory.getLogger(JpaIdentityStore.class);
+ // The following entity classes are configurable
private Class<?> identityObjectEntity;
private Class<?> identityObjectRelationshipEntity;
private Class<?> identityObjectCredentialEntity;
private Class<?> identityObjectAttributeEntity;
+ private Class<?> identityRoleTypeEntity;
+ // The following entity classes may be determined automatically
+ private Class<?> identityObjectTypeEntity;
+ private Class<?> identityObjectRelationshipTypeEntity;
+ private Class<?> identityObjectCredentialTypeEntity;
+
+
+ private AnnotatedBeanProperty<IdentityProperty> identityNameProperty;
+ private AnnotatedBeanProperty<IdentityProperty> identityTypeProperty;
+ private AnnotatedBeanProperty<IdentityProperty> identityTypeNameProperty;
+ private AnnotatedBeanProperty<IdentityProperty> relationshipNameProperty;
+ private AnnotatedBeanProperty<IdentityProperty> relationshipTypeProperty;
+ private AnnotatedBeanProperty<IdentityProperty> relationshipFromProperty;
+ private AnnotatedBeanProperty<IdentityProperty> relationshipToProperty;
+ private AnnotatedBeanProperty<IdentityProperty> relationshipTypeNameProperty;
+ private AnnotatedBeanProperty<IdentityProperty> credentialTypeProperty;
+ private AnnotatedBeanProperty<IdentityProperty> credentialValueProperty;
+ private AnnotatedBeanProperty<IdentityProperty> credentialTypeNameProperty;
+ private AnnotatedBeanProperty<IdentityProperty> attributeNameProperty;
+ private AnnotatedBeanProperty<IdentityProperty> attributeValueProperty;
+ private AnnotatedBeanProperty<IdentityProperty> roleTypeNameProperty;
+
private String userIdentityType = DEFAULT_USER_IDENTITY_TYPE;
private String roleIdentityType = DEFAULT_ROLE_IDENTITY_TYPE;
private String groupIdentityType = DEFAULT_GROUP_IDENTITY_TYPE;
+ private String relationshipTypeMembership = DEFAULT_RELATIONSHIP_TYPE_MEMBERSHIP;
+ private String relationshipTypeRole = DEFAULT_RELATIONSHIP_TYPE_ROLE;
+
+ @Inject
+ public void init()
+ {
+ if (identityObjectEntity == null)
+ {
+ throw new IdentityManagementException(
+ "Error initializing JpaIdentityStore - identityObjectEntity not set");
+ }
+
+ if (identityObjectRelationshipEntity == null)
+ {
+ throw new IdentityManagementException(
+ "Error initializing JpaIdentityStore - identityObjectRelationshipEntity not set");
+ }
+
+ identityNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ identityTypeProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectEntity, IdentityProperty.class, TYPE_ATTRIBUTE);
+
+ if (!String.class.equals(identityTypeProperty.getPropertyType()))
+ {
+ // If the identity type property isn't a String, it must be a related entity
+ identityObjectTypeEntity = (Class<?>) identityTypeProperty.getPropertyType();
+ identityTypeNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectTypeEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ }
+
+ relationshipNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectRelationshipEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ relationshipFromProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectRelationshipEntity, IdentityProperty.class, RELATIONSHIP_FROM_ATTRIBUTE);
+ relationshipToProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectRelationshipEntity, IdentityProperty.class, RELATIONSHIP_TO_ATTRIBUTE);
+ relationshipTypeProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectRelationshipEntity, IdentityProperty.class, TYPE_ATTRIBUTE);
+
+ if (!String.class.equals(relationshipTypeProperty.getPropertyType()))
+ {
+ identityObjectRelationshipTypeEntity = (Class<?>) relationshipTypeProperty.getPropertyType();
+ relationshipTypeNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectRelationshipTypeEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ }
+
+ // If a credential entity has been configured, scan it
+ if (identityObjectCredentialEntity != null)
+ {
+ credentialTypeProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectCredentialEntity, IdentityProperty.class, TYPE_ATTRIBUTE);
+
+ if (!String.class.equals(credentialTypeProperty.getPropertyType()))
+ {
+ identityObjectCredentialTypeEntity = (Class<?>) credentialTypeProperty.getPropertyType();
+ credentialTypeNameProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectCredentialTypeEntity, IdentityProperty.class, NAME_ATTRIBUTE);
+ }
+
+ credentialValueProperty = new AnnotatedBeanProperty<IdentityProperty>(
+ identityObjectCredentialEntity, IdentityProperty.class, VALUE_ATTRIBUTE);
+ }
+ // otherwise assume that the credential value is stored in the identityObjectEntity
+ else
+ {
+ // TODO implement this, we'll probably need some new PropertyType enums to support it
+ }
+
+
+
+ }
+
public Class<?> getIdentityObjectEntity()
{
return identityObjectEntity;
@@ -77,6 +190,16 @@
this.identityObjectAttributeEntity = identityObjectAttributeEntity;
}
+ public Class<?> getIdentityRoleTypeEntity()
+ {
+ return identityRoleTypeEntity;
+ }
+
+ public void setIdentityRoleTypeEntity(Class<?> identityRoleTypeEntity)
+ {
+ this.identityRoleTypeEntity = identityRoleTypeEntity;
+ }
+
public String getUserIdentityType()
{
return userIdentityType;
@@ -107,21 +230,50 @@
this.groupIdentityType = groupIdentityType;
}
- @Inject PasswordEncoder passwordEncoder;
+ public String getRelationshipTypeMembership()
+ {
+ return relationshipTypeMembership;
+ }
+
+ public void setRelationshipTypeMembership(String relationshipTypeMembership)
+ {
+ this.relationshipTypeMembership = relationshipTypeMembership;
+ }
+
+ public String getRelationshipTypeRole()
+ {
+ return relationshipTypeRole;
+ }
+
+ public void setRelationshipTypeRole(String relationshipTypeRole)
+ {
+ this.relationshipTypeRole = relationshipTypeRole;
+ }
+ /**
+ *
+ */
+ @Inject Instance<EntityManager> entityManagerInstance;
+
+ /**
+ *
+ */
+ @Inject PasswordEncoder passwordEncoder;
+
+
public boolean addUserToGroup(String username, Group group)
{
// TODO Auto-generated method stub
return false;
}
- public boolean authenticate(String username, String password)
+ public boolean authenticate(String username, Credential credential)
{
// TODO Auto-generated method stub
return false;
}
- public boolean changePassword(String username, String password)
+ public boolean updateCredential(String username, Credential credential)
{
// TODO Auto-generated method stub
return false;
@@ -139,19 +291,12 @@
return false;
}
- public boolean createUser(String username, String password)
+ public boolean createUser(String username, Credential credential, Map<String,?> attributes)
{
// TODO Auto-generated method stub
return false;
}
- public boolean createUser(String username, String password,
- String firstname, String lastname)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
public boolean deleteGroup(String name, String groupType)
{
// TODO Auto-generated method stub
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 08:59:51 UTC (rev 12805)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/util/AnnotatedBeanProperty.java 2010-05-26 09:33:30 UTC (rev 12806)
@@ -5,6 +5,8 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
/**
* A convenience class for working with an annotated property (either a field or method) of
@@ -24,12 +26,35 @@
private boolean isFieldProperty;
private boolean set = false;
- public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass)
- {
+ public static class AttributeValue
+ {
+ private String name;
+ private Object value;
+
+ public AttributeValue(String name, Object value)
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Object getValue()
+ {
+ return value;
+ }
+ }
+
+ public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass, AttributeValue... attributes)
+ {
// First check declared fields
for (Field f : cls.getDeclaredFields())
{
- if (f.isAnnotationPresent(annotationClass))
+ if (f.isAnnotationPresent(annotationClass) &&
+ attributesMatch(f.getAnnotation(annotationClass), attributes))
{
setupFieldProperty(f);
this.annotation = f.getAnnotation(annotationClass);
@@ -41,7 +66,8 @@
// Then check public fields, in case it's inherited
for (Field f : cls.getFields())
{
- if (f.isAnnotationPresent(annotationClass))
+ if (f.isAnnotationPresent(annotationClass) &&
+ attributesMatch(f.getAnnotation(annotationClass), attributes))
{
this.annotation = f.getAnnotation(annotationClass);
setupFieldProperty(f);
@@ -53,7 +79,8 @@
// Then check public methods (we ignore private methods)
for (Method m : cls.getMethods())
{
- if (m.isAnnotationPresent(annotationClass))
+ if (m.isAnnotationPresent(annotationClass) &&
+ attributesMatch(m.getAnnotation(annotationClass), attributes))
{
this.annotation = m.getAnnotation(annotationClass);
String methodName = m.getName();
@@ -83,6 +110,32 @@
}
}
}
+
+ private boolean attributesMatch(T annotation, AttributeValue[] attributes)
+ {
+ Class<?> cls = annotation.getClass();
+ for (AttributeValue attrib : attributes)
+ {
+ try
+ {
+ Field f = cls.getField(attrib.getName());
+ if (!f.get(annotation).equals(attrib.getValue()))
+ {
+ return false;
+ }
+ }
+ catch (IllegalAccessException e)
+ {
+ return false;
+ }
+ catch (NoSuchFieldException e)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
private void setupFieldProperty(Field propertyField)
{
15 years, 11 months
Seam SVN: r12805 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-05-26 04:59:51 -0400 (Wed, 26 May 2010)
New Revision: 12805
Modified:
branches/enterprise/JBPAPP_5_0/build/docs.pom.xml
Log:
added publican files for generation of docs
Modified: branches/enterprise/JBPAPP_5_0/build/docs.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/docs.pom.xml 2010-05-26 08:58:36 UTC (rev 12804)
+++ branches/enterprise/JBPAPP_5_0/build/docs.pom.xml 2010-05-26 08:59:51 UTC (rev 12805)
@@ -62,7 +62,7 @@
</dependencies>
<configuration>
<sourceDirectory>${pom.basedir}</sourceDirectory>
- <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDocumentName>Seam_Reference_Guide.xml</sourceDocumentName>
<masterTranslation>en-US</masterTranslation>
<translations>
<translation>fr-FR</translation>
15 years, 11 months