mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged BRANCHES/V3.2 to HEAD:
19177: (RECORD ONLY) Updated record-only entries for V3.1 branch 19321: (RECORD ONLY) Removed deep svn:mergeinfo 19331: (RECORD ONLY) Merged HEAD to BRANCHES/V3.2: 19324: Follow-up on ALF-765 by upgrading EHCache to 2.0.0Performing merge across the whole of the branch 19526: Moved ContentServicePolicy static QNames onto policy classes 19539: (RECORD ONLY) Merged HEAD to V3.2 19538: Build fix - fix build speed 19541: Added extraction of custom, mapped metadata from PDF documents 19543: (RECORD ONLY) Removed deep svn:mergeinfo 19598: (RECORD ONLY) Backported (merge not possible) HEAD rev 18790 for IndexInfo fixes 19626: Fix for ALF-732: Possible memory leak using the .getNodeRefs() method against a ResultSet ... 19629: (RECORD ONLY) Merged HEAD to V3.2 19625: Fix to allow Share logo to swapped out for a different one without having to modify the header CSS. 19628: Corrected Share header component height. 19649: ALF-885: Cannot retrieve cm:title from an AVM node in FreeMarker (if persisted with actual type set to MLText) 19694: (RECORD ONLY) Merged V3.2 to HEAD: r19310 bad back merge - record-only 19713: (RECORD ONLY) Removed svn:mergeinfo git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19719 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,9 +32,11 @@ import org.alfresco.service.namespace.QName;
|
|||||||
*/
|
*/
|
||||||
public interface ContentServicePolicies
|
public interface ContentServicePolicies
|
||||||
{
|
{
|
||||||
/** The QName's of the policies */
|
/** @deprecated Use {@link OnContentUpdatePolicy#QNAME} */
|
||||||
public static final QName ON_CONTENT_UPDATE = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentUpdate");
|
public static final QName ON_CONTENT_UPDATE = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentUpdate");
|
||||||
|
/** @deprecated Use {@link OnContentPropertyUpdatePolicy#QNAME} */
|
||||||
public static final QName ON_CONTENT_PROPERTY_UPDATE = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentPropertyUpdate");
|
public static final QName ON_CONTENT_PROPERTY_UPDATE = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentPropertyUpdate");
|
||||||
|
/** @deprecated Use {@link OnContentReadPolicy#QNAME} */
|
||||||
public static final QName ON_CONTENT_READ = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentRead");
|
public static final QName ON_CONTENT_READ = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentRead");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +46,7 @@ public interface ContentServicePolicies
|
|||||||
*/
|
*/
|
||||||
public interface OnContentUpdatePolicy extends ClassPolicy
|
public interface OnContentUpdatePolicy extends ClassPolicy
|
||||||
{
|
{
|
||||||
|
public static final QName QNAME = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentUpdate");
|
||||||
/**
|
/**
|
||||||
* @param nodeRef the node reference
|
* @param nodeRef the node reference
|
||||||
*/
|
*/
|
||||||
@@ -59,6 +62,7 @@ public interface ContentServicePolicies
|
|||||||
*/
|
*/
|
||||||
public interface OnContentPropertyUpdatePolicy extends ClassPolicy
|
public interface OnContentPropertyUpdatePolicy extends ClassPolicy
|
||||||
{
|
{
|
||||||
|
public static final QName QNAME = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentPropertyUpdate");
|
||||||
/**
|
/**
|
||||||
* @param nodeRef the node reference
|
* @param nodeRef the node reference
|
||||||
* @param propertyQName the name of the property that changed
|
* @param propertyQName the name of the property that changed
|
||||||
@@ -86,6 +90,7 @@ public interface ContentServicePolicies
|
|||||||
*/
|
*/
|
||||||
public interface OnContentReadPolicy extends ClassPolicy
|
public interface OnContentReadPolicy extends ClassPolicy
|
||||||
{
|
{
|
||||||
|
public static final QName QNAME = QName.createQName(NamespaceService.ALFRESCO_URI, "onContentRead");
|
||||||
/**
|
/**
|
||||||
* @param nodeRef the node reference
|
* @param nodeRef the node reference
|
||||||
*/
|
*/
|
||||||
|
@@ -42,6 +42,7 @@ import org.apache.pdfbox.pdmodel.PDDocumentInformation;
|
|||||||
* <b>title:</b> -- cm:title
|
* <b>title:</b> -- cm:title
|
||||||
* <b>subject:</b> -- cm:description
|
* <b>subject:</b> -- cm:description
|
||||||
* <b>created:</b> -- cm:created
|
* <b>created:</b> -- cm:created
|
||||||
|
* <b>Any custom property:</b> -- [not mapped]
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* TIKA Note - all the fields (plus a few others) are present
|
* TIKA Note - all the fields (plus a few others) are present
|
||||||
@@ -125,6 +126,17 @@ public class PdfBoxMetadataExtracter extends AbstractMappingMetadataExtracter
|
|||||||
putRawValue(KEY_CREATED, parsedDate, rawProperties);
|
putRawValue(KEY_CREATED, parsedDate, rawProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Extract remaining custom properties
|
||||||
|
for (String customProp : super.getMapping().keySet())
|
||||||
|
{
|
||||||
|
if (rawProperties.keySet().contains(customProp))
|
||||||
|
{
|
||||||
|
// Ignore it
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String customValue = docInfo.getCustomMetadataValue(customProp);
|
||||||
|
putRawValue(customProp, customValue, rawProperties);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@@ -231,7 +231,7 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
|||||||
{
|
{
|
||||||
// Register interest in the onContentUpdate policy for the dictionary model type
|
// Register interest in the onContentUpdate policy for the dictionary model type
|
||||||
policyComponent.bindClassBehaviour(
|
policyComponent.bindClassBehaviour(
|
||||||
ContentServicePolicies.ON_CONTENT_UPDATE,
|
ContentServicePolicies.OnContentUpdatePolicy.QNAME,
|
||||||
ContentModel.TYPE_DICTIONARY_MODEL,
|
ContentModel.TYPE_DICTIONARY_MODEL,
|
||||||
new JavaBehaviour(this, "onContentUpdate"));
|
new JavaBehaviour(this, "onContentUpdate"));
|
||||||
|
|
||||||
|
@@ -44,6 +44,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
|||||||
import org.alfresco.service.cmr.repository.Path;
|
import org.alfresco.service.cmr.repository.Path;
|
||||||
import org.alfresco.service.cmr.repository.Period;
|
import org.alfresco.service.cmr.repository.Period;
|
||||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||||
|
import org.alfresco.service.cmr.repository.datatype.TypeConverter.Converter;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.EqualsHelper;
|
import org.alfresco.util.EqualsHelper;
|
||||||
import org.alfresco.util.VersionNumber;
|
import org.alfresco.util.VersionNumber;
|
||||||
@@ -268,12 +269,36 @@ public class PropertyValue implements Cloneable, Serializable
|
|||||||
return ValueType.STRING;
|
return ValueType.STRING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (value instanceof String)
|
||||||
|
{
|
||||||
|
return ValueType.STRING;
|
||||||
|
}
|
||||||
return ValueType.DB_ATTRIBUTE;
|
return ValueType.DB_ATTRIBUTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
Serializable convert(Serializable value)
|
Serializable convert(Serializable value)
|
||||||
{
|
{
|
||||||
|
// NOTE: since 2.2.1, PropertyValue is only used by AVM (which does not natively support MLText, other than single/default string)
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
if (value instanceof String)
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
else if (value instanceof MLText)
|
||||||
|
{
|
||||||
|
if (((MLText)value).size() <= 1)
|
||||||
|
{
|
||||||
|
return (String)((Converter<MLText, String>)DefaultTypeConverter.INSTANCE.getConverter(MLText.class, String.class)).convert((MLText)value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new UnsupportedOperationException("PropertyValue MLText is not supported for AVM");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return DefaultTypeConverter.INSTANCE.convert(MLText.class, value);
|
return DefaultTypeConverter.INSTANCE.convert(MLText.class, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -37,7 +37,6 @@ import org.springframework.context.ApplicationContext;
|
|||||||
*/
|
*/
|
||||||
public class PropertyValueTest extends TestCase
|
public class PropertyValueTest extends TestCase
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
|
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
|
||||||
|
|
||||||
public void testMLText()
|
public void testMLText()
|
||||||
@@ -54,11 +53,21 @@ public class PropertyValueTest extends TestCase
|
|||||||
PropertyValue propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
PropertyValue propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
||||||
assertNotNull("MLText not persisted as a string", propertyValue.getStringValue());
|
assertNotNull("MLText not persisted as a string", propertyValue.getStringValue());
|
||||||
|
|
||||||
// multiple languages
|
try
|
||||||
mlText = new MLText(Locale.GERMAN, "hallo");
|
{
|
||||||
mlText.addValue(Locale.ITALIAN, "ciao");
|
// multiple languages
|
||||||
propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
mlText = new MLText(Locale.GERMAN, "hallo");
|
||||||
assertNotNull("MLText not persisted as an attribute", propertyValue.getAttributeValue());
|
mlText.addValue(Locale.ITALIAN, "ciao");
|
||||||
|
propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
||||||
|
assertNotNull("MLText not persisted as an attribute", propertyValue.getAttributeValue());
|
||||||
|
|
||||||
|
fail();
|
||||||
|
}
|
||||||
|
catch (UnsupportedOperationException uoe)
|
||||||
|
{
|
||||||
|
// expected
|
||||||
|
// NOTE: since 2.2.1, PropertyValue is only used by AVM (which does not natively support MLText, other than single/default string)
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -76,7 +76,7 @@ public class OnContentUpdateRuleTrigger extends RuleTriggerAbstractBase
|
|||||||
{
|
{
|
||||||
// Bind behaviour
|
// Bind behaviour
|
||||||
this.policyComponent.bindClassBehaviour(
|
this.policyComponent.bindClassBehaviour(
|
||||||
ContentServicePolicies.ON_CONTENT_UPDATE,
|
ContentServicePolicies.OnContentUpdatePolicy.QNAME,
|
||||||
this,
|
this,
|
||||||
new JavaBehaviour(this, "onContentUpdate"));
|
new JavaBehaviour(this, "onContentUpdate"));
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.security.permissions.impl.acegi;
|
package org.alfresco.repo.security.permissions.impl.acegi;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.BitSet;
|
import java.util.BitSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
@@ -120,26 +121,20 @@ public class FilteringResultSet extends ACLEntryAfterInvocationProvider implemen
|
|||||||
|
|
||||||
public List<NodeRef> getNodeRefs()
|
public List<NodeRef> getNodeRefs()
|
||||||
{
|
{
|
||||||
List<NodeRef> answer = unfiltered.getNodeRefs();
|
ArrayList<NodeRef> answer = new ArrayList<NodeRef>(length());
|
||||||
for (int i = unfiltered.length() - 1; i >= 0; i--)
|
for(ResultSetRow row : this)
|
||||||
{
|
{
|
||||||
if (!inclusionMask.get(i))
|
answer.add(row.getNodeRef());
|
||||||
{
|
|
||||||
answer.remove(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChildAssociationRef> getChildAssocRefs()
|
public List<ChildAssociationRef> getChildAssocRefs()
|
||||||
{
|
{
|
||||||
List<ChildAssociationRef> answer = unfiltered.getChildAssocRefs();
|
ArrayList<ChildAssociationRef> answer = new ArrayList<ChildAssociationRef>(length());
|
||||||
for (int i = unfiltered.length() - 1; i >= 0; i--)
|
for(ResultSetRow row : this)
|
||||||
{
|
{
|
||||||
if (!inclusionMask.get(i))
|
answer.add(row.getChildAssocRef());
|
||||||
{
|
|
||||||
answer.remove(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,9 @@ public class FilteringResultSetTest extends TestCase
|
|||||||
filtering.setIncluded(i, true);
|
filtering.setIncluded(i, true);
|
||||||
assertEquals(1, filtering.length());
|
assertEquals(1, filtering.length());
|
||||||
assertEquals("n"+i, filtering.getNodeRef(0).getId());
|
assertEquals("n"+i, filtering.getNodeRef(0).getId());
|
||||||
|
assertEquals(1, filtering.getNodeRefs().size());
|
||||||
|
assertEquals(1, filtering.getChildAssocRefs().size());
|
||||||
|
assertEquals("n"+i, filtering.getNodeRefs().get(0).getId());
|
||||||
filtering.setIncluded(i, false);
|
filtering.setIncluded(i, false);
|
||||||
assertEquals(0, filtering.length());
|
assertEquals(0, filtering.length());
|
||||||
}
|
}
|
||||||
|
@@ -143,7 +143,7 @@ public class VersionableAspect implements ContentServicePolicies.OnContentUpdate
|
|||||||
new JavaBehaviour(this, "afterCreateVersion", Behaviour.NotificationFrequency.EVERY_EVENT));
|
new JavaBehaviour(this, "afterCreateVersion", Behaviour.NotificationFrequency.EVERY_EVENT));
|
||||||
|
|
||||||
this.policyComponent.bindClassBehaviour(
|
this.policyComponent.bindClassBehaviour(
|
||||||
ContentServicePolicies.ON_CONTENT_UPDATE,
|
ContentServicePolicies.OnContentUpdatePolicy.QNAME,
|
||||||
ContentModel.ASPECT_VERSIONABLE,
|
ContentModel.ASPECT_VERSIONABLE,
|
||||||
new JavaBehaviour(this, "onContentUpdate", Behaviour.NotificationFrequency.TRANSACTION_COMMIT));
|
new JavaBehaviour(this, "onContentUpdate", Behaviour.NotificationFrequency.TRANSACTION_COMMIT));
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@ public class WorkflowDefinitionType implements ContentServicePolicies.OnContentU
|
|||||||
{
|
{
|
||||||
// Register interest in the onContentUpdate policy for the workflow definition type
|
// Register interest in the onContentUpdate policy for the workflow definition type
|
||||||
policyComponent.bindClassBehaviour(
|
policyComponent.bindClassBehaviour(
|
||||||
ContentServicePolicies.ON_CONTENT_UPDATE,
|
ContentServicePolicies.OnContentUpdatePolicy.QNAME,
|
||||||
WorkflowModel.TYPE_WORKFLOW_DEF,
|
WorkflowModel.TYPE_WORKFLOW_DEF,
|
||||||
new JavaBehaviour(this, "onContentUpdate"));
|
new JavaBehaviour(this, "onContentUpdate"));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user