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

import/export #27

Open
garrett opened this issue Aug 2, 2011 · 6 comments
Open

import/export #27

garrett opened this issue Aug 2, 2011 · 6 comments
Labels

Comments

@garrett
Copy link
Collaborator

garrett commented Aug 2, 2011

We should support an import & export feature.

I imagine it would be a snapshot of what's currently represented by the board, in JSON.

@bear454
Copy link

bear454 commented Aug 2, 2011

And CSV.

@garrett
Copy link
Collaborator Author

garrett commented Aug 3, 2011

We can use a data URI to export the data from the client-side of things, which would be a good idea anyway, as we want to eventually have offline support. (I imagine the offline support would simply store & retrieve this same data structure.)

The data structure could be something like:

{
  "board": boardTitle,
  "decks": allTheDeckData,
  "cards": allTheCardData,
  "version": 0.5
}

Essentially, the same format that we're using, but combine the two JSON requests into one object.

I also added a version, in case we want to make a stable release and support importing old data formats. When importing, do you think it's possible to import the data to an older schema and migrate it to the latest? With multiple tables too?

I think import would need to be handled on the server side, unless we did a copy/paste based hack. As of yet, I don't think it's possible to upload files to the client side only.

@garrett
Copy link
Collaborator Author

garrett commented Aug 3, 2011

Also: What would the CSV look like? I guess it would be something like:

"Header", "Card", "Tags"
DeckHeader1, Card1, Card1Tags
DeckHeader1, Card2
DeckHeader2, Card3, Card3Tags

Basically, the header would be included in every row, and tags would be included if they exist.

Should we prefix each line with the board title too? It would be for multi-board support. Otherwise, we could just make it overwrite the current board, or generate a new board name that they could change. (I think the generate name option is best for CSV.)

@garrett
Copy link
Collaborator Author

garrett commented Aug 3, 2011

I have downloading JSON working locally.

However, it doesn't set the filename. There's unfortunately no way to do this with pure JS in the browser. There's a JS lib + Flash object that makes it possible @ https://github.com/dcneiner/Downloadify ... or we could rely on the server (which means the feature wouldn't be available for offline use, unless we have an offline mode that falls back to either Downloadify or no-specified-filename if Flash and the server aren't available).

I can, however, open a new window/tab and inject the data into it w/o any problem. It can be copy/pasted from there. That's another approach. (Or it could be a textarea that appears in the page.)

Thoughts?

This would apply to both JSON and CSV.

@cthiel
Copy link
Owner

cthiel commented Aug 5, 2011

Let's just move the exporting to the backend.

I was also thinking about this feature a bit more: maybe we should introduce UUIDs for Cards? That would enable use to move them back and forth between boards and make merging changes easier. What do you think?

@garrett
Copy link
Collaborator Author

garrett commented Aug 5, 2011

Yeah, that's probably a good idea.

I think we should still have a fallback JSON export w/ copy/paste for offline mode, as that's when you need export the most! Of course, we'd need offline support and an offline mode too. (;

But the primary import/export should be handled by the server, evidently.

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

No branches or pull requests

3 participants