Merged V2.2 to HEAD

10963: Merged DEV/LARGE_COLLECTION_PROPERTIES_2.2.1 to V2.2
          - PersonService: Lucene removal
          - Lucene optimizations (in progress)
          - Multi-valued and locale-specific properties persisted in alf_node_properties
          - Removal of unused AVM tables
   10987: Oracle dialects and enhanced SQL patch support
          - Only support Alfresco's 9i and 10g dialects (with auto-switching)
          - SQL script patches can now apply selectively to ranges
   11007: Test to check cached retrieval of QNames


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11206 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-10-06 13:26:18 +00:00
parent dd2ce5da0a
commit 6f302f0350
100 changed files with 8759 additions and 3628 deletions

View File

@@ -1,76 +0,0 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.admin.patch.impl;
import java.util.Iterator;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.avm.AVMAspectName;
import org.alfresco.repo.avm.AVMAspectNameDAO;
import org.alfresco.repo.domain.QNameDAO;
import org.alfresco.repo.domain.QNameEntity;
import org.alfresco.service.namespace.QName;
/**
* Patches from old style aspect storage for AVM to new style.
* @author britt
*/
public class AVMAspectsPatch extends AbstractPatch
{
private static final String MSG_SUCCESS = "patch.AVMAspects.result";
private AVMAspectNameDAO fAVMAspectDAO;
private QNameDAO qnameDAO;
public void setAvmAspectNameDAO(AVMAspectNameDAO dao)
{
fAVMAspectDAO = dao;
}
public void setQnameDAO(QNameDAO qnameDAO)
{
this.qnameDAO = qnameDAO;
}
/* (non-Javadoc)
* @see org.alfresco.repo.admin.patch.AbstractPatch#applyInternal()
*/
@Override
protected String applyInternal() throws Exception
{
Iterator<AVMAspectName> iter = fAVMAspectDAO.iterator();
while (iter.hasNext())
{
AVMAspectName aspect = iter.next();
QName aspectQName = aspect.getName();
QNameEntity aspectQNameEntity = qnameDAO.getOrCreateQNameEntity(aspectQName);
aspect.getNode().getAspects().add(aspectQNameEntity.getId());
fAVMAspectDAO.delete(aspect);
}
return I18NUtil.getMessage(MSG_SUCCESS);
}
}

View File

@@ -1,75 +0,0 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.admin.patch.impl;
import java.util.Iterator;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.avm.AVMNodeProperty;
import org.alfresco.repo.avm.AVMNodePropertyDAO;
import org.alfresco.repo.domain.QNameDAO;
import org.alfresco.service.namespace.QName;
/**
* Patch more remapping AVM properties.
* @author britt
*/
public class AVMPropertiesPatch extends AbstractPatch
{
private static final String MSG_SUCCESS = "patch.AVMProperties.result";
private QNameDAO qnameDAO;
private AVMNodePropertyDAO fAVMNodePropertyDAO;
public void setQnameDAO(QNameDAO qnameDAO)
{
this.qnameDAO = qnameDAO;
}
public void setAvmNodePropertyDAO(AVMNodePropertyDAO dao)
{
fAVMNodePropertyDAO = dao;
}
/* (non-Javadoc)
* @see org.alfresco.repo.admin.patch.AbstractPatch#applyInternal()
*/
@Override
protected String applyInternal() throws Exception
{
Iterator<AVMNodeProperty> iter = fAVMNodePropertyDAO.iterate();
while (iter.hasNext())
{
AVMNodeProperty prop = iter.next();
QName propertyQName = prop.getName();
Long propertyQNameEntityId = qnameDAO.getOrCreateQNameEntity(propertyQName).getId();
prop.getNode().getProperties().put(propertyQNameEntityId, prop.getValue());
fAVMNodePropertyDAO.delete(prop.getNode(), prop.getName());
}
return I18NUtil.getMessage(MSG_SUCCESS);
}
}

View File

@@ -31,7 +31,8 @@ import java.util.Map;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.domain.Node;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.repo.domain.NodePropertyValue;
import org.alfresco.repo.domain.PropertyMapKey;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -103,22 +104,17 @@ public class NodePropertySerializablePatch extends AbstractPatch
{
Node node = iterator.next();
// retrieve the node properties
Map<Long, PropertyValue> properties = node.getProperties();
Map<PropertyMapKey, NodePropertyValue> properties = node.getProperties();
// check each property
for (Map.Entry<Long, PropertyValue> entry : properties.entrySet())
for (Map.Entry<PropertyMapKey, NodePropertyValue> entry : properties.entrySet())
{
PropertyValue propertyValue = entry.getValue();
NodePropertyValue propertyValue = entry.getValue();
if (propertyValue.getSerializableValue() == null)
{
// the property was not persisted as a serializable - nothing to do
continue;
}
else if (propertyValue.isMultiValued())
{
// this is a persisted collection - nothing to do
continue;
}
else if (!"SERIALIZABLE".equals(propertyValue.getActualType()))
else if (!"SERIALIZABLE".equals(propertyValue.getActualTypeString()))
{
// only handle actual types that were pushed in as any old type
continue;
@@ -126,7 +122,7 @@ public class NodePropertySerializablePatch extends AbstractPatch
// make sure that this value is persisted correctly
Serializable value = propertyValue.getSerializableValue();
// put it back
PropertyValue newPropertyValue = new PropertyValue(DataTypeDefinition.ANY, value);
NodePropertyValue newPropertyValue = new NodePropertyValue(DataTypeDefinition.ANY, value);
entry.setValue(newPropertyValue);
count++;
}