mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
13853: Merged V3.0 to V3.1 13008: Merged V2.2 to V3.0 12824: (record only) Change admin access to the web project staging store to be read-only in the virtualization view - ETWOTWO-933 13031: (Record only) AMP fix for ETWOTWO-968: Space rules are not run when saving from MS Word 13040: Merged V2.2 to V3.0 12824: (record-only) - already done via r13005 (ETWOTWO-933) 13145: Merged V2.2 to V3.0: 13089: (record-only) Fix "Read-Write transaction started within read-only transaction" exception. ETWOTWO-1055. 13091: (record-only) Fix for NFS server "Read-Write transaction started within read-only transaction" exception. ETWOTWO-1054. 13508: ETHREEOH-1548 - allow config to reset (even if null/cache) 13514: ETHREEOH-1548 (follow-on fix) - to allow config to reset (even if null/cache) and also reduce 5 caches to 1 13848: Merged V2.2 to V3.0 13188: *RECORD ONLY* Using correct ooo startup context - does not work for *nix. Fixed in 3.0sp1 13212: *RECORD ONLY* AMP for ETWOTWO-984 13342: *RECORD ONLY* Merge info stuff 13435: Merged V2.1 to V2.2 12307: Merged DEV/V2.1SP7 to 2.1 11927: ETWOONE-396 12112: ETWOONE-396 13442: *RECORD ONLY* Updated version to 2.2.4dev 13468: *RECORD ONLY* Removed svn:mergeinfo crud 13470: I18NUtil doesn't cause NPE if message key doesn't exist 13471: Fixed ETWOTWO-1133: Incorrect CRC32 Values for non-ASCII names 13475: Test fix: I18NUtil.getMessage() no longer returns null, leading to NPEs if message bundle is missing 13476: Reverted back to null return values. Will save for fixing on HEAD. 13749: Fixed ALFCOM-2655: MLTranslationInterceptor doesn't handle getType method 13803: ETWOTWO-710 13819: *RECORD ONLY* ACT-6420 - Office 2003 "Install for all users" - DO NOT MERGE 13827: ETWOTWO-1172 - authority exists now checks nodeRef result ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.0:r12824,13008,13031,13040,13089,13091,13145,13848 Merged /alfresco/BRANCHES/V2.2:r12824,13188,13212,13342,13442,13468,13470-13471,13475-13476,13749,13803,13827 Merged /alfresco/BRANCHES/V3.1:r13853 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14763 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2009 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
|
||||
@@ -945,7 +945,7 @@ public class ImporterComponent
|
||||
if (value instanceof Collection)
|
||||
{
|
||||
List<Serializable> boundCollection = new ArrayList<Serializable>();
|
||||
for (String collectionValue : (Collection<String>)value)
|
||||
for (Serializable collectionValue : (Collection<Serializable>)value)
|
||||
{
|
||||
Serializable objValue = bindValue(context, property, valueDataType, collectionValue);
|
||||
boundCollection.add(objValue);
|
||||
@@ -954,7 +954,7 @@ public class ImporterComponent
|
||||
}
|
||||
else
|
||||
{
|
||||
value = bindValue(context, property, valueDataType, (String)value);
|
||||
value = bindValue(context, property, valueDataType, value);
|
||||
}
|
||||
|
||||
// choose to provide property on node creation or at end of import for lazy binding
|
||||
@@ -1002,19 +1002,22 @@ public class ImporterComponent
|
||||
* @param value string form of value
|
||||
* @return the bound value
|
||||
*/
|
||||
private Serializable bindValue(ImportNode context, QName property, DataTypeDefinition valueType, String value)
|
||||
private Serializable bindValue(ImportNode context, QName property, DataTypeDefinition valueType, Serializable value)
|
||||
{
|
||||
Serializable objValue = null;
|
||||
if (value != null && valueType != null)
|
||||
{
|
||||
String strValue = bindPlaceHolder(value, binding);
|
||||
if (value instanceof String)
|
||||
{
|
||||
value = bindPlaceHolder(value.toString(), binding);
|
||||
}
|
||||
if ((valueType.getName().equals(DataTypeDefinition.NODE_REF) || valueType.getName().equals(DataTypeDefinition.CATEGORY)))
|
||||
{
|
||||
objValue = strValue;
|
||||
objValue = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
objValue = (Serializable)DefaultTypeConverter.INSTANCE.convert(valueType, strValue);
|
||||
objValue = (Serializable) DefaultTypeConverter.INSTANCE.convert(valueType, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -77,11 +77,32 @@
|
||||
<cm:name>Some content</cm:name>
|
||||
<cm:content>contentUrl=classpath:org/alfresco/repo/importer/importercomponent_testfile.txt|mimetype=text|size=|encoding=</cm:content>
|
||||
</cm:content>
|
||||
|
||||
<cm:folder view:id="ML Text">
|
||||
<view:aspects>
|
||||
<cm:auditable/>
|
||||
</view:aspects>
|
||||
<view:properties>
|
||||
<cm:name>ML Text</cm:name>
|
||||
<cm:title>
|
||||
<view:mlvalue view:locale="fr_FR">FR_TITLE</view:mlvalue>
|
||||
<view:mlvalue view:locale="de_DE">GE_TITLE</view:mlvalue>
|
||||
<view:mlvalue view:locale="en_US">ENG_TITLE</view:mlvalue>
|
||||
</cm:title>
|
||||
<cm:description>
|
||||
<view:mlvalue view:locale="fr_FR">FR_DESCRIPTION</view:mlvalue>
|
||||
<view:mlvalue view:locale="de_DE">GE_DESCRIPTION</view:mlvalue>
|
||||
<view:mlvalue view:locale="en_US">ENG_DESCRIPTION</view:mlvalue>
|
||||
</cm:description>
|
||||
</view:properties>
|
||||
</cm:folder>
|
||||
|
||||
|
||||
<view:reference view:idref="the root system folder">
|
||||
<view:associations>
|
||||
<cm:contains>
|
||||
<view:reference view:idref="some content" view:childName="link to some content"/>
|
||||
<view:reference view:idref="ML Text" view:childName="link to ML Text"/>
|
||||
</cm:contains>
|
||||
</view:associations>
|
||||
</view:reference>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2009 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
|
||||
@@ -247,7 +247,7 @@ public class NodeContext extends ElementContext
|
||||
* @param property the property name
|
||||
* @param value the property value
|
||||
*/
|
||||
public void addProperty(QName property, String value)
|
||||
public void addProperty(QName property, Serializable value)
|
||||
{
|
||||
// Process "special" properties
|
||||
// TODO: Make this configurable...
|
||||
@@ -256,7 +256,7 @@ public class NodeContext extends ElementContext
|
||||
// Process Alfresco UUID
|
||||
if (uuid == null && propDef != null && propDef.getName().equals(ContentModel.PROP_NODE_UUID))
|
||||
{
|
||||
uuid = value;
|
||||
uuid = value.toString();
|
||||
}
|
||||
|
||||
// Do not import properties of sys:referenceable or cm:versionable
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2009 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
|
||||
@@ -26,7 +26,9 @@ package org.alfresco.repo.importer.view;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
@@ -35,11 +37,14 @@ import org.alfresco.repo.importer.Importer;
|
||||
import org.alfresco.repo.importer.Parser;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.MLText;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.cmr.view.ImporterException;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
@@ -71,6 +76,7 @@ public class ViewParser implements Parser
|
||||
private static final String VIEW_IDREF_ATTR = "idref";
|
||||
private static final String VIEW_PATHREF_ATTR = "pathref";
|
||||
private static final String VIEW_NODEREF_ATTR = "noderef";
|
||||
private static final String VIEW_LOCALE_ATTR = "locale";
|
||||
private static final QName VIEW_METADATA = QName.createQName(NamespaceService.REPOSITORY_VIEW_1_0_URI, "metadata");
|
||||
private static final QName VIEW_VALUE_QNAME = QName.createQName(NamespaceService.REPOSITORY_VIEW_1_0_URI, "value");
|
||||
private static final QName VIEW_VALUES_QNAME = QName.createQName(NamespaceService.REPOSITORY_VIEW_1_0_URI, "values");
|
||||
@@ -82,7 +88,7 @@ public class ViewParser implements Parser
|
||||
private static final QName VIEW_AUTHORITY = QName.createQName(NamespaceService.REPOSITORY_VIEW_1_0_URI, "authority");
|
||||
private static final QName VIEW_PERMISSION = QName.createQName(NamespaceService.REPOSITORY_VIEW_1_0_URI, "permission");
|
||||
private static final QName VIEW_REFERENCE = QName.createQName(NamespaceService.REPOSITORY_VIEW_1_0_URI, "reference");
|
||||
|
||||
private static final QName VIEW_ML_VALUE = QName.createQName(NamespaceService.REPOSITORY_VIEW_1_0_URI, "mlvalue");
|
||||
|
||||
// XML Pull Parser Factory
|
||||
private XmlPullParserFactory factory;
|
||||
@@ -670,6 +676,7 @@ public class ViewParser implements Parser
|
||||
{
|
||||
// Extract collection, if specified
|
||||
boolean isCollection = false;
|
||||
boolean isMLProperty = false;
|
||||
if (eventType == XmlPullParser.START_TAG)
|
||||
{
|
||||
QName name = getName(xpp);
|
||||
@@ -683,6 +690,66 @@ public class ViewParser implements Parser
|
||||
eventType = xpp.next();
|
||||
}
|
||||
}
|
||||
else if (name.equals(VIEW_ML_VALUE))
|
||||
{
|
||||
isMLProperty = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Extract ML value
|
||||
|
||||
if (isMLProperty)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Start parsing MLValue for property: " + propertyName);
|
||||
}
|
||||
value = "";
|
||||
String locale = "";
|
||||
node.addDatatype(propertyName, dictionaryService.getDataType(DataTypeDefinition.MLTEXT));
|
||||
MLText mlText = new MLText();
|
||||
while (isMLProperty)
|
||||
{
|
||||
isMLProperty = false;
|
||||
|
||||
locale = xpp.getAttributeValue(NamespaceService.REPOSITORY_VIEW_1_0_URI, VIEW_LOCALE_ATTR);
|
||||
eventType = xpp.next();
|
||||
if (eventType == XmlPullParser.TEXT)
|
||||
{
|
||||
value = xpp.getText();
|
||||
eventType = xpp.next();
|
||||
}
|
||||
if (eventType == XmlPullParser.END_TAG)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Found ML entry: " + locale + "=" + value);
|
||||
}
|
||||
mlText.addValue(DefaultTypeConverter.INSTANCE.convert(Locale.class, locale), value);
|
||||
|
||||
eventType = xpp.next();
|
||||
if (eventType == XmlPullParser.TEXT)
|
||||
{
|
||||
eventType = xpp.next();
|
||||
}
|
||||
}
|
||||
|
||||
if (eventType == XmlPullParser.START_TAG)
|
||||
{
|
||||
QName name = getName(xpp);
|
||||
if (name.equals(VIEW_ML_VALUE))
|
||||
{
|
||||
isMLProperty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("End parsing MLValue for property: " + propertyName);
|
||||
}
|
||||
node.addProperty(propertyName, mlText);
|
||||
|
||||
}
|
||||
|
||||
// Extract decorated value
|
||||
|
Reference in New Issue
Block a user