mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
76635: Merged EOL2 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 76545: ACE-2016: EOL Google Docs v1 in 5.0 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77670 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
<#include "../slingshot-common.lib.ftl">
|
||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||
<title>File checked in from Google Docs: ${htmlTitle?xml}</title>
|
||||
<link rel="alternate" type="text/html" href="" />
|
||||
<id>http://www.alfresco.org/rss/atom/${id}</id>
|
||||
<updated>${xmldate(date)}</updated>
|
||||
<summary type="html">
|
||||
<![CDATA["${htmlTitle}" document checked in from Google Docs by ${userName?html}.]]>
|
||||
</summary>
|
||||
<author>
|
||||
<name>${userName?xml}</name>
|
||||
<uri>${userId?xml}</uri>
|
||||
</author>
|
||||
</entry>
|
@@ -1,14 +0,0 @@
|
||||
<#include "../slingshot-common.lib.ftl">
|
||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||
<title>File checked out to Google Docs: ${htmlTitle?xml}</title>
|
||||
<link rel="alternate" type="text/html" href="" />
|
||||
<id>http://www.alfresco.org/rss/atom/${id}</id>
|
||||
<updated>${xmldate(date)}</updated>
|
||||
<summary type="html">
|
||||
<![CDATA["${htmlTitle}" document checked out to Google Docs by ${userName?html}.]]>
|
||||
</summary>
|
||||
<author>
|
||||
<name>${userName?xml}</name>
|
||||
<uri>${userId?xml}</uri>
|
||||
</author>
|
||||
</entry>
|
@@ -1,10 +0,0 @@
|
||||
<webscript>
|
||||
<shortname>Get GoogleDocs Integration Status Information</shortname>
|
||||
<description>
|
||||
Get information about the GoogleDocs integration current status.
|
||||
</description>
|
||||
<url>/api/googledocs/status</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction allow="readonly">required</transaction>
|
||||
</webscript>
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"data" :
|
||||
{
|
||||
"enabled" : ${enabled?string}
|
||||
}
|
||||
}
|
@@ -70,13 +70,6 @@ var Evaluator =
|
||||
{
|
||||
workingCopy["workingCopyVersion"] = wcNode.properties["cm:versionLabel"];
|
||||
}
|
||||
|
||||
// Google Doc?
|
||||
if (node.hasAspect("{http://www.alfresco.org/model/googledocs/1.0}googleResource"))
|
||||
{
|
||||
// Property is duplicated here for convenience
|
||||
workingCopy["googleDocUrl"] = node.properties["gd:url"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -89,15 +82,6 @@ var Evaluator =
|
||||
var srcNode = node.assocs["cm:workingcopylink"][0];
|
||||
workingCopy["hasWorkingCopy"] = true;
|
||||
workingCopy["workingCopyNodeRef"] = srcNode.nodeRef;
|
||||
|
||||
if (srcNode.hasPermission("Read"))
|
||||
{
|
||||
// Google Doc?
|
||||
if (srcNode.hasAspect("{http://www.alfresco.org/model/googledocs/1.0}googleResource"))
|
||||
{
|
||||
workingCopy["googleDocUrl"] = srcNode.properties["gd:url"];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -85,8 +85,6 @@ function postActivity()
|
||||
case "file-previewed":
|
||||
case "file-downloaded":
|
||||
case "folder-liked":
|
||||
case "google-docs-checkout":
|
||||
case "google-docs-checkin":
|
||||
case "inline-edit":
|
||||
data.title = json.get("fileName");
|
||||
data.nodeRef = nodeRef;
|
||||
|
@@ -175,23 +175,6 @@ var Evaluator =
|
||||
}
|
||||
permissions["view-original"] = true;
|
||||
|
||||
// Google Doc?
|
||||
if (node.hasAspect("{http://www.alfresco.org/model/googledocs/1.0}googleResource"))
|
||||
{
|
||||
custom["googleDocUrl"] = node.properties["gd:url"];
|
||||
permissions["view-google-doc"] = true;
|
||||
if (lockOwnerUser == person.properties.userName)
|
||||
{
|
||||
permissions["checkin-from-google"] = true;
|
||||
wcStatus = "google-docs-owner";
|
||||
actionSet = "googleDocOwner";
|
||||
}
|
||||
else
|
||||
{
|
||||
wcStatus = "google-docs-locked " + lockedBy.displayName + "|" + lockedBy.userName;
|
||||
actionSet = "googleDocLocked";
|
||||
}
|
||||
}
|
||||
status[wcStatus] = true;
|
||||
}
|
||||
// Locked?
|
||||
@@ -216,24 +199,6 @@ var Evaluator =
|
||||
custom["hasWorkingCopy"] = true;
|
||||
custom["workingCopyNode"] = srcNode.nodeRef;
|
||||
permissions["view-working-copy"] = true;
|
||||
|
||||
// Google Doc?
|
||||
if (srcNode.hasAspect("{http://www.alfresco.org/model/googledocs/1.0}googleResource"))
|
||||
{
|
||||
custom["googleDocUrl"] = srcNode.properties["gd:url"];
|
||||
permissions["view-google-doc"] = true;
|
||||
if (lockOwnerUser == person.properties.userName)
|
||||
{
|
||||
permissions["checkin-from-google"] = true;
|
||||
lockStatus = "google-docs-owner";
|
||||
actionSet = "googleDocOwner";
|
||||
}
|
||||
else
|
||||
{
|
||||
lockStatus = "google-docs-locked " + lockedBy.displayName + "|" + lockedBy.userName;
|
||||
actionSet = "googleDocLocked";
|
||||
}
|
||||
}
|
||||
}
|
||||
status[lockStatus] = true;
|
||||
}
|
||||
@@ -243,12 +208,6 @@ var Evaluator =
|
||||
{
|
||||
permissions["inline-edit"] = true;
|
||||
}
|
||||
|
||||
// Google Docs editable aspect?
|
||||
if (node.hasAspect("{http://www.alfresco.org/model/googledocs/1.0}googleEditable"))
|
||||
{
|
||||
permissions["googledocs-edit"] = true;
|
||||
}
|
||||
|
||||
/* Transferred Nodes */
|
||||
if (node.hasAspect("trx:transferred"))
|
||||
|
@@ -1439,12 +1439,6 @@
|
||||
<property name="nodeLocatorService" ref="nodeLocatorService"/>
|
||||
</bean>
|
||||
|
||||
<!-- GoogleDocsV1 status API -->
|
||||
<bean id="webscript.org.alfresco.repository.googledocs.status.get"
|
||||
class="org.alfresco.repo.web.scripts.googledocs.Status"
|
||||
parent="webscript">
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- Links REST API -->
|
||||
|
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.web.scripts.googledocs;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.management.subsystems.ChildApplicationContextFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
/**
|
||||
* Google Doc service status web script implementation
|
||||
*/
|
||||
public class Status extends DeclarativeWebScript implements ApplicationContextAware
|
||||
{
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
{
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> executeImpl(WebScriptRequest req, org.springframework.extensions.webscripts.Status status, Cache cache)
|
||||
{
|
||||
Map<String, Object> model = new HashMap<String, Object>(1);
|
||||
try
|
||||
{
|
||||
ChildApplicationContextFactory subsystem = (ChildApplicationContextFactory)applicationContext.getBean("googledocs");
|
||||
|
||||
// note: getting property (rather than getting googleDocsService bean to check isEnabled) does not cause subsystem startup (if stopped)
|
||||
// hence providing ability for subsystem to be disabled (whilst still supporting ability to check status and/or dynamically start via JMX)
|
||||
String isEnabled = (String)subsystem.getProperty("googledocs.googleeditable.enabled");
|
||||
|
||||
model.put("enabled", isEnabled == null ? false : new Boolean(isEnabled).booleanValue());
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException nsbde)
|
||||
{
|
||||
model.put("enabled", false);
|
||||
}
|
||||
return model;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user