CVS: Tapestry/framework/src/net/sf/tapestry Tapestry.java,1.9.2.3,1.9.2.4 IComponent.java,1.12,1.12.2.1 ComponentAddress.java,1.3,1.3.2.1 StaleSessionException.java,1.4,1.4.2.1 IEngine.java,1.11.2.1,1.11.2.2 ApplicationServlet.java,1.16.2.2,1.16.2.3 PageRedirectException.java,1.3,1.3.2.1 TapestryStrings.properties,1.36.2.10,1.36.2.11 PageLoaderException.java,1.3.2.2,1.3.2.3 StaleLinkException.java,1.3,1.3.2.1 IPage.java,1.11,1.11.2.1 AbstractComponent.java,1.20,1.20.2.1 AbstractPage.java,1.10,1.10.2.1 IPageRecorder.java,1.3,1.3.2.1
Howard Lewis Ship <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry
In directory sc8-pr-cvs1:/tmp/cvs-serv9155/framework/src/net/sf/tapestry
Modified Files:
Tag: hship-2-3
Tapestry.java IComponent.java ComponentAddress.java
StaleSessionException.java IEngine.java
ApplicationServlet.java PageRedirectException.java
TapestryStrings.properties PageLoaderException.java
StaleLinkException.java IPage.java AbstractComponent.java
AbstractPage.java IPageRecorder.java
Log Message:
Automatically register components as page listeners if they implement necessary interfaces
Major rework on page property persistance
[ 653358 ] IPage.getName() == qualified name
[ 608768 ] Changes saved AFTER IPage.detach()
Index: Tapestry.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/Tapestry.java,v
retrieving revision 1.9.2.3
retrieving revision 1.9.2.4
diff -C2 -d -r1.9.2.3 -r1.9.2.4
*** Tapestry.java 11 Dec 2002 14:02:25 -0000 1.9.2.3
--- Tapestry.java 30 Dec 2002 03:04:55 -0000 1.9.2.4
***************
*** 563,567 ****
return array.length;
}
!
/**
* Returns true if the Map is null or empty.
--- 563,567 ----
return array.length;
}
!
/**
* Returns true if the Map is null or empty.
***************
*** 570,579 ****
*
**/
!
public static boolean isEmpty(Map map)
{
return map == null || map.isEmpty();
}
!
/**
* Converts a {@link Map} to an even-sized array of key/value
--- 570,591 ----
*
**/
!
public static boolean isEmpty(Map map)
{
return map == null || map.isEmpty();
}
!
! /**
! * Returns true if the Collection is null or empty.
! *
! * @since 2.4
! *
! **/
!
! public static boolean isEmpty(Collection c)
! {
! return c == null || c.isEmpty();
! }
!
/**
* Converts a {@link Map} to an even-sized array of key/value
***************
*** 590,616 ****
* @since 2.2
**/
!
public static Object[] convertMapToArray(Map map)
{
if (isEmpty(map))
return null;
!
Set entries = map.entrySet();
!
Object[] result = new Object[2 * entries.size()];
int x = 0;
!
Iterator i = entries.iterator();
while (i.hasNext())
{
! Map.Entry entry = (Map.Entry)i.next();
!
result[x++] = entry.getKey();
result[x++] = entry.getValue();
}
!
return result;
}
!
/**
* Converts an even-sized array of objects back
--- 602,628 ----
* @since 2.2
**/
!
public static Object[] convertMapToArray(Map map)
{
if (isEmpty(map))
return null;
!
Set entries = map.entrySet();
!
Object[] result = new Object[2 * entries.size()];
int x = 0;
!
Iterator i = entries.iterator();
while (i.hasNext())
{
! Map.Entry entry = (Map.Entry) i.next();
!
result[x++] = entry.getKey();
result[x++] = entry.getValue();
}
!
return result;
}
!
/**
* Converts an even-sized array of objects back
***************
*** 622,649 ****
*
**/
!
public static Map convertArrayToMap(Object[] array)
{
if (array == null || array.length == 0)
return null;
!
! if (array.length % 2 != 0)
! throw new IllegalArgumentException(
! getString("Tapestry.even-sized-array"));
!
! Map result = new HashMap();
!
! int x = 0;
! while (x < array.length)
! {
Object key = array[x++];
Object value = array[x++];
!
result.put(key, value);
! }
!
! return result;
}
!
/**
* Returns the application root location, which is in the
--- 634,660 ----
*
**/
!
public static Map convertArrayToMap(Object[] array)
{
if (array == null || array.length == 0)
return null;
!
! if (array.length % 2 != 0)
! throw new IllegalArgumentException(getString("Tapestry.even-sized-array"));
!
! Map result = new HashMap();
!
! int x = 0;
! while (x < array.length)
! {
Object key = array[x++];
Object value = array[x++];
!
result.put(key, value);
! }
!
! return result;
}
!
/**
* Returns the application root location, which is in the
***************
*** 654,658 ****
*
**/
!
public static IResourceLocation getApplicationRootLocation(IRequestCycle cycle)
{
--- 665,669 ----
*
**/
!
public static IResourceLocation getApplicationRootLocation(IRequestCycle cycle)
{
***************
*** 660,668 ****
ServletContext servletContext = context.getServlet().getServletContext();
String servletPath = context.getRequest().getServletPath();
!
// Could strip off the servlet name (i.e., "app" in "/app") but
// there's no need.
!
! return new ContextResourceLocation(servletContext, servletPath);
}
}
--- 671,679 ----
ServletContext servletContext = context.getServlet().getServletContext();
String servletPath = context.getRequest().getServletPath();
!
// Could strip off the servlet name (i.e., "app" in "/app") but
// there's no need.
!
! return new ContextResourceLocation(servletContext, servletPath);
}
}
Index: IComponent.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/IComponent.java,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -C2 -d -r1.12 -r1.12.2.1
*** IComponent.java 27 Nov 2002 17:58:45 -0000 1.12
--- IComponent.java 30 Dec 2002 03:04:56 -0000 1.12.2.1
***************
*** 282,287 ****
/**
* Returns the {@link INamespace} in which the component was defined
! * (as an alias). May return null if the component was loaded with
! * an explicit specification path. Pages will always have a real namespace.
*
* @since 2.2
--- 282,286 ----
/**
* Returns the {@link INamespace} in which the component was defined
! * (as an alias).
*
* @since 2.2
Index: ComponentAddress.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/ComponentAddress.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** ComponentAddress.java 27 Nov 2002 17:58:45 -0000 1.3
--- ComponentAddress.java 30 Dec 2002 03:04:56 -0000 1.3.2.1
***************
*** 53,57 ****
IPage objPage = objComponent.getPage();
! m_strPageName = objPage.getQualifiedName();
m_strIdPath = objComponent.getIdPath();
}
--- 53,57 ----
IPage objPage = objComponent.getPage();
! m_strPageName = objPage.getPageName();
m_strIdPath = objComponent.getIdPath();
}
Index: StaleSessionException.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/StaleSessionException.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** StaleSessionException.java 27 Nov 2002 17:58:45 -0000 1.4
--- StaleSessionException.java 30 Dec 2002 03:04:56 -0000 1.4.2.1
***************
*** 31,35 ****
if (page != null)
! _pageName = page.getName();
}
--- 31,35 ----
if (page != null)
! _pageName = page.getPageName();
}
Index: IEngine.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/IEngine.java,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -C2 -d -r1.11.2.1 -r1.11.2.2
*** IEngine.java 12 Dec 2002 12:42:39 -0000 1.11.2.1
--- IEngine.java 30 Dec 2002 03:04:56 -0000 1.11.2.2
***************
*** 95,105 ****
/**
! * Returns a recorder for a page. Returns null if the page record has
* not been created yet.
*
* @see #createPageRecorder(String, IRequestCycle)
**/
! public IPageRecorder getPageRecorder(String pageName);
/**
--- 95,106 ----
/**
! * Returns a recorder for a page. Returns null if the page recorder has
* not been created yet.
*
* @see #createPageRecorder(String, IRequestCycle)
+ *
**/
! public IPageRecorder getPageRecorder(String pageName, IRequestCycle cycle);
/**
Index: ApplicationServlet.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/ApplicationServlet.java,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -C2 -d -r1.16.2.2 -r1.16.2.3
*** ApplicationServlet.java 15 Dec 2002 16:26:12 -0000 1.16.2.2
--- ApplicationServlet.java 30 Dec 2002 03:04:56 -0000 1.16.2.3
***************
*** 17,21 ****
import org.apache.commons.logging.LogFactory;
! import net.sf.tapestry.engine.SimpleEngine;
import net.sf.tapestry.parse.SpecificationParser;
import net.sf.tapestry.resource.ClasspathResourceLocation;
--- 17,21 ----
import org.apache.commons.logging.LogFactory;
! import net.sf.tapestry.engine.BaseEngine;
import net.sf.tapestry.parse.SpecificationParser;
import net.sf.tapestry.resource.ClasspathResourceLocation;
***************
*** 667,671 ****
*
* <p>If the search is still unsuccessful, then
! * {@link net.sf.tapestry.engine.SimpleEngine} is used.
*
**/
--- 667,671 ----
*
* <p>If the search is still unsuccessful, then
! * {@link net.sf.tapestry.engine.BaseEngine} is used.
*
**/
***************
*** 682,686 ****
if (_engineClassName == null)
! _engineClassName = SimpleEngine.class.getName();
return _engineClassName;
--- 682,686 ----
if (_engineClassName == null)
! _engineClassName = BaseEngine.class.getName();
return _engineClassName;
Index: PageRedirectException.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/PageRedirectException.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** PageRedirectException.java 27 Nov 2002 17:58:45 -0000 1.3
--- PageRedirectException.java 30 Dec 2002 03:04:56 -0000 1.3.2.1
***************
*** 23,27 ****
public PageRedirectException(IPage page)
{
! this(page.getName());
}
--- 23,27 ----
public PageRedirectException(IPage page)
{
! this(page.getPageName());
}
Index: TapestryStrings.properties
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/TapestryStrings.properties,v
retrieving revision 1.36.2.10
retrieving revision 1.36.2.11
diff -C2 -d -r1.36.2.10 -r1.36.2.11
*** TapestryStrings.properties 21 Dec 2002 13:05:47 -0000 1.36.2.10
--- TapestryStrings.properties 30 Dec 2002 03:04:56 -0000 1.36.2.11
***************
*** 160,165 ****
ResourceResolver.unable-to-load-class=Could not load class {0} from {1}: {2}
! SimpleEngine.recorder-has-uncommited-changes=Could not forget changes to page {0} because the page's recorder has uncommitted changes.
! SimpleEngine.duplicate-page-recorder=Could not create a second page recorder for page {0}.
ExternalService.page-not-compatible=Page {0} does not implement the IExternalPage interface.
--- 160,165 ----
ResourceResolver.unable-to-load-class=Could not load class {0} from {1}: {2}
! BaseEngine.recorder-has-uncommited-changes=Could not forget changes to page {0} because the page's recorder has uncommitted changes.
! BaseEngine.duplicate-page-recorder=Could not create a second page recorder for page {0}.
ExternalService.page-not-compatible=Page {0} does not implement the IExternalPage interface.
***************
*** 296,301 ****
--- 296,305 ----
PageRecorder.change-after-lock=Page recorder for page {0} is locked after a commit(), but received a change to property {1} of component {2}.
PageRecorder.unable-to-persist=Unable to persist property {0} of component {1} as {2}.
+ PageRecorder.null-property-name=A change event for component {0} failed to specify the name of the updated property.
+
RollbackException.message=Unable to set property {0} of component {1} to {2}.
+ DefaultValuePersister.no-value-copier-for-class=No value copier has been registerred for class {0}.
+
# net.sf.tapestry.resource
***************
*** 338,341 ****
--- 342,346 ----
AdaptorRegistry.duplicate-registration=A registration for class {0} already exists.
AdaptorRegistry.adaptor-not-found=Could not find an adaptor for class {0}.
+ AdaptorRegistry.nothing-registered=No adaptors have been registered.
Enum.duplicate-registration=Enum.register(): {0} is already registered. The enumerationId property must be unique within the class.
Index: PageLoaderException.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/PageLoaderException.java,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -C2 -d -r1.3.2.2 -r1.3.2.3
*** PageLoaderException.java 5 Dec 2002 11:54:00 -0000 1.3.2.2
--- PageLoaderException.java 30 Dec 2002 03:04:56 -0000 1.3.2.3
***************
*** 50,54 ****
if (page != null)
! _pageName = page.getName();
}
--- 50,54 ----
if (page != null)
! _pageName = page.getPageName();
}
Index: StaleLinkException.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/StaleLinkException.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** StaleLinkException.java 27 Nov 2002 17:58:45 -0000 1.3
--- StaleLinkException.java 30 Dec 2002 03:04:56 -0000 1.3.2.1
***************
*** 15,22 ****
public class StaleLinkException extends RequestCycleException
{
! private transient IPage page;
! private String pageName;
! private String targetIdPath;
! private String targetActionId;
public StaleLinkException()
--- 15,22 ----
public class StaleLinkException extends RequestCycleException
{
! private transient IPage _page;
! private String _pageName;
! private String _targetIdPath;
! private String _targetActionId;
public StaleLinkException()
***************
*** 39,46 ****
component);
! page = component.getPage();
! pageName = page.getName();
! this.targetActionId = targetActionId;
! this.targetIdPath = targetIdPath;
}
--- 39,47 ----
component);
! _page = component.getPage();
! _pageName = _page.getPageName();
!
! _targetActionId = targetActionId;
! _targetIdPath = targetIdPath;
}
***************
*** 56,61 ****
page);
! this.targetActionId = targetActionId;
! this.targetIdPath = targetIdPath;
}
--- 57,62 ----
page);
! _targetActionId = targetActionId;
! _targetIdPath = targetIdPath;
}
***************
*** 69,81 ****
super(message, null);
! this.page = page;
if (page != null)
! pageName = page.getName();
}
public String getPageName()
{
! return pageName;
}
--- 70,82 ----
super(message, null);
! _page = page;
if (page != null)
! _pageName = page.getPageName();
}
public String getPageName()
{
! return _pageName;
}
***************
*** 88,92 ****
public IPage getPage()
{
! return page;
}
}
--- 89,93 ----
public IPage getPage()
{
! return _page;
}
}
Index: IPage.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/IPage.java,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** IPage.java 27 Nov 2002 17:58:45 -0000 1.11
--- IPage.java 30 Dec 2002 03:04:56 -0000 1.11.2.1
***************
*** 80,83 ****
--- 80,85 ----
* Returns the simple name of the page within its namespace.
*
+ * @deprecated This method has no use and will be removed after releaes 2.4.
+ *
**/
***************
*** 89,92 ****
--- 91,96 ----
*
* @since 2.3
+ * @deprecated This method will be removed after release 2.4, use
+ * {@link #getPageName()} instead.
*
**/
***************
*** 94,97 ****
--- 98,123 ----
public String getQualifiedName();
+ /**
+ * Returns the fully qualified name of the page, including its
+ * namespace prefix, if any.
+ *
+ * @since 2.4
+ *
+ **/
+
+ public String getPageName();
+
+
+ /**
+ * Sets the name of the page.
+ *
+ * @param name fully qualified page name (including namespace prefix, if any)
+ *
+ * @since 2.4
+ *
+ **/
+
+ public void setPageName(String pageName);
+
/**
* Returns a particular component from within the page. The path is a dotted
***************
*** 167,170 ****
--- 193,204 ----
public void setChangeObserver(ChangeObserver value);
+ /**
+ * Sets the simple (unqualified) name for the page.
+ *
+ * @deprecated To be removed after 2.4, use {@link #setPageName(String)}
+ * instead.
+ *
+ **/
+
public void setName(String value);
Index: AbstractComponent.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/AbstractComponent.java,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -C2 -d -r1.20 -r1.20.2.1
*** AbstractComponent.java 28 Nov 2002 15:05:21 -0000 1.20
--- AbstractComponent.java 30 Dec 2002 03:04:56 -0000 1.20.2.1
***************
*** 15,18 ****
--- 15,21 ----
import net.sf.tapestry.event.ChangeObserver;
import net.sf.tapestry.event.ObservedChangeEvent;
+ import net.sf.tapestry.event.PageCleanupListener;
+ import net.sf.tapestry.event.PageDetachListener;
+ import net.sf.tapestry.event.PageRenderListener;
import net.sf.tapestry.listener.ListenerMap;
import net.sf.tapestry.param.ParameterManager;
***************
*** 40,47 ****
OgnlRuntime.setPropertyAccessor(IBeanProvider.class, new BeanProviderPropertyAccessor());
!
// Same with IPublicBean.
!
! OgnlRuntime.setPropertyAccessor(IPublicBean.class, new PublicBeanPropertyAccessor());
}
--- 43,50 ----
OgnlRuntime.setPropertyAccessor(IBeanProvider.class, new BeanProviderPropertyAccessor());
!
// Same with IPublicBean.
!
! OgnlRuntime.setPropertyAccessor(IPublicBean.class, new PublicBeanPropertyAccessor());
}
***************
*** 231,234 ****
--- 234,243 ----
/**
+ * Registers this component as a listener of the page if it
+ * implements {@link net.sf.tapestry.event.PageDetachListener},
+ * {@link net.sf.tapestry.event.PageRenderListener} or
+ * {@link net.sf.tapestry.event.PageCleanupListener}.
+ *
+ * <p>
* Invokes {@link #finishLoad()}. Subclasses may overide as needed, but
* must invoke this implementation.
***************
*** 241,244 ****
--- 250,262 ----
throws PageLoaderException
{
+ if (this instanceof PageDetachListener)
+ _page.addPageDetachListener((PageDetachListener) this);
+
+ if (this instanceof PageRenderListener)
+ _page.addPageRenderListener((PageRenderListener) this);
+
+ if (this instanceof PageCleanupListener)
+ _page.addPageCleanupListener((PageCleanupListener) this);
+
finishLoad();
}
***************
*** 246,258 ****
protected void fireObservedChange(String propertyName, int newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 264,273 ----
protected void fireObservedChange(String propertyName, int newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 261,273 ****
protected void fireObservedChange(String propertyName, Object newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 276,285 ----
protected void fireObservedChange(String propertyName, Object newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 276,288 ****
protected void fireObservedChange(String propertyName, boolean newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 288,297 ----
protected void fireObservedChange(String propertyName, boolean newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 291,303 ****
protected void fireObservedChange(String propertyName, double newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 300,309 ----
protected void fireObservedChange(String propertyName, double newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 306,318 ****
protected void fireObservedChange(String propertyName, float newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 312,321 ----
protected void fireObservedChange(String propertyName, float newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 321,333 ****
protected void fireObservedChange(String propertyName, long newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 324,333 ----
protected void fireObservedChange(String propertyName, long newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 336,348 ****
protected void fireObservedChange(String propertyName, char newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 336,345 ----
protected void fireObservedChange(String propertyName, char newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 351,363 ****
protected void fireObservedChange(String propertyName, byte newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
--- 348,357 ----
protected void fireObservedChange(String propertyName, byte newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 366,403 ****
protected void fireObservedChange(String propertyName, short newValue)
{
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
!
! if (observer == null)
! return;
!
! event = new ObservedChangeEvent(this, propertyName, newValue);
!
! observer.observeChange(event);
! }
!
! /**
! * Fires a change event for no single property; the receiver should
! * note that the page containing the component is 'dirty' even if
! * no property appears to have changed. This is useful in situations
! * when a property is a mutable object (such as a Collection) and the
! * state of the property value is changing, even though the property
! * is not.
! *
! **/
!
! protected void fireObservedChange()
! {
! ChangeObserver observer;
! ObservedChangeEvent event;
!
! observer = getChangeObserver();
if (observer == null)
return;
! event = new ObservedChangeEvent(this);
observer.observeChange(event);
--- 360,369 ----
protected void fireObservedChange(String propertyName, short newValue)
{
! ChangeObserver observer = getChangeObserver();
if (observer == null)
return;
! ObservedChangeEvent event = new ObservedChangeEvent(this, propertyName, newValue);
observer.observeChange(event);
***************
*** 504,508 ****
{
IResourceResolver resolver = getPage().getEngine().getResourceResolver();
!
return (IBinding) OgnlUtils.get(bindingPropertyName, resolver, this);
}
--- 470,474 ----
{
IResourceResolver resolver = getPage().getEngine().getResourceResolver();
!
return (IBinding) OgnlUtils.get(bindingPropertyName, resolver, this);
}
***************
*** 565,570 ****
if (_page == null)
return null;
!
! return _page.getQualifiedName() + "/" + getIdPath();
}
--- 531,536 ----
if (_page == null)
return null;
!
! return _page.getPageName() + "/" + getIdPath();
}
***************
*** 1020,1024 ****
*
**/
!
public int getBodyCount()
{
--- 986,990 ----
*
**/
!
public int getBodyCount()
{
Index: AbstractPage.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/AbstractPage.java,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -C2 -d -r1.10 -r1.10.2.1
*** AbstractPage.java 27 Nov 2002 17:58:45 -0000 1.10
--- AbstractPage.java 30 Dec 2002 03:04:56 -0000 1.10.2.1
***************
*** 72,76 ****
**/
! private String _qualifiedName;
/**
--- 72,76 ----
**/
! private String _pageName;
/**
***************
*** 311,315 ****
--- 311,332 ----
_name = value;
}
+
+ /** @since 2.4 **/
+ public void setPageName(String pageName)
+ {
+ if (_pageName != null)
+ throw new ApplicationRuntimeException(Tapestry.getString("AbstractPage.attempt-to-change-name"));
+
+ _pageName = pageName;
+ }
+
+ /** @since 2.4 **/
+
+ public String getPageName()
+ {
+ return _pageName;
+ }
+
/**
* By default, pages are not protected and this method does nothing.
***************
*** 528,532 ****
/**
! * @since 2.1-beta-2
*
**/
--- 545,549 ----
/**
! * @since 2.1
*
**/
***************
*** 555,562 ****
public String getQualifiedName()
{
! if (_qualifiedName == null)
! _qualifiedName = getNamespace().constructQualifiedName(_name);
!
! return _qualifiedName;
}
}
--- 572,576 ----
public String getQualifiedName()
{
! return _pageName;
}
}
Index: IPageRecorder.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/IPageRecorder.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** IPageRecorder.java 27 Nov 2002 17:58:45 -0000 1.3
--- IPageRecorder.java 30 Dec 2002 03:04:56 -0000 1.3.2.1
***************
*** 16,28 ****
* @author Howard Lewis Ship
* @version $Id$
**/
public interface IPageRecorder extends ChangeObserver
{
/**
* Persists all changes that have been accumulated. If the recorder
* saves change incrementally, this should ensure that all changes have been persisted.
*
! * <p>After commiting, a page record automatically locks itself.
**/
--- 16,57 ----
* @author Howard Lewis Ship
* @version $Id$
+ *
**/
public interface IPageRecorder extends ChangeObserver
{
+ /**
+ * Invoked after the recorder is instantiated to initialize
+ * it for the current request cycle.
+ *
+ * @param pageName the fully qualified page name
+ * @param cycle the current request cycle
+ *
+ * @since 2.4
+ *
+ **/
+
+ public void initialize(String pageName, IRequestCycle cycle);
+
+
+ /**
+ * Invoked at the end of a request cycle in which the
+ * page recorder is discarded (either implicitly, because
+ * the page recorder has no changes, or explicitly
+ * because of {@link IEngine#forgetPage(String)} or
+ * {@link #markForDiscard()}.
+ *
+ * @since 2.4
+ *
+ **/
+
+ public void discard();
+
/**
* Persists all changes that have been accumulated. If the recorder
* saves change incrementally, this should ensure that all changes have been persisted.
*
! * <p>After commiting, a page recorder automatically locks itself.
! *
**/
***************
*** 64,69 ****
*
* <p>A page recorder can only rollback changes to properties
! * which have changed at some point. This can cause some minor
* problems, addressed by {@link PageDetachListener#pageDetached(PageEvent)}.
**/
--- 93,99 ----
*
* <p>A page recorder can only rollback changes to properties
! * which have changed at some point. This can cause some minor
* problems, addressed by {@link PageDetachListener#pageDetached(PageEvent)}.
+ *
**/
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf