Author: julien_viet
Date: 2009-11-23 13:37:57 -0500 (Mon, 23 Nov 2009)
New Revision: 769
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java
components/mop/trunk/pom.xml
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java
Log:
- update pom to have dependency management for common module
- finish to reformat code
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java 2009-11-23
17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -22,46 +22,47 @@
import java.util.Set;
/**
- * <p>This interface extends a map to provide convenient method for dealing with
attribute values in a type safe
- * manner when the interface client knows the type of an attribute and wants to deal with
it accordingly.</p>
+ * <p>This interface extends a map to provide convenient method for dealing with
attribute values in a type safe manner
+ * when the interface client knows the type of an attribute and wants to deal with it
accordingly.</p>
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Attributes {
+public interface Attributes
+{
- Set<String> getKeys();
+ Set<String> getKeys();
- String getString(String name);
+ String getString(String name);
- void setString(String name, String value);
+ void setString(String name, String value);
- Boolean getBoolean(String name);
+ Boolean getBoolean(String name);
- void setBoolean(String name, Boolean value);
+ void setBoolean(String name, Boolean value);
- Integer getInteger(String name);
+ Integer getInteger(String name);
- void setInteger(String name, Integer value);
+ void setInteger(String name, Integer value);
- Date getDate(String name);
+ Date getDate(String name);
- void setDate(String name, Date value);
+ void setDate(String name, Date value);
- Double getDouble(String name);
+ Double getDouble(String name);
- void setDouble(String name, Double value);
+ void setDouble(String name, Double value);
- Object getObject(String name);
+ Object getObject(String name);
- <T> void setObject(String name, T value);
+ <T> void setObject(String name, T value);
- ValueType<?> getType(String name);
+ ValueType<?> getType(String name);
- <T> T getValue(Key<T> key);
+ <T> T getValue(Key<T> key);
- <T> T getValue(Key<T> key, T defaultValue);
+ <T> T getValue(Key<T> key, T defaultValue);
- <T> void setValue(Key<T> key, T value);
+ <T> void setValue(Key<T> key, T value);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java 2009-11-23 17:22:31
UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java 2009-11-23 18:37:57
UTC (rev 769)
@@ -20,80 +20,93 @@
/**
* A key is a typed name. This class is immutable and is therefore thread safe.
- *
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public class Key<T> {
+public class Key<T>
+{
- public static <T> Key<T> create(java.lang.String name, ValueType<T>
type) {
- if (type == null) {
- throw new NullPointerException();
- }
- return new Key<T>(name, type);
- }
+ public static <T> Key<T> create(java.lang.String name, ValueType<T>
type)
+ {
+ if (type == null)
+ {
+ throw new NullPointerException();
+ }
+ return new Key<T>(name, type);
+ }
- /** The key name. */
- private final java.lang.String name;
+ /** The key name. */
+ private final java.lang.String name;
- /** The type. */
- private final ValueType<T> type;
+ /** The type. */
+ private final ValueType<T> type;
- /**
- * Creates a new key.
- *
- * @param name the key name
- * @param type the key type
- * @throws NullPointerException if the name is null
- */
- protected Key(java.lang.String name, ValueType<T> type) throws
NullPointerException {
- if (name == null) {
- throw new NullPointerException();
- }
- if (type == null) {
- throw new NullPointerException();
- }
- this.name = name;
- this.type = type;
- }
+ /**
+ * Creates a new key.
+ *
+ * @param name the key name
+ * @param type the key type
+ * @throws NullPointerException if the name is null
+ */
+ protected Key(java.lang.String name, ValueType<T> type) throws
NullPointerException
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ if (type == null)
+ {
+ throw new NullPointerException();
+ }
+ this.name = name;
+ this.type = type;
+ }
- /**
- * Returns the key type.
- *
- * @return the type
- */
- public ValueType<T> getType() {
- return type;
- }
+ /**
+ * Returns the key type.
+ *
+ * @return the type
+ */
+ public ValueType<T> getType()
+ {
+ return type;
+ }
- /**
- * Returns the key name.
- *
- * @return the name
- */
- public final java.lang.String getName() {
- return name;
- }
+ /**
+ * Returns the key name.
+ *
+ * @return the name
+ */
+ public final java.lang.String getName()
+ {
+ return name;
+ }
- @Override
- public int hashCode() {
- return getType().hashCode() + name.hashCode();
- }
+ @Override
+ public int hashCode()
+ {
+ return getType().hashCode() + name.hashCode();
+ }
- @Override
- public boolean equals(java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj.getClass() == getClass()) {
- Key that = (Key)obj;
- return name.equals(that.name);
- }
- return false;
- }
+ @Override
+ public boolean equals(java.lang.Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj.getClass() == getClass())
+ {
+ Key that = (Key)obj;
+ return name.equals(that.name);
+ }
+ return false;
+ }
- @Override
- public java.lang.String toString() {
- return "Key[name=" + name + ",type=" + getType() +
"]";
- }
+ @Override
+ public java.lang.String toString()
+ {
+ return "Key[name=" + name + ",type=" + getType() +
"]";
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java 2009-11-23
17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,40 +26,41 @@
import java.util.Iterator;
/**
- * Provides access to the model.
+ * Provides access to the model.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Model {
+public interface Model
+{
- /**
- * Returns the workspace.
- *
- * @return the workspace
- */
- Workspace getWorkspace();
+ /**
+ * Returns the workspace.
+ *
+ * @return the workspace
+ */
+ Workspace getWorkspace();
- /**
- * Returns a specified object or null if it cannot be found.
- *
- * @param type the object type
- * @param id the object id
- * @param <O> the object type parameter
- * @return the object
- */
- <O extends WorkspaceObject> O findObjectById(ObjectType<O> type, String
id);
+ /**
+ * Returns a specified object or null if it cannot be found.
+ *
+ * @param type the object type
+ * @param id the object id
+ * @param <O> the object type parameter
+ * @return the object
+ */
+ <O extends WorkspaceObject> O findObjectById(ObjectType<O> type, String
id);
- <O extends WorkspaceObject> O findObjectByPath(ObjectType<? extends O>
type, String path);
+ <O extends WorkspaceObject> O findObjectByPath(ObjectType<? extends O>
type, String path);
- <O extends WorkspaceObject> Iterator<O> findObject(ObjectType<O>
type, String statement);
+ <O extends WorkspaceObject> Iterator<O> findObject(ObjectType<O>
type, String statement);
- String pathOf(WorkspaceObject o);
+ String pathOf(WorkspaceObject o);
- Customization<?> findCustomizationById(String id);
+ Customization<?> findCustomizationById(String id);
- void save();
+ void save();
- void close();
+ void close();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java 2009-11-23
17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -23,140 +23,172 @@
import java.util.Date;
/**
- * The enumeration of value type that are permitted for attributes state. The generic
type is used to represent
- * the relevant associated java type for the runtime values.
+ * The enumeration of value type that are permitted for attributes state. The generic
type is used to represent the
+ * relevant associated java type for the runtime values.
*
- * @param <T> the value java type
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
+ * @param <T> the value java type
*/
-public abstract class ValueType<T> {
+public abstract class ValueType<T>
+{
- /** . */
- public static final ValueType<String> STRING = new ValueType<String>() {};
+ /** . */
+ public static final ValueType<String> STRING = new ValueType<String>()
+ {
+ };
- /** . */
- public static final ValueType<Integer> INTEGER = new ValueType<Integer>()
{};
+ /** . */
+ public static final ValueType<Integer> INTEGER = new ValueType<Integer>()
+ {
+ };
- /** . */
- public static final ValueType<Boolean> BOOLEAN = new ValueType<Boolean>()
{};
+ /** . */
+ public static final ValueType<Boolean> BOOLEAN = new ValueType<Boolean>()
+ {
+ };
- /** . */
- public static final ValueType<Date> DATE = new ValueType<Date>() {};
+ /** . */
+ public static final ValueType<Date> DATE = new ValueType<Date>()
+ {
+ };
- /** . */
- public static final ValueType<Double> DOUBLE = new ValueType<Double>() {};
+ /** . */
+ public static final ValueType<Double> DOUBLE = new ValueType<Double>()
+ {
+ };
- /** . */
- private final Class<T> javaType;
+ /** . */
+ private final Class<T> javaType;
- @SuppressWarnings("unchecked")
- private ValueType() {
- Type type = getClass().getGenericSuperclass();
- ParameterizedType parameterizedType = (ParameterizedType)type;
- javaType = (Class<T>)parameterizedType.getActualTypeArguments()[0];
- }
+ @SuppressWarnings("unchecked")
+ private ValueType()
+ {
+ Type type = getClass().getGenericSuperclass();
+ ParameterizedType parameterizedType = (ParameterizedType)type;
+ javaType = (Class<T>)parameterizedType.getActualTypeArguments()[0];
+ }
- /**
- * Returns the java type.
- *
- * @return the java type
- */
- public Class<T> getJavaType() {
- return javaType;
- }
+ /**
+ * Returns the java type.
+ *
+ * @return the java type
+ */
+ public Class<T> getJavaType()
+ {
+ return javaType;
+ }
- /**
- * Returns true if the object matches the type.
- *
- * @param o the object
- * @return true when the value matches the type
- */
- public boolean isInstance(Object o) {
- return javaType.isInstance(o);
- }
+ /**
+ * Returns true if the object matches the type.
+ *
+ * @param o the object
+ * @return true when the value matches the type
+ */
+ public boolean isInstance(Object o)
+ {
+ return javaType.isInstance(o);
+ }
- /**
- * Casts the object to the underlying java type.
- *
- * @param o the object to cast
- * @return the casted object
- * @throws ClassCastException if the object cannot be casted
- */
- public T cast(Object o) throws ClassCastException {
- if (o == null) {
- return null;
- }
- if (javaType.isInstance(o)) {
- return javaType.cast(o);
- }
- throw new ClassCastException("Object " + o + " cannot be casted to
" + javaType.getName());
- }
+ /**
+ * Casts the object to the underlying java type.
+ *
+ * @param o the object to cast
+ * @return the casted object
+ * @throws ClassCastException if the object cannot be casted
+ */
+ public T cast(Object o) throws ClassCastException
+ {
+ if (o == null)
+ {
+ return null;
+ }
+ if (javaType.isInstance(o))
+ {
+ return javaType.cast(o);
+ }
+ throw new ClassCastException("Object " + o + " cannot be casted to
" + javaType.getName());
+ }
- /**
- * Returns the corresponding value type for the specified object or null if no valid
one can be found.
- *
- * @param t the object to decode type for
- * @param <T> the java type
- * @return the decoded type
- */
- @SuppressWarnings("unchecked")
- public static <T> ValueType<T> decode(T t) {
- if (t == null) {
+ /**
+ * Returns the corresponding value type for the specified object or null if no valid
one can be found.
+ *
+ * @param t the object to decode type for
+ * @param <T> the java type
+ * @return the decoded type
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> ValueType<T> decode(T t)
+ {
+ if (t == null)
+ {
+ return null;
+ }
+ if (t instanceof String)
+ {
+ return (ValueType<T>)ValueType.STRING;
+ }
+ if (t instanceof Integer)
+ {
+ return (ValueType<T>)ValueType.INTEGER;
+ }
+ if (t instanceof Boolean)
+ {
+ return (ValueType<T>)ValueType.BOOLEAN;
+ }
+ if (t instanceof Date)
+ {
+ return (ValueType<T>)ValueType.DATE;
+ }
+ if (t instanceof Double)
+ {
+ return (ValueType<T>)ValueType.DOUBLE;
+ }
return null;
- }
- if (t instanceof String) {
- return (ValueType<T>)ValueType.STRING;
- }
- if (t instanceof Integer) {
- return (ValueType<T>)ValueType.INTEGER;
- }
- if (t instanceof Boolean) {
- return (ValueType<T>)ValueType.BOOLEAN;
- }
- if (t instanceof Date) {
- return (ValueType<T>)ValueType.DATE;
- }
- if (t instanceof Double) {
- return (ValueType<T>)ValueType.DOUBLE;
- }
- return null;
- }
+ }
- /**
- * Returns the corresponding value type for the specified object.
- *
- * @param t the object to get the type for
- * @param <T> the java type
- * @return the decoded type
- * @throws NullPointerException if the argument is null
- * @throws IllegalArgumentException if the argument does not match a valid type
- */
- @SuppressWarnings("unchecked")
- public static <T> ValueType<T> get(T t) throws NullPointerException,
IllegalArgumentException {
- if (t == null) {
- throw new NullPointerException();
- }
- if (t instanceof String) {
- return (ValueType<T>)ValueType.STRING;
- }
- if (t instanceof Integer) {
- return (ValueType<T>)ValueType.INTEGER;
- }
- if (t instanceof Boolean) {
- return (ValueType<T>)ValueType.BOOLEAN;
- }
- if (t instanceof Date) {
- return (ValueType<T>)ValueType.DATE;
- }
- if (t instanceof Double) {
- return (ValueType<T>)ValueType.DOUBLE;
- }
- throw new IllegalArgumentException("Java class " + t.getClass().getName() +
" cannot be used as a value type");
- }
+ /**
+ * Returns the corresponding value type for the specified object.
+ *
+ * @param t the object to get the type for
+ * @param <T> the java type
+ * @return the decoded type
+ * @throws NullPointerException if the argument is null
+ * @throws IllegalArgumentException if the argument does not match a valid type
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> ValueType<T> get(T t) throws NullPointerException,
IllegalArgumentException
+ {
+ if (t == null)
+ {
+ throw new NullPointerException();
+ }
+ if (t instanceof String)
+ {
+ return (ValueType<T>)ValueType.STRING;
+ }
+ if (t instanceof Integer)
+ {
+ return (ValueType<T>)ValueType.INTEGER;
+ }
+ if (t instanceof Boolean)
+ {
+ return (ValueType<T>)ValueType.BOOLEAN;
+ }
+ if (t instanceof Date)
+ {
+ return (ValueType<T>)ValueType.DATE;
+ }
+ if (t instanceof Double)
+ {
+ return (ValueType<T>)ValueType.DOUBLE;
+ }
+ throw new IllegalArgumentException("Java class " + t.getClass().getName()
+ " cannot be used as a value type");
+ }
- @Override
- public String toString() {
- return "ValueType[" + javaType.getSimpleName() + "]";
- }
+ @Override
+ public String toString()
+ {
+ return "ValueType[" + javaType.getSimpleName() + "]";
+ }
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -28,81 +28,105 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public class ComponentIterator implements StructureIterator {
+public class ComponentIterator implements StructureIterator
+{
- /** . */
- private final UIComponent root;
+ /** . */
+ private final UIComponent root;
- /** . */
- private final LinkedList<ContainerVisit> stack;
+ /** . */
+ private final LinkedList<ContainerVisit> stack;
- /** . */
- private UIComponent current;
+ /** . */
+ private UIComponent current;
- /** . */
- private IterationType type;
+ /** . */
+ private IterationType type;
- public ComponentIterator(UIComponent root) {
- this.root = root;
- this.stack = new LinkedList<ContainerVisit>();
- this.type = null;
- }
+ public ComponentIterator(UIComponent root)
+ {
+ this.root = root;
+ this.stack = new LinkedList<ContainerVisit>();
+ this.type = null;
+ }
- public UIComponent getComponent() {
- return current;
- }
+ public UIComponent getComponent()
+ {
+ return current;
+ }
- public IterationType next() {
+ public IterationType next()
+ {
- if (type == null) {
- current = root;
- type = IterationType.START;
- } else {
- if (type == IterationType.START) {
- if (current instanceof UIContainer) {
- UIContainer container = (UIContainer)current;
- Iterator<? extends UIComponent> iterator = container.iterator();
- if (iterator.hasNext()) {
- stack.add(new ContainerVisit(container, iterator));
- current = iterator.next();
- } else {
- type = IterationType.END;
- }
- } else {
- type = IterationType.END;
- }
- } else {
- if (stack.size() > 0) {
- ContainerVisit visit = stack.getLast();
- if (visit.iterator.hasNext()) {
- type = IterationType.START;
- current = visit.iterator.next();
- } else {
- stack.removeLast();
- current = visit.container;
- }
- } else {
- current = null;
- return IterationType.DONE;
- }
+ if (type == null)
+ {
+ current = root;
+ type = IterationType.START;
}
- }
+ else
+ {
+ if (type == IterationType.START)
+ {
+ if (current instanceof UIContainer)
+ {
+ UIContainer container = (UIContainer)current;
+ Iterator<? extends UIComponent> iterator = container.iterator();
+ if (iterator.hasNext())
+ {
+ stack.add(new ContainerVisit(container, iterator));
+ current = iterator.next();
+ }
+ else
+ {
+ type = IterationType.END;
+ }
+ }
+ else
+ {
+ type = IterationType.END;
+ }
+ }
+ else
+ {
+ if (stack.size() > 0)
+ {
+ ContainerVisit visit = stack.getLast();
+ if (visit.iterator.hasNext())
+ {
+ type = IterationType.START;
+ current = visit.iterator.next();
+ }
+ else
+ {
+ stack.removeLast();
+ current = visit.container;
+ }
+ }
+ else
+ {
+ current = null;
+ return IterationType.DONE;
+ }
+ }
+ }
- //
- return type;
- }
+ //
+ return type;
+ }
- private static class ContainerVisit {
+ private static class ContainerVisit
+ {
- /** . */
- private final UIContainer container;
+ /** . */
+ private final UIContainer container;
- /** . */
- private final Iterator<? extends UIComponent> iterator;
+ /** . */
+ private final Iterator<? extends UIComponent> iterator;
- private ContainerVisit(UIContainer container, Iterator<? extends UIComponent>
iterator) {
- this.container = container;
- this.iterator = iterator;
- }
- }
+ private ContainerVisit(UIContainer container, Iterator<? extends UIComponent>
iterator)
+ {
+ this.container = container;
+ this.iterator = iterator;
+ }
+ }
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -22,13 +22,14 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public enum IterationType {
+public enum IterationType
+{
- START,
+ START,
- END,
+ END,
- DONE
+ DONE
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -29,84 +29,102 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public class PageIterator implements StructureIterator {
+public class PageIterator implements StructureIterator
+{
- /** . */
- private final ArrayList<PageVisit> list;
+ /** . */
+ private final ArrayList<PageVisit> list;
- /** . */
- private int index;
+ /** . */
+ private int index;
- /** . */
- private UIComponent current;
+ /** . */
+ private UIComponent current;
- public PageIterator(Page page, PageIteratorStrategy strategy) {
- ArrayList<PageVisit> list = new ArrayList<PageVisit>();
- Iterator<Page> iterator = strategy.iterator(page);
- while (iterator.hasNext()) {
- Page p = iterator.next();
- list.add(new PageVisit(p, new ComponentIterator(p.getRootComponent())));
- }
+ public PageIterator(Page page, PageIteratorStrategy strategy)
+ {
+ ArrayList<PageVisit> list = new ArrayList<PageVisit>();
+ Iterator<Page> iterator = strategy.iterator(page);
+ while (iterator.hasNext())
+ {
+ Page p = iterator.next();
+ list.add(new PageVisit(p, new ComponentIterator(p.getRootComponent())));
+ }
- //
- this.list = list;
- this.index = list.size() - 1;
- this.current = null;
- }
+ //
+ this.list = list;
+ this.index = list.size() - 1;
+ this.current = null;
+ }
- public UIComponent getComponent() {
- return current;
- }
+ public UIComponent getComponent()
+ {
+ return current;
+ }
- public IterationType next() {
- while (index < list.size()) {
- PageVisit visit = list.get(index);
- switch (visit.iterator.next()) {
- case START: {
- UIComponent current = visit.iterator.getComponent();
- if (current instanceof UIBody) {
- index--;
- break;
- } else {
- this.current = current;
- return IterationType.START;
- }
- }
- case END: {
- UIComponent current = visit.iterator.getComponent();
- if (current instanceof UIBody) {
- break;
- } else {
- this.current = current;
- return IterationType.END;
- }
- }
- case DONE: {
- current = null;
- index++;
- break;
- }
- default:
- throw new AssertionError();
+ public IterationType next()
+ {
+ while (index < list.size())
+ {
+ PageVisit visit = list.get(index);
+ switch (visit.iterator.next())
+ {
+ case START:
+ {
+ UIComponent current = visit.iterator.getComponent();
+ if (current instanceof UIBody)
+ {
+ index--;
+ break;
+ }
+ else
+ {
+ this.current = current;
+ return IterationType.START;
+ }
+ }
+ case END:
+ {
+ UIComponent current = visit.iterator.getComponent();
+ if (current instanceof UIBody)
+ {
+ break;
+ }
+ else
+ {
+ this.current = current;
+ return IterationType.END;
+ }
+ }
+ case DONE:
+ {
+ current = null;
+ index++;
+ break;
+ }
+ default:
+ throw new AssertionError();
+ }
}
- }
- //
- return IterationType.DONE;
- }
+ //
+ return IterationType.DONE;
+ }
- private static class PageVisit {
+ private static class PageVisit
+ {
- /** . */
- private final Page page;
+ /** . */
+ private final Page page;
- /** . */
- private final ComponentIterator iterator;
+ /** . */
+ private final ComponentIterator iterator;
- private PageVisit(Page page, ComponentIterator iterator) {
- this.page = page;
- this.iterator = iterator;
- }
- }
+ private PageVisit(Page page, ComponentIterator iterator)
+ {
+ this.page = page;
+ this.iterator = iterator;
+ }
+ }
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -28,44 +28,61 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public enum PageIteratorStrategies implements PageIteratorStrategy {
+public enum PageIteratorStrategies implements PageIteratorStrategy
+{
- SIMPLE {
- public Iterator<Page> iterator(Page page) {
- return Collections.singletonList(page).iterator();
- }},
+ SIMPLE
+ {
+ public Iterator<Page> iterator(Page page)
+ {
+ return Collections.singletonList(page).iterator();
+ }},
- PAGE_TEMPLATE {
- public Iterator<Page> iterator(final Page page) {
- return new Iterator<Page>() {
- Page current = page;
- public boolean hasNext() {
- return current != null;
- }
- public Page next() {
- if (current == null) {
- throw new NoSuchElementException();
- }
- Page next = null;
- for (Page p = current;p != null;p = p.getParent()) {
- Page template = p.getTemplate();
- if (template != null) {
- next = template;
- break;
- }
- }
- Page tmp = current;
- current = next;
- return tmp;
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }},
+ PAGE_TEMPLATE
+ {
+ public Iterator<Page> iterator(final Page page)
+ {
+ return new Iterator<Page>()
+ {
+ Page current = page;
- PAGE_AND_SITE_TEMPLATE {
- public Iterator<Page> iterator(Page page) {
- throw new UnsupportedOperationException();
- }}
+ public boolean hasNext()
+ {
+ return current != null;
+ }
+
+ public Page next()
+ {
+ if (current == null)
+ {
+ throw new NoSuchElementException();
+ }
+ Page next = null;
+ for (Page p = current; p != null; p = p.getParent())
+ {
+ Page template = p.getTemplate();
+ if (template != null)
+ {
+ next = template;
+ break;
+ }
+ }
+ Page tmp = current;
+ current = next;
+ return tmp;
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }},
+
+ PAGE_AND_SITE_TEMPLATE
+ {
+ public Iterator<Page> iterator(Page page)
+ {
+ throw new UnsupportedOperationException();
+ }}
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,8 +26,9 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface PageIteratorStrategy {
+public interface PageIteratorStrategy
+{
- Iterator<Page> iterator(Page page);
+ Iterator<Page> iterator(Page page);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -24,10 +24,11 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface StructureIterator {
+public interface StructureIterator
+{
- IterationType next();
+ IterationType next();
- UIComponent getComponent();
+ UIComponent getComponent();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -25,20 +25,21 @@
* @version $Revision$
* @param <S> the content state type parameter
*/
-public interface Content<S> {
+public interface Content<S>
+{
- /**
- * Returns the content id.
- *
- * @return the id
- */
- String getId();
+ /**
+ * Returns the content id.
+ *
+ * @return the id
+ */
+ String getId();
- /**
- * Returns the content type.
- *
- * @return the content type
- */
- ContentType<S> getType();
+ /**
+ * Returns the content type.
+ *
+ * @return the content type
+ */
+ ContentType<S> getType();
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -25,56 +25,66 @@
* @version $Revision$
* @param <S> the content state type parameter
*/
-public final class ContentType<S> {
+public final class ContentType<S>
+{
- /** . */
- private final String mimeType;
+ /** . */
+ private final String mimeType;
- /** . */
- private final Class<S> stateClass;
+ /** . */
+ private final Class<S> stateClass;
- /**
- * Create a new content type.
- *
- * @param mimeType the mime type
- * @param stateClass the state class
- * @throws NullPointerException if any argument is null
- */
- public ContentType(String mimeType, Class<S> stateClass) throws
NullPointerException {
- if (mimeType == null) {
- throw new NullPointerException("No null mime type accepted");
- }
- if (stateClass == null) {
- throw new NullPointerException("No null state class accepted");
- }
+ /**
+ * Create a new content type.
+ *
+ * @param mimeType the mime type
+ * @param stateClass the state class
+ * @throws NullPointerException if any argument is null
+ */
+ public ContentType(String mimeType, Class<S> stateClass) throws
NullPointerException
+ {
+ if (mimeType == null)
+ {
+ throw new NullPointerException("No null mime type accepted");
+ }
+ if (stateClass == null)
+ {
+ throw new NullPointerException("No null state class accepted");
+ }
- //
- this.mimeType = mimeType;
- this.stateClass = stateClass;
- }
+ //
+ this.mimeType = mimeType;
+ this.stateClass = stateClass;
+ }
- public String getMimeType() {
- return mimeType;
- }
+ public String getMimeType()
+ {
+ return mimeType;
+ }
- public Class<S> getStateClass() {
- return stateClass;
- }
+ public Class<S> getStateClass()
+ {
+ return stateClass;
+ }
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj instanceof ContentType) {
- ContentType that = (ContentType)obj;
- return mimeType.equals(that.mimeType);
- }
- return false;
- }
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof ContentType)
+ {
+ ContentType that = (ContentType)obj;
+ return mimeType.equals(that.mimeType);
+ }
+ return false;
+ }
- @Override
- public int hashCode() {
- return mimeType.hashCode();
- }
+ @Override
+ public int hashCode()
+ {
+ return mimeType.hashCode();
+ }
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -28,105 +28,102 @@
* @version $Revision$
* @param <S> the content state type parameter
*/
-public interface Customization<S> {
+public interface Customization<S>
+{
- /**
- * Returns the customization id
- *
- * @return the customization id
- */
- String getId();
+ /**
+ * Returns the customization id
+ *
+ * @return the customization id
+ */
+ String getId();
- /**
- * Returns the content this customization refers to.
- */
- Content<S> getContent();
+ /** Returns the content this customization refers to. */
+ Content<S> getContent();
- /**
- * Returns the content id this customization refers to.
- *
- * @return the content id
- */
- String getContentId();
+ /**
+ * Returns the content id this customization refers to.
+ *
+ * @return the content id
+ */
+ String getContentId();
- /**
- * Returns the content type this customization refers to.
- *
- * @return The content type
- */
- ContentType<S> getType();
+ /**
+ * Returns the content type this customization refers to.
+ *
+ * @return The content type
+ */
+ ContentType<S> getType();
- /**
- * Returns the related context of this customization.
- *
- * @return the related context
- */
- CustomizationContext getContext();
+ /**
+ * Returns the related context of this customization.
+ *
+ * @return the related context
+ */
+ CustomizationContext getContext();
- /**
- * Returns the contexts that are associated with this customization. Note that the set
returned
- * maintains the hierararchy order of the set from the most specific to the least
specific.
- *
- * @return the contexts
- */
- Set<CustomizationContext> getContexts();
+ /**
+ * Returns the contexts that are associated with this customization. Note that the set
returned maintains the
+ * hierararchy order of the set from the most specific to the least specific.
+ *
+ * @return the contexts
+ */
+ Set<CustomizationContext> getContexts();
- /**
- * <p>Returns the stateful content associated with the specified customization
contexts or null
- * if no customization can be created for the desired contexts. The returned
customization
- * may not honour all provided the customization contexts.</p>
- *
- * <p>Calling the method with an empty set returns the default customization of
the
- * content or null if none is available.</p>
- *
- * <p>Calling the method with a set of contexts that is not consistent will
trigger an
- * <tt>IllegalArgumentException</tt> to be thrown. For instance two
workspace contexts
- * specifying different pages cannot lead to determine a final context.</p>
- *
- * @param contexts the customization contexts
- * @return the content state
- */
- Customization<S> getCustomization(Set<CustomizationContext> contexts);
+ /**
+ * <p>Returns the stateful content associated with the specified customization
contexts or null if no customization
+ * can be created for the desired contexts. The returned customization may not honour
all provided the customization
+ * contexts.</p>
+ * <p/>
+ * <p>Calling the method with an empty set returns the default customization of
the content or null if none is
+ * available.</p>
+ * <p/>
+ * <p>Calling the method with a set of contexts that is not consistent will
trigger an
+ * <tt>IllegalArgumentException</tt> to be thrown. For instance two
workspace contexts specifying different pages
+ * cannot lead to determine a final context.</p>
+ *
+ * @param contexts the customization contexts
+ * @return the content state
+ */
+ Customization<S> getCustomization(Set<CustomizationContext> contexts);
- /**
- * Customize the state with respect to the provided customization context.
- *
- * @param contexts the customization context
- * @return the customization
- */
- Customization<S> customize(Collection<CustomizationContext> contexts);
+ /**
+ * Customize the state with respect to the provided customization context.
+ *
+ * @param contexts the customization context
+ * @return the customization
+ */
+ Customization<S> customize(Collection<CustomizationContext> contexts);
- /**
- * Returns the parent customization or null if this customization is full featured
clone.
- *
- * @return the parent customization
- */
- Customization getParent();
+ /**
+ * Returns the parent customization or null if this customization is full featured
clone.
+ *
+ * @return the parent customization
+ */
+ Customization getParent();
- /**
- * Returns the customization virtual state that is computed from various state of the
customization hierarchy.
- *
- * @return the virtual state
- */
- S getVirtualState();
+ /**
+ * Returns the customization virtual state that is computed from various state of the
customization hierarchy.
+ *
+ * @return the virtual state
+ */
+ S getVirtualState();
- /**
- * Returns the customization state.
- *
- * @return the state
- */
- S getState();
+ /**
+ * Returns the customization state.
+ *
+ * @return the state
+ */
+ S getState();
- /**
- * Updates the customization state.
- *
- * @param state the customization state
- */
- void setState(S state);
+ /**
+ * Updates the customization state.
+ *
+ * @param state the customization state
+ */
+ void setState(S state);
- /**
- * Destroys the customization.
- */
- void destroy();
+ /** Destroys the customization. */
+ void destroy();
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -19,46 +19,40 @@
package org.gatein.mop.api.content;
/**
- * <p>The customization context defines where customization applies, it can be an
entity, an identity, or anything
- * else that is subject to customization.</p>
+ * <p>The customization context defines where customization applies, it can be an
entity, an identity, or anything else
+ * that is subject to customization.</p> <p/> <p>Contexts are
partitionned by their type, i.e all the context that share
+ * the same value returned by the invocation of the method {@link #getContextType()} are
considered to belong to the
+ * same type.</p> <p/> <p>Within a partition it is possible to find out
the relationship between two contexts thanks to
+ * the {@link #contains(CustomizationContext)} method. <ul> <li>Two contexts
are considered equals when they contain
+ * each other.</li> <li>Two contexts are not related when no context contains
the other one.</li> <li>Otherwise one
+ * contexts belongs to the other.</li> </ul> The
<tt>contains</tt> relationship is transitive.</p>
*
- * <p>Contexts are partitionned by their type, i.e all the context that share the
same value returned by the
- * invocation of the method {@link #getContextType()} are considered to belong to the
same type.</p>
- *
- * <p>Within a partition it is possible to find out the relationship between two
contexts thanks to the
- * {@link #contains(CustomizationContext)} method.
- * <ul>
- * <li>Two contexts are considered equals when they contain each other.</li>
- * <li>Two contexts are not related when no context contains the other
one.</li>
- * <li>Otherwise one contexts belongs to the other.</li>
- * </ul>
- * The <tt>contains</tt> relationship is transitive.</p>
- *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface CustomizationContext {
+public interface CustomizationContext
+{
- /**
- * Returns the identifier of the context.
- *
- * @return the context identifier
- */
- String getContextId();
+ /**
+ * Returns the identifier of the context.
+ *
+ * @return the context identifier
+ */
+ String getContextId();
- /**
- * Returns the customization context type.
- *
- * @return the customization context type
- */
- String getContextType();
+ /**
+ * Returns the customization context type.
+ *
+ * @return the customization context type
+ */
+ String getContextType();
- /**
- * Returns true if the context contains the provided context.
- *
- * @param that the context to test
- * @return a boolean indicated whether the provided context is contained by this
context
- */
- boolean contains(CustomizationContext that);
+ /**
+ * Returns true if the context contains the provided context.
+ *
+ * @param that the context to test
+ * @return a boolean indicated whether the provided context is contained by this
context
+ */
+ boolean contains(CustomizationContext that);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -20,86 +20,92 @@
import org.gatein.mop.api.workspace.link.Link;
-import java.util.Collection;
+import java.util.List;
/**
+ * <p>A navigation denotes a visual item that display a link to a referenced entity
like a page. A navigation is
+ * expressed as a tree where each navigation node owns an ordered list of named
children.</p> <p/> <p>A navigation node
+ * owns an optional link to a {@link org.gatein.mop.api.workspace.link.Link} that denotes
the entity shown visually by
+ * the navigation node.</p>
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Navigation extends TemplatizedObject {
+public interface Navigation extends TemplatizedObject
+{
- /**
- * Returns the navigation name.
- *
- * @return the navigation name
- */
- String getName();
+ /**
+ * Returns the navigation name.
+ *
+ * @return the navigation name
+ */
+ String getName();
- /**
- * Extends the object type to navigation.
- *
- * @return the object type
- */
- ObjectType<? extends Navigation> getObjectType();
+ /**
+ * Extends the object type to navigation.
+ *
+ * @return the object type
+ */
+ ObjectType<? extends Navigation> getObjectType();
- /**
- * Returns the site this navigation belongs to
- *
- * @return the site
- */
- Site getSite();
+ /**
+ * Returns the site this navigation belongs to
+ *
+ * @return the site
+ */
+ Site getSite();
- /**
- * Return the navigation parent or null if it is a root.
- *
- * @return the navigation parent
- */
- Navigation getParent();
+ /**
+ * Return the navigation parent or null if it is a root.
+ *
+ * @return the navigation parent
+ */
+ Navigation getParent();
- /**
- * Returns the child navigations.
- *
- * @return the child navigations
- */
- Collection<? extends Navigation> getChildren();
+ /**
+ * Returns the child navigations.
+ *
+ * @return the child navigations
+ */
+ List<? extends Navigation> getChildren();
- /**
- * Returns a specified navigation.
- *
- * @param name the navigation name
- * @return a child navigation
- */
- Navigation getChild(String name);
+ /**
+ * Returns a specified navigation.
+ *
+ * @param name the navigation name
+ * @return a child navigation
+ */
+ Navigation getChild(String name);
- /**
- * Adds a child navigation
- *
- * @param name the child name
- * @return the child navigation
- * @throws NullPointerException when a null name is provided
- * @throws IllegalArgumentException when an illegal name is provided
- */
- Navigation addChild(String name) throws NullPointerException,
IllegalArgumentException;
+ /**
+ * Adds a child navigation that will be added to the last position among the ordered
children list.
+ *
+ * @param name the child name
+ * @return the child navigation
+ * @throws NullPointerException when a null name is provided
+ * @throws IllegalArgumentException when an illegal name is provided
+ */
+ Navigation addChild(String name) throws NullPointerException,
IllegalArgumentException;
- /**
- * Destroys this navigation.
- */
- void destroy();
+ /**
+ * Destroys this navigation.
+ */
+ void destroy();
- /**
- * Returns the current link related to this navitation object.
- *
- * @return the link
- */
- Link getLink();
+ /**
+ * Returns the current link related to this navitation object.
+ *
+ * @return the link
+ */
+ Link getLink();
- /**
- * Link the navigation to a specifed type and returns the corresponding link subclass
that
- * allows the configuration of the link.
- *
- * @param linkType the link type
- * @param <L> the link type parameter
- * @return the link object
- */
- <L extends Link> L linkTo(ObjectType<L> linkType);
+ /**
+ * Link the navigation to a specifed type and returns the corresponding link subclass
that
+ * allows the configuration of the link.
+ *
+ * @param linkType the link type
+ * @param <L> the link type parameter
+ * @return the link object
+ */
+ <L extends Link> L linkTo(ObjectType<L> linkType);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -34,103 +34,119 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public class ObjectType<O extends WorkspaceObject> {
+public class ObjectType<O extends WorkspaceObject>
+{
- /** . */
- public static final ObjectType<WorkspaceObject> ANY = new
ObjectType<WorkspaceObject>(WorkspaceObject.class);
+ /** . */
+ public static final ObjectType<WorkspaceObject> ANY = new
ObjectType<WorkspaceObject>(WorkspaceObject.class);
- /** . */
- public static final ObjectType<Workspace> WORKSPACE = new
ObjectType<Workspace>(Workspace.class);
+ /** . */
+ public static final ObjectType<Workspace> WORKSPACE = new
ObjectType<Workspace>(Workspace.class);
- /** . */
- public static final ObjectType<Site> SITE = new
ObjectType<Site>(Site.class);
+ /** . */
+ public static final ObjectType<Site> SITE = new
ObjectType<Site>(Site.class);
- /** . */
- public static final ObjectType<Site> PORTAL_SITE = new
ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> PORTAL_SITE = new
ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Site> GROUP_SITE = new
ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> GROUP_SITE = new
ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Site> USER_SITE = new
ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> USER_SITE = new
ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Site> SHARED_SITE = new
ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> SHARED_SITE = new
ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Page> PAGE = new
ObjectType<Page>(Page.class);
+ /** . */
+ public static final ObjectType<Page> PAGE = new
ObjectType<Page>(Page.class);
- /** . */
- public static final ObjectType<Navigation> NAVIGATION = new
ObjectType<Navigation>(Navigation.class);
+ /** . */
+ public static final ObjectType<Navigation> NAVIGATION = new
ObjectType<Navigation>(Navigation.class);
- /** . */
- public static final ObjectType<UIComponent> COMPONENT = new
ObjectType<UIComponent>(UIComponent.class);
+ /** . */
+ public static final ObjectType<UIComponent> COMPONENT = new
ObjectType<UIComponent>(UIComponent.class);
- /** . */
- public static final ObjectType<UIBody> BODY = new
ObjectType<UIBody>(UIBody.class, COMPONENT);
+ /** . */
+ public static final ObjectType<UIBody> BODY = new
ObjectType<UIBody>(UIBody.class, COMPONENT);
- /** . */
- public static final ObjectType<UIContainer> CONTAINER = new
ObjectType<UIContainer>(UIContainer.class, COMPONENT);
+ /** . */
+ public static final ObjectType<UIContainer> CONTAINER = new
ObjectType<UIContainer>(UIContainer.class, COMPONENT);
- /** . */
- public static final ObjectType<UIWindow> WINDOW = new
ObjectType<UIWindow>(UIWindow.class, COMPONENT);
+ /** . */
+ public static final ObjectType<UIWindow> WINDOW = new
ObjectType<UIWindow>(UIWindow.class, COMPONENT);
- /** . */
- public static final ObjectType<PageLink> PAGE_LINK = new
ObjectType<PageLink>(PageLink.class);
+ /** . */
+ public static final ObjectType<PageLink> PAGE_LINK = new
ObjectType<PageLink>(PageLink.class);
- /** . */
- public static final ObjectType<URLLink> URL_LINK = new
ObjectType<URLLink>(URLLink.class);
+ /** . */
+ public static final ObjectType<URLLink> URL_LINK = new
ObjectType<URLLink>(URLLink.class);
- /** . */
- private final Class<O> javaType;
+ /** . */
+ private final Class<O> javaType;
- /** . */
- private final Set<ObjectType<?>> superTypes;
+ /** . */
+ private final Set<ObjectType<?>> superTypes;
- private ObjectType(Class<O> javaType, ObjectType<?>... superTypes) {
- for (ObjectType<?> superType : superTypes) {
- if (!superType.javaType.isAssignableFrom(javaType)) {
- throw new AssertionError();
+ private ObjectType(Class<O> javaType, ObjectType<?>... superTypes)
+ {
+ for (ObjectType<?> superType : superTypes)
+ {
+ if (!superType.javaType.isAssignableFrom(javaType))
+ {
+ throw new AssertionError();
+ }
}
- }
- //
- Set<ObjectType<?>> tmp = new HashSet<ObjectType<?>>();
- for (ObjectType<?> superType : superTypes) {
- tmp.add(superType);
- }
+ //
+ Set<ObjectType<?>> tmp = new HashSet<ObjectType<?>>();
+ for (ObjectType<?> superType : superTypes)
+ {
+ tmp.add(superType);
+ }
- //
- this.javaType = javaType;
- this.superTypes = tmp;
- }
+ //
+ this.javaType = javaType;
+ this.superTypes = tmp;
+ }
- public Class<O> getJavaType() {
- return javaType;
- }
+ public Class<O> getJavaType()
+ {
+ return javaType;
+ }
- public boolean isAssignableFrom(ObjectType<?> other) {
- if (other == null) {
- throw new NullPointerException();
- }
- if (this == ANY) {
- return true;
- }
- return other == this || other.superTypes.contains(this);
- }
+ public boolean isAssignableFrom(ObjectType<?> other)
+ {
+ if (other == null)
+ {
+ throw new NullPointerException();
+ }
+ if (this == ANY)
+ {
+ return true;
+ }
+ return other == this || other.superTypes.contains(this);
+ }
- public O cast(Object o) {
- if (o == null) {
- return null;
- } if (javaType.isInstance(o)) {
- return javaType.cast(o);
- } else {
- throw new ClassCastException();
- }
- }
+ public O cast(Object o)
+ {
+ if (o == null)
+ {
+ return null;
+ }
+ if (javaType.isInstance(o))
+ {
+ return javaType.cast(o);
+ }
+ else
+ {
+ throw new ClassCastException();
+ }
+ }
- @Override
- public String toString() {
- return "ObjectType[" + javaType + "]";
- }
+ @Override
+ public String toString()
+ {
+ return "ObjectType[" + javaType + "]";
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -25,103 +25,103 @@
import java.util.Collection;
/**
- * <p>A page is a pointer with useful information pointing to a component
structure.</p>
+ * <p>A page is a pointer with useful information pointing to a component
structure.</p> <p/> <p>Page can be organized
+ * as hierarchies used for the single purpose of performing property inheritance. The
pages of a same hierarchy belong
+ * to the same site.</p>
*
- * <p>Page can be organized as hierarchies used for the single purpose of
performing
- * property inheritance. The pages of a same hierarchy belong to the same
site.</p>
- *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Page extends TemplatizedObject, WorkspaceCustomizationContext {
+public interface Page extends TemplatizedObject, WorkspaceCustomizationContext
+{
- /**
- * Returns the page name.
- *
- * @return the page name
- */
- String getName();
+ /**
+ * Returns the page name.
+ *
+ * @return the page name
+ */
+ String getName();
- /**
- * Returns the page type.
- *
- * @return the page type
- */
- ObjectType<? extends Page> getObjectType();
+ /**
+ * Returns the page type.
+ *
+ * @return the page type
+ */
+ ObjectType<? extends Page> getObjectType();
- /**
- * Returns the page attributes.
- *
- * @return the attributes
- */
- Attributes getCascadingAttributes();
+ /**
+ * Returns the page attributes.
+ *
+ * @return the attributes
+ */
+ Attributes getCascadingAttributes();
- /**
- * Returns the site that owns the page.
- *
- * @return the owner site
- */
- Site getSite();
-
- /**
- * Returns the parent page
- *
- * @return the parent page
- */
- Page getParent();
+ /**
+ * Returns the site that owns the page.
+ *
+ * @return the owner site
+ */
+ Site getSite();
- /**
- * Returns the children.
- *
- * @return the children
- */
- Collection<? extends Page> getChildren();
+ /**
+ * Returns the parent page
+ *
+ * @return the parent page
+ */
+ Page getParent();
- /**
- * Returns a named child or null if it does not exist.
- *
- * @param name the child name
- * @return a child
- */
- Page getChild(String name);
+ /**
+ * Returns the children.
+ *
+ * @return the children
+ */
+ Collection<? extends Page> getChildren();
- /**
- * Create a child page and returns it.
- *
- * @param name the child name
- * @return the child page
- * @throws NullPointerException if the name is null
- * @throws IllegalArgumentException if a child with such name already exists
- */
- Page addChild(String name) throws NullPointerException, IllegalArgumentException;
+ /**
+ * Returns a named child or null if it does not exist.
+ *
+ * @param name the child name
+ * @return a child
+ */
+ Page getChild(String name);
- /**
- * Returns the layout of the page. A layout is automatically when the page is created
and is bound to the page
- * life cycle.
- *
- * @return the page layout.
- */
- UIContainer getRootComponent();
+ /**
+ * Create a child page and returns it.
+ *
+ * @param name the child name
+ * @return the child page
+ * @throws NullPointerException if the name is null
+ * @throws IllegalArgumentException if a child with such name already exists
+ */
+ Page addChild(String name) throws NullPointerException, IllegalArgumentException;
- /**
- * Returns the set of navigations pointing to this page.
- *
- * @return the related navigations
- */
- Collection<PageLink> getNavigations();
+ /**
+ * Returns the layout of the page. A layout is automatically when the page is created
and is bound to the page
+ * life cycle.
+ *
+ * @return the page layout.
+ */
+ UIContainer getRootComponent();
- /**
- * Destroys the page.
- */
- void destroy();
+ /**
+ * Returns the set of navigations pointing to this page.
+ *
+ * @return the related navigations
+ */
+ Collection<PageLink> getNavigations();
- /**
- * Returns the templatized objects for this page.
- *
- * @param templatizedType the type of templatized
- * @param <T> the templatized workspace object type parameter
- * @return the collection of templatized objects
- */
- <T extends TemplatizedObject> Collection<? extends T>
getTemplatizedObjects(ObjectType<T> templatizedType);
+ /**
+ * Destroys the page.
+ */
+ void destroy();
+ /**
+ * Returns the templatized objects for this page.
+ *
+ * @param templatizedType the type of templatized
+ * @param <T> the templatized workspace object type parameter
+ * @return the collection of templatized objects
+ */
+ <T extends TemplatizedObject> Collection<? extends T>
getTemplatizedObjects(ObjectType<T> templatizedType);
+
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -24,46 +24,45 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Site extends WorkspaceObject, WorkspaceCustomizationContext {
+public interface Site extends WorkspaceObject, WorkspaceCustomizationContext
+{
- /**
- * Returns the site name.
- *
- * @return the site name
- */
- String getName();
+ /**
+ * Returns the site name.
+ *
+ * @return the site name
+ */
+ String getName();
- /**
- * Returns a type that extends the site.
- *
- * @return the objec type
- */
- ObjectType<? extends Site> getObjectType();
+ /**
+ * Returns a type that extends the site.
+ *
+ * @return the objec type
+ */
+ ObjectType<? extends Site> getObjectType();
- /**
- * Returns the site root navigation.
- *
- * @return the site navigation
- */
- Navigation getRootNavigation();
+ /**
+ * Returns the site root navigation.
+ *
+ * @return the site navigation
+ */
+ Navigation getRootNavigation();
- /**
- * Returns the site root page.
- *
- * @return the site root page
- */
- Page getRootPage();
+ /**
+ * Returns the site root page.
+ *
+ * @return the site root page
+ */
+ Page getRootPage();
- /**
- * Returns the site workspace.
- *
- * @return the site workspace
- */
- Workspace getWorkspace();
+ /**
+ * Returns the site workspace.
+ *
+ * @return the site workspace
+ */
+ Workspace getWorkspace();
- /**
- * Destroy the site.
- */
- void destroy();
+ /** Destroy the site. */
+ void destroy();
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -22,20 +22,21 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Templatized {
+public interface Templatized
+{
- /**
- * Returns the page template or null if no page template exists.
- *
- * @return the page template
- */
- Page getTemplate();
+ /**
+ * Returns the page template or null if no page template exists.
+ *
+ * @return the page template
+ */
+ Page getTemplate();
- /**
- * Updates the page template.
- *
- * @param template the page template
- */
- void setTemplate(Page template);
+ /**
+ * Updates the page template.
+ *
+ * @param template the page template
+ */
+ void setTemplate(Page template);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -24,5 +24,6 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface TemplatizedObject extends WorkspaceObject, Templatized {
+public interface TemplatizedObject extends WorkspaceObject, Templatized
+{
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,46 +26,47 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Workspace extends WorkspaceObject, WorkspaceCustomizationContext {
+public interface Workspace extends WorkspaceObject, WorkspaceCustomizationContext
+{
- /**
- * Returns the default share site.
- *
- * @return the default shared site
- */
- Site getSharedSite();
+ /**
+ * Returns the default share site.
+ *
+ * @return the default shared site
+ */
+ Site getSharedSite();
- /**
- * Returns a specified site or null if it cannot be found.
- *
- * @param siteType the site type
- * @param siteName the site name
- * @return the site
- */
- <S extends Site> S getSite(ObjectType<S> siteType, String siteName);
+ /**
+ * Returns a specified site or null if it cannot be found.
+ *
+ * @param siteType the site type
+ * @param siteName the site name
+ * @return the site
+ */
+ <S extends Site> S getSite(ObjectType<S> siteType, String siteName);
- /**
- * Returns the sites of a given type.
- *
- * @param siteType the site type
- * @return the sites
- */
- <S extends Site> Collection<S> getSites(ObjectType<S> siteType);
+ /**
+ * Returns the sites of a given type.
+ *
+ * @param siteType the site type
+ * @return the sites
+ */
+ <S extends Site> Collection<S> getSites(ObjectType<S> siteType);
- /**
- * Returns all the sites.
- *
- * @return the sites
- */
- Collection<Site> getSites();
+ /**
+ * Returns all the sites.
+ *
+ * @return the sites
+ */
+ Collection<Site> getSites();
- /**
- * Creates a new site.
- *
- * @param siteType the site type
- * @param name the site name
- * @return the new site
- */
- <S extends Site> S addSite(ObjectType<S> siteType, String name);
+ /**
+ * Creates a new site.
+ *
+ * @param siteType the site type
+ * @param name the site name
+ * @return the new site
+ */
+ <S extends Site> S addSite(ObjectType<S> siteType, String name);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -28,51 +28,50 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface WorkspaceCustomizationContext extends CustomizationContext {
+public interface WorkspaceCustomizationContext extends CustomizationContext
+{
- /**
- * The context type returned that must be returned by implementations of the {@link
#getContextType()} method.
- */
- String TYPE = "workspace";
+ /** The context type returned that must be returned by implementations of the {@link
#getContextType()} method. */
+ String TYPE = "workspace";
- /**
- * The root customization.
- *
- * @param name the customization name
- * @return the root customization
- */
- Customization<?> getCustomization(String name);
+ /**
+ * The root customization.
+ *
+ * @param name the customization name
+ * @return the root customization
+ */
+ Customization<?> getCustomization(String name);
- /**
- * Configure a root customization for the specified content.
- *
- * @param name the customization name
- * @param contentType the content type
- * @param contentId the content id
- * @param state the customization state
- * @param <S> the content state typa parameter
- * @return the customization
- */
- <S> Customization<S> customize(String name, ContentType<S>
contentType, String contentId, S state);
+ /**
+ * Configure a root customization for the specified content.
+ *
+ * @param name the customization name
+ * @param contentType the content type
+ * @param contentId the content id
+ * @param state the customization state
+ * @param <S> the content state typa parameter
+ * @return the customization
+ */
+ <S> Customization<S> customize(String name, ContentType<S>
contentType, String contentId, S state);
- /**
- * Configure a customization for extending the specified customization.
- *
- * @param name the customization name
- * @param customization the customization to extend
- * @param <S> the content state typa parameter
- * @return the customization
- */
- <S> Customization<S> customize(String name, Customization<S>
customization);
+ /**
+ * Configure a customization for extending the specified customization.
+ *
+ * @param name the customization name
+ * @param customization the customization to extend
+ * @param <S> the content state typa parameter
+ * @return the customization
+ */
+ <S> Customization<S> customize(String name, Customization<S>
customization);
- /**
- * Returns the customization name related to this context or null if the customization
is not
- * related to this context.
- *
- * @param customization the customization related to this context
- * @return the customization name
- */
- String nameOf(Customization customization);
+ /**
+ * Returns the customization name related to this context or null if the customization
is not related to this
+ * context.
+ *
+ * @param customization the customization related to this context
+ * @return the customization name
+ */
+ String nameOf(Customization customization);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,27 +26,28 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface WorkspaceObject {
+public interface WorkspaceObject
+{
- /**
- * Returns an id that uniquely identify the object in the workspace.
- *
- * @return the id
- */
- String getObjectId();
+ /**
+ * Returns an id that uniquely identify the object in the workspace.
+ *
+ * @return the id
+ */
+ String getObjectId();
- /**
- * Returns the object type.
- *
- * @return the object type
- */
- ObjectType<? extends WorkspaceObject> getObjectType();
+ /**
+ * Returns the object type.
+ *
+ * @return the object type
+ */
+ ObjectType<? extends WorkspaceObject> getObjectType();
- /**
- * Returns the object attributes.
- *
- * @return the attributes
- */
- Attributes getAttributes();
+ /**
+ * Returns the object attributes.
+ *
+ * @return the attributes
+ */
+ Attributes getAttributes();
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,20 +26,21 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface ContentLink extends Link {
+public interface ContentLink extends Link
+{
- /**
- * Returns the link to a content.
- *
- * @return the content
- */
- Content getContent();
+ /**
+ * Returns the link to a content.
+ *
+ * @return the content
+ */
+ Content getContent();
- /**
- * Updates the content linked.
- *
- * @param content the content to link
- */
- void setContent(Content content);
+ /**
+ * Updates the content linked.
+ *
+ * @param content the content to link
+ */
+ void setContent(Content content);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,5 +26,6 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface Link extends WorkspaceObject {
+public interface Link extends WorkspaceObject
+{
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,20 +26,21 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface PageLink extends Link {
+public interface PageLink extends Link
+{
- /**
- * The target page.
- *
- * @return the page
- */
- Page getPage();
+ /**
+ * The target page.
+ *
+ * @return the page
+ */
+ Page getPage();
- /**
- * Updates the target page.
- *
- * @param page the page to update
- */
- void setPage(Page page);
+ /**
+ * Updates the target page.
+ *
+ * @param page the page to update
+ */
+ void setPage(Page page);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -24,19 +24,20 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface URLLink extends Link {
+public interface URLLink extends Link
+{
- /**
- * Returns the link URL.
- *
- * @return the link URL
- */
- String getURL();
+ /**
+ * Returns the link URL.
+ *
+ * @return the link URL
+ */
+ String getURL();
- /**
- * Sets the link URL.
- *
- * @param url the link URL
- */
- void setURL(String url);
+ /**
+ * Sets the link URL.
+ *
+ * @param url the link URL
+ */
+ void setURL(String url);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -19,11 +19,11 @@
package org.gatein.mop.api.workspace.ui;
/**
- * The ui body denotes a place holder in a user interface structure. Usually it is used
by template
- * mechanisms.
+ * The ui body denotes a place holder in a user interface structure. Usually it is used
by template mechanisms.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface UIBody extends UIComponent {
+public interface UIBody extends UIComponent
+{
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,14 +26,15 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface UIComponent extends WorkspaceObject {
+public interface UIComponent extends WorkspaceObject
+{
- String getName();
+ String getName();
- ObjectType<? extends UIComponent> getObjectType();
+ ObjectType<? extends UIComponent> getObjectType();
- UIContainer getParent();
-
- Page getPage();
+ UIContainer getParent();
+ Page getPage();
+
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,12 +26,13 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface UIContainer extends UIComponent, List<UIComponent> {
+public interface UIContainer extends UIComponent, List<UIComponent>
+{
- <T extends UIComponent> T add(ObjectType<T> componentType, String
componentName);
+ <T extends UIComponent> T add(ObjectType<T> componentType, String
componentName);
- <T extends UIComponent> T add(int index, ObjectType<T> componentType,
String componentName);
+ <T extends UIComponent> T add(int index, ObjectType<T> componentType,
String componentName);
- UIComponent get(String componentName);
+ UIComponent get(String componentName);
}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -28,33 +28,34 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface UIWindow extends UIComponent, CustomizationContext {
+public interface UIWindow extends UIComponent, CustomizationContext
+{
- /**
- * Returns the customization of this window or null if no customization exists.
- *
- * @return the window customization
- */
- Customization<?> getCustomization();
+ /**
+ * Returns the customization of this window or null if no customization exists.
+ *
+ * @return the window customization
+ */
+ Customization<?> getCustomization();
- /**
- * Customizes the specified content.
- *
- * @param contentType the content type
- * @param contentId the content id
- * @param state the content state
- * @param <S> the content type parameter
- * @return the created customization
- */
- <S> Customization<S> customize(ContentType<S> contentType, String
contentId, S state);
+ /**
+ * Customizes the specified content.
+ *
+ * @param contentType the content type
+ * @param contentId the content id
+ * @param state the content state
+ * @param <S> the content type parameter
+ * @return the created customization
+ */
+ <S> Customization<S> customize(ContentType<S> contentType, String
contentId, S state);
- /**
- * Specialize the specified customization.
- *
- * @param customization the customization to specialise
- * @param <S> the content type parameter
- * @return the created customization
- */
- <S> Customization<S> customize(Customization<S> customization);
+ /**
+ * Specialize the specified customization.
+ *
+ * @param customization the customization to specialise
+ * @param <S> the content type parameter
+ * @return the created customization
+ */
+ <S> Customization<S> customize(Customization<S> customization);
}
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
@@ -60,6 +60,16 @@
<!-- Internal dependencies -->
<dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <version>${version.gatein.common}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ <version>${version.gatein.common}</version>
+ </dependency>
+ <dependency>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-api</artifactId>
<version>${project.version}</version>
@@ -82,6 +92,7 @@
</dependencies>
<properties>
+ <version.gatein.common>2.0.0-CR02</version.gatein.common>
<!-- ************** -->
<!-- Build settings -->
<!-- ************** -->
Modified:
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
===================================================================
---
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -24,37 +24,38 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface ContentProvider<S> {
+public interface ContentProvider<S>
+{
- /**
- * Combines several states into a single state representation.
- *
- * @param states the various states to combine
- * @return the combined state
- */
- S combine(List<S> states);
+ /**
+ * Combines several states into a single state representation.
+ *
+ * @param states the various states to combine
+ * @return the combined state
+ */
+ S combine(List<S> states);
- /**
- * Update the state container with the provided state.
- *
- * @param container the state container
- * @param state the state
- */
- void setState(StateContainer container, S state);
+ /**
+ * Update the state container with the provided state.
+ *
+ * @param container the state container
+ * @param state the state
+ */
+ void setState(StateContainer container, S state);
- /**
- * Returns the state attached to the provided container.
- *
- * @param container the container
- * @return the state
- */
- S getState(StateContainer container);
+ /**
+ * Returns the state attached to the provided container.
+ *
+ * @param container the container
+ * @return the state
+ */
+ S getState(StateContainer container);
- /**
- * Returns the class the represents the state as seen by the framework client.
- *
- * @return the external state class
- */
- Class<S> getStateType();
+ /**
+ * Returns the class the represents the state as seen by the framework client.
+ *
+ * @return the external state class
+ */
+ Class<S> getStateType();
}
Modified:
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
===================================================================
---
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -22,5 +22,6 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface StateContainer {
+public interface StateContainer
+{
}
Modified:
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java
===================================================================
---
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java 2009-11-23
17:22:31 UTC (rev 768)
+++
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java 2009-11-23
18:37:57 UTC (rev 769)
@@ -26,14 +26,15 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface CustomizationContextProvider {
+public interface CustomizationContextProvider
+{
- /**
- * Resolves the provided customization context or returns null if no context can be
resolved.
- *
- * @param contextId the context id
- * @return the resolved context
- */
- CustomizationContext resolveContext(String contextId);
+ /**
+ * Resolves the provided customization context or returns null if no context can be
resolved.
+ *
+ * @param contextId the context id
+ * @return the resolved context
+ */
+ CustomizationContext resolveContext(String contextId);
}