[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread sagar15795
Github user sagar15795 commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169214069
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflow/WorkflowPresenter.java 
---
@@ -84,25 +82,27 @@ public void onError(Throwable e) {
 }
 
 @Override
-public void onNext(Workflows workflows) {
-getMvpView().showProgressbar(false);
-getMvpView().removeLoadMoreProgressbar();
-getMvpView().showWorkflows(workflows);
+public void onComplete() {
+
 }
 }));
 
 }
 
 public void attachSearchHandler(final SearchView searchView) {
-mSearchViewSubscription = RxSearch.fromSearchView(searchView)
+checkViewAttached();
+compositeDisposable.add(RxSearch.fromSearchView(searchView)
 .distinctUntilChanged()
 .debounce(300, TimeUnit.MILLISECONDS)
 .observeOn(AndroidSchedulers.mainThread())
 .subscribeOn(Schedulers.io())
-.subscribe(new Subscriber() {
+.subscribeWith(new DisposableObserver() {
 @Override
-public void onCompleted() {
-
+public void onNext(String s) {
--- End diff --

This String `s` name should be `searchText`


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-taverna-mobile/pull/56


---


RE: Swagger & Taverna

2018-02-19 Thread Mark Fortner
You could extend the same basic principle of semantic annotations to
relational databases. You can use the column's 'comments' field to store an
ontology reference. You would just need to be able to consume it when you
write JDBC queries.

Mark

On 19 Feb 2018 3:43 am, "Ian Dunlop"  wrote:

> Hello,
>
> That sounds like a really interesting idea. I wonder if it could be a
> generalised approach as well for annotating swagger docs so that
> taverna/CWL/knime/PP etc could use them. Maybe that exists already?
>
> Cheers,
>
> Ian
>
> Sent from Mail for Windows 10
>
> From: Stian Soiland-Reyes
> Sent: 18 February 2018 17:50
> To: dev@taverna.incubator.apache.org
> Subject: Re: Swagger & Taverna
>
> I think consuming Swagger APIs for building pre-configured REST
> service activities in Taverna is indeed a good idea - we've already
> got similar for WSDL/SOAP - should we propose this as a potential GSOC
> project? Would need a mentor..
>
> On 17 February 2018 at 00:17, Mark Fortner  wrote:
> > I'm curious if there's a way to incorporate Swagger REST service metadata
> > into a workflow? For example, you could add ontology URIs to parts of the
> > Swagger metadata, which Taverna could then consume and expose. This would
> > make it easier to orchestrate REST service-based workflows.
> >
> > Regards,
> >
> > Mark Fortner
>
>
>
> --
> Stian Soiland-Reyes
> http://orcid.org/-0001-9842-9718
>
>


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread Hiteshgautam01
GitHub user Hiteshgautam01 opened a pull request:

https://github.com/apache/incubator-taverna-mobile/pull/56

Migration RxJava 1 ->  RxJava2

Please make sure these boxes are checked before submitting your pull 
request - thanks!

- [ ] Apply the `AndroidStyle.xml` style template to your code in Android 
Studio.

- [ ] Run the checks with `./gradlew check` to make sure you didn't break 
anything

- [ ] If you have multiple commits please combine them into one commit by 
squashing them.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/Hiteshgautam01/incubator-taverna-mobile 
RxJava2

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-taverna-mobile/pull/56.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #56


commit 573cc4a4721bb09797bced075f3b60c9a4ec
Author: Hitesh Gautam 
Date:   2018-02-15T19:52:07Z

Adding RxJava 2.0 dependencies

commit 3e921aca92dee1f69adcd82d43484bf6255ddd7a
Author: Hitesh Gautam 
Date:   2018-02-17T13:38:26Z

Feat: Migrating to RxJava2

commit 9ae9186588297ba90b6697588b6c5862eaed6697
Author: Hitesh Gautam 
Date:   2018-02-19T10:28:18Z

fix: Announcement test




---


RE: Swagger & Taverna

2018-02-19 Thread Ian Dunlop
Hello,

That sounds like a really interesting idea. I wonder if it could be a 
generalised approach as well for annotating swagger docs so that 
taverna/CWL/knime/PP etc could use them. Maybe that exists already?

Cheers,

Ian

Sent from Mail for Windows 10

From: Stian Soiland-Reyes
Sent: 18 February 2018 17:50
To: dev@taverna.incubator.apache.org
Subject: Re: Swagger & Taverna

I think consuming Swagger APIs for building pre-configured REST
service activities in Taverna is indeed a good idea - we've already
got similar for WSDL/SOAP - should we propose this as a potential GSOC
project? Would need a mentor..

On 17 February 2018 at 00:17, Mark Fortner  wrote:
> I'm curious if there's a way to incorporate Swagger REST service metadata
> into a workflow? For example, you could add ontology URIs to parts of the
> Swagger metadata, which Taverna could then consume and expose. This would
> make it easier to orchestrate REST service-based workflows.
>
> Regards,
>
> Mark Fortner



-- 
Stian Soiland-Reyes
http://orcid.org/-0001-9842-9718



[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169137816
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflowrun/WorkflowRunPresenter.java
 ---
@@ -31,50 +31,48 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 
+import io.reactivex.Observable;
+import io.reactivex.ObservableSource;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.CompositeDisposable;
+import io.reactivex.functions.Function;
+import io.reactivex.observers.DisposableObserver;
+import io.reactivex.schedulers.Schedulers;
 import okhttp3.MediaType;
 import okhttp3.RequestBody;
 import okhttp3.ResponseBody;
-import rx.Observable;
-import rx.Observer;
-import rx.Subscription;
-import rx.android.schedulers.AndroidSchedulers;
-import rx.functions.Func1;
-import rx.schedulers.Schedulers;
 
 public class WorkflowRunPresenter extends 
BasePresenter {
 
 private static final String TAG = 
WorkflowRunPresenter.class.getSimpleName();
-private final DataManager mDataManager;
-private Subscription mSubscriptions;
 
+private final DataManager mDataManager;
+private CompositeDisposable compositeDisposable;
 
 public WorkflowRunPresenter(DataManager dataManager) {
 mDataManager = dataManager;
-
+compositeDisposable = new CompositeDisposable();
 }
 
 @Override
 public void attachView(WorkflowRunMvpView mvpView) {
-
 super.attachView(mvpView);
-
 }
 
 @Override
 public void detachView() {
 super.detachView();
-if (mSubscriptions != null) mSubscriptions.unsubscribe();
+compositeDisposable.clear();
 }
 
-
 public void runWorkflow(String contentURL) {
-if (mSubscriptions != null) mSubscriptions.unsubscribe();
+compositeDisposable.clear();
--- End diff --

don't need to clear the Disposable, as we are using `CompositeDisposable` 
It manages every subscription we don't have to worry about, any subscription 
will drop or mix. clear only in detachView.


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169131194
  
--- Diff: app/build.gradle ---
@@ -82,11 +88,8 @@ dependencies {
 compile "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
 annotationProcessor 
"com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion"
 
-
-compile "io.reactivex:rxandroid:1.2.0"
-// Because RxAndroid releases are few and far between, it is recommended 
you also
-// explicitly depend on RxJava's latest version for bug fixes and new 
features.
-compile "io.reactivex:rxjava:1.1.5"
+compile "io.reactivex.rxjava2:rxjava:2.0.1"
+compile "io.reactivex.rxjava2:rxandroid:2.0.1"
--- End diff --

Please make `rxJavaVersion = 2.0.1` and `rxAndroidVersion = 2.0.1` in 
project build.gradle and use here as we already using. 


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169132417
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/local/PreferencesHelper.java 
---
@@ -155,9 +158,15 @@ private void setUserAvatar(String userAvatar) {
 }
 
 public Observable saveUserDetail(final User user) {
-return Observable.defer(new Func0() {
+return Observable.defer(new Callable() {
+/**
+ * Computes a result, or throws an exception if unable to do 
so.
+ *
+ * @return computed result
+ * @throws Exception if unable to compute a result
+ */
--- End diff --

Please change the return type in the comment.


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169136620
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/myworkflows/MyWorkflowPresenter.java
 ---
@@ -102,23 +101,20 @@ public void onError(Throwable e) {
 }
 
 @Override
-public void onNext(Workflow workflow) {
-getMvpView().showWorkflow(workflow);
+public void onComplete() {
+getMvpView().showProgressbar(false);
+getMvpView().checkWorkflowSize();
--- End diff --

Move these two lines in onNext


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169134000
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/favouriteworkflowdetail/FavouriteWorkflowDetailPresenter.java
 ---
@@ -135,22 +130,26 @@ public void onError(Throwable e) {
 }
 
 @Override
-public void onNext(License license) {
-getMvpView().showLicense(license);
+public void onComplete() {
+getMvpView().showLicenseProgress(false);
 }
 }));
 }
 
 public void setFavourite(String id) {
-
-
-mCompositeSubscription.add(mDataManager.setFavoriteWorkflow(id)
+checkViewAttached();
+compositeDisposable.add(mDataManager.setFavoriteWorkflow(id)
 .observeOn(AndroidSchedulers.mainThread())
 .subscribeOn(Schedulers.io())
-.subscribe(new Observer() {
+.subscribeWith(new DisposableObserver() {
 @Override
-public void onCompleted() {
-
+public void onNext(Boolean b) {
--- End diff --

This Boolean `b` name should be `favoriteStatus`


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169131553
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/data/local/DBHelper.java ---
@@ -46,23 +46,21 @@ public DBHelper() {
 
 @Nullable
 public Observable syncWorkflows(final Workflows workflows) {
-return Observable.create(new Observable.OnSubscribe() {
+return Observable.defer(new Callable() {
--- End diff --

Good work for using `Observable.defer(...)`


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread therajanmaurya
Github user therajanmaurya commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169137166
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/workflow/WorkflowPresenter.java 
---
@@ -111,33 +111,36 @@ public void onError(Throwable e) {
 }
 
 @Override
-public void onNext(String s) {
-getMvpView().performSearch(s);
-if (!TextUtils.isEmpty(s)) {
-searchWorkflow(1, s);
-}
+public void onComplete() {
+
 }
-});
-mSubscriptions.add(mSearchViewSubscription);
+}));
+compositeDisposable.add(compositeDisposable);
--- End diff --

As we are using `CompositeDisposable`, Please remove this line. this line 
is making no sense.


---


[GitHub] incubator-taverna-mobile pull request #56: Migration RxJava 1 -> RxJava2

2018-02-19 Thread Hiteshgautam01
Github user Hiteshgautam01 commented on a diff in the pull request:


https://github.com/apache/incubator-taverna-mobile/pull/56#discussion_r169177839
  
--- Diff: 
app/src/main/java/org/apache/taverna/mobile/ui/login/LoginPresenter.java ---
@@ -76,16 +75,15 @@ public void onError(Throwable e) {
 }
 
 @Override
-public void onNext(User user) {
-
+public void onComplete() {
+getMvpView().showDashboardActivity();
+getMvpView().showProgressDialog(false);
--- End diff --

When i am moving these to OnNext then it showing the activity.Its keep 
loading.


---