如何将google docs与alfresco社区4.0集成?

时间:2017-04-28 08:46:31

标签: authentication alfresco google-docs alfresco-webscripts

我找到了一些启用谷歌文档的配置

我在alfresco-global.properties

中添加了这些属性
googledocs.googleeditable.enabled = true 
googledocs.username =*******@gmail.com
googledocs.password =*************

在share-config中我添加了代码并添加了方面<aspect name="gd:googleEditable"/>

<!-- Google Docs™ integration -->

<google-docs>

    <enabled>true</enabled>

    <creatable-types>

    <creatable type="doc">application/msword</creatable>

   <creatable type="xls">application/vnd.ms-excel</creatable>

   <creatable type="ppt">application/vnd.ms-powerpoint</creatable>

   </creatable-types>

</google-docs>

我能够在google docs中看到CheckOut 但它不起作用 enter image description here

但是点击这个我收到错误

2017-04-28 13:20:27,867  DEBUG [repo.googledocs.GoogleDocsServiceImpl] [http-8086-7] Creating folder SpacesStore
 2017-04-28 13:20:28,104  DEBUG [repo.googledocs.GoogleDocsServiceImpl] [http-8086-7] Setting user credentials for GDoc service. (serviceName=writely, userName=**************@gmail.com, password=***************)
 2017-04-28 13:20:28,891  ERROR [extensions.webscripts.AbstractRuntime] [http-8086-7] Exception from executeScript - redirecting to status template error: 03280002 JavaException: org.alfresco.repo.googledocs.GoogleDocsServiceInitException: 03280008 Unable to connect to Google Docs.  Please check the Google Docs authentication configuration.
 org.springframework.extensions.webscripts.WebScriptException: 03280002 JavaException: org.alfresco.repo.googledocs.GoogleDocsServiceInitException: 03280008 Unable to connect to Google Docs.  Please check the Google Docs authentication configuration.
    at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:956)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
    at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:400)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:462)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.alfresco.repo.googledocs.GoogleDocsServiceInitException: 03280008 Unable to connect to Google Docs.  Please check the Google Docs authentication configuration.
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getMediaService(GoogleDocsServiceImpl.java:223)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getDocumentService(GoogleDocsServiceImpl.java:177)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.createGoogleFolder(GoogleDocsServiceImpl.java:1039)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getParentFolder(GoogleDocsServiceImpl.java:620)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getParentFolder(GoogleDocsServiceImpl.java:605)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getParentFolder(GoogleDocsServiceImpl.java:605)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getParentFolder(GoogleDocsServiceImpl.java:605)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getParentFolder(GoogleDocsServiceImpl.java:605)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.createGoogleDoc(GoogleDocsServiceImpl.java:438)
    at org.alfresco.repo.googledocs.GoogleEditableAspect.onCheckOut(GoogleEditableAspect.java:175)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.alfresco.repo.policy.JavaBehaviour$JavaMethodInvocationHandler.invoke(JavaBehaviour.java:173)
    at $Proxy103.onCheckOut(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.alfresco.repo.policy.TransactionInvocationHandlerFactory$TransactionHandler.invoke(TransactionInvocationHandlerFactory.java:128)
    at $Proxy103.onCheckOut(Unknown Source)
    at org.alfresco.repo.coci.CheckOutCheckInServiceImpl.invokeOnCheckOut(CheckOutCheckInServiceImpl.java:263)
    at org.alfresco.repo.coci.CheckOutCheckInServiceImpl.doCheckout(CheckOutCheckInServiceImpl.java:473)
    at org.alfresco.repo.coci.CheckOutCheckInServiceImpl.checkout(CheckOutCheckInServiceImpl.java:380)
    at org.alfresco.repo.coci.CheckOutCheckInServiceImpl.checkout(CheckOutCheckInServiceImpl.java:355)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy51.checkout(Unknown Source)
    at org.alfresco.repo.jscript.ScriptNode.checkout(ScriptNode.java:2283)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
    at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
    at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
    at org.mozilla.javascript.gen.c12._c18(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js:914)
    at org.mozilla.javascript.gen.c12.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
    at org.mozilla.javascript.gen.c12._c12(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js:618)
    at org.mozilla.javascript.gen.c12.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
    at org.mozilla.javascript.gen.c12._c0(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js:951)
    at org.mozilla.javascript.gen.c12.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
    at org.mozilla.javascript.gen.c12.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js)
    at org.mozilla.javascript.gen.c12.exec(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/checkout.post.json.js)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:483)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:191)
    at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)
    at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)
    at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
    at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1193)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
    ... 25 more
Caused by: com.google.gdata.util.AuthenticationException: Error authenticating (check service name)
    at com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenFactory.java:628)
    at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFactory.java:500)
    at com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthTokenFactory.java:346)
    at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:362)
    at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:317)
    at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:301)
    at org.alfresco.repo.googledocs.GoogleDocsServiceImpl.getMediaService(GoogleDocsServiceImpl.java:218)
    ... 94 more

如何解决这个问题?

或者还有其他方法可以将Google文档与Alfresco Community 4.0集成 ??

1 个答案:

答案 0 :(得分:2)

根据您的错误:

Caused by: com.google.gdata.util.AuthenticationException: Error authenticating (check service name)

您的配置似乎使用旧的Google连接库(https://github.com/google/gdata-java-client/issues/451)。

setUserCredentials() uses ClientLogin, which has been deprecated since April 2012 and recently disabled. You will need to use OAuth instead.

您必须修改代码库并使用新的身份验证方法

祝你好运