JBehave
  1. JBehave
  2. JBEHAVE-584

Support loading stories from Google Docs

    Details

    • Type: New Feature New Feature
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5
    • Component/s: Google Support
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      As a BA I want to be able to write my story in Google Docs.
      This has the advantage that the stories are in the cloud and multiple stakeholders (BA, developer, ...) work at the same time on the same document.

      By using the Google docs API, a document can be exported to ODT and be delegated to the ODT support in JBehave.

      ATTENTION: the given patch contains also a fix for the class OdfUtils in the module jbehave-odf. The class OdfTextExtractor is used to convert ODT correctly to text.

      1. googledocs.patch
        8 kB
        Bart De Neuter
      2. googledocs-20110823.patch
        3 kB
        Bart De Neuter

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Fix Version/s 3.5 [ 17393 ]
        Mauro Talevi made changes -
        Assignee Mauro Talevi [ maurotalevi ]
        Mauro Talevi made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Mauro Talevi added a comment -

        Hi Bart,

        added your contributed Google docs loader, but kept in the jbehave-odf module rather than a separate one.

        I've tested against a private document, but clearly this cannot be used for generic testing (hence the tests are marked as @Ignore). What we'd need is to create a public group account that we can use for testing.

        Do you know if that is possible?

        Show
        Mauro Talevi added a comment - Hi Bart, added your contributed Google docs loader, but kept in the jbehave-odf module rather than a separate one. I've tested against a private document, but clearly this cannot be used for generic testing (hence the tests are marked as @Ignore). What we'd need is to create a public group account that we can use for testing. Do you know if that is possible?
        Hide
        Bart De Neuter added a comment -

        Hi Mauro,

        I added it to a separate module because it has nothing to do with odf. Google docs can export to different formats and I have used odt in order to delegate it to the odf-module for converting it to text. But from the user perspective it is an implementation detail. If you place it in the odf-module then this module also needs the dependencies to the google api's.

        I'm not sure how to test it without putting a password in the test class. Maybe you can make a google account for JBehave and put the password in the settings.xml from the maven build on the different environments?

        Show
        Bart De Neuter added a comment - Hi Mauro, I added it to a separate module because it has nothing to do with odf. Google docs can export to different formats and I have used odt in order to delegate it to the odf-module for converting it to text. But from the user perspective it is an implementation detail. If you place it in the odf-module then this module also needs the dependencies to the google api's. I'm not sure how to test it without putting a password in the test class. Maybe you can make a google account for JBehave and put the password in the settings.xml from the maven build on the different environments?
        Hide
        Mauro Talevi added a comment -

        For the moment, we are exporting to use odf formats, so it makes sense for it be in the jbehave-odf module.

        Once we start using other formats, we can move it to a separate module. But is there an alternative format to use?

        And we should create a jbehave user for google docs.

        Show
        Mauro Talevi added a comment - For the moment, we are exporting to use odf formats, so it makes sense for it be in the jbehave-odf module. Once we start using other formats, we can move it to a separate module. But is there an alternative format to use? And we should create a jbehave user for google docs.
        Hide
        Bart De Neuter added a comment -

        Actually, for jbehave we convert the document from google docs to a String. How we do it, is an implementation detail and not important for the user. Instead of first exporting to ODT, we could export directly to txt. But then we loose the correct formatting of the table.
        But for me it's fine if you put it in the jbehave-odf module.

        Do you want me to create a jbehave user? I still don't know how I have to handle the password question. If you put the password in settings.xml or as an environment variable, then you could run the tests on your CI server. But the downloaded code can not be build out of the box.

        Show
        Bart De Neuter added a comment - Actually, for jbehave we convert the document from google docs to a String. How we do it, is an implementation detail and not important for the user. Instead of first exporting to ODT, we could export directly to txt. But then we loose the correct formatting of the table. But for me it's fine if you put it in the jbehave-odf module. Do you want me to create a jbehave user? I still don't know how I have to handle the password question. If you put the password in settings.xml or as an environment variable, then you could run the tests on your CI server. But the downloaded code can not be build out of the box.
        Hide
        Mauro Talevi added a comment -

        Presumably, we should be able to maintain the format in txt too, like in a wiki.

        Let's decide what formats we are going to or can support and then we can decide whether it warrants a separate module or not. Not against it, just would like to understand the usecase first.

        For the google access, ideally we'd want to create a group access and have a read-only user. It'd be great if you could investigate the issue with the Google Docs folks and present the options we have. I'd be surprised if they did not offer some sort of test access (but perhaps it's not available for general public).

        Show
        Mauro Talevi added a comment - Presumably, we should be able to maintain the format in txt too, like in a wiki. Let's decide what formats we are going to or can support and then we can decide whether it warrants a separate module or not. Not against it, just would like to understand the usecase first. For the google access, ideally we'd want to create a group access and have a read-only user. It'd be great if you could investigate the issue with the Google Docs folks and present the options we have. I'd be surprised if they did not offer some sort of test access (but perhaps it's not available for general public).
        Hide
        Bart De Neuter added a comment -

        Use the DocumentQuery API for safer construction of the request URI

        Show
        Bart De Neuter added a comment - Use the DocumentQuery API for safer construction of the request URI
        Bart De Neuter made changes -
        Attachment googledocs-20110823.patch [ 56540 ]
        Hide
        Mauro Talevi added a comment -

        Thanks, applied patch, although had to applied changes manually. Somehow this patch did not get applied as the other. Did you change method of patch generation?

        Show
        Mauro Talevi added a comment - Thanks, applied patch, although had to applied changes manually. Somehow this patch did not get applied as the other. Did you change method of patch generation?
        Hide
        Bart De Neuter added a comment -

        Mauro,
        My apologies, it is the first time I use git and I'm still learning how to use it. Although both are created with eclipse, it is possible that I created the second patch with other options then the first patch.

        Show
        Bart De Neuter added a comment - Mauro, My apologies, it is the first time I use git and I'm still learning how to use it. Although both are created with eclipse, it is possible that I created the second patch with other options then the first patch.
        Hide
        Mauro Talevi added a comment -

        No problem I find that using command-line "git diff > ~/some.patch" is easier and safer.

        Show
        Mauro Talevi added a comment - No problem I find that using command-line "git diff > ~/some.patch" is easier and safer.
        Hide
        Bart De Neuter added a comment -

        Mauro,

        I tried to figure out if there is something like a public group account. But it seems not. You can find the discussion here: http://code.google.com/apis/documents/forum.html?place=topic%2Fgoogle-documents-list-api%2FIh0R7qza8D4%2Fdiscussion

        Show
        Bart De Neuter added a comment - Mauro, I tried to figure out if there is something like a public group account. But it seems not. You can find the discussion here: http://code.google.com/apis/documents/forum.html?place=topic%2Fgoogle-documents-list-api%2FIh0R7qza8D4%2Fdiscussion
        Hide
        Mauro Talevi added a comment -

        Hi Bart,

        added jbehave-google-example which can be executed by users providing their own credentials as env variables.

        The unit test will be refactored to mock the response from the Google docs API.

        Show
        Mauro Talevi added a comment - Hi Bart, added jbehave-google-example which can be executed by users providing their own credentials as env variables. The unit test will be refactored to mock the response from the Google docs API.
        Mauro Talevi made changes -
        Component/s Google Support [ 14862 ]
        Component/s Core [ 11086 ]
        Component/s ODF Support [ 14705 ]
        Hide
        Mauro Talevi added a comment -

        Hi Bart,

        as you originally suggested, a separate jbehave-google module has now been created, which can be used to expand support for Google Docs, even when not based on ODF.

        Show
        Mauro Talevi added a comment - Hi Bart, as you originally suggested, a separate jbehave-google module has now been created, which can be used to expand support for Google Docs, even when not based on ODF.
        Mauro Talevi made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Bart De Neuter
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: