Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "publicly-accessible" receiver #878

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

NatKarmios
Copy link

@NatKarmios NatKarmios commented Aug 16, 2021

I'm a big fan of Automate, and I (along with many others, it seems) would love to be able to use it - or Tasker, etc. - with Orgzly.

In the spirit of being the change I want to see the world, I've got to work on implementing a publicly-accessible intent receiver to this end :)

Just a few issues relevant to this (most of which are more or less already implemented):

These "endpoints" (i.e. actions) have currently been implemented, and tested to be working on an emulated Pixel 4:

  • GET_BOOKS
  • GET_SAVED_SEARCHES
  • GET_NOTE
  • ADD_NOTE
  • EDIT_NOTE
  • REFILE_NOTE / REFILE_NOTES
  • MOVE_NOTE / MOVE_NOTES
  • DELETE_NOTE / DELETE_NOTES
  • ADD_SAVED_SEARCH
  • EDIT_SAVED_SEARCH
  • MOVE_SAVED_SEARCH
  • DELETE_SAVED_SEARCH
  • SEARCH (runs the same kind of query a saved search would use, and returns the result)
  • GET_WIDETS
  • SET_WIDGET (sets the saved search that a widget displays)

Any instance where a note or multiple notes are selected, both note IDs and book/path combos are supported.

P.S.: Might I compliment you on your implementation of the DataRepository - developing this was a breeze because of it!

@NatKarmios
Copy link
Author

I've pushed a bunch more actions; see the edited main post

@NatKarmios NatKarmios changed the title WIP: Add "publicly-accessible" receiver Add "publicly-accessible" receiver Aug 18, 2021
@lytex
Copy link

lytex commented Aug 22, 2021

There isn't already a search Intent using com.orgzly.intent.extra.QUERY_STRING as mentioned in #784?

am start -a android.intent.action.MAIN -n com.orgzly/com.orgzly.android.ui.main.MainActivity \ 
--es "com.orgzly.intent.extra.QUERY_STRING" "search term" --activity-clear-task

Anyway, thank you for all the effort!

@NatKarmios
Copy link
Author

NatKarmios commented Aug 23, 2021

There isn't already a search Intent using com.orgzly.intent.extra.QUERY_STRING as mentioned in #784?

am start -a android.intent.action.MAIN -n com.orgzly/com.orgzly.android.ui.main.MainActivity \ 
--es "com.orgzly.intent.extra.QUERY_STRING" "search term" --activity-clear-task

Anyway, thank you for all the effort!

Thanks for getting back to me!

R.E. queries, this is a different kind of query; the QUERY_STRING intent you refer to opens Orgzly in the foreground with the specified search (from what I understand, at least). In contrast, the query intent I've added returns all the relevant note data in JSON format via an ordered broadcast, so Automate (or Tasker, etc.) can use this data in further computation.

@TeMPOraL
Copy link

Great work, @NatKarmios! I was about to start working on this myself (I desperately need to integrate Orgzly with Tasker), so I'm grateful to see the work has already been done!

Is there any way to help to fast-track merging in these changes? This is the missing bit to make Orgzly a fully-featured Emacs companion for org-based productivity systems, allowing users to customize the workflow to individual needs, without burdening Orgzly itself with supporting a zillion switches and integrations.

@NatKarmios
Copy link
Author

Just to bump this (@nevenz), I've rebased on master and spruced it up a little more.
I'm already getting a lot of use out of it, it'd be awesome if others could too 😁

@lytex
Copy link

lytex commented Apr 22, 2023

Hey, I would like to try this out (I've compiled the app from your branch) but I don't know how is supposed to work

For example, in this editNote function, I see there is a note id and a note content but I don't know what's that noteView.note.id. Is it the ID / CUSTOM_ID property of the note? An internal id used by orgzly?

@NatKarmios
Copy link
Author

NatKarmios commented Apr 24, 2023

It's an internal ID used by Orgzly, useful if you're editing a note based on a previous query.

If you take a look at getNote(), you can specify a note in 3 ways:

  • The aforementioned internal ID
  • The "path" to the note; say you have a heading Inner under a heading Outer, in book MyBook, the path would be "MyBook/Outer/Inner"
  • An Orgzly search query, like you'd use in saved searches; errors if more than one note is returned (though maybe this should be configurable).

@NatKarmios
Copy link
Author

For anyone still holding their breath for these changes, I've just popped a PR for it on the orgzly-android-revived repo:
orgzly-revived/orgzly-android-revived#112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants