mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
. Fixes/improvements for handling of author/creator in the repository and the web-client:
- added new aspect called "cm:author" with a single text property "cm:author" - fixed the content meta-data extractors to set the new cm:author property rather than the system cm:creator property (which was causing a couple of bugs spotted recently) - fixed the web-client to set the new cm:author property rather than the cm:creator property from user entered data into the UI - fixed web-client config of document properties screen to display cm:author - fixed client to not allow editing of the cm:creator value git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2034 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
145f72a6e7
commit
aedd354dea
@ -552,7 +552,6 @@ general=General
|
||||
file_name=File Name
|
||||
content_type=Content Type
|
||||
content_format=Content Format
|
||||
author=Author
|
||||
inline_editable=Inline Editable
|
||||
locate_document=Locate document to upload
|
||||
location=Location
|
||||
|
@ -177,7 +177,7 @@
|
||||
<override from-outcome="deleteSpace" to-view-id="/jsp/forums/delete-topic.jsp" />
|
||||
</navigation>
|
||||
</config>
|
||||
|
||||
|
||||
<config evaluator="node-type" condition="dictionaryModel">
|
||||
<property-sheet>
|
||||
<show-property name="modelActive"/>
|
||||
@ -251,11 +251,17 @@
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
<config evaluator="aspect-name" condition="author">
|
||||
<property-sheet>
|
||||
<show-property name="author"/>
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
<config evaluator="aspect-name" condition="auditable">
|
||||
<property-sheet>
|
||||
<show-property name="creator"/>
|
||||
<show-property name="creator" readOnly="true"/>
|
||||
<show-property name="created" readOnly="true"/>
|
||||
<show-property name="modifier"/>
|
||||
<show-property name="modifier" readOnly="true"/>
|
||||
<show-property name="modified" readOnly="true"/>
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
@ -565,7 +565,7 @@ public class AdvancedSearchBean
|
||||
}
|
||||
if (this.author != null && this.author.length() != 0)
|
||||
{
|
||||
search.addAttributeQuery(ContentModel.PROP_CREATOR, this.author);
|
||||
search.addAttributeQuery(ContentModel.PROP_AUTHOR, this.author);
|
||||
}
|
||||
if (this.contentFormat != null && this.contentFormat.length() != 0)
|
||||
{
|
||||
|
@ -19,6 +19,7 @@ package org.alfresco.web.bean;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -146,6 +147,20 @@ public class DocumentPropertiesBean
|
||||
}
|
||||
}
|
||||
|
||||
// extra and deal with the Author prop if the aspect has not been applied yet
|
||||
String author = (String)props.get(ContentModel.PROP_AUTHOR);
|
||||
if (author != null)
|
||||
{
|
||||
// add aspect if required
|
||||
if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == false)
|
||||
{
|
||||
Map<QName, Serializable> authorProps = new HashMap<QName, Serializable>(1, 1.0f);
|
||||
authorProps.put(ContentModel.PROP_AUTHOR, author);
|
||||
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_AUTHOR, authorProps);
|
||||
}
|
||||
// else it will get updated in the later setProperties() call
|
||||
}
|
||||
|
||||
// add the remaining properties
|
||||
Iterator<String> iterProps = props.keySet().iterator();
|
||||
while (iterProps.hasNext())
|
||||
|
@ -82,7 +82,7 @@ public class AddContentWizard extends BaseContentWizard
|
||||
|
||||
if (Repository.extractMetadata(FacesContext.getCurrentInstance(), cr, contentProps))
|
||||
{
|
||||
this.author = (String)(contentProps.get(ContentModel.PROP_CREATOR));
|
||||
this.author = (String)(contentProps.get(ContentModel.PROP_AUTHOR));
|
||||
this.title = (String)(contentProps.get(ContentModel.PROP_TITLE));
|
||||
this.description = (String)(contentProps.get(ContentModel.PROP_DESCRIPTION));
|
||||
}
|
||||
|
@ -111,7 +111,21 @@ public abstract class BaseContentWizard extends AbstractWizardBean
|
||||
Map<QName, Serializable> contentProps = this.nodeService.getProperties(nodeRef);
|
||||
contentProps.put(ContentModel.PROP_TITLE, this.title);
|
||||
contentProps.put(ContentModel.PROP_DESCRIPTION, this.description);
|
||||
contentProps.put(ContentModel.PROP_CREATOR, this.author);
|
||||
|
||||
// add author property
|
||||
if (this.author != null && this.author.length() != 0)
|
||||
{
|
||||
if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == false)
|
||||
{
|
||||
Map<QName, Serializable> authorProps = new HashMap<QName, Serializable>(1, 1.0f);
|
||||
authorProps.put(ContentModel.PROP_AUTHOR, this.author);
|
||||
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_AUTHOR, authorProps);
|
||||
}
|
||||
else
|
||||
{
|
||||
contentProps.put(ContentModel.PROP_AUTHOR, this.author);
|
||||
}
|
||||
}
|
||||
|
||||
// set up content properties - copy or create the compound property
|
||||
ContentData contentData = (ContentData)contentProps.get(ContentModel.PROP_CONTENT);
|
||||
@ -161,10 +175,12 @@ public abstract class BaseContentWizard extends AbstractWizardBean
|
||||
Repository.resolveToQName(this.objectType));
|
||||
NodeRef fileNodeRef = fileInfo.getNodeRef();
|
||||
|
||||
// set the author (if we have)
|
||||
// set the author aspect (if we have one)
|
||||
if (this.author != null && this.author.length() > 0)
|
||||
{
|
||||
this.nodeService.setProperty(fileNodeRef, ContentModel.PROP_CREATOR, this.author);
|
||||
Map<QName, Serializable> authorProps = new HashMap<QName, Serializable>(1, 1.0f);
|
||||
authorProps.put(ContentModel.PROP_AUTHOR, this.author);
|
||||
this.nodeService.addAspect(fileNodeRef, ContentModel.ASPECT_AUTHOR, authorProps);
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
|
@ -146,7 +146,7 @@
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.author}" />:</nobr></td>
|
||||
<td>
|
||||
<h:inputText value="#{EditDocPropsDialog.properties.creator}" size="35" maxlength="1024" />
|
||||
<h:inputText value="#{EditDocPropsDialog.properties.author}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="paddingRow"></td></tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user