mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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
105 lines
3.8 KiB
Java
Executable File
105 lines
3.8 KiB
Java
Executable File
/*
|
|
* 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.web.bean.spaces;
|
|
|
|
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 Space" dialog
|
|
*
|
|
* @author gavinc
|
|
*/
|
|
public class DeleteSpaceAssociationDialog extends DeleteSpaceDialog
|
|
{
|
|
private static final Log logger = LogFactory.getLog(DeleteSpaceAssociationDialog.class);
|
|
|
|
// ------------------------------------------------------------------------------
|
|
// Dialog implementation
|
|
|
|
@Override
|
|
protected String finishImpl(FacesContext context, String outcome)
|
|
throws Exception
|
|
{
|
|
// get the space to delete
|
|
Node node = this.browseBean.getActionSpace();
|
|
if (node != null)
|
|
{
|
|
if (logger.isDebugEnabled())
|
|
logger.debug("Trying to delete space 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 Space!");
|
|
}
|
|
|
|
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()
|
|
{
|
|
Node node = this.browseBean.getActionSpace();
|
|
if (node != null)
|
|
{
|
|
String spaceConfirmMsg = Application.getMessage(FacesContext.getCurrentInstance(),
|
|
"delete_space_assoc_confirm");
|
|
return MessageFormat.format(spaceConfirmMsg, new Object[] {node.getName()});
|
|
}
|
|
else
|
|
{
|
|
return Application.getMessage(FacesContext.getCurrentInstance(),
|
|
"delete_node_not_found");
|
|
}
|
|
}
|
|
}
|