Merged V1.4 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3987 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4133 .
   Removed LicenseComponent reference from projects\repository\source\java\org\alfresco\repo\descriptor\DescriptorServiceImpl.java


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4135 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-10-17 22:42:59 +00:00
parent 4f1682e8d0
commit be167f60cf
106 changed files with 5379 additions and 2646 deletions

View File

@@ -74,6 +74,7 @@ public interface CopyService
* @param destinationAssocTypeQName the type of the new child assoc
* @param destinationQName the qualified name of the child association from the
* parent to the new node
* @param copyChildren indicates that the children of the node should also be copied
*
* @return the new node reference
*/
@@ -85,10 +86,32 @@ public interface CopyService
QName destinationQName,
boolean copyChildren);
/**
* @see CopyService#copy(NodeRef, NodeRef, QName, QName, boolean)
*
* Ensures the copy name is the same as the origional or is renamed to prevent duplicate names.
*
* @param sourceNodeRef the node reference used as the source of the copy
* @param destinationParent the intended parent of the new node
* @param destinationAssocTypeQName the type of the new child assoc
* @param destinationQName the qualified name of the child association from the
* parent to the new node
* @param copyChildren indicates that the children of the node should also be copied
*
* @return the new node reference
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"sourceNodeRef", "destinationParent", "destinationAssocTypeQName", "destinationQName", "copyChildren"})
public NodeRef copyAndRename(
NodeRef sourceNodeRef,
NodeRef destinationParent,
QName destinationAssocTypeQName,
QName destinationQName,
boolean copyChildren);
/**
* By default children of the source node are not copied.
*
* @see NodeCopyService#copy(NodeRef, NodeRef, QName, QName, boolean)
* @see CopyService#copy(NodeRef, NodeRef, QName, QName, boolean)
*
* @param sourceNodeRef the node reference used as the source of the copy
* @param destinationParent the intended parent of the new node
@@ -142,4 +165,5 @@ public interface CopyService
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"nodeRef"})
public List<NodeRef> getCopies(NodeRef nodeRef);
}

View File

@@ -60,7 +60,7 @@ import freemarker.ext.dom.NodeModel;
*
* @author Kevin Roast
*/
public final class TemplateNode implements Serializable
public class TemplateNode implements Serializable
{
private static final long serialVersionUID = 1234390333739034171L;
@@ -78,7 +78,7 @@ public final class TemplateNode implements Serializable
private Map<String, List<TemplateNode>> assocs = null;
/** Cached values */
private NodeRef nodeRef;
protected NodeRef nodeRef;
private String name;
private QName type;
private String path;
@@ -87,15 +87,16 @@ public final class TemplateNode implements Serializable
private QNameMap<String, Object> properties;
private List<String> permissions = null;
private boolean propsRetrieved = false;
private ServiceRegistry services = null;
protected ServiceRegistry services = null;
private Boolean isDocument = null;
private Boolean isContainer = null;
private String displayPath = null;
private String mimetype = null;
private Long size = null;
private TemplateImageResolver imageResolver = null;
protected TemplateImageResolver imageResolver = null;
private TemplateNode parent = null;
private ChildAssociationRef primaryParentAssoc = null;
private Boolean isCategory = null;
// ------------------------------------------------------------------------------
@@ -360,6 +361,20 @@ public final class TemplateNode implements Serializable
return locked;
}
/**
* @return true if the node is a Category instance
*/
public boolean getIsCategory()
{
if (isCategory == null)
{
DictionaryService dd = this.services.getDictionaryService();
isCategory = Boolean.valueOf(dd.isSubClass(getType(), ContentModel.TYPE_CATEGORY));
}
return isCategory.booleanValue();
}
/**
* @return the parent node
*/
@@ -482,17 +497,17 @@ public final class TemplateNode implements Serializable
*/
public NodeModel getXmlNodeModel()
{
try
{
return NodeModel.parse(new InputSource(new StringReader(getContent())));
}
catch (Throwable err)
{
if (logger.isDebugEnabled())
logger.debug(err.getMessage(), err);
return null;
}
try
{
return NodeModel.parse(new InputSource(new StringReader(getContent())));
}
catch (Throwable err)
{
if (logger.isDebugEnabled())
logger.debug(err.getMessage(), err);
return null;
}
}
/**
@@ -661,14 +676,18 @@ public final class TemplateNode implements Serializable
}
// ------------------------------------------------------------------------------
// Audit API
/**
* @return a list of AuditInfo objects describing the Audit Trail for this node instance
*/
public List<AuditInfo> getAuditTrail()
{
return this.services.getAuditService().getAuditTrail(this.nodeRef);
}
// ------------------------------------------------------------------------------
// Misc helpers