| <?xml version="1.0"?> |
| <!-- |
| Copyright 2005 The Apache Software Foundation |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <module id="tapestry.persist" version="4.0.0" package="org.apache.tapestry.record"> |
| |
| Services for managing page property persistence. |
| |
| <configuration-point id="PersistenceStrategy"> |
| |
| Defines the different strategies for persisting page properties between requests. |
| The names match against the persist attribute of the property element. |
| |
| <schema> |
| <element name="strategy"> |
| <attribute name="name" required="true" unique="true"> |
| A unique name for the strategy. |
| </attribute> |
| <attribute name="object" required="true" translator="object"> |
| The object implementing PropertyPersistenceStrategy. |
| </attribute> |
| <conversion class="PropertyPersistenceStrategyContribution"> |
| <map attribute="object" property="strategy"/> |
| </conversion> |
| </element> |
| </schema> |
| |
| </configuration-point> |
| |
| |
| <service-point id="SessionPropertyPersistenceStrategy" interface="PropertyPersistenceStrategy"> |
| |
| The standard persistence strategy, mapped to the name "session". Simply stores each property as |
| a session attribute. |
| |
| <invoke-factory> |
| <construct class="SessionPropertyPersistenceStrategy"> |
| <set-object property="request" value="infrastructure:request"/> |
| <set-object property="applicationId" value="infrastructure:applicationId"/> |
| </construct> |
| </invoke-factory> |
| |
| </service-point> |
| |
| <service-point id="AppClientPropertyPersistenceScope" interface="ClientPropertyPersistenceScope"> |
| |
| Stores client persistent properties in all cases. |
| |
| <create-instance class="AppClientPropertyPersistenceScope"/> |
| |
| </service-point> |
| |
| <service-point id="PageClientPropertyPersistenceScope" interface="ClientPropertyPersistenceScope"> |
| |
| Stores client persistent properties only if the page remains the same. |
| When a new page is activated and rendered, the values for other pages |
| are discarded. |
| |
| <invoke-factory> |
| <construct class="PageClientPropertyPersistenceScope"> |
| <set-object property="requestCycle" value="infrastructure:requestCycle"/> |
| </construct> |
| </invoke-factory> |
| </service-point> |
| |
| <service-point id="PageClientPropertyPersistenceStrategy" interface="PropertyPersistenceStrategy"> |
| |
| Stores persistent properties on the client, as either hidden form fields, or as |
| query parameters. Persistent data for each page is stored in a seperate query parameter. |
| The service stores client-specific state internally, and so it must use the threaded service model. |
| |
| <invoke-factory model="threaded"> |
| <construct class="ClientPropertyPersistenceStrategy"> |
| <set-object property="request" value="infrastructure:request"/> |
| <set-object property="scope" value="service:PageClientPropertyPersistenceScope"/> |
| <set-object property="encoder" value="service:PersistentPropertyDataEncoder"/> |
| </construct> |
| </invoke-factory> |
| |
| </service-point> |
| |
| <service-point id="PersistentPropertyDataEncoder"> |
| |
| Responsible for encoding and decoding client persistent properties into MIME streams. |
| |
| <invoke-factory> |
| <construct class="PersistentPropertyDataEncoderImpl"/> |
| </invoke-factory> |
| |
| </service-point> |
| |
| <service-point id="AppClientPropertyPersistenceStrategy" interface="PropertyPersistenceStrategy"> |
| |
| Stores persistent properties on the client, as either hidden form fields, or as |
| query parameters. Persistent data for each page is stored in a seperate query parameter. |
| The service stores client-specific state internally, and so it must use the threaded service model. |
| |
| <invoke-factory model="threaded"> |
| <construct class="ClientPropertyPersistenceStrategy"> |
| <set-object property="request" value="infrastructure:request"/> |
| <set-object property="scope" value="service:AppClientPropertyPersistenceScope"/> |
| </construct> |
| </invoke-factory> |
| |
| </service-point> |
| |
| <service-point id="PropertyPersistenceStrategySource" interface="PropertyPersistenceStrategySource"> |
| |
| Used by other services to locate persistence strategies and run certain operations across all strategies. |
| |
| <invoke-factory> |
| <construct class="PropertyPersistenceStrategySourceImpl"> |
| <set-configuration property="contributions" configuration-id="PersistenceStrategy"/> |
| </construct> |
| </invoke-factory> |
| |
| </service-point> |
| |
| <contribution configuration-id="PersistenceStrategy"> |
| <strategy name="session" object="service:SessionPropertyPersistenceStrategy"/> |
| <strategy name="client" object="service:PageClientPropertyPersistenceStrategy"/> |
| <strategy name="client:page" object="service:PageClientPropertyPersistenceStrategy"/> |
| <strategy name="client:app" object="service:AppClientPropertyPersistenceStrategy"/> |
| </contribution> |
| |
| </module> |