mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.0 to HEAD
11360: Fixed MySQL upgrade path from pre-2.9: Copying the user usage data is now optional as the table might be missing. 11363: Merged V2.2 to V3.0 11320: Fixed ETWOTWO-747: Incorrect historical tables created during Oracle upgrade 11336: Upgrade script optimizations 11340: Fix for ETWOTWO-752: Expired content task shows all items in the web project 11362: Fixed ETHREEOH-402: Error while attempting to set node DB ID and other unsettable properties 11367: Removed old blog detritus git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12423 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<value>classpath:alfresco/web-client-config-wcm.xml</value>
|
||||
<value>classpath:alfresco/web-client-config-actions.xml</value>
|
||||
<value>classpath:alfresco/web-client-config-forum-actions.xml</value>
|
||||
<value>classpath:alfresco/web-client-config-blog-actions.xml</value>
|
||||
|
||||
<value>classpath:alfresco/web-client-config-wcm-actions.xml</value>
|
||||
<value>classpath:alfresco/web-client-config-workflow-actions.xml</value>
|
||||
<value>classpath:alfresco/extension/web-client-config-custom.xml</value>
|
||||
@@ -290,18 +290,6 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Blog Integration Action Listeners -->
|
||||
<bean id="BlogDetailsActionListener" class="org.alfresco.web.bean.actions.blogIntegration.BlogDetailsActionListener">
|
||||
<property name="serviceRegistry">
|
||||
<ref bean="ServiceRegistry"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="BlogActionListener" class="org.alfresco.web.bean.actions.blogIntegration.BlogActionListener">
|
||||
<property name="serviceRegistry" ref="ServiceRegistry"/>
|
||||
<property name="blogIntegrationService" ref="BlogIntegrationService"/>
|
||||
</bean>
|
||||
|
||||
<!-- ===================================== -->
|
||||
<!-- Web Script Beans -->
|
||||
<!-- ===================================== -->
|
||||
|
@@ -1129,9 +1129,6 @@
|
||||
<action idref="add_translation" />
|
||||
<action idref="add_translation_wc" />
|
||||
<action idref="ml_details" />
|
||||
<action idref="postBlog" />
|
||||
<action idref="updateBlog" />
|
||||
<action idref="removeBlog" />
|
||||
</action-group>
|
||||
|
||||
<action-group id="multilingual_details_actions">
|
||||
|
@@ -1,90 +0,0 @@
|
||||
<alfresco-config>
|
||||
|
||||
<config>
|
||||
<actions>
|
||||
<!-- Blog Integration Actions -->
|
||||
<action id="addBlogDetails">
|
||||
<permissions>
|
||||
<permission allow="true">Write</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.bean.actions.blogIntegration.AddBlogDetailsEvaluator</evaluator>
|
||||
<label>Add Blog Details</label>
|
||||
<image>/images/icons/edit_icon.gif</image>
|
||||
<action-listener>#{org_alfresco_module_blogIntegration_BlogDetailsActionListener.executeScript}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
<param name="action">add</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<action id="removeBlogDetails">
|
||||
<permissions>
|
||||
<permission allow="true">Write</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.bean.actions.blogIntegration.RemoveBlogDetailsEvaluator</evaluator>
|
||||
<label>Remove Blog Details</label>
|
||||
<image>/images/icons/edit_icon.gif</image>
|
||||
<action-listener>#{org_alfresco_module_blogIntegration_BlogDetailsActionListener.executeScript}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
<param name="action">remove</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<action id="postBlog">
|
||||
<permissions>
|
||||
<permission allow="true">Write</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.bean.actions.blogIntegration.PostBlogEvaluator</evaluator>
|
||||
<label>Post To Blog</label>
|
||||
<image>/images/icons/edit_icon.gif</image>
|
||||
<action-listener>#{org_alfresco_module_blogIntegration_BlogActionListener.executeScript}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
<param name="action">post</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<action id="updateBlog">
|
||||
<permissions>
|
||||
<permission allow="true">Write</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.bean.actions.blogIntegration.UpdateBlogEvaluator</evaluator>
|
||||
<label>Update Blog Post</label>
|
||||
<image>/images/icons/edit_icon.gif</image>
|
||||
<action-listener>#{org_alfresco_module_blogIntegration_BlogActionListener.executeScript}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
<param name="action">update</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<action id="removeBlog">
|
||||
<permissions>
|
||||
<permission allow="true">Write</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.bean.actions.blogIntegration.UpdateBlogEvaluator</evaluator>
|
||||
<label>Remove Blog Post</label>
|
||||
<image>/images/icons/edit_icon.gif</image>
|
||||
<action-listener>#{org_alfresco_module_blogIntegration_BlogActionListener.executeScript}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
<param name="action">remove</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<action-group id="space_details_actions">
|
||||
<action idref="addBlogDetails" />
|
||||
<action idref="removeBlogDetails" />
|
||||
</action-group>
|
||||
|
||||
<action-group id="doc_details_actions">
|
||||
<action idref="postBlog" />
|
||||
<action idref="updateBlog" />
|
||||
<action idref="removeBlog" />
|
||||
</action-group>
|
||||
|
||||
</actions>
|
||||
</config>
|
||||
|
||||
</alfresco-config>
|
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user