Merged V3.0 to HEAD

12310: Merged V2.2 to V3.0
    12306: Merged V2.1 to V2.2
      12212: Final set of XSS and HTML encoding fixes for ETWOONE-90
  12312: Merged V2.2 to V3.0
    12311: Merged V2.1 to V2.2
      11667: Fix for ETWOONE-389 - Current page number not always visible on the browse screen.
  12316: Fix for merge issue
  12317: Merged 2.1 to 3.0
    12313: Fix for regression introduced when fixing ETWOONE-91. Also fixes ETHREEOH-1043
  12319: Final set of XSS fixes specific to 3.0 codeline see ETWOONE-90
  12321: Missing file from previous checkin
  12324: Merged 2.2 to 3.0
    12320: Merged 2.1 to 2.2
      11682: Fix for ETWOONE-87: Behavior of delete cascade
  12326: Merge 2.1 to 3.0
    11615: Fix for ETWOONE-188: After session has timed out, expanding a space in the Navigator results in unfriendly error


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12531 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-12-22 13:20:37 +00:00
parent d34f99c2d9
commit d5f42006f8
57 changed files with 1023 additions and 176 deletions

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) 2005-2008 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.web.bean.content;
import java.text.MessageFormat;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Bean implementation for the "Delete Content Association" dialog
*
* @author valerysh
* @author gavinc
*/
public class DeleteContentAssociationDialog extends DeleteContentDialog
{
private static final Log logger = LogFactory.getLog(DeleteContentAssociationDialog.class);
// ------------------------------------------------------------------------------
// Dialog implementation
@Override
protected String finishImpl(FacesContext context, String outcome)
throws Exception
{
// get the content to delete
Node node = this.browseBean.getDocument();
if (node != null)
{
if (logger.isDebugEnabled())
logger.debug("Trying to delete content node association: " + node.getId());
NodeRef parentRef = this.navigator.getCurrentNode().getNodeRef();
QName qname = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
QName.createValidLocalName(node.getName()));
ChildAssociationRef childAssocRef = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS,
parentRef, qname, node.getNodeRef());
// remove the child association
this.getNodeService().removeChildAssociation(childAssocRef);
}
else
{
logger.warn("WARNING: delete called without a current Document!");
}
return outcome;
}
// ------------------------------------------------------------------------------
// Bean Getters and Setters
/**
* Returns the confirmation to display to the user before deleting the content.
*
* @return The formatted message to display
*/
public String getConfirmMessage()
{
String fileConfirmMsg = null;
Node document = this.browseBean.getDocument();
fileConfirmMsg = Application.getMessage(FacesContext.getCurrentInstance(),
"delete_file_assoc_confirm");
return MessageFormat.format(fileConfirmMsg,
new Object[] {document.getName()});
}
}