Giter Site home page Giter Site logo

trello-java-wrapper's Introduction

Java Wrapper for Trello API

Overview

This project is a Java Wrapper for the Trello REST API. It provides a fluent interface for requesting the API.

Usage

The library can be used with Java 11 or newer.

Available in Maven Central. Gradle dependency declaration:

dependencies {
    compile 'com.taskadapter:trello-java-wrapper:<current-version>'
}

The wrapper can make use of one of the following HTTP clients:

  • JDKTrelloHttpClient
    • pure JDK http client, no other dependencies
  • OKHttp
    • compile 'com.squareup.okhttp3:okhttp:VERSION'
  • Spring Web
    • compile 'org.springframework:spring-web:VERSION'
  • Apache Http Components HttpClient
    • compile 'org.apache.httpcomponents:httpclient:VERSION'
  • Async Http Client
    • compile 'org.asynchttpclient:async-http-client:VERSION'
  • Ning async-http-client
    • The predecessor to the modern Async Http Client above
    • compile 'com.ning:async-http-client:VERSION'

Choose one if you don't already use one of those. You will need to instantiate the corresponding TrelloHttpClient implementation and pass it to the TrelloImpl constructor (see Init section below).

Optional dependency in case you want to attach files to cards:

compile 'org.apache.httpcomponents:httpmime'

Failure to do so will most probably cause a NoClassDefFoundError.

Init

First, create an instance of TrelloImpl. This examples uses an http client based on Apache Http library.

Trello trelloApi = new TrelloImpl(trelloKey, trelloAccessToken, new ApacheHttpClient());
  • trelloKey : The key of your application
  • trelloAccessToken : the oauth token of the authenticated user on Trello
  • http client : one of supported http client implementations. See com.julienvey.trello.impl.http package.

Usage

Sample call:

Board board = trelloApi.getBoard(trelloBoardForAddingCardsId);

The wrapper provides a fluent interface. On each "Trello" Object, you have access to methods to fetch other object

Board board = trelloApi.getBoard(trelloBoardForAddingCardsId);
List<TList> lists = board.fetchLists();

which can also be written like this

List<TList> lists = trelloApi.getBoard(trelloBoardForAddingCardsId).fetchLists();

Contribute

Each pull request should respect current code conventions and provide tests for the newly implemented features. The new test code is implemented using Scala. The prod code is only Java - to avoid adding extra Scala dependency to the lib without providing much value (at the moment).

Implementation Status

Method Impl Unit Test Int Test
GET /1/actions/[idAction] Yes Yes Yes
GET /1/actions/[idAction]/[field]
GET /1/actions/[idAction]/board Yes Yes Yes
GET /1/actions/[idAction]/board/[field]
GET /1/actions/[idAction]/card Yes Yes Yes
GET /1/actions/[idAction]/card/[field]
GET /1/actions/[idAction]/entities Yes Yes Yes
GET /1/actions/[idAction]/list Yes Yes Yes
GET /1/actions/[idAction]/list/[field]
GET /1/actions/[idAction]/member Yes Yes Yes
GET /1/actions/[idAction]/member/[field]
GET /1/actions/[idAction]/memberCreator Yes Yes Yes
GET /1/actions/[idAction]/memberCreator/[field]
GET /1/actions/[idAction]/organization Yes Yes Yes
GET /1/actions/[idAction]/organization/[field]
PUT /1/actions/[idAction]
PUT /1/actions/[idAction]/text
DELETE /1/actions/[idAction]
GET /1/boards/[board_id] Yes Yes Yes
GET /1/boards/[board_id]/[field]
GET /1/boards/[board_id]/actions Yes Yes Yes
GET /1/boards/[board_id]/cards Yes Yes Yes
GET /1/boards/[board_id]/cards/[filter]
GET /1/boards/[board_id]/cards/[idCard] Yes Yes Yes
GET /1/boards/[board_id]/checklists Yes Yes Yes
GET /1/boards/[board_id]/labels Yes Yes Yes
GET /1/boards/[board_id]/lists Yes Yes Yes
GET /1/boards/[board_id]/lists/[filter]
GET /1/boards/[board_id]/members Yes Yes
GET /1/boards/[board_id]/members/[filter]
GET /1/boards/[board_id]/members/[idMember]/cards Yes Yes Yes
GET /1/boards/[board_id]/memberships
GET /1/boards/[board_id]/memberships/[idMembership]
GET /1/boards/[board_id]/myPrefs Yes Yes Yes
GET /1/boards/[board_id]/organization Yes Yes Yes
GET /1/boards/[board_id]/organization/[field]
PUT /1/boards/[board_id]
PUT /1/boards/[board_id]/closed
PUT /1/boards/[board_id]/desc
PUT /1/boards/[board_id]/idOrganization
PUT /1/boards/[board_id]/labelNames/blue
PUT /1/boards/[board_id]/labelNames/green
PUT /1/boards/[board_id]/labelNames/orange
PUT /1/boards/[board_id]/labelNames/purple
PUT /1/boards/[board_id]/labelNames/red
PUT /1/boards/[board_id]/labelNames/yellow
PUT /1/boards/[board_id]/members Yes No Yes
PUT /1/boards/[board_id]/members/[idMember] Yes No Yes
PUT /1/boards/[board_id]/memberships/[idMembership]
PUT /1/boards/[board_id]/myPrefs/emailPosition
PUT /1/boards/[board_id]/myPrefs/idEmailList
PUT /1/boards/[board_id]/myPrefs/showListGuide
PUT /1/boards/[board_id]/myPrefs/showSidebar
PUT /1/boards/[board_id]/myPrefs/showSidebarActivity
PUT /1/boards/[board_id]/myPrefs/showSidebarBoardActions
PUT /1/boards/[board_id]/myPrefs/showSidebarMembers
PUT /1/boards/[board_id]/name
PUT /1/boards/[board_id]/prefs/calendarFeedEnabled
PUT /1/boards/[board_id]/prefs/cardAging
PUT /1/boards/[board_id]/prefs/cardCovers
PUT /1/boards/[board_id]/prefs/comments
PUT /1/boards/[board_id]/prefs/invitations
PUT /1/boards/[board_id]/prefs/permissionLevel
PUT /1/boards/[board_id]/prefs/selfJoin
PUT /1/boards/[board_id]/prefs/voting
PUT /1/boards/[board_id]/subscribed
POST /1/boards
POST /1/boards/[board_id]/calendarKey/generate
POST /1/boards/[board_id]/checklists
POST /1/boards/[board_id]/emailKey/generate
POST /1/boards/[board_id]/lists
POST /1/boards/[board_id]/markAsViewed
POST /1/boards/[board_id]/powerUps
DELETE /1/boards/[board_id]/members/[idMember] Yes No Yes
DELETE /1/boards/[board_id]/powerUps/[powerUp]
GET /1/cards/[card id or shortlink] Yes Yes Yes
GET /1/cards/[card id or shortlink]/[field]
GET /1/cards/[card id or shortlink]/actions Yes Yes Yes
GET /1/cards/[card id or shortlink]/attachments Yes Yes Yes
GET /1/cards/[card id or shortlink]/attachments/[idAttachment] Yes Yes Yes
GET /1/cards/[card id or shortlink]/board Yes
GET /1/cards/[card id or shortlink]/board/[field]
GET /1/cards/[card id or shortlink]/checkItemStates
GET /1/cards/[card id or shortlink]/checklists Yes Yes Yes
GET /1/cards/[card id or shortlink]/list
GET /1/cards/[card id or shortlink]/list/[field]
GET /1/cards/[card id or shortlink]/members
GET /1/cards/[card id or shortlink]/membersVoted
PUT /1/cards/[card id or shortlink] Yes
PUT /1/cards/[card id or shortlink]/actions/[idAction]/comments Yes No Yes
PUT /1/cards/[card id or shortlink]/checklist/[idChecklist]/checkItem/[idCheckItem]/name
PUT /1/cards/[card id or shortlink]/checklist/[idChecklist]/checkItem/[idCheckItem]/pos
PUT /1/cards/[card id or shortlink]/checklist/[idChecklist]/checkItem/[idCheckItem]/state
PUT /1/cards/[card id or shortlink]/checklist/[idChecklistCurrent]/checkItem/[idCheckItem]
PUT /1/cards/[card id or shortlink]/closed
PUT /1/cards/[card id or shortlink]/desc
PUT /1/cards/[card id or shortlink]/due
PUT /1/cards/[card id or shortlink]/idAttachmentCover
PUT /1/cards/[card id or shortlink]/idBoard
PUT /1/cards/[card id or shortlink]/idList
PUT /1/cards/[card id or shortlink]/idMembers
PUT /1/cards/[card id or shortlink]/labels
PUT /1/cards/[card id or shortlink]/name
PUT /1/cards/[card id or shortlink]/pos
PUT /1/cards/[card id or shortlink]/subscribed
PUT /1/cards/[card id or shortlink]/warnWhenUpcoming
POST /1/cards Yes
POST /1/cards/[card id or shortlink]/actions/comments Yes No Yes
POST /1/cards/[card id or shortlink]/attachments Yes
(Except AsyncTrelloHttpClient)
No Yes
POST /1/cards/[card id or shortlink]/checklist/[idChecklist]/checkItem
POST /1/cards/[card id or shortlink]/checklist/[idChecklist]/checkItem/[idCheckItem]/convertToCard
POST /1/cards/[card id or shortlink]/checklists
POST /1/cards/[card id or shortlink]/idMembers Yes No Yes
POST /1/cards/[card id or shortlink]/labels Yes No Yes
POST /1/cards/[card id or shortlink]/idLabels Yes No Yes
POST /1/cards/[card id or shortlink]/markAssociatedNotificationsRead
POST /1/cards/[card id or shortlink]/membersVoted
DELETE /1/cards/[card id or shortlink] Yes No Yes
DELETE /1/cards/[card id or shortlink]/actions/[idAction]/comments
DELETE /1/cards/[card id or shortlink]/attachments/[idAttachment] Yes No Yes
DELETE /1/cards/[card id or shortlink]/checklist/[idChecklist]/checkItem/[idCheckItem]
DELETE /1/cards/[card id or shortlink]/checklists/[idChecklist]
DELETE /1/cards/[card id or shortlink]/idMembers/[idMember] Yes No Yes
DELETE /1/cards/[card id or shortlink]/labels/[color]
DELETE /1/cards/[card id or shortlink]/membersVoted/[idMember]
GET /1/checklists/[idChecklist] Yes Yes Yes
GET /1/checklists/[idChecklist]/[field]
GET /1/checklists/[idChecklist]/board
GET /1/checklists/[idChecklist]/board/[field]
GET /1/checklists/[idChecklist]/cards
GET /1/checklists/[idChecklist]/cards/[filter]
GET /1/checklists/[idChecklist]/checkItems
GET /1/checklists/[idChecklist]/checkItems/[idCheckItem]
PUT /1/checklists/[idChecklist]
PUT /1/checklists/[idChecklist]/idCard
PUT /1/checklists/[idChecklist]/name
PUT /1/checklists/[idChecklist]/pos
POST /1/checklists
POST /1/checklists/[idChecklist]/checkItems
DELETE /1/checklists/[idChecklist]
DELETE /1/checklists/[idChecklist]/checkItems/[idCheckItem]
GET /1/labels/[idLabel] Yes No Yes
PUT /1/labels/[idLabel] Yes No Yes
PUT /1/labels/[idLabel]/color
PUT /1/labels/[idLabel]/name
POST /1/labels/[idLabel] Yes No Yes
DELETE /1/labels/[idLabel] Yes No Yes
GET /1/lists/[idList] Yes Yes Yes
GET /1/lists/[idList]/[field]
GET /1/lists/[idList]/actions
GET /1/lists/[idList]/board
GET /1/lists/[idList]/board/[field]
GET /1/lists/[idList]/cards Yes Yes Yes
GET /1/lists/[idList]/cards/[filter]
PUT /1/lists/[idList]
PUT /1/lists/[idList]/closed
PUT /1/lists/[idList]/idBoard
PUT /1/lists/[idList]/name
PUT /1/lists/[idList]/pos
PUT /1/lists/[idList]/subscribed
POST /1/lists
POST /1/lists/[idList]/cards
GET /1/members/[idMember or username] Yes
GET /1/members/[idMember or username]/[field]
GET /1/members/[idMember or username]/actions Yes Yes Yes
GET /1/members/[idMember or username]/boards Yes Yes Yes
GET /1/members/[idMember or username]/boards/[filter]
GET /1/members/[idMember or username]/boardsInvited
GET /1/members/[idMember or username]/boardsInvited/[field]
GET /1/members/[idMember or username]/cards Yes No Yes
GET /1/members/[idMember or username]/cards/[filter]
GET /1/members/[idMember or username]/notifications
GET /1/members/[idMember or username]/notifications/[filter]
GET /1/members/[idMember or username]/organizations
GET /1/members/[idMember or username]/organizations/[filter]
GET /1/members/[idMember or username]/organizationsInvited
GET /1/members/[idMember or username]/organizationsInvited/[field]
GET /1/members/[idMember or username]/sessions
GET /1/members/[idMember or username]/tokens
PUT /1/members/[idMember or username]
PUT /1/members/[idMember or username]/avatarSource
PUT /1/members/[idMember or username]/bio
PUT /1/members/[idMember or username]/fullName
PUT /1/members/[idMember or username]/initials
PUT /1/members/[idMember or username]/prefs/colorBlind
PUT /1/members/[idMember or username]/prefs/minutesBetweenSummaries
PUT /1/members/[idMember or username]/username
POST /1/members/[idMember or username]/avatar
POST /1/members/[idMember or username]/idBoardsPinned
POST /1/members/[idMember or username]/oneTimeMessagesDismissed
DELETE /1/members/[idMember or username]/idBoardsPinned/[idBoard]
GET /1/notifications/[idNotification]
GET /1/notifications/[idNotification]/[field]
GET /1/notifications/[idNotification]/board
GET /1/notifications/[idNotification]/board/[field]
GET /1/notifications/[idNotification]/card
GET /1/notifications/[idNotification]/card/[field]
GET /1/notifications/[idNotification]/entities
GET /1/notifications/[idNotification]/list
GET /1/notifications/[idNotification]/list/[field]
GET /1/notifications/[idNotification]/member
GET /1/notifications/[idNotification]/member/[field]
GET /1/notifications/[idNotification]/memberCreator
GET /1/notifications/[idNotification]/memberCreator/[field]
GET /1/notifications/[idNotification]/organization
GET /1/notifications/[idNotification]/organization/[field]
PUT /1/notifications/[idNotification]
PUT /1/notifications/[idNotification]/unread
POST /1/notifications/all/read
GET /1/organizations/[idOrg or name] Yes Yes Yes
GET /1/organizations/[idOrg or name]/[field]
GET /1/organizations/[idOrg or name]/actions
GET /1/organizations/[idOrg or name]/boards Yes Yes Yes
GET /1/organizations/[idOrg or name]/boards/[filter]
GET /1/organizations/[idOrg or name]/members Yes Yes Yes
GET /1/organizations/[idOrg or name]/members/[filter]
GET /1/organizations/[idOrg or name]/members/[idMember]/cards
GET /1/organizations/[idOrg or name]/membersInvited
GET /1/organizations/[idOrg or name]/membersInvited/[field]
GET /1/organizations/[idOrg or name]/memberships
GET /1/organizations/[idOrg or name]/memberships/[idMembership]
PUT /1/organizations/[idOrg or name]
PUT /1/organizations/[idOrg or name]/desc
PUT /1/organizations/[idOrg or name]/displayName
PUT /1/organizations/[idOrg or name]/members
PUT /1/organizations/[idOrg or name]/members/[idMember]
PUT /1/organizations/[idOrg or name]/members/[idMember]/deactivated
PUT /1/organizations/[idOrg or name]/memberships/[idMembership]
PUT /1/organizations/[idOrg or name]/name
PUT /1/organizations/[idOrg or name]/prefs/associatedDomain
PUT /1/organizations/[idOrg or name]/prefs/boardVisibilityRestrict/org
PUT /1/organizations/[idOrg or name]/prefs/boardVisibilityRestrict/private
PUT /1/organizations/[idOrg or name]/prefs/boardVisibilityRestrict/public
PUT /1/organizations/[idOrg or name]/prefs/externalMembersDisabled
PUT /1/organizations/[idOrg or name]/prefs/orgInviteRestrict
PUT /1/organizations/[idOrg or name]/prefs/permissionLevel
PUT /1/organizations/[idOrg or name]/website
POST /1/organizations
POST /1/organizations/[idOrg or name]/logo
DELETE /1/organizations/[idOrg or name]
DELETE /1/organizations/[idOrg or name]/logo
DELETE /1/organizations/[idOrg or name]/members/[idMember]
DELETE /1/organizations/[idOrg or name]/members/[idMember]/all
DELETE /1/organizations/[idOrg or name]/prefs/associatedDomain
DELETE /1/organizations/[idOrg or name]/prefs/orgInviteRestrict
GET /1/search
GET /1/search/members
GET /1/tokens/[token]
GET /1/tokens/[token]/[field]
GET /1/tokens/[token]/member
GET /1/tokens/[token]/member/[field]
GET /1/tokens/[token]/webhooks
GET /1/tokens/[token]/webhooks/[idWebhook]
POST /1/tokens/[token]/webhooks
DELETE /1/tokens/[token]
DELETE /1/tokens/[token]/webhooks/[idWebhook]
GET /1/types/[id]
GET /1/webhooks/[idWebhook]
GET /1/webhooks/[idWebhook]/[field]
PUT /1/webhooks/[idWebhook]
PUT /1/webhooks/[idWebhook]/active
PUT /1/webhooks/[idWebhook]/callbackURL
PUT /1/webhooks/[idWebhook]/description
PUT /1/webhooks/[idWebhook]/idModel
POST /1/webhooks
DELETE /1/webhooks/[idWebhook]

trello-java-wrapper's People

Contributors

alecharp avatar alexey-twilio avatar alexeyongithub avatar benemon avatar clamey avatar edralzar avatar gusehr avatar haklop avatar julienvey avatar marshallpierce avatar mickaelponsolle avatar nilsga avatar nstdio avatar pesua avatar sephbain avatar simonbasle avatar ustitc avatar wallois-alexandre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trello-java-wrapper's Issues

Additional HTTP clients.

For enhancement I would like to suggest to provide 2 additional implementations for TrelloHttpClient.

First implementation would backed by OkHttp.

Second one is HttpURLConnection based implementation.

Now project includes org.springframework:spring-web:3.2.2.RELEASE compile dependency. After HttpURLConnection based implementation will be provided we can change heavy spring-web dependency to compileOnly and provide HttpURLConnection as a default implementation.

If you don't mind I'll provide PR for mentioned changes.

No suitable HttpMessageConverter

I can not execute any method due to below issue

Caused by: org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.julienvey.trello.domain.Board] and content type [application/json;charset=utf-8]

Is it known problem?

No save Labels on trelloApi.updateCard(itemCard);

Hi,

When I tried to do the follow statement:

trelloApi.updateCard(itemCard);

The card lost theirs Labels.

In my case, the object "itemCard" is coming from trelloApi.getBoardCards(idBoard) statement and all data is correct until I do the update.

Regards

Omar

client 400 error on "Create card" gives JsonParseException: "Unexpected character ('i' (code 105)): " for any client errors

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('i' (code 105)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: org.apache.http.conn.EofSensorInputStream@5e8a459; line: 1, column: 2]

this is thrown instead of a user-friendly error when creating a card with some fields filled out incorrectly

the actual error is:

invalid value for idList

found deep inside the parsing code using this hack in debugger:

new java.util.Scanner(((org.apache.http.conn.BasicManagedEntity) httpEntity).wrappedEntity.getContent()).useDelimiter("\\A").next()
)

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

Hello,
when trying to execute this code, I got this error message :
" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory"

what have I missed ?

Here is my test code :


import com.julienvey.trello.Trello;
import com.julienvey.trello.domain.Board;
import com.julienvey.trello.domain.TList;
import com.julienvey.trello.impl.TrelloImpl;
import com.julienvey.trello.impl.http.ApacheHttpClient;
import java.util.List;

public class TrelloRestInterface {
static String trelloKey = "66666";
static String trelloAccessToken="55555";


public TrelloRestInterface(TestEnv testEnv) {

    /*
    Properties props = System.getProperties();
    props.put("http.proxyHost", "server");
    props.put("http.proxyPort", "port");
    props.put("https.proxyHost", "server");
    props.put("https.proxyPort", "portHttps");
*/
    Trello trelloApi = new TrelloImpl(trelloKey, trelloAccessToken, new ApacheHttpClient());

    String trelloBoardForAddingCardsId = "t74KdgJM";
    Board board = trelloApi.getBoard(trelloBoardForAddingCardsId);

    List<TList> lists = board.fetchLists();
    System.out.println("Trello board\n"+board.getDesc()+"\n"+board.getName());

}

complete Exception trace :

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

at com.julienvey.trello.impl.TrelloImpl.(TrelloImpl.java:81)
at tests.base.TrelloRestInterface.(TrelloRestInterface.java:27)
at tests.base.TestBase.setUp(TestBase.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 32 more

my maven dependency :

>    <dependency>
>             <groupId>com.taskadapter</groupId>
>             <artifactId>trello-java-wrapper</artifactId>
>             <version>0.9</version>
>         </dependency>

Proxy setting

Please, I need to connect using proxy setting.

I used as follow, but it didn't work

	Properties props = System.getProperties();
	props.put("http.proxyHost", "server");
	props.put("http.proxyPort", "port");

The error is:

18:58:02.041 [main] DEBUG com.julienvey.trello.impl.TrelloImpl - Get request on Trello API at url https://api.trello.com/1/boards/{boardId}?key={applicationKey}&token={userToken} for class com.julienvey.trello.domain.Board with params [EDITED]
Exception in thread "main" com.julienvey.trello.exception.TrelloHttpException: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://api.trello.com/1/boards/EDITED?key=EDITED&token=EDITED":Connection timed out: connect; nested exception is java.net.ConnectException: Connection timed out: connect
	at com.julienvey.trello.impl.http.RestTemplateHttpClient.get(RestTemplateHttpClient.java:44)
	at com.julienvey.trello.impl.TrelloImpl.get(TrelloImpl.java:323)
	at com.julienvey.trello.impl.TrelloImpl.getBoard(TrelloImpl.java:40)
	at com.everis.ogmz.main.Principal.main(Principal.java:81)
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://api.trello.com/1/boards/EDITED?key=EDITED&token=EDITED":Connection timed out: connect; nested exception is java.net.ConnectException: Connection timed out: connect
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:498)
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:446)
	at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:214)
	at com.julienvey.trello.impl.http.RestTemplateHttpClient.get(RestTemplateHttpClient.java:42)
	... 3 more
Caused by: java.net.ConnectException: Connection timed out: connect
	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:656)
	at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
	at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76)
	at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:46)
	at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:49)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:483)
	... 6 more

Make a release?

Any chance you could cut a release? It'd be nice to have easy access to the changes since 0.7.

Be able to configure https.proxyHost when opening httpClient

Hello,
I does not achieve to use this API through my proxy.

Here is one try :

    HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
    HttpHost proxy = new HttpHost(testEnv.getProxyHost(), Integer.parseInt(testEnv.getProxyPort()), "http");
    httpClientBuilder.setProxy(proxy);
    org.apache.http.impl.client.CloseableHttpClient closeableClient = httpClientBuilder.build();
    
    httpClient = new com.julienvey.trello.impl.http.ApacheHttpClient(closeableClient);

    Trello trelloApi;
    trelloApi = new TrelloImpl(trelloKey, trelloAccessToken, httpClient);

I get error when instantiating "new com.julienvey.trello.impl.http.ApacheHttpClient(closeableClient);":

Error:(141, 70) java: incompatible types: org.apache.http.impl.client.CloseableHttpClient cannot be converted to org.apache.http.impl.client.DefaultHttpClient

Is there a way to use a CloseableHttpClient to declare new instance of TrelloImpl ?
Or perhaps is there a way to pass some proxy config to DefaultHttpClient ?

Request to release 0.15

Hello folks ๐Ÿ‘‹๐Ÿป
I am currently stumbling on the following error when invoking the getListCards() method:

com.fasterxml.jackson.databind.JsonMappingException: Numeric value (663355555077.0367) out of range of int (-2147483648 - 2147483647)
 at [Source: (String)"[{"id":"65369888efaa0e8bc170b036","badges":{"attachmentsByType":{"trello":{"board":0,"card":0}},"location":false,"votes":0,"viewingMemberVoted":false,"subscribed":false,"fogbugz":"","checkItems":0,"checkItemsChecked":0,"checkItemsEarliestDue":null,"comments":10,"attachments":0,"description":true,"due":"2023-11-09T16:00:00.000Z","dueComplete":true,"start":null},"checkItemStates":[],"closed":false,"dueComplete":true,"dateLastActivity":"2023-11-08T19:15:58.919Z","desc":"### Sua tarefa รฉ sobre:\n\nO"[truncated 5817 chars]; line: 1, column: 3308] (through reference chain: java.lang.Object[][1]->com.julienvey.trello.domain.Card["pos"])

And I see that the following fix has already been provided for this: Changing pos from int to long (#76).
Are there any plans to release version 0.15 with this fix? Happy to help if needed.
Thanks,
Rafael

Can't create a TList

I would like to create a list on a board.
Using trelloApi.createList(TList list) or board.addList(TList list).

3 integration tests in Scala folder are failing with non default HTTP clients.

If we are changing httpClient in the TrelloTestFactory to AsyncTrelloHttpClient, AsyncTrelloHttpClient2 or RestTemplateHttpClient 3 integration tests are failing with following output.

./gradlew clean build

> Task :compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning

> Task :compileTestScala
Pruning sources from previous analysis, due to incompatible CompileSetup.
warning: [options] bootstrap class path not set in conjunction with -source 1.7
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning

> Task :test

com.julienvey.trello.CardIt > create API gets user-friendly error when list id unknown FAILED
    org.scalatest.exceptions.TestFailedException at CardIt.scala:21
        Caused by: com.julienvey.trello.exception.TrelloHttpException at CardIt.scala:22
            Caused by: java.util.concurrent.ExecutionException at CardIt.scala:22
                Caused by: com.fasterxml.jackson.core.JsonParseException

com.julienvey.trello.CardIt > create API gets proper exception and a user-friendly error with valid but inaccessible List Id FAILED
    org.scalatest.exceptions.TestFailedException at CardIt.scala:28
        Caused by: com.julienvey.trello.exception.TrelloHttpException at CardIt.scala:32
            Caused by: java.util.concurrent.ExecutionException at CardIt.scala:32
                Caused by: com.fasterxml.jackson.core.JsonParseException

com.julienvey.trello.CardIt > update API gets user-friendly exception when updating a deleted card FAILED
    org.scalatest.exceptions.TestFailedException at CardIt.scala:59
        Caused by: com.julienvey.trello.exception.TrelloHttpException at CardIt.scala:64
            Caused by: java.util.concurrent.ExecutionException at CardIt.scala:64
                Caused by: com.fasterxml.jackson.core.JsonParseException

223 tests completed, 3 failed

As a solution for this kind of problems I could try to implement parametrized tests and integrate Travis for project.

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/NestedRuntimeException

Hi Guys, hi @haklop and @julienvey , I using Eclipse and m2e... I added trello-java-wrapper on maven then it uploaded every dependency and library into the path... I made a simple class that implement Trello interface, I instantiated my trelloKey and my trelloAccessToken, then I run this class but eclipse not compile it and generate this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/NestedRuntimeException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.julienvey.trello.impl.TrelloImpl.(TrelloImpl.java:27)
at webOnEclipse.UP.main(UP.java:29)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.NestedRuntimeException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more

What I do for using this trello wrapper?
Is it working or I must remove some stuff on FIX ME into the library classes?

Thanks Men!!

IOException

com.julienvey.trello.exception.TrelloHttpException: java.io.IOException: stream is closed
at com.julienvey.trello.impl.http.JDKTrelloHttpClient.get(JDKTrelloHttpClient.java:60)
at com.julienvey.trello.impl.TrelloImpl.get(TrelloImpl.java:579)
at com.julienvey.trello.impl.TrelloImpl.lambda$getBoardActions$0(TrelloImpl.java:138)
at com.julienvey.trello.impl.TrelloImpl.asList(TrelloImpl.java:600)
at com.julienvey.trello.impl.TrelloImpl.getBoardActions(TrelloImpl.java:138)
at com.julienvey.trello.domain.Board.fetchActions(Board.java:37)
at io.manalabs.manastafffeedback.managers.trello.TrelloManager.loadActivity(TrelloManager.java:115)
at io.manalabs.manastafffeedback.ManaStaffFeedbackMain.loadStats(ManaStaffFeedbackMain.java:220)
at io.manalabs.manastafffeedback.ManaStaffFeedbackMain.main(ManaStaffFeedbackMain.java:153)
Caused by: java.io.IOException: stream is closed
at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.ensureOpen(HttpURLConnection.java:3671)
at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3676)
at java.base/java.util.zip.CheckedInputStream.read(CheckedInputStream.java:59)
at java.base/java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:266)
at java.base/java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:258)
at java.base/java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:164)
at java.base/java.util.zip.GZIPInputStream.(GZIPInputStream.java:79)
at java.base/java.util.zip.GZIPInputStream.(GZIPInputStream.java:91)
at com.julienvey.trello.impl.http.JDKTrelloHttpClient.responseStream(JDKTrelloHttpClient.java:185)
at com.julienvey.trello.impl.http.JDKTrelloHttpClient.readResponse(JDKTrelloHttpClient.java:175)
at com.julienvey.trello.impl.http.JDKTrelloHttpClient.get(JDKTrelloHttpClient.java:58)
... 8 more

Can't move card to another list

I am successfully getting the Card object from the API
Card card = trelloApi.getCard(cardId);

Then I change the list id in that object
card.setIdBoard(listId);

And I'm trying to update it.
trelloApi.updateCard(card);

At this point I am getting the error:
Card with id 63c2d1ea3ac57800cf010b5f is not found. It may have been deleted in Trello

org.springframework:spring-web not optional

I could not use the wrapper without adding org.springframework:spring-web to my build.gradle.

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/web/client/RestClientException
    at com.julienvey.trello.impl.TrelloImpl.<init>(TrelloImpl.java:27)
    at de.joschuck.Main.main(Main.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.client.RestClientException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 7 more

Is it optional and I am just missing something?

Can't add labels to a card

I can't add a label to a card / I don't know how to do it:

Card card = new Card(); card.setName(title); card.addLabels("???"); // <- tried with color, name and id board.createCard(card);

Can't manage webhooks

The Trello webhook API is listed as supported at the README file but I can't find a way to create/delete/update webhooks.

ClassNotFoundException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException

Initialized the project as per the README. Used spring-web 5.0.1. Still get the error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:73) at org.springframework.web.client.RestTemplate.<init>(RestTemplate.java:171) at com.julienvey.trello.impl.http.RestTemplateHttpClient.<init>(RestTemplateHttpClient.java:17) at com.julienvey.trello.impl.TrelloImpl.<init>(TrelloImpl.java:27) at com.shamalk.webchecker.TrelloTest.main(TrelloTest.java:14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.