mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.0 to HEAD
11489: Added step for JDBC info 11490: Fixed: ETHREEOH-452 Error appear when a user trying to view metadata for item, which is deleting 11491: Blog integration package rename and removal of obsolete web-client beans 11492: Adding missing web-extension dir to dynamic-website project 11493: ETHREEOH_520: Fixes to prevent new users from being created when existing users invited to a site 11494: Updated version to beta2 11495: Fixes ETHREEOH-252, 392 & 393. When merged to 2.2 will also fix ETWOTWO-246 & 616 and when merged to HEAD will fix ALFCOM-1685 & 1712. 11496: Partial fix for ETHREEOH-27, fixes 2 out of the final 3 error conditions. 11497: Fix for ETHREEOH-550 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12447 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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.actions.blogIntegration;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.web.action.evaluator.BaseActionEvaluator;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
|
||||
/**
|
||||
* Add blog details evaluator
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class AddBlogDetailsEvaluator extends BaseActionEvaluator implements BlogIntegrationModel
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(Node node)
|
||||
{
|
||||
boolean result = false;
|
||||
if (node.hasAspect(ASPECT_BLOG_DETAILS) == false)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
* 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.actions.blogIntegration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.blogIntegration.BlogDetails;
|
||||
import org.alfresco.repo.blogIntegration.BlogIntegrationRuntimeException;
|
||||
import org.alfresco.repo.blogIntegration.BlogIntegrationService;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.BrowseBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
|
||||
|
||||
/**
|
||||
* Blog details action listener
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class BlogActionListener implements BlogIntegrationModel
|
||||
{
|
||||
/** The service registry */
|
||||
private ServiceRegistry services;
|
||||
|
||||
/** The blog service */
|
||||
private BlogIntegrationService blogIntegrationService;
|
||||
|
||||
/**
|
||||
* Set the service registry
|
||||
*
|
||||
* @param services the service registry
|
||||
*/
|
||||
public void setServiceRegistry(ServiceRegistry services)
|
||||
{
|
||||
this.services = services;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the blog integration service
|
||||
*
|
||||
* @param blogIntegrationService the blog integration service
|
||||
*/
|
||||
public void setBlogIntegrationService(BlogIntegrationService blogIntegrationService)
|
||||
{
|
||||
this.blogIntegrationService = blogIntegrationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Listener's execute method
|
||||
*/
|
||||
public void executeScript(ActionEvent event)
|
||||
{
|
||||
// Get the script to be executed
|
||||
UIActionLink link = (UIActionLink)event.getComponent();
|
||||
Map<String, String> params = link.getParameterMap();
|
||||
|
||||
// Get the action
|
||||
String action = params.get("action");
|
||||
|
||||
String id = params.get("id");
|
||||
NodeRef documentNodeRef = new NodeRef(Repository.getStoreRef(), id);
|
||||
if ("post".equals(action) == true)
|
||||
{
|
||||
QName type = this.services.getNodeService().getType(documentNodeRef);
|
||||
if (this.services.getDictionaryService().isSubClass(type, ContentModel.TYPE_CONTENT) == true)
|
||||
{
|
||||
List<BlogDetails> list = this.blogIntegrationService.getBlogDetails(documentNodeRef);
|
||||
if (list.size() != 0)
|
||||
{
|
||||
// Take the 'nearest' blog details
|
||||
BlogDetails blogDetails = list.get(0);
|
||||
this.blogIntegrationService.newPost(blogDetails, documentNodeRef, ContentModel.PROP_CONTENT, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ("update".equals(action) == true)
|
||||
{
|
||||
QName type = this.services.getNodeService().getType(documentNodeRef);
|
||||
if (this.services.getNodeService().hasAspect(documentNodeRef, ASPECT_BLOG_POST) == true &&
|
||||
this.services.getDictionaryService().isSubClass(type, ContentModel.TYPE_CONTENT) == true)
|
||||
{
|
||||
this.blogIntegrationService.updatePost(documentNodeRef, ContentModel.PROP_CONTENT, true);
|
||||
}
|
||||
}
|
||||
else if ("remove".equals(action) == true)
|
||||
{
|
||||
QName type = this.services.getNodeService().getType(documentNodeRef);
|
||||
if (this.services.getNodeService().hasAspect(documentNodeRef, ASPECT_BLOG_POST) == true &&
|
||||
this.services.getDictionaryService().isSubClass(type, ContentModel.TYPE_CONTENT) == true)
|
||||
{
|
||||
this.blogIntegrationService.deletePost(documentNodeRef);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BlogIntegrationRuntimeException("Invalid action has been specified '" + action + "'");
|
||||
}
|
||||
|
||||
// Refresh the document details
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
BrowseBean browseBean = (BrowseBean)FacesHelper.getManagedBean(context, "BrowseBean");
|
||||
browseBean.getDocument().reset();
|
||||
UIComponent comp = context.getViewRoot().findComponent("dialog:dialog-body:document-props");
|
||||
comp.getChildren().clear();
|
||||
|
||||
}
|
||||
}
|
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* 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.actions.blogIntegration;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.repo.blogIntegration.BlogIntegrationRuntimeException;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.BrowseBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
|
||||
|
||||
/**
|
||||
* Blog details action listener
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class BlogDetailsActionListener implements BlogIntegrationModel
|
||||
{
|
||||
/** The service registry */
|
||||
private ServiceRegistry services;
|
||||
|
||||
/**
|
||||
* Set the service registry
|
||||
*
|
||||
* @param services the service registry
|
||||
*/
|
||||
public void setServiceRegistry(ServiceRegistry services)
|
||||
{
|
||||
this.services = services;
|
||||
}
|
||||
|
||||
/**
|
||||
* Listener's execute method
|
||||
*/
|
||||
public void executeScript(ActionEvent event)
|
||||
{
|
||||
// Get the script to be executed
|
||||
UIActionLink link = (UIActionLink)event.getComponent();
|
||||
Map<String, String> params = link.getParameterMap();
|
||||
|
||||
String action = params.get("action");
|
||||
|
||||
String id = params.get("id");
|
||||
NodeRef documentNodeRef = new NodeRef(Repository.getStoreRef(), id);
|
||||
if ("add".equals(action) == true)
|
||||
{
|
||||
this.services.getNodeService().addAspect(documentNodeRef, ASPECT_BLOG_DETAILS, null);
|
||||
}
|
||||
else if ("remove".equals(action) == true)
|
||||
{
|
||||
this.services.getNodeService().removeAspect(documentNodeRef, ASPECT_BLOG_DETAILS);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BlogIntegrationRuntimeException("Invalid action has been specified '" + action + "'");
|
||||
}
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
BrowseBean browseBean = (BrowseBean)FacesHelper.getManagedBean(context, "BrowseBean");
|
||||
browseBean.getActionSpace().reset();
|
||||
UIComponent comp = context.getViewRoot().findComponent("dialog:dialog-body:document-props");
|
||||
comp.getChildren().clear();
|
||||
}
|
||||
}
|
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* 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.actions.blogIntegration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.component.UISelectItems;
|
||||
import javax.faces.component.UISelectOne;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import org.alfresco.repo.blogIntegration.BlogIntegrationImplementation;
|
||||
import org.alfresco.repo.blogIntegration.BlogIntegrationService;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.generator.BaseComponentGenerator;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.ui.repo.component.property.PropertySheetItem;
|
||||
import org.alfresco.web.ui.repo.component.property.UIPropertySheet;
|
||||
|
||||
/**
|
||||
* Blog selector generator.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class BlogSelectorGenerator extends BaseComponentGenerator
|
||||
{
|
||||
/** Node */
|
||||
protected Node node;
|
||||
|
||||
/** Blog integration service */
|
||||
BlogIntegrationService blogIntegrationService;
|
||||
|
||||
/**
|
||||
* Set the blog integration service
|
||||
*
|
||||
* @param blogIntegrationService the blog integration service
|
||||
*/
|
||||
public void setBlogIntegrationService(BlogIntegrationService blogIntegrationService)
|
||||
{
|
||||
this.blogIntegrationService = blogIntegrationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.generator.IComponentGenerator#generate(javax.faces.context.FacesContext, java.lang.String)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public UIComponent generate(FacesContext context, String id)
|
||||
{
|
||||
UIComponent component = context.getApplication().createComponent(UISelectOne.COMPONENT_TYPE);
|
||||
FacesHelper.setupComponentId(context, component, id);
|
||||
|
||||
// create the list of choices
|
||||
UISelectItems itemsComponent = (UISelectItems)context.getApplication().createComponent("javax.faces.SelectItems");
|
||||
|
||||
itemsComponent.setValue(getBlogItems());
|
||||
|
||||
// add the items as a child component
|
||||
component.getChildren().add(itemsComponent);
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the items to put in the drop down control using the blog integration service.
|
||||
*
|
||||
* @return SelectItem[] array of select items
|
||||
*/
|
||||
protected SelectItem[] getBlogItems()
|
||||
{
|
||||
List<BlogIntegrationImplementation> blogs = this.blogIntegrationService.getBlogIntegrationImplementations();
|
||||
SelectItem[] items = new SelectItem[blogs.size()];
|
||||
int index = 0;
|
||||
for (BlogIntegrationImplementation blog : blogs)
|
||||
{
|
||||
items[index] = new SelectItem(blog.getName(), blog.getDisplayName());
|
||||
index ++;
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.generator.BaseComponentGenerator#createComponent(javax.faces.context.FacesContext, org.alfresco.web.ui.repo.component.property.UIPropertySheet, org.alfresco.web.ui.repo.component.property.PropertySheetItem)
|
||||
*/
|
||||
@Override
|
||||
protected UIComponent createComponent(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item) {
|
||||
|
||||
this.node = propertySheet.getNode();
|
||||
|
||||
return super.createComponent(context, propertySheet, item);
|
||||
}
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* 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.actions.blogIntegration;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.blogIntegration.BlogIntegrationService;
|
||||
import org.alfresco.repo.blogIntegration.BlogIntegrationServiceImpl;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.web.action.evaluator.BaseActionEvaluator;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
|
||||
/**
|
||||
* Post blog evaluator
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class PostBlogEvaluator extends BaseActionEvaluator implements BlogIntegrationModel
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(Node node)
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
// Get the conten service and the blog integration service
|
||||
WebApplicationContext applicationContext = FacesContextUtils.getRequiredWebApplicationContext(FacesContext.getCurrentInstance());
|
||||
ContentService contentService = (ContentService)applicationContext.getBean("ContentService");
|
||||
BlogIntegrationService blogIntegrationService = (BlogIntegrationService)applicationContext.getBean("BlogIntegrationService");
|
||||
|
||||
// Check the mimetype of the content
|
||||
ContentReader contentReader = contentService.getReader(node.getNodeRef(), ContentModel.PROP_CONTENT);
|
||||
if (contentReader != null)
|
||||
{
|
||||
String mimetype = contentReader.getMimetype();
|
||||
if (node.hasAspect(ASPECT_BLOG_POST) == false &&
|
||||
BlogIntegrationServiceImpl.supportedMimetypes.contains(mimetype) == true &&
|
||||
blogIntegrationService.getBlogDetails(node.getNodeRef()).size() != 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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.actions.blogIntegration;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.web.action.evaluator.BaseActionEvaluator;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
|
||||
/**
|
||||
* Remove blog details evaluator
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class RemoveBlogDetailsEvaluator extends BaseActionEvaluator implements BlogIntegrationModel
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(Node node)
|
||||
{
|
||||
boolean result = false;
|
||||
if (node.hasAspect(ASPECT_BLOG_DETAILS) == true)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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.actions.blogIntegration;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.web.action.evaluator.BaseActionEvaluator;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
|
||||
/**
|
||||
* Update blog evaluator
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class UpdateBlogEvaluator extends BaseActionEvaluator implements BlogIntegrationModel
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(Node node)
|
||||
{
|
||||
boolean result = false;
|
||||
if (node.hasAspect(ASPECT_BLOG_POST) == true)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@@ -179,6 +179,10 @@ public class CreateDiscussionDialog extends CreateTopicDialog
|
||||
tx = Repository.getUserTransaction(context);
|
||||
tx.begin();
|
||||
|
||||
// remove this node from the breadcrumb if required
|
||||
Node forumNode = this.navigator.getCurrentNode();
|
||||
this.browseBean.removeSpaceFromBreadcrumb(forumNode);
|
||||
|
||||
// remove the discussable aspect from the node we were going to discuss!
|
||||
// AWC-1519: removing the aspect that defines the child association now does the
|
||||
// cascade delete so we no longer have to delete the child explicitly
|
||||
@@ -186,10 +190,6 @@ public class CreateDiscussionDialog extends CreateTopicDialog
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
|
||||
// remove this node from the breadcrumb if required
|
||||
Node forumNode = this.navigator.getCurrentNode();
|
||||
this.browseBean.removeSpaceFromBreadcrumb(forumNode);
|
||||
|
||||
// clear action context
|
||||
this.browseBean.setActionSpace(null);
|
||||
|
@@ -64,20 +64,12 @@ public class DeleteForumDialog extends DeleteSpaceDialog
|
||||
{
|
||||
// find out what the parent type of the node being deleted
|
||||
Node node = this.browseBean.getActionSpace();
|
||||
NodeRef parent = null;
|
||||
ChildAssociationRef assoc = this.getNodeService().getPrimaryParent(node.getNodeRef());
|
||||
if (assoc != null)
|
||||
{
|
||||
// get the parent node
|
||||
NodeRef parent = assoc.getParentRef();
|
||||
|
||||
// get the association type
|
||||
QName type = assoc.getTypeQName();
|
||||
if (type.equals(ForumModel.ASSOC_DISCUSSION))
|
||||
{
|
||||
// if the association type is the 'discussion' association we
|
||||
// need to remove the discussable aspect from the parent node
|
||||
this.getNodeService().removeAspect(parent, ForumModel.ASPECT_DISCUSSABLE);
|
||||
}
|
||||
parent = assoc.getParentRef();
|
||||
|
||||
// if the parent type is a forum space then we need the dialog to go
|
||||
// back to the forums view otherwise it will use the default of 'browse',
|
||||
@@ -89,7 +81,23 @@ public class DeleteForumDialog extends DeleteSpaceDialog
|
||||
}
|
||||
}
|
||||
|
||||
return super.finishImpl(context, outcome);
|
||||
// delete the forum itself
|
||||
outcome = super.finishImpl(context, outcome);
|
||||
|
||||
// remove the discussable aspect if appropriate
|
||||
if (assoc != null && parent != null)
|
||||
{
|
||||
// get the association type
|
||||
QName type = assoc.getTypeQName();
|
||||
if (type.equals(ForumModel.ASSOC_DISCUSSION))
|
||||
{
|
||||
// if the association type is the 'discussion' association we
|
||||
// need to remove the discussable aspect from the parent node
|
||||
this.getNodeService().removeAspect(parent, ForumModel.ASPECT_DISCUSSABLE);
|
||||
}
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user