<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.mule.modules</groupId>
    <artifactId>mule-module-yammer</artifactId>
    <packaging>mule-module</packaging>
    <name>Mule Yammer Connector</name>
    <version>2.1-SNAPSHOT</version>
    <description>
    
The Yammer Connector currently makes it possible to query different timelines 
available to a user, such as the public, friends or private timeline. For example:

    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:spring="http://www.springframework.org/schema/beans"
        xmlns:yammer="http://www.mulesoft.org/schema/mule/yammer"
        xmlns:json="http://www.mulesoft.org/schema/mule/json"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                              http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
                              http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/3.1/mule-json.xsd
                              http://www.mulesoft.org/schema/mule/yammer http://www.mulesoft.org/schema/mule/yammer/1.0-SNAPSHOT/mule-yammer.xsd"&gt;
                              
        &lt;yammer:config consumerKey="${consumer.key}" consumerSecret="${consumer.secret}"/&gt;
        
        &lt;flow name="YammerTest"&gt;
            &lt;inbound-endpoint address="http://localhost:9002/get-statuses"/&gt;
            &lt;response&gt;
                &lt;json:object-to-json-transformer/&gt;
            &lt;/response&gt;
            &lt;yammer:get-messages/&gt;
        &lt;/flow&gt;
        ....
        
Authenticating with OAuth
-------------------------
With OAuth 1.0, you must do a two step process to authenticate the connector. 
First, request authorization from Yammer. Then, submit the OAuth verifier code back 
to the connector.

You'll need to set up the following two flows to do this:

    &lt;flow name="request-authorization"&gt;
        &lt;inbound-endpoint address="http://localhost:9002/yammer/request-authorization"/&gt;
        &lt;yammer:request-authorization/&gt;
        &lt;message-properties-transformer&gt;
            &lt;add-message-property key="http.status" value="302"/&gt;
            &lt;add-message-property key="Location" value="#[payload]"/&gt;
        &lt;/message-properties-transformer&gt;
    &lt;/flow&gt;
    
    &lt;flow name="set-oauth-verifier"&gt;
        &lt;inbound-endpoint address="http://localhost:9002/yammer/set-oauth-verifier"/&gt;
        &lt;logger /&gt;
        &lt;yammer:set-oauth-verifier oauthVerifier="#[header:inbound:verifier]"/&gt;
    &lt;/flow&gt;
    
The first flow will redirect you to the Yammer authorization page once the connector has
requested an authentication token. The second flow will allow you to set the OAuth verifier code.

To authenticate your connector, do the following:

- [Create a Yammer account](http://yammer.com)
- [Register your application](https://www.yammer.com/client_applications/new) with Yammer  
- Set your OAuth consumer key and secret on your config element as shown above
- Go to http://localhost:9002/yammer/request-authorization in your browser
- You will be redirected to the Yammer authorization page. Click Authorize.
- Take the resulting OAuth verifier code and go to http://localhost:9002/yammer/set-oauth-verifier?verifier=OAUTH_VERIFIER in your browser.
- Your access token and secret will be logged to your application logs. You can use those to avoid future authentication setup by setting the accessToken and accessTokenSecret attributes on the connector.

    </description>
    <url>http://www.muleforge.org/projects/yammer-connector</url>

  <properties>
    <mule.version>3.2.0</mule.version>
    <mule.devkit.version>3.0-SNAPSHOT</mule.devkit.version>
    <mule.dsl.version>0.7</mule.dsl.version>
    <junit.version>4.8.2</junit.version>
    <mockito.version>1.8.2</mockito.version>
    <cxf.version>2.3.0</cxf.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
  </properties>



<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.mule.tools.devkit</groupId>
          <artifactId>mule-devkit-maven-plugin</artifactId>
          <version>${mule.devkit.version}</version>
          <extensions>true</extensions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
<!--      <plugin>-->
<!--        <groupId>org.codehaus.mojo</groupId>-->
<!--        <artifactId>axistools-maven-plugin</artifactId>-->
<!--        <version>1.4</version>-->
<!--        <configuration>-->
<!--          <sourceDirectory>src/main/resources</sourceDirectory>-->
<!--          <wsdlFiles>-->
<!--            <wsdlFile>AmazonFBAOutbound.wsdl</wsdlFile>-->
<!--            <wsdlFile>AmazonFBAInventory.wsdl</wsdlFile>-->
<!--            <wsdlFile>FBAInboundService.wsdl</wsdlFile>-->
<!--          </wsdlFiles>-->
<!--          -->
<!--            <packageSpace>org.mule.module.fws.api.internal</packageSpace>-->
<!--          -->
<!--        </configuration>-->
<!--        <executions>-->
<!--          <execution>-->
<!--            <goals>-->
<!--              <goal>wsdl2java</goal>-->
<!--            </goals>-->
<!--          </execution>-->
<!--        </executions>-->
<!--      </plugin>-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <executions>
          <execution>
            <id>default-compile</id>
            <configuration>
              <compilerArgument>-proc:none</compilerArgument>
              <source>1.6</source>
              <target>1.6</target>
            </configuration>
          </execution>
          <execution>
            <id>default-testCompile</id>
            <configuration>
              <compilerArgument>-proc:none</compilerArgument>
              <source>1.6</source>
              <target>1.6</target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.mule.tools.devkit</groupId>
        <artifactId>mule-devkit-maven-plugin</artifactId>
        <version>${mule.devkit.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <docletArtifact>
            <groupId>org.mule.tools.devkit</groupId>
            <artifactId>mule-devkit-doclet</artifactId>
            <version>${mule.devkit.version}</version>
          </docletArtifact>
          <doclet>org.mule.devkit.doclet.Doclava</doclet>
          <bootclasspath>${sun.boot.class.path}</bootclasspath>
          <additionalparam>
            <!--
              -federate JDK
              http://download.oracle.com/javase/6/docs/api/index.html?
              -federationxml JDK
              http://doclava.googlecode.com/svn/static/api/openjdk-6.xml
            -->
            -hdf project.artifactId "${project.artifactId}"
            -hdf
            project.groupId "${project.groupId}"
            -hdf project.version
            "${project.version}"
            -hdf project.name "${project.name}"
            -hdf
            project.repo.name
            "${project.distributionManagement.repository.name}"
            -hdf
            project.repo.id
            "${project.distributionManagement.repository.id}"
            -hdf
            project.repo.url
            "${project.distributionManagement.repository.url}"
            -hdf
            project.snapshotRepo.name
            "${project.distributionManagement.snapshotRepository.name}"
            -hdf project.snapshotRepo.id
            "${project.distributionManagement.snapshotRepository.id}"
            -hdf project.snapshotRepo.url
            "${project.distributionManagement.snapshotRepository.url}"
            -d ${project.build.directory}/apidocs
            -htmldir ${basedir}/doc
          </additionalparam>
          <useStandardDocletOptions>false</useStandardDocletOptions>
          <additionalJOption>-J-Xmx1024m</additionalJOption>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <pushChanges>false</pushChanges>
        </configuration>
        <version>2.2.1</version>
      </plugin>
      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <version>1.8.0</version>
        <configuration>
          <header>LICENSE_HEADER.txt</header>
          <excludes>
            <exclude>target/**</exclude>
            <exclude>src/main/java/com/sforce/**</exclude>
            <exclude>.gitignore</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>**/*.ftl</exclude>
            <exclude>**/build-number.txt</exclude> <!-- bamboo -->
          </excludes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <filtering>false</filtering>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <filtering>true</filtering>
        <directory>src/test/resources</directory>
      </resource>
    </resources>
  </build>


  <!-- plugins for creating site reports -->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.6</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <targetJdk>${jdk.version}</targetJdk>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.4</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <tags>
            <tag>TODO</tag>
            <tag>@todo</tag>
            <tag>FIXME</tag>
            <tag>@fixme</tag>
            <tag>@deprecated</tag>
          </tags>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <source>${jdk.version}</source>
          <links>
            <link>http://java.sun.com/j2ee/1.4/docs/api</link>
            <link>http://java.sun.com/j2se/1.4.2/docs/api</link>
            <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
          </links>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jdepend-maven-plugin</artifactId>
        <version>2.0-beta-2</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>2.3.1</version>
      </plugin>
    </plugins>
  </reporting>
  
  
  
  <dependencies>
    <!-- Mule Dependencies -->
    <dependency>
      <groupId>org.mule.modules</groupId>
      <artifactId>mule-module-spring-config</artifactId>
      <version>${mule.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.mule.dsl</groupId>
      <artifactId>dsl-api</artifactId>
      <version>0.7</version>
    </dependency>
    <dependency>
      <groupId>org.mule.transports</groupId>
      <artifactId>mule-transport-axis</artifactId>
      <version>${mule.version}</version>
    </dependency>





    <!-- Validation -->
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>1.0.0.GA</version>
    </dependency>




    <!-- for testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mule.tests</groupId>
      <artifactId>mule-tests-functional</artifactId>
      <version>${mule.version}</version>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mule.transports</groupId>
      <artifactId>mule-transport-vm</artifactId>
      <version>${mule.version}</version>
      <scope>test</scope>
    </dependency>

    <!--  Mule & Devkit -->
    <dependency>
      <groupId>org.mule.modules</groupId>
      <artifactId>mule-module-spring-config</artifactId>
      <version>${mule.version}</version>
    </dependency>
    <dependency>
      <groupId>org.mule.tools.devkit</groupId>
      <artifactId>mule-devkit-annotations</artifactId>
      <version>${mule.devkit.version}</version>
    </dependency>
    
    <!-- Jersey -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-jersey</artifactId>
            <version>${mule.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
            <version>1.6</version>
        </dependency>
         <dependency>
            <groupId>com.sun.jersey.oauth</groupId>
            <artifactId>oauth-client</artifactId>
            <version>1.1.1-ea</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.oauth</groupId>
            <artifactId>oauth-signature</artifactId>
            <version>1.1.1-ea</version>
        </dependency>
        
        
        <!-- Json -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-json</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- ???? -->
                <dependency>
          <groupId>org.htmlparser</groupId>
          <artifactId>htmlparser</artifactId>
          <version>1.6</version>
          <type>jar</type>
          <scope>compile</scope>
        </dependency>

  </dependencies>
  
       



    <scm>
        <connection>scm:git:git://github.com:mulesoft/yammer-connector.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/yammer-connector.git</developerConnection>
        <url>http://github.com/mulesoft/yammer-connector</url>
    </scm>
  
    <repositories>
    <repository>
      <id>muleforge-releases</id>
      <name>MuleForge Releases Repository</name>
      <url>http://repository.mulesoft.org/releases/</url>
      <layout>default</layout>
    </repository>
    <repository>
      <id>muleforge-snapshots</id>
      <name>MuleForge Snapshots Repository</name>
      <url>http://repository.mulesoft.org/snapshots/</url>
      <layout>default</layout>
    </repository>
        <repository>
            <id>codehaus-repo</id>
            <name>MuleForge Release Repository</name>
            <url>http://repository.codehaus.org/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>codehaus-mule-repo</id>
            <name>Codehaus Repository</name>
            <url>http://dist.codehaus.org/mule/dependencies/maven2</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>dev.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>http://download.java.net/maven/2/</url>
        </repository>
    </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>muleforge-plugin-releases</id>
      <name>Muleforge Release Repository</name>
      <url>http://repository.mulesoft.org/releases/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>muleforge-plugin-snapshots</id>
      <name>Muleforge Snapshot Repository</name>
      <url>http://repository.mulesoft.org/snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
   <distributionManagement>
    <repository>
      <id>mulesoft-releases</id>
      <name>MuleSoft Snapshot Repository</name>
      <url>http://repository.mulesoft.org/releases/</url>
    </repository>
    <snapshotRepository>
      <id>mulesoft-snapshots</id>
      <name>MuleSoft Repository</name>
      <url>http://repository.mulesoft.org/snapshots/</url>
      <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
  </distributionManagement>
</project>
