diff --git a/.classpath b/.classpath deleted file mode 100644 index f596458fb..000000000 --- a/.classpath +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.gitignore b/.gitignore index b83d22266..aee5425d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -/target/ +target +.springBeans +.ant-targets-build.xml +src/ant/.ant-targets-upload-dist.xml diff --git a/.project b/.project deleted file mode 100644 index 94203693f..000000000 --- a/.project +++ /dev/null @@ -1,40 +0,0 @@ - - spring-data-commons - Spring Data Common Interfaces and Implementations - - - - org.eclipse.wst.common.project.facet.core.builder - - - org.eclipse.wst.validation.validationbuilder - - - org.eclipse.ajdt.core.ajbuilder - - - org.springframework.ide.eclipse.core.springbuilder - - - org.eclipse.ajdt.core.ajbuilder - - - aspectPath - org.springframework.aspects - - - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.jdt.core.javanature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.ajdt.ui.ajnature - com.springsource.sts.roo.core.nature - org.springframework.ide.eclipse.core.springnature - - \ No newline at end of file diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index caab2af32..000000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Thu Sep 09 15:12:37 EDT 2010 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component deleted file mode 100644 index 9d396ff7d..000000000 --- a/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml deleted file mode 100644 index be3b0394b..000000000 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.springBeans b/.springBeans deleted file mode 100644 index 4dff64763..000000000 --- a/.springBeans +++ /dev/null @@ -1,13 +0,0 @@ - - - 1 - - - - - - - - - - diff --git a/pom.xml b/pom.xml index dc0f6f0d7..f94aff4fb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,31 +1,17 @@ - - + + 4.0.0 - spring-data-commons - 1.0.0.M1-SNAPSHOT - Spring Data Commons - Spring Data Common Interfaces and Implementations - http://www.springsource.org - jar - - - org.springframework.data - spring-data-parent - 1.0.0.M1-SNAPSHOT - - - - Issue Tracker - http://jira.springframework.org/browse/DATACOMMONS - - - http://git.springsource.org/spring-data/data-commons - - - SpringSource, a division of VMware - http://www.SpringSource.org - - 2010 + org.springframework.data + spring-data-commons-dist + Spring Data Commons Distribution + 1.0.0.BUILD-SNAPSHOT + pom + + spring-data-commons-parent + spring-data-commons-core + spring-data-commons-aspects + @@ -67,49 +53,234 @@ UTF-8 - 1.6.10.BUILD-SNAPSHOT - - - - - - org.springframework - spring-aop - ${spring.framework.version} - - - org.springframework - spring-aspects - ${spring.framework.version} - - - org.springframework - spring-tx - ${spring.framework.version} - - - commons-logging - commons-logging - 1.1.1 - provided - - - org.aspectj - aspectjrt - ${aspectj.version} - - - - + + spring-data-commons + Spring Data Commons + DATA + ${project.version} + snapshot + ${dist.id}-${dist.version} + ${dist.finalName}.zip + target/${dist.fileName} + dist.springframework.org + + + + + staging + + + spring-site-staging + file:///${java.io.tmpdir}/spring-data/data-commons/docs/${project.version} + + + spring-milestone-staging + file:///${java.io.tmpdir}/spring-data/data-commons/milestone + + + spring-snapshot-staging + file:///${java.io.tmpdir}/spring-data/data-commons/snapshot + + + + + + + http://www.springsource.com/download/community + + spring-site + scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/data-commons/docs/${project.version} + + + spring-milestone + Spring Milestone Repository + s3://maven.springframework.org/milestone + + + spring-snapshot + Spring Snapshot Repository + s3://maven.springframework.org/snapshot + + + + + + + org.springframework.build.aws + org.springframework.build.aws.maven + 3.0.0.RELEASE + + + + + com.agilejava.docbkx + docbkx-maven-plugin + 2.0.6 + + + + generate-html + generate-pdf + + package + + + + + org.docbook + docbook-xml + 4.4 + runtime + + + + index.xml + true + ${project.basedir}/src/docbkx/resources/xsl/fopdf.xsl + + css/html.css + + false + ${project.basedir}/src/docbkx/resources/xsl/html.xsl + + + + version + ${pom.version} + + + + + + + + + + + + + + + + + + + + + + + maven-javadoc-plugin + 2.5 + + + aggregate + + aggregate + + package + + true + true +
Spring Datastore Key-Value
+ 1.5 + true + ${project.basedir}/src/main/javadoc + ${project.basedir}/src/main/javadoc/overview.html + ${project.basedir}/src/main/javadoc/spring-javadoc.css + + true + + http://static.springframework.org/spring/docs/3.0.x/javadoc-api + http://java.sun.com/javase/6/docs/api + +
+
+
+
+ + maven-assembly-plugin + 2.2-beta-5 + false + + + distribution + + single + + package + + + ${project.basedir}/src/assembly/distribution.xml + + false + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.4 + + + upload-dist + deploy + + + + + + + + + run + + + + + + org.springframework.build + org.springframework.build.aws.ant + 3.0.5.RELEASE + + + net.java.dev.jets3t + jets3t + 0.7.2 + + + +
+ + ${dist.finalName} +
- spring-maven-snapshot - - true - - Springframework Maven SNAPSHOT Repository - http://maven.springframework.org/snapshot + repository.springframework.maven.release + Spring Framework Maven Release Repository + http://maven.springframework.org/release - - -
+ + repository.springframework.maven.milestone + Spring Framework Maven Milestone Repository + http://maven.springframework.org/milestone + + + + repository.source.maven.release + SpringSource Maven Release Repository + http://repository.springsource.com/maven/bundles/release + + +
\ No newline at end of file diff --git a/spring-data-commons-aspects/pom.xml b/spring-data-commons-aspects/pom.xml new file mode 100644 index 000000000..6f48ae893 --- /dev/null +++ b/spring-data-commons-aspects/pom.xml @@ -0,0 +1,156 @@ + + 4.0.0 + + org.springframework.data + spring-data-commons-parent + 1.0.0.BUILD-SNAPSHOT + ../spring-data-commons-parent/pom.xml + + spring-data-commons-aspects + jar + Spring Data Commons Aspects + + 1.6.10.BUILD-SNAPSHOT + + + + + + org.springframework + spring-beans + + + org.springframework + spring-tx + + + org.springframework + spring-aspects + ${org.springframework.version} + + + + + org.springframework.data + spring-data-commons-core + + + + + org.slf4j + slf4j-api + + + org.slf4j + jcl-over-slf4j + compile + + + org.slf4j + slf4j-log4j12 + runtime + + + log4j + log4j + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + runtime + + + + javax.annotation + jsr250-api + true + + + + org.mockito + mockito-all + test + + + + junit + junit + + + + org.aspectj + aspectjrt + ${aspectj.version} + + + + + + spring-maven-snapshot + + true + + Springframework Maven SNAPSHOT Repository + http://maven.springframework.org/snapshot + + + + + + org.codehaus.mojo + aspectj-maven-plugin + 1.2 + + + org.aspectj + aspectjrt + ${aspectj.version} + + + org.aspectj + aspectjtools + ${aspectj.version} + + + + + + compile + test-compile + + + + + true + + + org.springframework + spring-aspects + + + 1.6 + 1.6 + + + + com.springsource.bundlor + com.springsource.bundlor.maven + + + + diff --git a/spring-data-commons-aspects/src/main/java/org/springframework/persistence/support/AbstractMixinFields.aj b/spring-data-commons-aspects/src/main/java/org/springframework/persistence/support/AbstractMixinFields.aj new file mode 100644 index 000000000..9e6473ea3 --- /dev/null +++ b/spring-data-commons-aspects/src/main/java/org/springframework/persistence/support/AbstractMixinFields.aj @@ -0,0 +1,54 @@ +package org.springframework.persistence.support; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Configurable; +import org.springframework.persistence.RelatedEntity; + +/** + * Abstract superaspect to advise field read and write + * and introduce a mixin interface. + * + * @param type of introduced interface + * + * @author Rod Johnson + */ +privileged abstract public aspect AbstractMixinFields { + + protected final Log log = LogFactory.getLog(getClass()); + + //------------------------------------------------------------------------- + // ITDs to add behavior and state to classes + //------------------------------------------------------------------------- + // Enable Spring DI for all mixed-in objects + declare @type: N+: @Configurable; + + //------------------------------------------------------------------------- + // Advice for field get/set to delegate to backing Node. + //------------------------------------------------------------------------- + protected pointcut entityFieldGet(N entity) : + get(* N+.*) && + this(entity) && + !(get(@RelatedEntity * *) + || get(* N.*) + || getsNotToAdvise()); + + /** + * Never matches. Subclasses can override to exempt certain field reads from advice + */ + protected pointcut getsNotToAdvise(); + + protected pointcut entityFieldSet(N entity, Object newVal) : + set(* N+.*) && + this(entity) && + args(newVal) && + !(set(@RelatedEntity * *) || + set(* N.*) || + setsNotToAdvise()); + + /** + * Never matches. Subclasses can override to exempt certain field writes from advice + */ + protected pointcut setsNotToAdvise(); + +} diff --git a/spring-data-commons-aspects/src/main/java/org/springframework/persistence/support/AbstractTypeAnnotatingMixinFields.aj b/spring-data-commons-aspects/src/main/java/org/springframework/persistence/support/AbstractTypeAnnotatingMixinFields.aj new file mode 100644 index 000000000..ba63e81e4 --- /dev/null +++ b/spring-data-commons-aspects/src/main/java/org/springframework/persistence/support/AbstractTypeAnnotatingMixinFields.aj @@ -0,0 +1,21 @@ +package org.springframework.persistence.support; + +import java.lang.annotation.Annotation; + +/** + * Abstract superaspect for aspects that advice + * field access with a mixin for all types annotated with + * a given annotation. + * + * @param annotation on entity + * @param type of introduced interface + * + * @author Rod Johnson + */ +privileged abstract public aspect AbstractTypeAnnotatingMixinFields + extends AbstractMixinFields { + + // ITD to introduce N state to Annotated objects + declare parents : (@ET *) implements N; + +} diff --git a/spring-data-commons-aspects/template.mf b/spring-data-commons-aspects/template.mf new file mode 100644 index 000000000..2f7b22146 --- /dev/null +++ b/spring-data-commons-aspects/template.mf @@ -0,0 +1,20 @@ +Bundle-SymbolicName: org.springframework.data.commons.aspects +Bundle-Name: Spring Data Commons Aspects +Bundle-Vendor: SpringSource +Bundle-ManifestVersion: 2 +Import-Package: + sun.reflect;version="0";resolution:=optional +Import-Template: + org.springframework.beans.*;version="[3.0.0, 4.0.0)", + org.springframework.core.*;version="[3.0.0, 4.0.0)", + org.springframework.dao.*;version="[3.0.0, 4.0.0)", + org.springframework.util.*;version="[3.0.0, 4.0.0)", + org.springframework.data.core.*;version="[1.0.0, 2.0.0)", + org.springframework.datastore.core.*;version="[1.0.0, 2.0.0)", + org.springframework.datastore.persistence.*;version="[1.0.0, 2.0.0)", + org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional, + org.apache.commons.logging.*;version="[1.1.1, 2.0.0)", + org.aspectj.*;version="[1.6.5, 2.0.0)", + org.w3c.dom.*;version="0" + + diff --git a/spring-data-commons-core/pom.xml b/spring-data-commons-core/pom.xml new file mode 100644 index 000000000..d03a3c6e3 --- /dev/null +++ b/spring-data-commons-core/pom.xml @@ -0,0 +1,90 @@ + + 4.0.0 + + org.springframework.data + spring-data-commons-parent + 1.0.0.BUILD-SNAPSHOT + ../spring-data-commons-parent/pom.xml + + spring-data-commons-core + jar + Spring Data Commons Core + + + + + org.springframework + spring-beans + + + org.springframework + spring-tx + + + + + org.slf4j + slf4j-api + + + org.slf4j + jcl-over-slf4j + compile + + + org.slf4j + slf4j-log4j12 + runtime + + + log4j + log4j + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + runtime + + + + javax.annotation + jsr250-api + true + + + + org.mockito + mockito-all + test + + + + junit + junit + + + + + + + com.springsource.bundlor + com.springsource.bundlor.maven + + + + diff --git a/src/main/java/org/springframework/data/support/ChangeSet.java b/spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSet.java similarity index 100% rename from src/main/java/org/springframework/data/support/ChangeSet.java rename to spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSet.java diff --git a/src/main/java/org/springframework/data/support/ChangeSetBacked.java b/spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSetBacked.java similarity index 100% rename from src/main/java/org/springframework/data/support/ChangeSetBacked.java rename to spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSetBacked.java diff --git a/src/main/java/org/springframework/data/support/ChangeSetPersister.java b/spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSetPersister.java similarity index 100% rename from src/main/java/org/springframework/data/support/ChangeSetPersister.java rename to spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSetPersister.java diff --git a/src/main/java/org/springframework/data/support/ChangeSetSynchronizer.java b/spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSetSynchronizer.java similarity index 100% rename from src/main/java/org/springframework/data/support/ChangeSetSynchronizer.java rename to spring-data-commons-core/src/main/java/org/springframework/data/support/ChangeSetSynchronizer.java diff --git a/src/main/java/org/springframework/data/support/HashMapChangeSet.java b/spring-data-commons-core/src/main/java/org/springframework/data/support/HashMapChangeSet.java similarity index 100% rename from src/main/java/org/springframework/data/support/HashMapChangeSet.java rename to spring-data-commons-core/src/main/java/org/springframework/data/support/HashMapChangeSet.java diff --git a/src/main/java/org/springframework/data/transaction/ChangeSetBackedTransactionSynchronization.java b/spring-data-commons-core/src/main/java/org/springframework/data/transaction/ChangeSetBackedTransactionSynchronization.java similarity index 100% rename from src/main/java/org/springframework/data/transaction/ChangeSetBackedTransactionSynchronization.java rename to spring-data-commons-core/src/main/java/org/springframework/data/transaction/ChangeSetBackedTransactionSynchronization.java diff --git a/src/main/java/org/springframework/datastore/serialization/SerializationStore.java b/spring-data-commons-core/src/main/java/org/springframework/datastore/serialization/SerializationStore.java similarity index 100% rename from src/main/java/org/springframework/datastore/serialization/SerializationStore.java rename to spring-data-commons-core/src/main/java/org/springframework/datastore/serialization/SerializationStore.java diff --git a/spring-data-commons-core/src/main/java/org/springframework/persistence/AsynchStoreCompletionListener.java b/spring-data-commons-core/src/main/java/org/springframework/persistence/AsynchStoreCompletionListener.java new file mode 100644 index 000000000..4f417bb57 --- /dev/null +++ b/spring-data-commons-core/src/main/java/org/springframework/persistence/AsynchStoreCompletionListener.java @@ -0,0 +1,32 @@ +package org.springframework.persistence; + +import java.lang.reflect.Field; + +/** + * Listener interface for asynchronous storage operations. + * Can be annotated with OnlyOnFailure as an optimization + * if the listener is only interested in compensating transactions + * in the event of write failure. + * + * @author Rod Johnson + * + * @param new value type + */ +public interface AsynchStoreCompletionListener { + + /** + * Constant indicating no store completion action + */ + class NONE implements AsynchStoreCompletionListener { + public void onCompletion(AsynchStoreCompletionListener.StoreResult result, Object newValue, Field foreignStore) {} + } + + enum StoreResult { + SUCCESS, + FAILURE, + INDETERMINATE + }; + + void onCompletion(StoreResult result, V newValue, Field foreignStore); + +} diff --git a/spring-data-commons-core/src/main/java/org/springframework/persistence/PersistencePolicy.java b/spring-data-commons-core/src/main/java/org/springframework/persistence/PersistencePolicy.java new file mode 100644 index 000000000..63d91895a --- /dev/null +++ b/spring-data-commons-core/src/main/java/org/springframework/persistence/PersistencePolicy.java @@ -0,0 +1,34 @@ +package org.springframework.persistence; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Persistence policies that can be attached to entities or relationship + * fields. + * @author rodjohnson + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.FIELD}) +public @interface PersistencePolicy { + + enum LATENCY_SENSITIVITY { NONE, MEDIUM, HIGH }; + + boolean largeObject() default false; + + boolean queryable() default true; + + boolean immutable() default false; + + boolean transactional() default true; + + boolean lossAcceptable() default false; + + // TODO freshness, or should this be handled separately in a caching annotation + + LATENCY_SENSITIVITY latencySensitivity() default LATENCY_SENSITIVITY.HIGH; + +} diff --git a/spring-data-commons-core/src/main/java/org/springframework/persistence/RelatedEntity.java b/spring-data-commons-core/src/main/java/org/springframework/persistence/RelatedEntity.java new file mode 100644 index 000000000..f9e538c82 --- /dev/null +++ b/spring-data-commons-core/src/main/java/org/springframework/persistence/RelatedEntity.java @@ -0,0 +1,65 @@ +package org.springframework.persistence; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation indicating that a field may be stored in a foreign store + * and specifying the necessary guarantees. Conceptual rather than + * implementation-specific. + * @see ForeignStoreKeyManager + * + * @author Rod Johnson + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface RelatedEntity { + + /** + * + * Optional information as to how to compute or locate the key value. + * Some strategies may take this into account. + */ + String keyExpression() default ""; + + /** + * Should we use the key of the present entity + * @return + */ + boolean sameKey() default false; + + /** + * Policies for persistence + * @return + */ + PersistencePolicy policy() default @PersistencePolicy(); + + /** + * Name for the preferred data store. Merely a hint. May not be followed. + * @return + */ + String preferredStore() default ""; + + /** + * Is asynchronous store OK? + * @return + */ + boolean asynchStore() default false; + + // TODO - indicates if an asynchronous write should begin + // only after commit of a transaction + boolean afterCommit() default false; + + /** + * Completion listener class. Only used if asynchStore is true. + * Must have a no-arg constructor. + * @return + */ + @SuppressWarnings("unchecked") + Class storeCompletionListenerClass() default AsynchStoreCompletionListener.NONE.class; + + String storeCompletionListenerBeanName() default ""; + +} diff --git a/spring-data-commons-core/src/main/java/org/springframework/persistence/support/AbstractConstructorEntityInstantiator.java b/spring-data-commons-core/src/main/java/org/springframework/persistence/support/AbstractConstructorEntityInstantiator.java new file mode 100644 index 000000000..6747a900b --- /dev/null +++ b/spring-data-commons-core/src/main/java/org/springframework/persistence/support/AbstractConstructorEntityInstantiator.java @@ -0,0 +1,73 @@ +package org.springframework.persistence.support; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.util.ClassUtils; + +/** + * Try for a constructor taking state: failing that, try a no-arg + * constructor and then setUnderlyingNode(). + * + * @author Rod Johnson + */ +public abstract class AbstractConstructorEntityInstantiator implements EntityInstantiator { + + private final Log log = LogFactory.getLog(getClass()); + + final public T createEntityFromState(STATE n, Class c) { + try { + return fromStateInternal(n, c); + } catch (InstantiationException e) { + throw new IllegalArgumentException(e); + } catch (IllegalAccessException e) { + throw new IllegalArgumentException(e); + } catch (InvocationTargetException e) { + throw new IllegalArgumentException(e); + } + } + + final private T fromStateInternal(STATE n, Class c) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { + // TODO this is fragile + Class stateInterface = (Class) n.getClass().getInterfaces()[0]; + Constructor nodeConstructor = ClassUtils.getConstructorIfAvailable(c, stateInterface); + if (nodeConstructor != null) { + // TODO is this the correct way to instantiate or does Spring have a preferred way? + log.info("Using " + c + " constructor taking " + stateInterface); + return nodeConstructor.newInstance(n); + } + + Constructor noArgConstructor = ClassUtils.getConstructorIfAvailable(c); + if (noArgConstructor == null) noArgConstructor = getDeclaredConstructor(c); + if (noArgConstructor != null) { + log.info("Using " + c + " no-arg constructor"); + StateProvider.setUnderlyingState(n); + T t = noArgConstructor.newInstance(); + setState(t, n); + return t; + } + + throw new IllegalArgumentException(getClass().getSimpleName() + ": entity " + c + " must have either a constructor taking [" + stateInterface + + "] or a no-arg constructor and state set method"); + } + + private Constructor getDeclaredConstructor(Class c) { + try { + final Constructor declaredConstructor = c.getDeclaredConstructor(); + declaredConstructor.setAccessible(true); + return declaredConstructor; + } catch (NoSuchMethodException e) { + return null; + } + } + + /** + * Subclasses must implement to set state + * @param entity + * @param s + */ + protected abstract void setState(BACKING_INTERFACE entity, STATE s); + +} diff --git a/spring-data-commons-core/src/main/java/org/springframework/persistence/support/EntityInstantiator.java b/spring-data-commons-core/src/main/java/org/springframework/persistence/support/EntityInstantiator.java new file mode 100644 index 000000000..f17db133e --- /dev/null +++ b/spring-data-commons-core/src/main/java/org/springframework/persistence/support/EntityInstantiator.java @@ -0,0 +1,32 @@ +package org.springframework.persistence.support; + + +/** + * Interface to be implemented by classes that can instantiate and + * configure entities. + * The framework must do this when creating objects resulting from finders, + * even when there may be no no-arg constructor supplied by the user. + * + * @author Rod Johnson + */ +public interface EntityInstantiator { + + /* + * The best solution if available is to add a constructor that takes Node + * to each GraphEntity. This means generating an aspect beside every + * class as Roo presently does. + * + * An alternative that does not require Roo + * is a user-authored constructor taking Node and calling setUnderlyingNode() + * but this is less elegant and pollutes the domain object. + * + * If the user supplies a no-arg constructor, instantiation can occur by invoking it + * prior to calling setUnderlyingNode(). + * + * If the user does NOT supply a no-arg constructor, we must rely on Sun-specific + * code to instantiate entities without invoking a constructor. + */ + + T createEntityFromState(STATE s, Class c); + +} diff --git a/spring-data-commons-core/src/main/java/org/springframework/persistence/support/StateProvider.java b/spring-data-commons-core/src/main/java/org/springframework/persistence/support/StateProvider.java new file mode 100644 index 000000000..6334662a0 --- /dev/null +++ b/spring-data-commons-core/src/main/java/org/springframework/persistence/support/StateProvider.java @@ -0,0 +1,21 @@ +package org.springframework.persistence.support; + +/** + * @author Michael Hunger + * @since 24.09.2010 + */ +public abstract class StateProvider { + private final static ThreadLocal stateHolder=new ThreadLocal(); + + private StateProvider() {} + + public static void setUnderlyingState(STATE state) { + if (stateHolder.get()!=null) throw new IllegalStateException("StateHolder already contains state "+stateHolder.get()+" in thread "+Thread.currentThread()); + stateHolder.set(state); + } + public static STATE retrieveState() { + STATE result= (STATE) stateHolder.get(); + stateHolder.remove(); + return result; + } +} diff --git a/spring-data-commons-core/src/main/java/org/springframework/persistence/transaction/NaiveDoubleTransactionManager.java b/spring-data-commons-core/src/main/java/org/springframework/persistence/transaction/NaiveDoubleTransactionManager.java new file mode 100644 index 000000000..b4e11742f --- /dev/null +++ b/spring-data-commons-core/src/main/java/org/springframework/persistence/transaction/NaiveDoubleTransactionManager.java @@ -0,0 +1,78 @@ +package org.springframework.persistence.transaction; + +import java.util.IdentityHashMap; +import java.util.Map; + +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionDefinition; +import org.springframework.transaction.TransactionException; +import org.springframework.transaction.TransactionStatus; +import org.springframework.transaction.support.DefaultTransactionStatus; + +public class NaiveDoubleTransactionManager implements PlatformTransactionManager { + Map status=new IdentityHashMap(); + private final PlatformTransactionManager a; + + private final PlatformTransactionManager b; + + public NaiveDoubleTransactionManager(PlatformTransactionManager a, PlatformTransactionManager b) { + System.err.println("WARNING: Naive JTA/Neo4j Spring transaction manager--must implement properly"); + this.a = a; + this.b = b; + } + + @Override + public void commit(TransactionStatus ts) throws TransactionException { + try { + final TransactionStatus tsb = copyTransactionStatus(status.get(ts)); + try { + a.commit(ts); + } + catch (Throwable t) { + System.err.println("Continuing to commit tx despite this:" + t); + } + try { + b.commit(tsb); + } + catch (Throwable t) { + System.err.println("Can't commit tx" + t); + throw new TransactionException(t.getMessage(), t) {}; + } + } finally { + status.remove(ts); + } + } + + private TransactionStatus copyTransactionStatus(TransactionStatus ts) { + Object t = (ts instanceof DefaultTransactionStatus) ? ((DefaultTransactionStatus) ts).getTransaction() : null; + return new DefaultTransactionStatus(t,ts.isNewTransaction(), false, false, false, null); + } + + @Override + public TransactionStatus getTransaction(TransactionDefinition td) + throws TransactionException { + TransactionStatus atx = a.getTransaction(td); + TransactionStatus btx = b.getTransaction(td); + status.put(atx, btx); + return atx; + } + + @Override + public void rollback(TransactionStatus ts) throws TransactionException { + final TransactionStatus tsb = copyTransactionStatus(status.remove(ts)); + try { + a.rollback(ts); + } + catch (Throwable t) { + System.err.println("Continuing to rollback tx despite this:" + t); + } + try { + b.rollback(tsb); + } + catch (Throwable t) { + System.err.println("Can't rollback tx" + t); + throw new TransactionException(t.getMessage(), t) {}; + } + } + +} diff --git a/spring-data-commons-core/template.mf b/spring-data-commons-core/template.mf new file mode 100644 index 000000000..1841acccf --- /dev/null +++ b/spring-data-commons-core/template.mf @@ -0,0 +1,20 @@ +Bundle-SymbolicName: org.springframework.data.commons +Bundle-Name: Spring Data Commons Core +Bundle-Vendor: SpringSource +Bundle-ManifestVersion: 2 +Import-Package: + sun.reflect;version="0";resolution:=optional +Import-Template: + org.springframework.beans.*;version="[3.0.0, 4.0.0)", + org.springframework.core.*;version="[3.0.0, 4.0.0)", + org.springframework.dao.*;version="[3.0.0, 4.0.0)", + org.springframework.util.*;version="[3.0.0, 4.0.0)", + org.springframework.transaction.*;version="[3.0.0, 4.0.0)", + org.springframework.data.core.*;version="[1.0.0, 2.0.0)", + org.springframework.datastore.core.*;version="[1.0.0, 2.0.0)", + org.springframework.datastore.persistence.*;version="[1.0.0, 2.0.0)", + org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional, + org.apache.commons.logging.*;version="[1.1.1, 2.0.0)", + org.w3c.dom.*;version="0" + + diff --git a/spring-data-commons-parent/pom.xml b/spring-data-commons-parent/pom.xml new file mode 100644 index 000000000..08bb16506 --- /dev/null +++ b/spring-data-commons-parent/pom.xml @@ -0,0 +1,380 @@ + + + 4.0.0 + org.springframework.data + spring-data-commons-parent + Spring Data Commons Parent + http://www.springsource.org/spring-data + 1.0.0.BUILD-SNAPSHOT + pom + + UTF-8 + + 4.8.1 + 1.2.15 + 1.8.4 + 1.5.10 + 3.0.4.RELEASE + + + + strict + + false + + + + fast + + true + true + + + + staging + + + spring-site-staging + file:///${java.io.tmpdir}/spring-data/data-commons/docs + + + spring-milestone-staging + file:///${java.io.tmpdir}/spring-data/data-commons/milestone + + + spring-snapshot-staging + file:///${java.io.tmpdir}/spring-data/data-commons/snapshot + + + + + bootstrap + + + + + + http://www.springsource.com/download/community + + + spring-docs + scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/data-commons/docs/${project.version} + + + + spring-milestone + Spring Milestone Repository + s3://maven.springframework.org/milestone + + + spring-snapshot + Spring Snapshot Repository + s3://maven.springframework.org/snapshot + + + + + + + + + org.springframework + spring-aop + ${org.springframework.version} + + + org.springframework + spring-beans + ${org.springframework.version} + + + org.springframework + spring-core + ${org.springframework.version} + + + commons-logging + commons-logging + + + + + org.springframework + spring-tx + ${org.springframework.version} + + + org.springframework + spring-test + ${org.springframework.version} + test + + + + + org.springframework.data + spring-data-commons-core + ${project.version} + + + org.springframework.data + spring-datastore-redis + ${project.version} + + + + + org.slf4j + slf4j-api + ${org.slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${org.slf4j.version} + runtime + + + org.slf4j + slf4j-log4j12 + ${org.slf4j.version} + runtime + + + log4j + log4j + ${log4j.version} + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + runtime + + + + javax.annotation + jsr250-api + 1.0 + true + + + + org.mockito + mockito-all + ${org.mockito.version} + test + + + + junit + junit + ${junit.version} + test + + + + + + + + log4j + log4j + ${log4j.version} + test + + + + + + + + org.springframework.build.aws + org.springframework.build.aws.maven + 3.0.0.RELEASE + + + + + ${project.basedir}/src/main/java + + **/* + + + **/*.java + **/*.aj + + + + ${project.basedir}/src/main/resources + + **/* + + + + + + ${project.basedir}/src/test/java + + **/* + + + **/*.java + + + + ${project.basedir}/src/test/resources + + **/* + + + **/*.java + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + -Xlint:all + true + false + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + **/*Tests.java + + + **/Abstract*.java + **/*IntegrationTests.java + + junit:junit + + + + maven-source-plugin + + + attach-sources + + jar + + + + + + + + + + com.springsource.bundlor + com.springsource.bundlor.maven + 1.0.0.RELEASE + + true + + + + bundlor + + bundlor + + + + + + + + + + + repository.plugin.springsource.release + SpringSource Maven Repository + http://repository.springsource.com/maven/bundles/release + + + + + repository.springframework.maven.release + Spring Framework Maven Release Repository + http://maven.springframework.org/release + + + repository.springframework.maven.milestone + Spring Framework Maven Milestone Repository + http://maven.springframework.org/milestone + + + repository.springframework.maven.snapshot + Spring Framework Maven Snapshot Repository + http://maven.springframework.org/snapshot + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.1 + + false + + + + + diff --git a/src/ant/upload-dist.xml b/src/ant/upload-dist.xml new file mode 100644 index 000000000..94ed552ed --- /dev/null +++ b/src/ant/upload-dist.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assembly/distribution.xml b/src/assembly/distribution.xml new file mode 100644 index 000000000..56aa8a239 --- /dev/null +++ b/src/assembly/distribution.xml @@ -0,0 +1,69 @@ + + + + distribution + + zip + + true + + + + src/main/resources + + readme.txt + apache-license.txt + notice.txt + changelog.txt + + + dos + + + + target/site/reference + docs/reference + + + + target/site/apidocs + docs/javadoc + + + + + + + org.springframework.data:spring-data-commons-core + org.springframework.data:spring-data-commons-aspects + + + dist + false + false + + + + + + org.springframework.data:spring-data-commons-core + org.springframework.data:spring-data-commons-aspects + + + sources + src + false + false + + + + diff --git a/src/docbkx/index.xml b/src/docbkx/index.xml new file mode 100644 index 000000000..20f51f0a6 --- /dev/null +++ b/src/docbkx/index.xml @@ -0,0 +1,43 @@ + + + + + Spring Data Commons - Reference Documentation + &version; + + + + Mark + Pollack + + + Thomas + Risberg + + + + + + Copies of this document may be made for your own use and for distribution + to others, provided that you do not charge any fee for such copies and + further provided that each copy contains this Copyright Notice, whether + distributed in print or electronically. + + + + + + + + + + Reference + + + This part of the reference documentation details the ... + + + + + diff --git a/src/docbkx/preface.xml b/src/docbkx/preface.xml new file mode 100644 index 000000000..bfe4eca6a --- /dev/null +++ b/src/docbkx/preface.xml @@ -0,0 +1,9 @@ + + + + Preface + + The Spring Data Commons project applies core Spring concepts to the development of solutions using many non-relational data stores. + + diff --git a/src/docbkx/resources/css/highlight.css b/src/docbkx/resources/css/highlight.css new file mode 100644 index 000000000..ffefef72d --- /dev/null +++ b/src/docbkx/resources/css/highlight.css @@ -0,0 +1,35 @@ +/* + code highlight CSS resemblign the Eclipse IDE default color schema + @author Costin Leau +*/ + +.hl-keyword { + color: #7F0055; + font-weight: bold; +} + +.hl-comment { + color: #3F5F5F; + font-style: italic; +} + +.hl-multiline-comment { + color: #3F5FBF; + font-style: italic; +} + +.hl-tag { + color: #3F7F7F; +} + +.hl-attribute { + color: #7F007F; +} + +.hl-value { + color: #2A00FF; +} + +.hl-string { + color: #2A00FF; +} \ No newline at end of file diff --git a/src/docbkx/resources/css/html.css b/src/docbkx/resources/css/html.css new file mode 100644 index 000000000..10936f337 --- /dev/null +++ b/src/docbkx/resources/css/html.css @@ -0,0 +1,421 @@ +body { + text-align: justify; + margin-right: 2em; + margin-left: 2em; +} + +a, + a[accesskey^ + += +"h" +] +, +a[accesskey^ + += +"n" +] +, +a[accesskey^ + += +"u" +] +, +a[accesskey^ + += +"p" +] +{ +font-family: Verdana, Arial, helvetica, sans-serif + +; +font-size: + +12 +px + +; +color: #003399 + +; +} + +a:active { + color: #003399; +} + +a:visited { + color: #888888; +} + +p { + font-family: Verdana, Arial, sans-serif; +} + +dt { + font-family: Verdana, Arial, sans-serif; + font-size: 12px; +} + +p, dl, dt, dd, blockquote { + color: #000000; + margin-bottom: 3px; + margin-top: 3px; + padding-top: 0px; +} + +ol, ul, p { + margin-top: 6px; + margin-bottom: 6px; +} + +p, blockquote { + font-size: 90%; +} + +p.releaseinfo { + font-size: 100%; + font-weight: bold; + font-family: Verdana, Arial, helvetica, sans-serif; + padding-top: 10px; +} + +p.pubdate { + font-size: 120%; + font-weight: bold; + font-family: Verdana, Arial, helvetica, sans-serif; +} + +td { + font-size: 80%; +} + +td, th, span { + color: #000000; +} + +td[width^ + += +"40%" +] +{ +font-family: Verdana, Arial, helvetica, sans-serif + +; +font-size: + +12 +px + +; +color: #003399 + +; +} + +table[summary^ + += +"Navigation header" +] +tbody tr th[colspan^ + += +"3" +] +{ +font-family: Verdana, Arial, helvetica, sans-serif + +; +} + +blockquote { + margin-right: 0px; +} + +h1, h2, h3, h4, h6, H6 { + color: #000000; + font-weight: 500; + margin-top: 0px; + padding-top: 14px; + font-family: Verdana, Arial, helvetica, sans-serif; + margin-bottom: 0px; +} + +h2.title { + font-weight: 800; + margin-bottom: 8px; +} + +h2.subtitle { + font-weight: 800; + margin-bottom: 20px; +} + +.firstname, .surname { + font-size: 12px; + font-family: Verdana, Arial, helvetica, sans-serif; +} + +table { + border-collapse: collapse; + border-spacing: 0; + border: 1px black; + empty-cells: hide; + margin: 10px 0px 30px 50px; + width: 90%; +} + +div.table { + margin: 30px 0px 30px 0px; + border: 1px dashed gray; + padding: 10px; +} + +div .table-contents table { + border: 1px solid black; +} + +div.table > p.title { + padding-left: 10px; +} + +table[summary^ + += +"Navigation footer" +] +{ +border-collapse: collapse + +; +border-spacing: + +0 +; +border: + +1 +px black + +; +empty-cells: hide + +; +margin: + +0 +px + +; +width: + +100 +% +; +} + +table[summary^ + += +"Note" +] +, +table[summary^ + += +"Warning" +] +, +table[summary^ + += +"Tip" +] +{ +border-collapse: collapse + +; +border-spacing: + +0 +; +border: + +1 +px black + +; +empty-cells: hide + +; +margin: + +10 +px + +0 +px + +10 +px + +- +20 +px + +; +width: + +100 +% +; +} + +td { + padding: 4pt; + font-family: Verdana, Arial, helvetica, sans-serif; +} + +div.warning TD { + text-align: justify; +} + +h1 { + font-size: 150%; +} + +h2 { + font-size: 110%; +} + +h3 { + font-size: 100%; + font-weight: bold; +} + +h4 { + font-size: 90%; + font-weight: bold; +} + +h5 { + font-size: 90%; + font-style: italic; +} + +h6 { + font-size: 100%; + font-style: italic; +} + +tt { + font-size: 110%; + font-family: "Courier New", Courier, monospace; + color: #000000; +} + +.navheader, .navfooter { + border: none; +} + +div.navfooter table { + border: dashed gray; + border-width: 1px 1px 1px 1px; + background-color: #cde48d; +} + +pre { + font-size: 110%; + padding: 5px; + border-style: solid; + border-width: 1px; + border-color: #CCCCCC; + background-color: #f3f5e9; +} + +ul, ol, li { + list-style: disc; +} + +hr { + width: 100%; + height: 1px; + background-color: #CCCCCC; + border-width: 0px; + padding: 0px; +} + +.variablelist { + padding-top: 10px; + padding-bottom: 10px; + margin: 0; +} + +.term { + font-weight: bold; +} + +.mediaobject { + padding-top: 30px; + padding-bottom: 30px; +} + +.legalnotice { + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; + font-style: italic; +} + +.sidebar { + float: right; + margin: 10px 0px 10px 30px; + padding: 10px 20px 20px 20px; + width: 33%; + border: 1px solid black; + background-color: #F4F4F4; + font-size: 14px; +} + +.property { + font-family: "Courier New", Courier, monospace; +} + +a code { + font-family: Verdana, Arial, monospace; + font-size: 12px; +} + +td code { + font-size: 110%; +} + +div.note * td, + div.tip * td, + div.warning * td, + div.calloutlist * td { + text-align: justify; + font-size: 100%; +} + +.programlisting .interfacename, + .programlisting .literal, + .programlisting .classname { + font-size: 95%; +} + +.title .interfacename, + .title .literal, + .title .classname { + font-size: 130%; +} + +/* everything in a is displayed in a coloured, comment-like font */ +.programlisting * .lineannotation, + .programlisting * .lineannotation * { + color: green; +} diff --git a/src/docbkx/resources/css/stylesheet.css b/src/docbkx/resources/css/stylesheet.css new file mode 100644 index 000000000..77569070a --- /dev/null +++ b/src/docbkx/resources/css/stylesheet.css @@ -0,0 +1,99 @@ +@IMPORT url("highlight.css"); + +html { + padding: 0pt; + margin: 0pt; +} + +body { + margin-left: 10%; + margin-right: 10%; + font-family: Arial, Sans-serif; +} + +div { + margin: 0pt; +} + +p { + text-align: justify; +} + +hr { + border: 1px solid gray; + background: gray; +} + +h1,h2,h3,h4 { + color: #234623; + font-family: Arial, Sans-serif; +} + +pre { + line-height: 1.0; + color: black; +} + +pre.programlisting { + font-size: 10pt; + padding: 7pt 3pt; + border: 1pt solid black; + background: #eeeeee; + clear: both; +} + +div.table { + margin: 1em; + padding: 0.5em; + text-align: center; +} + +div.table table { + display: table; + width: 100%; +} + +div.table td { + padding-left: 7px; + padding-right: 7px; +} + +.sidebar { + float: right; + margin: 10px 0 10px 30px; + padding: 10px 20px 20px 20px; + width: 33%; + border: 1px solid black; + background-color: #F4F4F4; + font-size: 14px; +} + +.mediaobject { + padding-top: 30px; + padding-bottom: 30px; +} + +.legalnotice { + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; + font-style: italic; +} + +p.releaseinfo { + font-size: 100%; + font-weight: bold; + font-family: Verdana, Arial, helvetica, sans-serif; + padding-top: 10px; +} + +p.pubdate { + font-size: 120%; + font-weight: bold; + font-family: Verdana, Arial, helvetica, sans-serif; +} + +span.productname { + font-size: 200%; + font-weight: bold; + font-family: Verdana, Arial, helvetica, sans-serif; +} diff --git a/src/docbkx/resources/images/callouts/1.png b/src/docbkx/resources/images/callouts/1.png new file mode 100644 index 000000000..7d473430b Binary files /dev/null and b/src/docbkx/resources/images/callouts/1.png differ diff --git a/src/docbkx/resources/images/callouts/10.png b/src/docbkx/resources/images/callouts/10.png new file mode 100644 index 000000000..997bbc824 Binary files /dev/null and b/src/docbkx/resources/images/callouts/10.png differ diff --git a/src/docbkx/resources/images/callouts/11.png b/src/docbkx/resources/images/callouts/11.png new file mode 100644 index 000000000..ce47dac3f Binary files /dev/null and b/src/docbkx/resources/images/callouts/11.png differ diff --git a/src/docbkx/resources/images/callouts/12.png b/src/docbkx/resources/images/callouts/12.png new file mode 100644 index 000000000..31daf4e2f Binary files /dev/null and b/src/docbkx/resources/images/callouts/12.png differ diff --git a/src/docbkx/resources/images/callouts/13.png b/src/docbkx/resources/images/callouts/13.png new file mode 100644 index 000000000..14021a89c Binary files /dev/null and b/src/docbkx/resources/images/callouts/13.png differ diff --git a/src/docbkx/resources/images/callouts/14.png b/src/docbkx/resources/images/callouts/14.png new file mode 100644 index 000000000..64014b75f Binary files /dev/null and b/src/docbkx/resources/images/callouts/14.png differ diff --git a/src/docbkx/resources/images/callouts/15.png b/src/docbkx/resources/images/callouts/15.png new file mode 100644 index 000000000..0d65765fc Binary files /dev/null and b/src/docbkx/resources/images/callouts/15.png differ diff --git a/src/docbkx/resources/images/callouts/2.png b/src/docbkx/resources/images/callouts/2.png new file mode 100644 index 000000000..5d09341b2 Binary files /dev/null and b/src/docbkx/resources/images/callouts/2.png differ diff --git a/src/docbkx/resources/images/callouts/3.png b/src/docbkx/resources/images/callouts/3.png new file mode 100644 index 000000000..ef7b70047 Binary files /dev/null and b/src/docbkx/resources/images/callouts/3.png differ diff --git a/src/docbkx/resources/images/callouts/4.png b/src/docbkx/resources/images/callouts/4.png new file mode 100644 index 000000000..adb8364eb Binary files /dev/null and b/src/docbkx/resources/images/callouts/4.png differ diff --git a/src/docbkx/resources/images/callouts/5.png b/src/docbkx/resources/images/callouts/5.png new file mode 100644 index 000000000..4d7eb4600 Binary files /dev/null and b/src/docbkx/resources/images/callouts/5.png differ diff --git a/src/docbkx/resources/images/callouts/6.png b/src/docbkx/resources/images/callouts/6.png new file mode 100644 index 000000000..0ba694af6 Binary files /dev/null and b/src/docbkx/resources/images/callouts/6.png differ diff --git a/src/docbkx/resources/images/callouts/7.png b/src/docbkx/resources/images/callouts/7.png new file mode 100644 index 000000000..472e96f8a Binary files /dev/null and b/src/docbkx/resources/images/callouts/7.png differ diff --git a/src/docbkx/resources/images/callouts/8.png b/src/docbkx/resources/images/callouts/8.png new file mode 100644 index 000000000..5e60973c2 Binary files /dev/null and b/src/docbkx/resources/images/callouts/8.png differ diff --git a/src/docbkx/resources/images/callouts/9.png b/src/docbkx/resources/images/callouts/9.png new file mode 100644 index 000000000..a0676d26c Binary files /dev/null and b/src/docbkx/resources/images/callouts/9.png differ diff --git a/src/docbkx/resources/images/logo.png b/src/docbkx/resources/images/logo.png new file mode 100644 index 000000000..a9f6d959e Binary files /dev/null and b/src/docbkx/resources/images/logo.png differ diff --git a/src/docbkx/resources/images/xdev-spring_logo.jpg b/src/docbkx/resources/images/xdev-spring_logo.jpg new file mode 100644 index 000000000..622962ee3 Binary files /dev/null and b/src/docbkx/resources/images/xdev-spring_logo.jpg differ diff --git a/src/docbkx/resources/xsl/fopdf.xsl b/src/docbkx/resources/xsl/fopdf.xsl new file mode 100644 index 000000000..5e05e298a --- /dev/null +++ b/src/docbkx/resources/xsl/fopdf.xsl @@ -0,0 +1,418 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright © 2010 + + + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -5em + -5em + + + + + + + + + + + Spring Data Commons ( + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 0 + 1 + + 1 + + + + + + book toc + + + + 2 + + + + + + + + + + 0 + 0 + 0 + + + 5mm + 10mm + 10mm + + 15mm + 10mm + 0mm + + 18mm + 18mm + + + 0pc + + + + + justify + false + + + 11 + 8 + + + 1.4 + + + + + + + 0.8em + + + + + + 17.4cm + + + + 4pt + 4pt + 4pt + 4pt + + + + 0.1pt + 0.1pt + + + + + 1 + + + + + + + + left + bold + + + pt + + + + + + + + + + + + + + + 0.8em + 0.8em + 0.8em + + + pt + + 0.1em + 0.1em + 0.1em + + + 0.6em + 0.6em + 0.6em + + + pt + + 0.1em + 0.1em + 0.1em + + + 0.4em + 0.4em + 0.4em + + + pt + + 0.1em + 0.1em + 0.1em + + + + + bold + + + pt + + false + 0.4em + 0.6em + 0.8em + + + + + + + + + pt + + + + + 1em + 1em + 1em + #444444 + solid + 0.1pt + 0.5em + 0.5em + 0.5em + 0.5em + 0.5em + 0.5em + + + + 1 + + #F0F0F0 + + + + + + 0 + 1 + + + 90 + + + + + '1' + + + + + + + figure after + example before + equation before + table before + procedure before + + + + 1 + + + + 0.8em + 0.8em + 0.8em + 0.1em + 0.1em + 0.1em + + + + + + + + + + + + + + + + + diff --git a/src/docbkx/resources/xsl/html.xsl b/src/docbkx/resources/xsl/html.xsl new file mode 100644 index 000000000..aa7930bab --- /dev/null +++ b/src/docbkx/resources/xsl/html.xsl @@ -0,0 +1,91 @@ + + + + + + + + + html.css + + + 1 + 0 + 1 + 0 + + + + + + book toc + + + + 3 + + + + + 1 + + + + + + + 0 + + + 90 + + + + + 0 + + + + + figure after + example before + equation before + table before + procedure before + + + + , + + + + + + + + +
+

Authors

+

+ +

+
+ +
diff --git a/src/docbkx/resources/xsl/html/html_chunk.xsl b/src/docbkx/resources/xsl/html/html_chunk.xsl new file mode 100644 index 000000000..81e6ab235 --- /dev/null +++ b/src/docbkx/resources/xsl/html/html_chunk.xsl @@ -0,0 +1,136 @@ + + + + + + + '5' + + + + 1 + 0 + 1 + + + + images/ + .gif + + 120 + images/callouts/ + .gif + + + css/stylesheet.css + text/css + book toc,title + + text-align: left + + + + + + + + + + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Begin Google Analytics code + + + End Google Analytics code + + + + + Begin LoopFuse code + + + End LoopFuse code + + + \ No newline at end of file diff --git a/src/docbkx/resources/xsl/html/titlepage.xml b/src/docbkx/resources/xsl/html/titlepage.xml new file mode 100644 index 000000000..09539c068 --- /dev/null +++ b/src/docbkx/resources/xsl/html/titlepage.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + <subtitle/> + <!-- <corpauthor/> + <authorgroup/> + <author/> + <mediaobject/> --> + <othercredit/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content t:side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <hr/> + </t:titlepage-separator> + + <t:titlepage-before t:side="recto"> + </t:titlepage-before> + + <t:titlepage-before t:side="verso"> + </t:titlepage-before> +</t:titlepage> + +</t:templates> diff --git a/src/docbkx/resources/xsl/html_chunk.xsl b/src/docbkx/resources/xsl/html_chunk.xsl new file mode 100644 index 000000000..59016d819 --- /dev/null +++ b/src/docbkx/resources/xsl/html_chunk.xsl @@ -0,0 +1,208 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + This is the XSL HTML configuration file for the Spring Reference Documentation. +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version="1.0"> + + <xsl:import href="urn:docbkx:stylesheet"/> + <!--################################################### + HTML Settings + ################################################### --> + <xsl:param name="chunk.section.depth">'5'</xsl:param> + <xsl:param name="use.id.as.filename">'1'</xsl:param> + <!-- These extensions are required for table printing and other stuff --> + <xsl:param name="use.extensions">1</xsl:param> + <xsl:param name="tablecolumns.extension">0</xsl:param> + <xsl:param name="callout.extensions">1</xsl:param> + <xsl:param name="graphicsize.extension">0</xsl:param> + <!--################################################### + Table Of Contents + ################################################### --> + <!-- Generate the TOCs for named components only --> + <xsl:param name="generate.toc"> + book toc + </xsl:param> + <!-- Show only Sections up to level 3 in the TOCs --> + <xsl:param name="toc.section.depth">3</xsl:param> + <!--################################################### + Labels + ################################################### --> + <!-- Label Chapters and Sections (numbering) --> + <xsl:param name="chapter.autolabel">1</xsl:param> + <xsl:param name="section.autolabel" select="1"/> + <xsl:param name="section.label.includes.component.label" select="1"/> + <!--################################################### + Callouts + ################################################### --> + <!-- Place callout marks at this column in annotated areas --> + <xsl:param name="callout.graphics">1</xsl:param> + <xsl:param name="callout.defaultcolumn">90</xsl:param> + <!--################################################### + Misc + ################################################### --> + <!-- Placement of titles --> + <xsl:param name="formal.title.placement"> + figure after + example before + equation before + table before + procedure before + </xsl:param> + <xsl:template match="author" mode="titlepage.mode"> + <xsl:if test="name(preceding-sibling::*[1]) = 'author'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:call-template name="person.name"/> + <xsl:apply-templates mode="titlepage.mode" select="./contrib"/> + <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/> + </span> + </xsl:template> + <xsl:template match="authorgroup" mode="titlepage.mode"> + <div class="{name(.)}"> + <h2>Authors</h2> + <p/> + <xsl:apply-templates mode="titlepage.mode"/> + </div> + </xsl:template> + <!--################################################### + Headers and Footers + ################################################### --> + <!-- let's have a Spring and SpringSource banner across the top of each page --> + <xsl:template name="user.header.navigation"> + <div style="background-color:white;border:none;height:73px;border:1px solid black;"> + <a style="border:none;" href="http://static.springframework.org/spring-ws/site/" + title="The Spring Framework - Spring Web Services"> + <img style="border:none;" src="images/xdev-spring_logo.jpg"/> + </a> + <a style="border:none;" href="http://www.springsource.com/" title="SpringSource"> + <img style="border:none;position:absolute;padding-top:5px;right:42px;" src="images/s2_box_logo.png"/> + </a> + </div> + </xsl:template> + <!-- no other header navigation (prev, next, etc.) --> + <xsl:template name="header.navigation"/> + <xsl:param name="navig.showtitles">1</xsl:param> + <!-- let's have a 'Sponsored by SpringSource' strapline (or somesuch) across the bottom of each page --> + <xsl:template name="footer.navigation"> + <xsl:param name="prev" select="/foo"/> + <xsl:param name="next" select="/foo"/> + <xsl:param name="nav.context"/> + <xsl:variable name="home" select="/*[1]"/> + <xsl:variable name="up" select="parent::*"/> + <xsl:variable name="row1" select="count($prev) > 0 + or count($up) > 0 + or count($next) > 0"/> + <xsl:variable name="row2" select="($prev and $navig.showtitles != 0) + or (generate-id($home) != generate-id(.) + or $nav.context = 'toc') + or ($chunk.tocs.and.lots != 0 + and $nav.context != 'toc') + or ($next and $navig.showtitles != 0)"/> + <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'"> + <div class="navfooter"> + <xsl:if test="$footer.rule != 0"> + <hr/> + </xsl:if> + <xsl:if test="$row1 or $row2"> + <table width="100%" summary="Navigation footer"> + <xsl:if test="$row1"> + <tr> + <td width="40%" align="left"> + <xsl:if test="count($prev)>0"> + <a accesskey="p"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$prev"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="navig.content"> + <xsl:with-param name="direction" select="'prev'"/> + </xsl:call-template> + </a> + </xsl:if> + <xsl:text> </xsl:text> + </td> + + <td width="20%" align="center"> + <xsl:choose> + <xsl:when test="$home != . or $nav.context = 'toc'"> + <a accesskey="h"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$home"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="navig.content"> + <xsl:with-param name="direction" select="'home'"/> + </xsl:call-template> + </a> + <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> + <xsl:text> | </xsl:text> + </xsl:if> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> + <a accesskey="t"> + <xsl:attribute name="href"> + <xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + <xsl:text>-toc</xsl:text> + <xsl:value-of select="$html.ext"/> + </xsl:attribute> + <xsl:call-template name="gentext"> + <xsl:with-param name="key" select="'nav-toc'"/> + </xsl:call-template> + </a> + </xsl:if> + </td> + <td width="40%" align="right"> + <xsl:text> </xsl:text> + <xsl:if test="count($next)>0"> + <a accesskey="n"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$next"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="navig.content"> + <xsl:with-param name="direction" select="'next'"/> + </xsl:call-template> + </a> + </xsl:if> + </td> + </tr> + </xsl:if> + <xsl:if test="$row2"> + <tr> + <td width="40%" align="left" valign="top"> + <xsl:if test="$navig.showtitles != 0"> + <xsl:apply-templates select="$prev" mode="object.title.markup"/> + </xsl:if> + <xsl:text> </xsl:text> + </td> + <td width="20%" align="center"> + <span style="color:white;font-size:90%;"> + <a href="http://www.springsource.com/" + title="SpringSource">Sponsored by SpringSource + </a> + </span> + </td> + <td width="40%" align="right" valign="top"> + <xsl:text> </xsl:text> + <xsl:if test="$navig.showtitles != 0"> + <xsl:apply-templates select="$next" mode="object.title.markup"/> + </xsl:if> + </td> + </tr> + </xsl:if> + </table> + </xsl:if> + </div> + </xsl:if> + </xsl:template> +</xsl:stylesheet> diff --git a/src/docbkx/resources/xsl/pdf/fopdf.xsl b/src/docbkx/resources/xsl/pdf/fopdf.xsl new file mode 100644 index 000000000..2905ee3c2 --- /dev/null +++ b/src/docbkx/resources/xsl/pdf/fopdf.xsl @@ -0,0 +1,518 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you 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. +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xslthl="http://xslthl.sf.net" + exclude-result-prefixes="xslthl" + version='1.0'> + +<!-- Use nice graphics for admonitions --> + <xsl:param name="admon.graphics">'1'</xsl:param> + <xsl:param name="admon.graphics.path">@file.prefix@@dbf.xsl@/images/</xsl:param> + <xsl:param name="draft.watermark.image" select="'@file.prefix@@dbf.xsl@/images/draft.png'"/> + <xsl:param name="paper.type" select="'@paper.type@'"/> + + <xsl:param name="page.margin.top" select="'1cm'"/> + <xsl:param name="region.before.extent" select="'1cm'"/> + <xsl:param name="body.margin.top" select="'1.5cm'"/> + + <xsl:param name="body.margin.bottom" select="'1.5cm'"/> + <xsl:param name="region.after.extent" select="'1cm'"/> + <xsl:param name="page.margin.bottom" select="'1cm'"/> + <xsl:param name="title.margin.left" select="'0cm'"/> + +<!--################################################### + Header + ################################################### --> + +<!-- More space in the center header for long text --> + <xsl:attribute-set name="header.content.properties"> + <xsl:attribute name="font-family"> + <xsl:value-of select="$body.font.family"/> + </xsl:attribute> + <xsl:attribute name="margin-left">-5em</xsl:attribute> + <xsl:attribute name="margin-right">-5em</xsl:attribute> + </xsl:attribute-set> + +<!--################################################### + Table of Contents + ################################################### --> + + <xsl:param name="generate.toc"> + book toc,title + </xsl:param> + +<!--################################################### + Custom Header + ################################################### --> + + <xsl:template name="header.content"> + <xsl:param name="pageclass" select="''"/> + <xsl:param name="sequence" select="''"/> + <xsl:param name="position" select="''"/> + <xsl:param name="gentext-key" select="''"/> + + <xsl:variable name="Version"> + <xsl:choose> + <xsl:when test="//productname"> + <xsl:value-of select="//productname"/><xsl:text> </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>please define productname in your docbook file!</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$sequence='blank'"> + <xsl:choose> + <xsl:when test="$position='center'"> + <xsl:value-of select="$Version"/> + </xsl:when> + + <xsl:otherwise> + <!-- nop --> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + + <xsl:when test="$pageclass='titlepage'"> + <!-- nop: other titlepage sequences have no header --> + </xsl:when> + + <xsl:when test="$position='center'"> + <xsl:value-of select="$Version"/> + </xsl:when> + + <xsl:otherwise> + <!-- nop --> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + +<!--################################################### + Custom Footer + ################################################### --> + + <xsl:template name="footer.content"> + <xsl:param name="pageclass" select="''"/> + <xsl:param name="sequence" select="''"/> + <xsl:param name="position" select="''"/> + <xsl:param name="gentext-key" select="''"/> + + <xsl:variable name="Version"> + <xsl:choose> + <xsl:when test="//releaseinfo"> + <xsl:value-of select="//releaseinfo"/> + </xsl:when> + <xsl:otherwise> + <!-- nop --> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="Title"> + <xsl:value-of select="//title"/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$sequence='blank'"> + <xsl:choose> + <xsl:when test="$double.sided != 0 and $position = 'left'"> + <xsl:value-of select="$Version"/> + </xsl:when> + + <xsl:when test="$double.sided = 0 and $position = 'center'"> + <!-- nop --> + </xsl:when> + + <xsl:otherwise> + <fo:page-number/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + + <xsl:when test="$pageclass='titlepage'"> + <!-- nop: other titlepage sequences have no footer --> + </xsl:when> + + <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'"> + <fo:page-number/> + </xsl:when> + + <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'"> + <fo:page-number/> + </xsl:when> + + <xsl:when test="$double.sided = 0 and $position='right'"> + <fo:page-number/> + </xsl:when> + + <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'"> + <xsl:value-of select="$Version"/> + </xsl:when> + + <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'"> + <xsl:value-of select="$Version"/> + </xsl:when> + + <xsl:when test="$double.sided = 0 and $position='left'"> + <xsl:value-of select="$Version"/> + </xsl:when> + + <xsl:when test="$position='center'"> + <xsl:value-of select="$Title"/> + </xsl:when> + + <xsl:otherwise> + <!-- nop --> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="processing-instruction('hard-pagebreak')"> + <fo:block break-before='page'/> + </xsl:template> + +<!--################################################### + Extensions + ################################################### --> + +<!-- These extensions are required for table printing and other stuff --> + <xsl:param name="use.extensions">1</xsl:param> + <xsl:param name="tablecolumns.extension">0</xsl:param> + <xsl:param name="callout.extensions">1</xsl:param> + <xsl:param name="fop.extensions">1</xsl:param> + +<!--################################################### + Paper & Page Size + ################################################### --> + +<!-- Paper type, no headers on blank pages, no double sided printing --> + <xsl:param name="double.sided">0</xsl:param> + <xsl:param name="headers.on.blank.pages">0</xsl:param> + <xsl:param name="footers.on.blank.pages">0</xsl:param> + +<!--################################################### + Fonts & Styles + ################################################### --> + + <xsl:param name="hyphenate">false</xsl:param> + +<!-- Default Font size --> + <xsl:param name="body.font.master">11</xsl:param> + <xsl:param name="body.font.small">8</xsl:param> + +<!-- Line height in body text --> + <xsl:param name="line-height">1.4</xsl:param> + +<!-- Chapter title size --> + <xsl:attribute-set name="chapter.titlepage.recto.style"> + <xsl:attribute name="text-align">left</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.8"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + </xsl:attribute-set> + +<!-- Why is the font-size for chapters hardcoded in the XSL FO templates? + Let's remove it, so this sucker can use our attribute-set only... --> + <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode"> + <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" + xsl:use-attribute-sets="chapter.titlepage.recto.style"> + <xsl:call-template name="component.title"> + <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/> + </xsl:call-template> + </fo:block> + </xsl:template> + +<!-- Sections 1, 2 and 3 titles have a small bump factor and padding --> + <xsl:attribute-set name="section.title.level1.properties"> + <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.5"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="section.title.level2.properties"> + <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.25"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="section.title.level3.properties"> + <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.4em</xsl:attribute> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 1.0"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="section.title.level4.properties"> + <xsl:attribute name="space-before.optimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.3em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.3em</xsl:attribute> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master * 0.9"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> + </xsl:attribute-set> + +<!-- Use code syntax highlighting --> + <xsl:param name="highlight.source" select="1"/> + <xsl:param name="highlight.default.language" select="xml" /> + + <xsl:template match='xslthl:keyword'> + <fo:inline font-weight="bold" color="#7F0055"><xsl:apply-templates/></fo:inline> + </xsl:template> + + <xsl:template match='xslthl:comment'> + <fo:inline font-style="italic" color="#3F5F5F"><xsl:apply-templates/></fo:inline> + </xsl:template> + + <xsl:template match='xslthl:oneline-comment'> + <fo:inline font-style="italic" color="#3F5F5F"><xsl:apply-templates/></fo:inline> + </xsl:template> + + <xsl:template match='xslthl:multiline-comment'> + <fo:inline font-style="italic" color="#3F5FBF"><xsl:apply-templates/></fo:inline> + </xsl:template> + + <xsl:template match='xslthl:tag'> + <fo:inline color="#3F7F7F"><xsl:apply-templates/></fo:inline> + </xsl:template> + + <xsl:template match='xslthl:attribute'> + <fo:inline color="#7F007F"><xsl:apply-templates/></fo:inline> + </xsl:template> + + <xsl:template match='xslthl:value'> + <fo:inline color="#2A00FF"><xsl:apply-templates/></fo:inline> + </xsl:template> + + <xsl:template match='xslthl:string'> + <fo:inline color="#2A00FF"><xsl:apply-templates/></fo:inline> + </xsl:template> + +<!--################################################### + Tables + ################################################### --> + + <!-- Some padding inside tables --> + <xsl:attribute-set name="table.cell.padding"> + <xsl:attribute name="padding-left">4pt</xsl:attribute> + <xsl:attribute name="padding-right">4pt</xsl:attribute> + <xsl:attribute name="padding-top">4pt</xsl:attribute> + <xsl:attribute name="padding-bottom">4pt</xsl:attribute> + </xsl:attribute-set> + +<!-- Only hairlines as frame and cell borders in tables --> + <xsl:param name="table.frame.border.thickness">0.1pt</xsl:param> + <xsl:param name="table.cell.border.thickness">0.1pt</xsl:param> + +<!--################################################### + Labels + ################################################### --> + +<!-- Label Chapters and Sections (numbering) --> + <xsl:param name="chapter.autolabel" select="1"/> + <xsl:param name="section.autolabel" select="1"/> + <xsl:param name="section.autolabel.max.depth" select="1"/> + + <xsl:param name="section.label.includes.component.label" select="1"/> + <xsl:param name="table.footnote.number.format" select="'1'"/> + +<!--################################################### + Programlistings + ################################################### --> + +<!-- Verbatim text formatting (programlistings) --> + <xsl:attribute-set name="monospace.verbatim.properties"> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.small * 1.0"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="verbatim.properties"> + <xsl:attribute name="space-before.minimum">1em</xsl:attribute> + <xsl:attribute name="space-before.optimum">1em</xsl:attribute> + <xsl:attribute name="space-before.maximum">1em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> + + <xsl:attribute name="border-color">#444444</xsl:attribute> + <xsl:attribute name="border-style">solid</xsl:attribute> + <xsl:attribute name="border-width">0.1pt</xsl:attribute> + <xsl:attribute name="padding-top">0.5em</xsl:attribute> + <xsl:attribute name="padding-left">0.5em</xsl:attribute> + <xsl:attribute name="padding-right">0.5em</xsl:attribute> + <xsl:attribute name="padding-bottom">0.5em</xsl:attribute> + <xsl:attribute name="margin-left">0.5em</xsl:attribute> + <xsl:attribute name="margin-right">0.5em</xsl:attribute> + </xsl:attribute-set> + + <!-- Shade (background) programlistings --> + <xsl:param name="shade.verbatim">1</xsl:param> + <xsl:attribute-set name="shade.verbatim.style"> + <xsl:attribute name="background-color">#F0F0F0</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="list.block.spacing"> + <xsl:attribute name="space-before.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="example.properties"> + <xsl:attribute name="space-before.minimum">0.5em</xsl:attribute> + <xsl:attribute name="space-before.optimum">0.5em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.5em</xsl:attribute> + <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute> + <xsl:attribute name="keep-together.within-column">always</xsl:attribute> + </xsl:attribute-set> + +<!--################################################### + Title information for Figures, Examples etc. + ################################################### --> + + <xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing"> + <xsl:attribute name="font-weight">normal</xsl:attribute> + <xsl:attribute name="font-style">italic</xsl:attribute> + <xsl:attribute name="font-size"> + <xsl:value-of select="$body.font.master"/> + <xsl:text>pt</xsl:text> + </xsl:attribute> + <xsl:attribute name="hyphenate">false</xsl:attribute> + <xsl:attribute name="space-before.minimum">0.1em</xsl:attribute> + <xsl:attribute name="space-before.optimum">0.1em</xsl:attribute> + <xsl:attribute name="space-before.maximum">0.1em</xsl:attribute> + </xsl:attribute-set> + +<!--################################################### + Callouts + ################################################### --> + +<!-- don't use images for callouts --> + <xsl:param name="callout.graphics">0</xsl:param> + <xsl:param name="callout.unicode">1</xsl:param> + +<!-- Place callout marks at this column in annotated areas --> + <xsl:param name="callout.defaultcolumn">90</xsl:param> + +<!--################################################### + Misc + ################################################### --> + +<!-- Placement of titles --> + <xsl:param name="formal.title.placement"> + figure after + example after + equation before + table before + procedure before + </xsl:param> + +<!-- Format Variable Lists as Blocks (prevents horizontal overflow) --> + <xsl:param name="variablelist.as.blocks">1</xsl:param> + + <xsl:param name="body.start.indent">0pt</xsl:param> + +<!-- Show only Sections up to level 3 in the TOCs --> + <xsl:param name="toc.section.depth">3</xsl:param> + +<!-- Remove "Chapter" from the Chapter titles... --> + <xsl:param name="local.l10n.xml" select="document('')"/> + <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> + <l:l10n language="en"> + <l:context name="title-numbered"> + <l:template name="chapter" text="%n. %t"/> + <l:template name="section" text="%n %t"/> + </l:context> + <l:context name="title"> + <l:template name="example" text="Example %n %t"/> + </l:context> + </l:l10n> + </l:i18n> + +<!--################################################### + colored and hyphenated links + ################################################### --> + + <xsl:template match="ulink"> + <fo:basic-link external-destination="{@url}" + xsl:use-attribute-sets="xref.properties" + text-decoration="underline" + color="blue"> + <xsl:choose> + <xsl:when test="count(child::node())=0"> + <xsl:value-of select="@url"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </fo:basic-link> + </xsl:template> + + <xsl:template match="link"> + <fo:basic-link internal-destination="{@linkend}" + xsl:use-attribute-sets="xref.properties" + text-decoration="underline" + color="blue"> + <xsl:choose> + <xsl:when test="count(child::node())=0"> + <xsl:value-of select="@linkend"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </fo:basic-link> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/src/docbkx/resources/xsl/pdf/titlepage.xml b/src/docbkx/resources/xsl/pdf/titlepage.xml new file mode 100644 index 000000000..dc18e1e0d --- /dev/null +++ b/src/docbkx/resources/xsl/pdf/titlepage.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you 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. +--> + +<!DOCTYPE t:templates [ +<!ENTITY hsize0 "10pt"> +<!ENTITY hsize1 "12pt"> +<!ENTITY hsize2 "14.4pt"> +<!ENTITY hsize3 "17.28pt"> +<!ENTITY hsize4 "20.736pt"> +<!ENTITY hsize5 "24.8832pt"> +<!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 --> +<!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 --> +<!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 --> +<!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 --> +<!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 --> +<!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 --> +]> +<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0" + xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <t:titlepage t:element="book" t:wrapper="fo:block"> + <t:titlepage-content t:side="recto"> + <title + t:named-template="division.title" + param:node="ancestor-or-self::book[1]" + text-align="center" + font-size="&hsize5;" + space-before="&hsize5space;" + font-weight="bold" + font-family="{$title.fontset}"/> + <subtitle + text-align="center" + font-size="&hsize4;" + space-before="&hsize4space;" + font-family="{$title.fontset}"/> + + <!-- <corpauthor space-before="0.5em" + font-size="&hsize2;"/> + <authorgroup space-before="0.5em" + font-size="&hsize2;"/> + <author space-before="0.5em" + font-size="&hsize2;"/> --> + + <mediaobject space-before="2em" space-after="2em"/> + <releaseinfo space-before="5em" font-size="&hsize2;"/> + <copyright space-before="1.5em" + font-weight="normal" + font-size="8"/> + <legalnotice space-before="5em" + font-weight="normal" + font-style="italic" + font-size="8"/> + <othercredit space-before="2em" + font-weight="normal" + font-size="8"/> + <pubdate space-before="0.5em"/> + <revision space-before="0.5em"/> + <revhistory space-before="0.5em"/> + <abstract space-before="0.5em" + text-align="start" + margin-left="0.5in" + margin-right="0.5in" + font-family="{$body.fontset}"/> + </t:titlepage-content> + + <t:titlepage-content t:side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + </t:titlepage-separator> + + <t:titlepage-before t:side="recto"> + </t:titlepage-before> + + <t:titlepage-before t:side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +</t:templates> diff --git a/src/main/javadoc/doc-files/th-background.png b/src/main/javadoc/doc-files/th-background.png new file mode 100644 index 000000000..72d65e771 Binary files /dev/null and b/src/main/javadoc/doc-files/th-background.png differ diff --git a/src/main/javadoc/spring-javadoc.css b/src/main/javadoc/spring-javadoc.css new file mode 100644 index 000000000..c438fafa5 --- /dev/null +++ b/src/main/javadoc/spring-javadoc.css @@ -0,0 +1,178 @@ +/* stylesheet.css 2008/04/22 nicolekonicki */ + +/* + * + * Spring-specific Javadoc style sheet + * + */ + + + +.code +{ + border: 1px solid black; + background-color: #F4F4F4; + padding: 5px; +} + +body +{ + font: 12px Verdana, Arial, Helvetica, "Bitstream Vera Sans", sans-serif; + background-color: #fff; + color: #333; +} + + +/* Link colors */ +a +{ + color:#2c7b14; + text-decoration:none; +} + +a:hover +{ + text-decoration:underline; +} + +/* Headings */ +h1 +{ + font-size:28px; + color:#007c00; +} + +/* Table colors */ + +table +{ + border:none; +} + +td +{ + border:none; + border-bottom:1px dotted #ddd; +} + +th +{ + border:none; +} + +.TableHeadingColor th +{ + background-color: #efffcb; + background-image: url(doc-files/th-background.png); + background-repeat: repeat-x; + color:#fff; + font-size:14px; + height:26px; +} + +.TableSubHeadingColor +{ + background: #f7ffee; + +} +.TableRowColor +{ + background: #fff; +} + +.TableRowColor a +{ + border-bottom:none; + color:#2c7b14; + font-weight:normal; +} + +tr.TableRowColor:hover +{ + background:#eef2e1; +} + + +/* Font used in left-hand frame lists */ +.FrameTitleFont +{ + font-size: 120%; + font-weight:bold; +} + +.FrameTitleFont a +{ + color: #333; +} + +.FrameHeadingFont +{ + font-weight: bold; + font-size:95%; +} + +.FrameItemFont +{ + line-height:130%; + font-size: 95%; +} + +.FrameItemFont a +{ + color:#333; +} + +.FrameItemFont a:hover +{ + color:#249901; + border-bottom:none; + text-decoration:underline; +} + +/* Navigation bar fonts and colors */ +.NavBarCell1 +{ + background-color:#fff; + border:none; +} + +.NavBarCell1Rev +{ + background-color:#e3faa5; + border:1px solid #9ad00c; + padding:0; + margin:0; +} + +.NavBarCell1 a +{ + color:#333; + text-decoration:none; +} + +.NavBarFont1Rev +{ + +} + +.NavBarCell2 +{ + border:none; +} + +.NavBarCell2 a +{ + color:#249901; + font-size:90%; +} + +.NavBarCell3 +{ + border:none; +} + +/* Override sizes in font tags */ +font +{ + font: inherit !important; +} diff --git a/src/main/resources/apache-license.txt b/src/main/resources/apache-license.txt new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/src/main/resources/apache-license.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/src/main/resources/changelog.txt b/src/main/resources/changelog.txt new file mode 100644 index 000000000..fedcbaed8 --- /dev/null +++ b/src/main/resources/changelog.txt @@ -0,0 +1,5 @@ +Spring Data Commons 1.0.0 Milestone 1 (?, 2010) +============================================= + +New Features + * Lot's of good stuff \ No newline at end of file diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt new file mode 100644 index 000000000..e6900be90 --- /dev/null +++ b/src/main/resources/notice.txt @@ -0,0 +1,21 @@ + ======================================================================== + == NOTICE file corresponding to section 4 d of the Apache License, == + == Version 2.0, in this case for the Spring Integration distribution. == + ======================================================================== + + This product includes software developed by + the Apache Software Foundation (http://www.apache.org). + + The end-user documentation included with a redistribution, if any, + must include the following acknowledgement: + + "This product includes software developed by the Spring Framework + Project (http://www.springframework.org)." + + Alternatively, this acknowledgement may appear in the software itself, + if and wherever such third-party acknowledgements normally appear. + + The names "Spring", "Spring Framework", and "Spring Data" must + not be used to endorse or promote products derived from this software + without prior written permission. For written permission, please contact + enquiries@springsource.com. diff --git a/src/main/resources/readme.txt b/src/main/resources/readme.txt new file mode 100644 index 000000000..fe1328c8c --- /dev/null +++ b/src/main/resources/readme.txt @@ -0,0 +1,17 @@ +SPRING DATA Commons 1.0.0 M1 (? ? 2010) +------------------------------------------------- + +Spring Data Commons is released under the terms of the Apache Software License Version 2.0 (see license.txt). + + +DISTRIBUTION CONTENTS: + +The JARs are available in the 'dist' directory, and the source JARs are in the 'src' directory. + +The reference manual and javadoc are located in the 'docs' directory. + + +ADDITIONAL RESOURCES: + +Spring Data Homepage: http://www.springsource.org/spring-data +Spring Data Forum: http://forum.springsource.org/forumdisplay.php?f=?? diff --git a/template.mf b/template.mf deleted file mode 100644 index 85d6ead32..000000000 --- a/template.mf +++ /dev/null @@ -1,9 +0,0 @@ -Bundle-SymbolicName: org.springframework.data.commons -Bundle-Name: Spring Data Commons -Bundle-Vendor: SpringSource -Bundle-ManifestVersion: 2 -Import-Template: - org.springframework.core.*;version="[3.0.0, 4.0.0)", - org.springframework.dao.*;version="[3.0.0, 4.0.0)", - org.springframework.transaction.*;version="[3.0.0, 4.0.0)", - org.apache.commons.logging;version="[1.1.1, 2.0.0)"