mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
11540: Fix for ETHREEOH-642: forms-runtime.js doesn't process multiple select boxes correctly 11541: Fix for occasional CIFS packet allocations that are over the maximum pooled packet size. The oversized packets are allocated from normal Java heap and will be picked up by the garbage collector. JLAN-42. 11542: Removed dynamic-website and extranet projects from 3.0E codeline 11543: Missing XML/HTML encoding in activity list feed. 11544: Fix for ETHREEOH-528 - removed Complete Repository as Export option. 11545: Updated NTLM example config in web.xml to include web-client ajax servlet mapping. 11546: Merged V2.2 to V3.0 11478: Keep creator and owner as orihinally set in AVM - Fix for ETWOTWO-604 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12454 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
227 lines
8.0 KiB
Java
227 lines
8.0 KiB
Java
/*
|
|
* 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.avm;
|
|
|
|
import org.alfresco.repo.domain.DbAccessControlList;
|
|
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
|
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
|
|
|
/**
|
|
* Place holder for a deleted node.
|
|
* @author britt
|
|
*/
|
|
public class DeletedNodeImpl extends AVMNodeImpl implements DeletedNode
|
|
{
|
|
private static final long serialVersionUID = 7283526790174482993L;
|
|
|
|
/**
|
|
* The type of node that this is a deleted node for.
|
|
*/
|
|
private int fDeletedType;
|
|
|
|
/**
|
|
* For Hibernate's use.
|
|
*/
|
|
protected DeletedNodeImpl()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Create a new one from scratch.
|
|
* @param id The node id.
|
|
* @param store The store it's being created in.
|
|
*/
|
|
public DeletedNodeImpl(long id,
|
|
AVMStore store, DbAccessControlList acl)
|
|
{
|
|
super(id, store);
|
|
this.setAcl(acl);
|
|
}
|
|
|
|
public DeletedNodeImpl(DeletedNode other,
|
|
AVMStore store, Long parentAcl, ACLCopyMode mode)
|
|
{
|
|
super(store.getAVMRepository().issueID(), store);
|
|
AVMDAOs.Instance().fAVMNodeDAO.save(this);
|
|
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
|
copyProperties(other);
|
|
copyAspects(other);
|
|
copyACLs(other, parentAcl, mode);
|
|
copyCreationAndOwnerBasicAttributes(other);
|
|
}
|
|
|
|
/**
|
|
* Setter.
|
|
*/
|
|
public void setDeletedType(int type)
|
|
{
|
|
fDeletedType = type;
|
|
}
|
|
|
|
/**
|
|
* Getter.
|
|
*/
|
|
public int getDeletedType()
|
|
{
|
|
return fDeletedType;
|
|
}
|
|
|
|
// TODO What happens when this is called? Does it muck anything up.
|
|
/**
|
|
* This is only called rarely.
|
|
*/
|
|
public AVMNode copy(Lookup lPath)
|
|
{
|
|
DirectoryNode dir = lPath.getCurrentNodeDirectory();
|
|
Long parentAclId = null;
|
|
if((dir != null) && (dir.getAcl() != null))
|
|
{
|
|
parentAclId = dir.getAcl().getId();
|
|
}
|
|
AVMNode newMe = new DeletedNodeImpl(this, lPath.getAVMStore(), parentAclId, ACLCopyMode.COPY);
|
|
newMe.setAncestor(this);
|
|
return newMe;
|
|
}
|
|
|
|
/**
|
|
* Get a descriptor.
|
|
* @param lPath The Lookup to this node's parent.
|
|
* @param name The name of this node.
|
|
* @return An AVMNodeDescriptor
|
|
*/
|
|
public AVMNodeDescriptor getDescriptor(Lookup lPath, String name)
|
|
{
|
|
BasicAttributes attrs = getBasicAttributes();
|
|
String path = lPath.getRepresentedPath();
|
|
if (path.endsWith("/"))
|
|
{
|
|
path = path + name;
|
|
}
|
|
else
|
|
{
|
|
path = path + "/" + name;
|
|
}
|
|
return new AVMNodeDescriptor(path,
|
|
name,
|
|
AVMNodeType.DELETED_NODE,
|
|
attrs.getCreator(),
|
|
attrs.getOwner(),
|
|
attrs.getLastModifier(),
|
|
attrs.getCreateDate(),
|
|
attrs.getModDate(),
|
|
attrs.getAccessDate(),
|
|
getId(),
|
|
getGuid(),
|
|
getVersionID(),
|
|
null,
|
|
-1,
|
|
false,
|
|
-1,
|
|
false,
|
|
-1,
|
|
fDeletedType);
|
|
}
|
|
|
|
/**
|
|
* Get a descriptor.
|
|
* @param lPath The full Lookup to this.
|
|
* @return An AVMNodeDescriptor.
|
|
*/
|
|
public AVMNodeDescriptor getDescriptor(Lookup lPath)
|
|
{
|
|
BasicAttributes attrs = getBasicAttributes();
|
|
String path = lPath.getRepresentedPath();
|
|
return new AVMNodeDescriptor(path,
|
|
path.substring(path.lastIndexOf("/") + 1),
|
|
AVMNodeType.DELETED_NODE,
|
|
attrs.getCreator(),
|
|
attrs.getOwner(),
|
|
attrs.getLastModifier(),
|
|
attrs.getCreateDate(),
|
|
attrs.getModDate(),
|
|
attrs.getAccessDate(),
|
|
getId(),
|
|
getGuid(),
|
|
getVersionID(),
|
|
null,
|
|
-1,
|
|
false,
|
|
-1,
|
|
false,
|
|
-1,
|
|
fDeletedType);
|
|
}
|
|
|
|
/**
|
|
* Get a descriptor.
|
|
* @param parentPath
|
|
* @param name
|
|
* @param parentIndirection Ignored.
|
|
* @return An AVMNodeDescriptor.
|
|
*/
|
|
public AVMNodeDescriptor getDescriptor(String parentPath, String name, String parentIndirection, int parentIndirectionVersion)
|
|
{
|
|
BasicAttributes attrs = getBasicAttributes();
|
|
String path = parentPath.endsWith("/") ? parentPath + name : parentPath + "/" + name;
|
|
return new AVMNodeDescriptor(path,
|
|
name,
|
|
AVMNodeType.DELETED_NODE,
|
|
attrs.getCreator(),
|
|
attrs.getOwner(),
|
|
attrs.getLastModifier(),
|
|
attrs.getCreateDate(),
|
|
attrs.getModDate(),
|
|
attrs.getAccessDate(),
|
|
getId(),
|
|
getGuid(),
|
|
getVersionID(),
|
|
null,
|
|
-1,
|
|
false,
|
|
-1,
|
|
false,
|
|
-1,
|
|
fDeletedType);
|
|
}
|
|
|
|
/**
|
|
* Get the type of this node.
|
|
* @return The AVMNodeType of this.
|
|
*/
|
|
public int getType()
|
|
{
|
|
return AVMNodeType.DELETED_NODE;
|
|
}
|
|
|
|
/**
|
|
* Get a descriptive string representation.
|
|
* @param lPath The lookup we've been found through.
|
|
* @return A String representation.
|
|
*/
|
|
public String toString(Lookup lPath)
|
|
{
|
|
return "[DN:" + getId() + "]";
|
|
}
|
|
}
|