Google任务/日历

时间:2013-05-03 13:48:24

标签: mule mule-studio

我正在玩Google任务连接器并最终出现以下错误

The content of element 'google-tasks:config-with-oauth' is not complete. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/google-tasks":oauth-callback-config}' is expected.

这是我的配置

 <google-tasks:config-with-oauth name="Google_Tasks"
 consumerKey="sagitec.mygbiz.com"
 consumerSecret="oeX9wb_GhldQJYjHKLDqC-EB" doc:name="Google Tasks"/>
     <flow name="google_taskFlow1" doc:name="google_taskFlow1">
         <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
         <google-tasks:authorize config-ref="Google_Tasks" accessTokenUrl="https://accounts.google.com/o/oauth2/token"
 authorizationUrl="https://accounts.google.com/o/oauth2/auth"
 access_type="online" force_prompt="auto" doc:name="Google Tasks"/>
         <logger level="INFO" doc:name="Logger" message="#[payload]"/> </flow>

如果我在google-tasks:config-with-oauth的Oauth选项卡下的Domain(指定为可选)中输入“localhost”,我没有收到任何构建错误。

所以我的第一个问题是,我必须在Domain下输入什么值,以及我可以从哪里获得它。

2)Consumer Key / Secret和ClientKey / secret之间有什么区别。

3)在其中一个样本中,我看到${google.apiKey}。这是什么,如果这是一个变量,wgere以及如何声明它。

如果提供任何样品,那将非常好。

提前致谢, 卡纳安

1 个答案:

答案 0 :(得分:0)

这里我添加了使用谷歌连接器进行谷歌日历认证的示例示例

你的

客户ID&gt;&gt; consumerKey

客户机密钥&gt;&gt; consumerSecret

$ {google.apiKey}&gt;&gt;您的全球Google日历配置名称,即name =&#34; Google_Calendars&#34;在下面的流程

<?xml version="1.0" encoding="UTF-8"?>

    <mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-   mapper" xmlns:json="http://www.mulesoft.org/schema/mule/json"
    xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
    xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
    xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:google-calendars="http://www.mulesoft.org/schema/mule/google-calendars"
    xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/google-calendars http://www.mulesoft.org/schema/mule/google-calendars/1.0/mule-google-calendars.xsd
http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/1.0/mule-objectstore.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">

    <google-calendars:config-with-oauth
        name="Google_Calendars"
        consumerKey="${consumer-key}"
        consumerSecret="${consumer-secret}" doc:name="Google Calendars"
        applicationName="test">
        <google-calendars:oauth-callback-config
            domain="localhost" localPort="8083" path="list"
            remotePort="8083"  />
        <google-calendars:oauth-store-config objectStore-ref="ObjectStoreBean" />
    </google-calendars:config-with-oauth>


    <spring:beans>
        <spring:bean id="ObjectStoreBean" name="ObjectStoreBean"
            class="org.mule.util.store.SimpleMemoryObjectStore" />
    </spring:beans>
    <flow name="authorizationAndAuthenticationFlow" doc:name="authorizationAndAuthenticationFlow">
        <http:inbound-endpoint host="localhost" port="8080"
            path="oauth-authorize" doc:name="HTTP" />
        <google-calendars:authorize config-ref="Google_Calendars"
            doc:name="Google Calendars" />
        <http:response-builder status="200"
            doc:name="HTTP Response Builder">
            <set-payload value="You have successfully authorized the connector" />
        </http:response-builder>
        <catch-exception-strategy doc:name="Catch Exception Strategy">
            <http:response-builder status="404"
                doc:name="HTTP Response Builder">
                <set-payload value="An error has occurred authorizing the connector" />
            </http:response-builder>
        </catch-exception-strategy>
    </flow>     

</mule>