diff --git a/config/alfresco/extension/custom-data-location.properties.sample b/config/alfresco/extension/custom-data-location.properties.sample deleted file mode 100644 index 096d44b61f..0000000000 --- a/config/alfresco/extension/custom-data-location.properties.sample +++ /dev/null @@ -1,5 +0,0 @@ -# -# Sample custom content and index data location -# - -dir.root=/srv/alfresco/data diff --git a/config/alfresco/extension/custom-hibernate-dialect.properties.sample b/config/alfresco/extension/custom-hibernate-dialect.properties.sample index e3563689d5..0a2e9f1d62 100644 --- a/config/alfresco/extension/custom-hibernate-dialect.properties.sample +++ b/config/alfresco/extension/custom-hibernate-dialect.properties.sample @@ -1,7 +1,3 @@ -# Sample Hibernate configuration to disnable Hibernate schema updates -# Values are "validate" or "update" (default) -#hibernate.hbm2ddl.auto=validate - # # Sample Hibernate configuration for changing Database dialect # For a full list: http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-optional-dialects diff --git a/config/alfresco/extension/custom-db-and-data-context.xml.sample b/config/alfresco/extension/custom-repository-context.xml.sample similarity index 76% rename from config/alfresco/extension/custom-db-and-data-context.xml.sample rename to config/alfresco/extension/custom-repository-context.xml.sample index b88e5838a7..60077ad653 100644 --- a/config/alfresco/extension/custom-db-and-data-context.xml.sample +++ b/config/alfresco/extension/custom-repository-context.xml.sample @@ -15,15 +15,12 @@ - classpath:alfresco/alfresco-shared.properties classpath:alfresco/repository.properties classpath:alfresco/version.properties classpath:alfresco/domain/transaction.properties - - classpath:alfresco/extension/custom-data-location.properties - - classpath:alfresco/extension/custom-db-connection.properties + + classpath:alfresco/extension/custom-repository.properties @@ -39,4 +36,4 @@ - + \ No newline at end of file diff --git a/config/alfresco/extension/custom-db-connection.properties.sample b/config/alfresco/extension/custom-repository.properties.sample similarity index 69% rename from config/alfresco/extension/custom-db-connection.properties.sample rename to config/alfresco/extension/custom-repository.properties.sample index de46bd2233..56ee035323 100644 --- a/config/alfresco/extension/custom-db-connection.properties.sample +++ b/config/alfresco/extension/custom-repository.properties.sample @@ -1,13 +1,28 @@ +############################### +## Common Alfresco Properties # +############################### + +# +# Sample custom content and index data location +# +#dir.root=/srv/alfresco/data + # # Sample database connection properties # - -#db.schema.update=true #db.username=alfresco #db.password=alfresco #db.pool.initial=10 #db.pool.max=100 +# +# Property to control whether schema updates are performed automatically. +# Updates must be enabled during upgrades as, apart from the static upgrade scripts, +# there are also auto-generated update scripts that will need to be executed. After +# upgrading to a new version, this can be disabled. +# +#db.schema.update=true + # # HSQL connection # @@ -41,7 +56,5 @@ # # SQLServer connection using Microsoft JDDB driver # -#db.username=sa -#db.password=sa #db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver #db.url=jdbc:sqlserver://localhost;DatabaseName=alfresco diff --git a/project-build.xml b/project-build.xml index dd7b4cf75b..72261f99f6 100644 --- a/project-build.xml +++ b/project-build.xml @@ -56,7 +56,6 @@ - diff --git a/source/java/org/alfresco/repo/cache/TreeCacheAdapter.java b/source/java/org/alfresco/repo/cache/TreeCacheAdapter.java deleted file mode 100644 index 9b9d93c16c..0000000000 --- a/source/java/org/alfresco/repo/cache/TreeCacheAdapter.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2005-2006 Alfresco, Inc. - * - * Licensed under the Mozilla Public License version 1.1 - * with a permitted attribution clause. You may obtain a - * copy of the License at - * - * http://www.alfresco.org/legal/license.txt - * - * 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. - */ -package org.alfresco.repo.cache; - -import java.io.Serializable; - -import org.alfresco.error.AlfrescoRuntimeException; -import org.jboss.cache.Fqn; -import org.jboss.cache.TreeCache; - -/** - * A thin adapter for TreeCache support. - * - * @author Derek Hulley - */ -public class TreeCacheAdapter - implements SimpleCache -{ - private TreeCache cache; - private Fqn regionFqn; - - public TreeCacheAdapter() - { - } - - /** - * @param cache the backing Ehcache instance - */ - public void setCache(TreeCache cache) - { - this.cache = cache; - } - - /** - * Set the uniquely named region of the cache within which all object must be cached - * - * @param regionName the cache region - */ - public void setRegionName(String regionName) - { - this.regionFqn = new Fqn(regionName); - } - - public boolean contains(K key) - { - try - { - return cache.exists(regionFqn, key); - } - catch (Throwable e) - { - throw new AlfrescoRuntimeException("contains failed", e); - } - } - - @SuppressWarnings("unchecked") - public V get(K key) - { - try - { - Object element = cache.get(regionFqn, key); - if (element != null) - { - return (V) element; - } - else - { - return null; - } - } - catch (Throwable e) - { - throw new AlfrescoRuntimeException("Failed to get from TreeCache: \n" + - " key: " + key, - e); - } - } - - public void put(K key, V value) - { - try - { - cache.put(regionFqn, key, value); - } - catch (Throwable e) - { - throw new AlfrescoRuntimeException("Failed to put into TreeCache: \n" + - " key: " + key + "\n" + - " value: " + value, - e); - } - } - - public void remove(K key) - { - try - { - cache.remove(regionFqn, key); - } - catch (Throwable e) - { - throw new AlfrescoRuntimeException("Failed to remove from TreeCache: \n" + - " key: " + key, - e); - } - } - - public void clear() - { - try - { - cache.remove(regionFqn); - } - catch (Throwable e) - { - throw new AlfrescoRuntimeException("Failed to clear cache", e); - } - } -} diff --git a/source/java/org/alfresco/repo/cache/TreeCacheAdapterTest.java b/source/java/org/alfresco/repo/cache/TreeCacheAdapterTest.java deleted file mode 100644 index 956124a39c..0000000000 --- a/source/java/org/alfresco/repo/cache/TreeCacheAdapterTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2005-2006 Alfresco, Inc. - * - * Licensed under the Mozilla Public License version 1.1 - * with a permitted attribution clause. You may obtain a - * copy of the License at - * - * http://www.alfresco.org/legal/license.txt - * - * 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. - */ -package org.alfresco.repo.cache; - -import java.io.Serializable; - -import org.jboss.cache.DummyTransactionManagerLookup; -import org.jboss.cache.Fqn; -import org.jboss.cache.TreeCache; - -import junit.framework.TestCase; - -/** - * @see org.alfresco.repo.cache.TreeCacheAdapter - * - * @author Derek Hulley - */ -public class TreeCacheAdapterTest extends TestCase -{ - private static final String KEY_A = "A"; - private static final String VALUE_A = "AAA"; - private static final String KEY_B = "B"; - private static final String VALUE_B = "BBB"; - - private TreeCache treeCache; - private TreeCacheAdapter cache; - - @Override - public void setUp() throws Exception - { - treeCache = new TreeCache(); - treeCache.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName()); - treeCache.start(); - - cache = new TreeCacheAdapter(); - cache.setCache(treeCache); - cache.setRegionName(getName()); - } - - public void testSimplePutGet() throws Exception - { - cache.put(KEY_A, VALUE_A); - cache.put(KEY_B, VALUE_B); - - // check that this is present in the underlying cache - Serializable checkValueA = (Serializable) treeCache.get(new Fqn(getName()), KEY_A); - assertNotNull("Value A is not present in underlying cache", checkValueA); - assertEquals("Value A is incorrect in underlying cache", VALUE_A, checkValueA); - - Serializable checkValueB = cache.get(KEY_B); - assertNotNull("Value B is not present in cache", checkValueB); - assertEquals("Value B is incorrect in cache", VALUE_B, checkValueB); - } -} diff --git a/source/java/org/alfresco/repo/transaction/TransactionManagerJndiLookup.java b/source/java/org/alfresco/repo/transaction/TransactionManagerJndiLookup.java deleted file mode 100644 index 7b70f0b19b..0000000000 --- a/source/java/org/alfresco/repo/transaction/TransactionManagerJndiLookup.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2005-2006 Alfresco, Inc. - * - * Licensed under the Mozilla Public License version 1.1 - * with a permitted attribution clause. You may obtain a - * copy of the License at - * - * http://www.alfresco.org/legal/license.txt - * - * 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. - */ -package org.alfresco.repo.transaction; - -import java.util.Properties; - -import javax.transaction.TransactionManager; - -import org.jboss.cache.TransactionManagerLookup; -import org.springframework.jndi.JndiObjectFactoryBean; -import org.springframework.jndi.JndiTemplate; - -/** - * Helper lookup class to supply JBoss components with a TransactionManager. - *

- * The JBossTransactionManagerLookup will work when Alfresco is running in JBoss, - * but the TreeCache can be used within other containers; there might not be any - * container and the TransactionManager may held in a local JNDI tree. - *

- * For compatibility with other app servers, the JBoss GenericTransactionManagerLookup - * could also be used. - *

- * The default constructor configures the object to look in java:/TransactionManager - * for a TransactionManager. The only customisation that should be required is - * to change the {@link #setJndiName(String) jndiName} property. If more JNDI details need - * changing, then the actual {@link #setJndiLookup(JndiObjectFactoryBean) jndiLookup object} can - * be substituted with a customized version. - * - * @author Derek Hulley - */ -public class TransactionManagerJndiLookup implements TransactionManagerLookup -{ - public static final String DEFAULT_JNDI_NAME = "java:/TransactionManager"; - - private JndiObjectFactoryBean jndiLookup; - - public TransactionManagerJndiLookup() - { - jndiLookup = new JndiObjectFactoryBean(); - jndiLookup.setJndiName(DEFAULT_JNDI_NAME); - jndiLookup.setProxyInterface(TransactionManager.class); - } - - /** - * @see org.springframework.jndi.JndiAccessor#setJndiTemplate(org.springframework.jndi.JndiTemplate) - */ - public void setJndiTemplate(JndiTemplate jndiTemplate) - { - this.jndiLookup.setJndiTemplate(jndiTemplate); - } - - /** - * @see org.springframework.jndi.JndiAccessor#setJndiEnvironment(java.util.Properties) - */ - public void setJndiEnvironment(Properties jndiEnvironment) - { - this.jndiLookup.setJndiEnvironment(jndiEnvironment); - } - - /** - * Set the JNDI location where the TransactionManager can be found. - * - * @param jndiName - */ - public void setJndiName(String jndiName) - { - jndiLookup.setJndiName(jndiName); - } - - /** - * @return Returns a TransactionManager looked up at the JNDI location - */ - public TransactionManager getTransactionManager() throws Exception - { - return (TransactionManager) jndiLookup.getObject(); - } -}