You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@taverna.apache.org by Ian Dunlop <ia...@gmail.com> on 2016/08/11 14:50:15 UTC

Help needed with android xml parsing

Hello,

I have been trying to understand how the taverna mobile application works.
I added some functionality to list your own workflows (rather than all of
them or your favourites). I  can get the app to request 'my' workflow list
from myExperiment but when the app tries to parse it I get the following
error:

org.simpleframework.xml.core.AttributeException: Attribute 'uri' does not
have a match in class org.apache.taverna.mobile.data.model.Workflows at
line 2

Here is the xml that is returned:

<?xml version="1.0" encoding="UTF-8"?>
<user uri="http://www.myexperiment.org/user.xml?id=474" resource="
http://www.myexperiment.org/users/474" id="474">
  <workflows>
    <workflow uri="http://www.myexperiment.org/workflow.xml?id=2770"
resource="http://www.myexperiment.org/workflows/2770" id="2770"
version="1">Disability estimates by year</workflow>
    <workflow uri="http://www.myexperiment.org/workflow.xml?id=3628"
resource="http://www.myexperiment.org/workflows/3628" id="3628"
version="4">Free text search to Concept Wiki URI</workflow>
  </workflows>
</user>


This is different from the format that the 'All workflows' returns within
the app.
I'm not sure what line 2 refers to here, is it the class or the xml? If it
is the xml  then is it the <user> node that it doesn't like. The
simpleframework docs seem to suggest that you can have optional elements
http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#optional.
Can it be told to ignore  elements?
So....how can I change the org.apache.taverna.mobile.data.model.Workflows
and I guess the org.apache.taverna.mobile.data.model.Workflow code to
accept the above xml format as well?

Cheers,

Ian

Re: Help needed with android xml parsing

Posted by Sagar <ku...@gmail.com>.
I have pushed all changes.

Have a look and tell me if there is any error or change required.

On Tue, Aug 16, 2016 at 5:11 PM, Ian Dunlop <ia...@gmail.com> wrote:

> Hello
>
> Thanks sagar. I have added you to the repository.
>
> Cheers
>
> Ian
>
> On 15 Aug 2016 20:44, "Sagar" <ku...@gmail.com> wrote:
>
> > Ian,
> > I have resolved your error.
> >
> > Give me access to your taverna's fork GitHub repo. So that I can push it
> to
> > your repo.
> >
> >
> >
> > On Mon, Aug 15, 2016 at 3:29 PM, Ian Dunlop <ia...@gmail.com>
> wrote:
> >
> > > Hello,
> > >
> > > I have pushed the ian_my_workflows branch to
> > > https://github.com/ianwdunlop/incubator-taverna-mobile
> > > Still not sure why the apache repo branch wasn't mirrored to github
> > though.
> > >
> > > Cheers,
> > >
> > > Ian
> > >
> > > On 12 August 2016 at 13:58, Sagar <ku...@gmail.com> wrote:
> > >
> > > > Can you provide me the link ? I am unable to find it on GitHub.
> > > >
> > > > On Fri, Aug 12, 2016 at 5:40 PM, Ian Dunlop <ia...@gmail.com>
> > > wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I changed the User class using your code snippet but I am still
> > getting
> > > > the
> > > > > same error. I have pushed a branch into the apache git repo called
> > > > > ian_my_workflows. This should be mirrored into github (hopefully)
> and
> > > you
> > > > > can see the code I have added - mainly a MyWorkflow fragment etc
> plus
> > > > data
> > > > > manager/API addition to fetch the worklfows for the logged in
> user. I
> > > > guess
> > > > > this is a good chance for us to understand and document how to add
> > > > > functionality to the app.
> > > > >
> > > > > Cheers,
> > > > >
> > > > > Ian
> > > > >
> > > > > On 12 August 2016 at 12:40, Ian Dunlop <ia...@gmail.com>
> wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > Thanks for the tips and code Sagar. Much appreciated.
> > > > > >
> > > > > > Cheers,
> > > > > >
> > > > > > Ian
> > > > > >
> > > > > > On 12 August 2016 at 10:09, Sagar <ku...@gmail.com>
> > wrote:
> > > > > >
> > > > > >> Hi Ian,
> > > > > >>
> > > > > >> To parse the xml that was given by you . You have to add some
> > object
> > > > in
> > > > > >> Java Beans in user .
> > > > > >>
> > > > > >> 1. *Workflows* object's element  in User java bean
> > > > > >>
> > > > > >> 2. Add required = false in @element annotation of  title and
> type
> > in
> > > > > >> *Workflow* java bean.
> > > > > >>
> > > > > >> You can see the changed code at Github Gist
> > > > > >> <https://gist.github.com/sagar15795/
> > ec65c84a5a14c32691b493f4841331
> > > ce>
> > > > > >>
> > > > > >> I have tried it. And I found an error that we can not use
> @element
> > > > and @
> > > > > >> text annotation together in SimpleXML parser . So we can not get
> > the
> > > > > >> workflow as element's text using current java bean. we can get
> all
> > > the
> > > > > >> rest
> > > > > >> elements and attribute.
> > > > > >>
> > > > > >> I am trying to rectify it.
> > > > > >>
> > > > > >> On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <
> ianwdunlop@gmail.com
> > >
> > > > > wrote:
> > > > > >>
> > > > > >> > Hello,
> > > > > >> >
> > > > > >> > I have been trying to understand how the taverna mobile
> > > application
> > > > > >> works.
> > > > > >> > I added some functionality to list your own workflows (rather
> > than
> > > > all
> > > > > >> of
> > > > > >> > them or your favourites). I  can get the app to request 'my'
> > > > workflow
> > > > > >> list
> > > > > >> > from myExperiment but when the app tries to parse it I get the
> > > > > following
> > > > > >> > error:
> > > > > >> >
> > > > > >> > org.simpleframework.xml.core.AttributeException: Attribute
> > 'uri'
> > > > does
> > > > > >> not
> > > > > >> > have a match in class org.apache.taverna.mobile.
> > > > data.model.Workflows
> > > > > at
> > > > > >> > line 2
> > > > > >> >
> > > > > >> > Here is the xml that is returned:
> > > > > >> >
> > > > > >> > <?xml version="1.0" encoding="UTF-8"?>
> > > > > >> > <user uri="http://www.myexperiment.org/user.xml?id=474"
> > > resource="
> > > > > >> > http://www.myexperiment.org/users/474" id="474">
> > > > > >> >   <workflows>
> > > > > >> >     <workflow uri="http://www.myexperiment.
> > > org/workflow.xml?id=2770
> > > > "
> > > > > >> > resource="http://www.myexperiment.org/workflows/2770"
> id="2770"
> > > > > >> > version="1">Disability estimates by year</workflow>
> > > > > >> >     <workflow uri="http://www.myexperiment.
> > > org/workflow.xml?id=3628
> > > > "
> > > > > >> > resource="http://www.myexperiment.org/workflows/3628"
> id="3628"
> > > > > >> > version="4">Free text search to Concept Wiki URI</workflow>
> > > > > >> >   </workflows>
> > > > > >> > </user>
> > > > > >> >
> > > > > >> >
> > > > > >> > This is different from the format that the 'All workflows'
> > returns
> > > > > >> within
> > > > > >> > the app.
> > > > > >> > I'm not sure what line 2 refers to here, is it the class or
> the
> > > xml?
> > > > > If
> > > > > >> it
> > > > > >> > is the xml  then is it the <user> node that it doesn't like.
> The
> > > > > >> > simpleframework docs seem to suggest that you can have
> optional
> > > > > elements
> > > > > >> > http://simple.sourceforge.net/download/stream/doc/tutorial/
> > > > > >> > tutorial.php#optional.
> > > > > >> > Can it be told to ignore  elements?
> > > > > >> > So....how can I change the org.apache.taverna.mobile.data
> > > > > >> .model.Workflows
> > > > > >> > and I guess the org.apache.taverna.mobile.data.model.Workflow
> > > code
> > > > to
> > > > > >> > accept the above xml format as well?
> > > > > >> >
> > > > > >> > Cheers,
> > > > > >> >
> > > > > >> > Ian
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> --
> > > > > >>
> > > > > >> *With warm regards  *
> > > > > >> *Sincerely yours*
> > > > > >> Sagar
> > > > > >>
> > > > > >>
> > > > > >> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> > > > > >> *Cluster Innovation Centre*
> > > > > >> *University of Delhi *
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > *With warm regards  *
> > > > *Sincerely yours*
> > > > Sagar
> > > >
> > > >
> > > > *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> > > > *Cluster Innovation Centre*
> > > > *University of Delhi *
> > > >
> > >
> >
> >
> >
> > --
> >
> > *With warm regards  *
> > *Sincerely yours*
> > Sagar
> >
> >
> > *Student ,(7th Semester )B.Tech IT and mathematical innovation*
> > *Cluster Innovation Centre*
> > *University of Delhi *
> >
>



-- 

*With warm regards  *
*Sincerely yours*
Sagar


*Student ,(6th Semester )B.Tech IT and mathematical innovation*
*Cluster Innovation Centre*
*University of Delhi *

Re: Help needed with android xml parsing

Posted by Ian Dunlop <ia...@gmail.com>.
Hello

Thanks sagar. I have added you to the repository.

Cheers

Ian

On 15 Aug 2016 20:44, "Sagar" <ku...@gmail.com> wrote:

> Ian,
> I have resolved your error.
>
> Give me access to your taverna's fork GitHub repo. So that I can push it to
> your repo.
>
>
>
> On Mon, Aug 15, 2016 at 3:29 PM, Ian Dunlop <ia...@gmail.com> wrote:
>
> > Hello,
> >
> > I have pushed the ian_my_workflows branch to
> > https://github.com/ianwdunlop/incubator-taverna-mobile
> > Still not sure why the apache repo branch wasn't mirrored to github
> though.
> >
> > Cheers,
> >
> > Ian
> >
> > On 12 August 2016 at 13:58, Sagar <ku...@gmail.com> wrote:
> >
> > > Can you provide me the link ? I am unable to find it on GitHub.
> > >
> > > On Fri, Aug 12, 2016 at 5:40 PM, Ian Dunlop <ia...@gmail.com>
> > wrote:
> > >
> > > > Hello,
> > > >
> > > > I changed the User class using your code snippet but I am still
> getting
> > > the
> > > > same error. I have pushed a branch into the apache git repo called
> > > > ian_my_workflows. This should be mirrored into github (hopefully) and
> > you
> > > > can see the code I have added - mainly a MyWorkflow fragment etc plus
> > > data
> > > > manager/API addition to fetch the worklfows for the logged in user. I
> > > guess
> > > > this is a good chance for us to understand and document how to add
> > > > functionality to the app.
> > > >
> > > > Cheers,
> > > >
> > > > Ian
> > > >
> > > > On 12 August 2016 at 12:40, Ian Dunlop <ia...@gmail.com> wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > Thanks for the tips and code Sagar. Much appreciated.
> > > > >
> > > > > Cheers,
> > > > >
> > > > > Ian
> > > > >
> > > > > On 12 August 2016 at 10:09, Sagar <ku...@gmail.com>
> wrote:
> > > > >
> > > > >> Hi Ian,
> > > > >>
> > > > >> To parse the xml that was given by you . You have to add some
> object
> > > in
> > > > >> Java Beans in user .
> > > > >>
> > > > >> 1. *Workflows* object's element  in User java bean
> > > > >>
> > > > >> 2. Add required = false in @element annotation of  title and type
> in
> > > > >> *Workflow* java bean.
> > > > >>
> > > > >> You can see the changed code at Github Gist
> > > > >> <https://gist.github.com/sagar15795/
> ec65c84a5a14c32691b493f4841331
> > ce>
> > > > >>
> > > > >> I have tried it. And I found an error that we can not use @element
> > > and @
> > > > >> text annotation together in SimpleXML parser . So we can not get
> the
> > > > >> workflow as element's text using current java bean. we can get all
> > the
> > > > >> rest
> > > > >> elements and attribute.
> > > > >>
> > > > >> I am trying to rectify it.
> > > > >>
> > > > >> On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <ianwdunlop@gmail.com
> >
> > > > wrote:
> > > > >>
> > > > >> > Hello,
> > > > >> >
> > > > >> > I have been trying to understand how the taverna mobile
> > application
> > > > >> works.
> > > > >> > I added some functionality to list your own workflows (rather
> than
> > > all
> > > > >> of
> > > > >> > them or your favourites). I  can get the app to request 'my'
> > > workflow
> > > > >> list
> > > > >> > from myExperiment but when the app tries to parse it I get the
> > > > following
> > > > >> > error:
> > > > >> >
> > > > >> > org.simpleframework.xml.core.AttributeException: Attribute
> 'uri'
> > > does
> > > > >> not
> > > > >> > have a match in class org.apache.taverna.mobile.
> > > data.model.Workflows
> > > > at
> > > > >> > line 2
> > > > >> >
> > > > >> > Here is the xml that is returned:
> > > > >> >
> > > > >> > <?xml version="1.0" encoding="UTF-8"?>
> > > > >> > <user uri="http://www.myexperiment.org/user.xml?id=474"
> > resource="
> > > > >> > http://www.myexperiment.org/users/474" id="474">
> > > > >> >   <workflows>
> > > > >> >     <workflow uri="http://www.myexperiment.
> > org/workflow.xml?id=2770
> > > "
> > > > >> > resource="http://www.myexperiment.org/workflows/2770" id="2770"
> > > > >> > version="1">Disability estimates by year</workflow>
> > > > >> >     <workflow uri="http://www.myexperiment.
> > org/workflow.xml?id=3628
> > > "
> > > > >> > resource="http://www.myexperiment.org/workflows/3628" id="3628"
> > > > >> > version="4">Free text search to Concept Wiki URI</workflow>
> > > > >> >   </workflows>
> > > > >> > </user>
> > > > >> >
> > > > >> >
> > > > >> > This is different from the format that the 'All workflows'
> returns
> > > > >> within
> > > > >> > the app.
> > > > >> > I'm not sure what line 2 refers to here, is it the class or the
> > xml?
> > > > If
> > > > >> it
> > > > >> > is the xml  then is it the <user> node that it doesn't like. The
> > > > >> > simpleframework docs seem to suggest that you can have optional
> > > > elements
> > > > >> > http://simple.sourceforge.net/download/stream/doc/tutorial/
> > > > >> > tutorial.php#optional.
> > > > >> > Can it be told to ignore  elements?
> > > > >> > So....how can I change the org.apache.taverna.mobile.data
> > > > >> .model.Workflows
> > > > >> > and I guess the org.apache.taverna.mobile.data.model.Workflow
> > code
> > > to
> > > > >> > accept the above xml format as well?
> > > > >> >
> > > > >> > Cheers,
> > > > >> >
> > > > >> > Ian
> > > > >> >
> > > > >>
> > > > >>
> > > > >>
> > > > >> --
> > > > >>
> > > > >> *With warm regards  *
> > > > >> *Sincerely yours*
> > > > >> Sagar
> > > > >>
> > > > >>
> > > > >> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> > > > >> *Cluster Innovation Centre*
> > > > >> *University of Delhi *
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > *With warm regards  *
> > > *Sincerely yours*
> > > Sagar
> > >
> > >
> > > *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> > > *Cluster Innovation Centre*
> > > *University of Delhi *
> > >
> >
>
>
>
> --
>
> *With warm regards  *
> *Sincerely yours*
> Sagar
>
>
> *Student ,(7th Semester )B.Tech IT and mathematical innovation*
> *Cluster Innovation Centre*
> *University of Delhi *
>

Re: Help needed with android xml parsing

Posted by Sagar <ku...@gmail.com>.
Ian,
I have resolved your error.

Give me access to your taverna's fork GitHub repo. So that I can push it to
your repo.



On Mon, Aug 15, 2016 at 3:29 PM, Ian Dunlop <ia...@gmail.com> wrote:

> Hello,
>
> I have pushed the ian_my_workflows branch to
> https://github.com/ianwdunlop/incubator-taverna-mobile
> Still not sure why the apache repo branch wasn't mirrored to github though.
>
> Cheers,
>
> Ian
>
> On 12 August 2016 at 13:58, Sagar <ku...@gmail.com> wrote:
>
> > Can you provide me the link ? I am unable to find it on GitHub.
> >
> > On Fri, Aug 12, 2016 at 5:40 PM, Ian Dunlop <ia...@gmail.com>
> wrote:
> >
> > > Hello,
> > >
> > > I changed the User class using your code snippet but I am still getting
> > the
> > > same error. I have pushed a branch into the apache git repo called
> > > ian_my_workflows. This should be mirrored into github (hopefully) and
> you
> > > can see the code I have added - mainly a MyWorkflow fragment etc plus
> > data
> > > manager/API addition to fetch the worklfows for the logged in user. I
> > guess
> > > this is a good chance for us to understand and document how to add
> > > functionality to the app.
> > >
> > > Cheers,
> > >
> > > Ian
> > >
> > > On 12 August 2016 at 12:40, Ian Dunlop <ia...@gmail.com> wrote:
> > >
> > > > Hello,
> > > >
> > > > Thanks for the tips and code Sagar. Much appreciated.
> > > >
> > > > Cheers,
> > > >
> > > > Ian
> > > >
> > > > On 12 August 2016 at 10:09, Sagar <ku...@gmail.com> wrote:
> > > >
> > > >> Hi Ian,
> > > >>
> > > >> To parse the xml that was given by you . You have to add some object
> > in
> > > >> Java Beans in user .
> > > >>
> > > >> 1. *Workflows* object's element  in User java bean
> > > >>
> > > >> 2. Add required = false in @element annotation of  title and type in
> > > >> *Workflow* java bean.
> > > >>
> > > >> You can see the changed code at Github Gist
> > > >> <https://gist.github.com/sagar15795/ec65c84a5a14c32691b493f4841331
> ce>
> > > >>
> > > >> I have tried it. And I found an error that we can not use @element
> > and @
> > > >> text annotation together in SimpleXML parser . So we can not get the
> > > >> workflow as element's text using current java bean. we can get all
> the
> > > >> rest
> > > >> elements and attribute.
> > > >>
> > > >> I am trying to rectify it.
> > > >>
> > > >> On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <ia...@gmail.com>
> > > wrote:
> > > >>
> > > >> > Hello,
> > > >> >
> > > >> > I have been trying to understand how the taverna mobile
> application
> > > >> works.
> > > >> > I added some functionality to list your own workflows (rather than
> > all
> > > >> of
> > > >> > them or your favourites). I  can get the app to request 'my'
> > workflow
> > > >> list
> > > >> > from myExperiment but when the app tries to parse it I get the
> > > following
> > > >> > error:
> > > >> >
> > > >> > org.simpleframework.xml.core.AttributeException: Attribute 'uri'
> > does
> > > >> not
> > > >> > have a match in class org.apache.taverna.mobile.
> > data.model.Workflows
> > > at
> > > >> > line 2
> > > >> >
> > > >> > Here is the xml that is returned:
> > > >> >
> > > >> > <?xml version="1.0" encoding="UTF-8"?>
> > > >> > <user uri="http://www.myexperiment.org/user.xml?id=474"
> resource="
> > > >> > http://www.myexperiment.org/users/474" id="474">
> > > >> >   <workflows>
> > > >> >     <workflow uri="http://www.myexperiment.
> org/workflow.xml?id=2770
> > "
> > > >> > resource="http://www.myexperiment.org/workflows/2770" id="2770"
> > > >> > version="1">Disability estimates by year</workflow>
> > > >> >     <workflow uri="http://www.myexperiment.
> org/workflow.xml?id=3628
> > "
> > > >> > resource="http://www.myexperiment.org/workflows/3628" id="3628"
> > > >> > version="4">Free text search to Concept Wiki URI</workflow>
> > > >> >   </workflows>
> > > >> > </user>
> > > >> >
> > > >> >
> > > >> > This is different from the format that the 'All workflows' returns
> > > >> within
> > > >> > the app.
> > > >> > I'm not sure what line 2 refers to here, is it the class or the
> xml?
> > > If
> > > >> it
> > > >> > is the xml  then is it the <user> node that it doesn't like. The
> > > >> > simpleframework docs seem to suggest that you can have optional
> > > elements
> > > >> > http://simple.sourceforge.net/download/stream/doc/tutorial/
> > > >> > tutorial.php#optional.
> > > >> > Can it be told to ignore  elements?
> > > >> > So....how can I change the org.apache.taverna.mobile.data
> > > >> .model.Workflows
> > > >> > and I guess the org.apache.taverna.mobile.data.model.Workflow
> code
> > to
> > > >> > accept the above xml format as well?
> > > >> >
> > > >> > Cheers,
> > > >> >
> > > >> > Ian
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >>
> > > >> *With warm regards  *
> > > >> *Sincerely yours*
> > > >> Sagar
> > > >>
> > > >>
> > > >> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> > > >> *Cluster Innovation Centre*
> > > >> *University of Delhi *
> > > >>
> > > >
> > > >
> > >
> >
> >
> >
> > --
> >
> > *With warm regards  *
> > *Sincerely yours*
> > Sagar
> >
> >
> > *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> > *Cluster Innovation Centre*
> > *University of Delhi *
> >
>



-- 

*With warm regards  *
*Sincerely yours*
Sagar


*Student ,(7th Semester )B.Tech IT and mathematical innovation*
*Cluster Innovation Centre*
*University of Delhi *

Re: Help needed with android xml parsing

Posted by Ian Dunlop <ia...@gmail.com>.
Hello,

I have pushed the ian_my_workflows branch to
https://github.com/ianwdunlop/incubator-taverna-mobile
Still not sure why the apache repo branch wasn't mirrored to github though.

Cheers,

Ian

On 12 August 2016 at 13:58, Sagar <ku...@gmail.com> wrote:

> Can you provide me the link ? I am unable to find it on GitHub.
>
> On Fri, Aug 12, 2016 at 5:40 PM, Ian Dunlop <ia...@gmail.com> wrote:
>
> > Hello,
> >
> > I changed the User class using your code snippet but I am still getting
> the
> > same error. I have pushed a branch into the apache git repo called
> > ian_my_workflows. This should be mirrored into github (hopefully) and you
> > can see the code I have added - mainly a MyWorkflow fragment etc plus
> data
> > manager/API addition to fetch the worklfows for the logged in user. I
> guess
> > this is a good chance for us to understand and document how to add
> > functionality to the app.
> >
> > Cheers,
> >
> > Ian
> >
> > On 12 August 2016 at 12:40, Ian Dunlop <ia...@gmail.com> wrote:
> >
> > > Hello,
> > >
> > > Thanks for the tips and code Sagar. Much appreciated.
> > >
> > > Cheers,
> > >
> > > Ian
> > >
> > > On 12 August 2016 at 10:09, Sagar <ku...@gmail.com> wrote:
> > >
> > >> Hi Ian,
> > >>
> > >> To parse the xml that was given by you . You have to add some object
> in
> > >> Java Beans in user .
> > >>
> > >> 1. *Workflows* object's element  in User java bean
> > >>
> > >> 2. Add required = false in @element annotation of  title and type in
> > >> *Workflow* java bean.
> > >>
> > >> You can see the changed code at Github Gist
> > >> <https://gist.github.com/sagar15795/ec65c84a5a14c32691b493f4841331ce>
> > >>
> > >> I have tried it. And I found an error that we can not use @element
> and @
> > >> text annotation together in SimpleXML parser . So we can not get the
> > >> workflow as element's text using current java bean. we can get all the
> > >> rest
> > >> elements and attribute.
> > >>
> > >> I am trying to rectify it.
> > >>
> > >> On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <ia...@gmail.com>
> > wrote:
> > >>
> > >> > Hello,
> > >> >
> > >> > I have been trying to understand how the taverna mobile application
> > >> works.
> > >> > I added some functionality to list your own workflows (rather than
> all
> > >> of
> > >> > them or your favourites). I  can get the app to request 'my'
> workflow
> > >> list
> > >> > from myExperiment but when the app tries to parse it I get the
> > following
> > >> > error:
> > >> >
> > >> > org.simpleframework.xml.core.AttributeException: Attribute 'uri'
> does
> > >> not
> > >> > have a match in class org.apache.taverna.mobile.
> data.model.Workflows
> > at
> > >> > line 2
> > >> >
> > >> > Here is the xml that is returned:
> > >> >
> > >> > <?xml version="1.0" encoding="UTF-8"?>
> > >> > <user uri="http://www.myexperiment.org/user.xml?id=474" resource="
> > >> > http://www.myexperiment.org/users/474" id="474">
> > >> >   <workflows>
> > >> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=2770
> "
> > >> > resource="http://www.myexperiment.org/workflows/2770" id="2770"
> > >> > version="1">Disability estimates by year</workflow>
> > >> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=3628
> "
> > >> > resource="http://www.myexperiment.org/workflows/3628" id="3628"
> > >> > version="4">Free text search to Concept Wiki URI</workflow>
> > >> >   </workflows>
> > >> > </user>
> > >> >
> > >> >
> > >> > This is different from the format that the 'All workflows' returns
> > >> within
> > >> > the app.
> > >> > I'm not sure what line 2 refers to here, is it the class or the xml?
> > If
> > >> it
> > >> > is the xml  then is it the <user> node that it doesn't like. The
> > >> > simpleframework docs seem to suggest that you can have optional
> > elements
> > >> > http://simple.sourceforge.net/download/stream/doc/tutorial/
> > >> > tutorial.php#optional.
> > >> > Can it be told to ignore  elements?
> > >> > So....how can I change the org.apache.taverna.mobile.data
> > >> .model.Workflows
> > >> > and I guess the org.apache.taverna.mobile.data.model.Workflow code
> to
> > >> > accept the above xml format as well?
> > >> >
> > >> > Cheers,
> > >> >
> > >> > Ian
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >>
> > >> *With warm regards  *
> > >> *Sincerely yours*
> > >> Sagar
> > >>
> > >>
> > >> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> > >> *Cluster Innovation Centre*
> > >> *University of Delhi *
> > >>
> > >
> > >
> >
>
>
>
> --
>
> *With warm regards  *
> *Sincerely yours*
> Sagar
>
>
> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> *Cluster Innovation Centre*
> *University of Delhi *
>

Re: Help needed with android xml parsing

Posted by Sagar <ku...@gmail.com>.
Can you provide me the link ? I am unable to find it on GitHub.

On Fri, Aug 12, 2016 at 5:40 PM, Ian Dunlop <ia...@gmail.com> wrote:

> Hello,
>
> I changed the User class using your code snippet but I am still getting the
> same error. I have pushed a branch into the apache git repo called
> ian_my_workflows. This should be mirrored into github (hopefully) and you
> can see the code I have added - mainly a MyWorkflow fragment etc plus data
> manager/API addition to fetch the worklfows for the logged in user. I guess
> this is a good chance for us to understand and document how to add
> functionality to the app.
>
> Cheers,
>
> Ian
>
> On 12 August 2016 at 12:40, Ian Dunlop <ia...@gmail.com> wrote:
>
> > Hello,
> >
> > Thanks for the tips and code Sagar. Much appreciated.
> >
> > Cheers,
> >
> > Ian
> >
> > On 12 August 2016 at 10:09, Sagar <ku...@gmail.com> wrote:
> >
> >> Hi Ian,
> >>
> >> To parse the xml that was given by you . You have to add some object in
> >> Java Beans in user .
> >>
> >> 1. *Workflows* object's element  in User java bean
> >>
> >> 2. Add required = false in @element annotation of  title and type in
> >> *Workflow* java bean.
> >>
> >> You can see the changed code at Github Gist
> >> <https://gist.github.com/sagar15795/ec65c84a5a14c32691b493f4841331ce>
> >>
> >> I have tried it. And I found an error that we can not use @element and @
> >> text annotation together in SimpleXML parser . So we can not get the
> >> workflow as element's text using current java bean. we can get all the
> >> rest
> >> elements and attribute.
> >>
> >> I am trying to rectify it.
> >>
> >> On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <ia...@gmail.com>
> wrote:
> >>
> >> > Hello,
> >> >
> >> > I have been trying to understand how the taverna mobile application
> >> works.
> >> > I added some functionality to list your own workflows (rather than all
> >> of
> >> > them or your favourites). I  can get the app to request 'my' workflow
> >> list
> >> > from myExperiment but when the app tries to parse it I get the
> following
> >> > error:
> >> >
> >> > org.simpleframework.xml.core.AttributeException: Attribute 'uri' does
> >> not
> >> > have a match in class org.apache.taverna.mobile.data.model.Workflows
> at
> >> > line 2
> >> >
> >> > Here is the xml that is returned:
> >> >
> >> > <?xml version="1.0" encoding="UTF-8"?>
> >> > <user uri="http://www.myexperiment.org/user.xml?id=474" resource="
> >> > http://www.myexperiment.org/users/474" id="474">
> >> >   <workflows>
> >> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=2770"
> >> > resource="http://www.myexperiment.org/workflows/2770" id="2770"
> >> > version="1">Disability estimates by year</workflow>
> >> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=3628"
> >> > resource="http://www.myexperiment.org/workflows/3628" id="3628"
> >> > version="4">Free text search to Concept Wiki URI</workflow>
> >> >   </workflows>
> >> > </user>
> >> >
> >> >
> >> > This is different from the format that the 'All workflows' returns
> >> within
> >> > the app.
> >> > I'm not sure what line 2 refers to here, is it the class or the xml?
> If
> >> it
> >> > is the xml  then is it the <user> node that it doesn't like. The
> >> > simpleframework docs seem to suggest that you can have optional
> elements
> >> > http://simple.sourceforge.net/download/stream/doc/tutorial/
> >> > tutorial.php#optional.
> >> > Can it be told to ignore  elements?
> >> > So....how can I change the org.apache.taverna.mobile.data
> >> .model.Workflows
> >> > and I guess the org.apache.taverna.mobile.data.model.Workflow code to
> >> > accept the above xml format as well?
> >> >
> >> > Cheers,
> >> >
> >> > Ian
> >> >
> >>
> >>
> >>
> >> --
> >>
> >> *With warm regards  *
> >> *Sincerely yours*
> >> Sagar
> >>
> >>
> >> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> >> *Cluster Innovation Centre*
> >> *University of Delhi *
> >>
> >
> >
>



-- 

*With warm regards  *
*Sincerely yours*
Sagar


*Student ,(6th Semester )B.Tech IT and mathematical innovation*
*Cluster Innovation Centre*
*University of Delhi *

Re: Help needed with android xml parsing

Posted by Ian Dunlop <ia...@gmail.com>.
Hello,

I changed the User class using your code snippet but I am still getting the
same error. I have pushed a branch into the apache git repo called
ian_my_workflows. This should be mirrored into github (hopefully) and you
can see the code I have added - mainly a MyWorkflow fragment etc plus data
manager/API addition to fetch the worklfows for the logged in user. I guess
this is a good chance for us to understand and document how to add
functionality to the app.

Cheers,

Ian

On 12 August 2016 at 12:40, Ian Dunlop <ia...@gmail.com> wrote:

> Hello,
>
> Thanks for the tips and code Sagar. Much appreciated.
>
> Cheers,
>
> Ian
>
> On 12 August 2016 at 10:09, Sagar <ku...@gmail.com> wrote:
>
>> Hi Ian,
>>
>> To parse the xml that was given by you . You have to add some object in
>> Java Beans in user .
>>
>> 1. *Workflows* object's element  in User java bean
>>
>> 2. Add required = false in @element annotation of  title and type in
>> *Workflow* java bean.
>>
>> You can see the changed code at Github Gist
>> <https://gist.github.com/sagar15795/ec65c84a5a14c32691b493f4841331ce>
>>
>> I have tried it. And I found an error that we can not use @element and @
>> text annotation together in SimpleXML parser . So we can not get the
>> workflow as element's text using current java bean. we can get all the
>> rest
>> elements and attribute.
>>
>> I am trying to rectify it.
>>
>> On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <ia...@gmail.com> wrote:
>>
>> > Hello,
>> >
>> > I have been trying to understand how the taverna mobile application
>> works.
>> > I added some functionality to list your own workflows (rather than all
>> of
>> > them or your favourites). I  can get the app to request 'my' workflow
>> list
>> > from myExperiment but when the app tries to parse it I get the following
>> > error:
>> >
>> > org.simpleframework.xml.core.AttributeException: Attribute 'uri' does
>> not
>> > have a match in class org.apache.taverna.mobile.data.model.Workflows at
>> > line 2
>> >
>> > Here is the xml that is returned:
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <user uri="http://www.myexperiment.org/user.xml?id=474" resource="
>> > http://www.myexperiment.org/users/474" id="474">
>> >   <workflows>
>> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=2770"
>> > resource="http://www.myexperiment.org/workflows/2770" id="2770"
>> > version="1">Disability estimates by year</workflow>
>> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=3628"
>> > resource="http://www.myexperiment.org/workflows/3628" id="3628"
>> > version="4">Free text search to Concept Wiki URI</workflow>
>> >   </workflows>
>> > </user>
>> >
>> >
>> > This is different from the format that the 'All workflows' returns
>> within
>> > the app.
>> > I'm not sure what line 2 refers to here, is it the class or the xml? If
>> it
>> > is the xml  then is it the <user> node that it doesn't like. The
>> > simpleframework docs seem to suggest that you can have optional elements
>> > http://simple.sourceforge.net/download/stream/doc/tutorial/
>> > tutorial.php#optional.
>> > Can it be told to ignore  elements?
>> > So....how can I change the org.apache.taverna.mobile.data
>> .model.Workflows
>> > and I guess the org.apache.taverna.mobile.data.model.Workflow code to
>> > accept the above xml format as well?
>> >
>> > Cheers,
>> >
>> > Ian
>> >
>>
>>
>>
>> --
>>
>> *With warm regards  *
>> *Sincerely yours*
>> Sagar
>>
>>
>> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
>> *Cluster Innovation Centre*
>> *University of Delhi *
>>
>
>

Re: Help needed with android xml parsing

Posted by Ian Dunlop <ia...@gmail.com>.
Hello,

Thanks for the tips and code Sagar. Much appreciated.

Cheers,

Ian

On 12 August 2016 at 10:09, Sagar <ku...@gmail.com> wrote:

> Hi Ian,
>
> To parse the xml that was given by you . You have to add some object in
> Java Beans in user .
>
> 1. *Workflows* object's element  in User java bean
>
> 2. Add required = false in @element annotation of  title and type in
> *Workflow* java bean.
>
> You can see the changed code at Github Gist
> <https://gist.github.com/sagar15795/ec65c84a5a14c32691b493f4841331ce>
>
> I have tried it. And I found an error that we can not use @element and @
> text annotation together in SimpleXML parser . So we can not get the
> workflow as element's text using current java bean. we can get all the rest
> elements and attribute.
>
> I am trying to rectify it.
>
> On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <ia...@gmail.com> wrote:
>
> > Hello,
> >
> > I have been trying to understand how the taverna mobile application
> works.
> > I added some functionality to list your own workflows (rather than all of
> > them or your favourites). I  can get the app to request 'my' workflow
> list
> > from myExperiment but when the app tries to parse it I get the following
> > error:
> >
> > org.simpleframework.xml.core.AttributeException: Attribute 'uri' does
> not
> > have a match in class org.apache.taverna.mobile.data.model.Workflows at
> > line 2
> >
> > Here is the xml that is returned:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <user uri="http://www.myexperiment.org/user.xml?id=474" resource="
> > http://www.myexperiment.org/users/474" id="474">
> >   <workflows>
> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=2770"
> > resource="http://www.myexperiment.org/workflows/2770" id="2770"
> > version="1">Disability estimates by year</workflow>
> >     <workflow uri="http://www.myexperiment.org/workflow.xml?id=3628"
> > resource="http://www.myexperiment.org/workflows/3628" id="3628"
> > version="4">Free text search to Concept Wiki URI</workflow>
> >   </workflows>
> > </user>
> >
> >
> > This is different from the format that the 'All workflows' returns within
> > the app.
> > I'm not sure what line 2 refers to here, is it the class or the xml? If
> it
> > is the xml  then is it the <user> node that it doesn't like. The
> > simpleframework docs seem to suggest that you can have optional elements
> > http://simple.sourceforge.net/download/stream/doc/tutorial/
> > tutorial.php#optional.
> > Can it be told to ignore  elements?
> > So....how can I change the org.apache.taverna.mobile.
> data.model.Workflows
> > and I guess the org.apache.taverna.mobile.data.model.Workflow code to
> > accept the above xml format as well?
> >
> > Cheers,
> >
> > Ian
> >
>
>
>
> --
>
> *With warm regards  *
> *Sincerely yours*
> Sagar
>
>
> *Student ,(6th Semester )B.Tech IT and mathematical innovation*
> *Cluster Innovation Centre*
> *University of Delhi *
>

Re: Help needed with android xml parsing

Posted by Sagar <ku...@gmail.com>.
Hi Ian,

To parse the xml that was given by you . You have to add some object in
Java Beans in user .

1. *Workflows* object's element  in User java bean

2. Add required = false in @element annotation of  title and type in
*Workflow* java bean.

You can see the changed code at Github Gist
<https://gist.github.com/sagar15795/ec65c84a5a14c32691b493f4841331ce>

I have tried it. And I found an error that we can not use @element and @
text annotation together in SimpleXML parser . So we can not get the
workflow as element's text using current java bean. we can get all the rest
elements and attribute.

I am trying to rectify it.

On Thu, Aug 11, 2016 at 8:20 PM, Ian Dunlop <ia...@gmail.com> wrote:

> Hello,
>
> I have been trying to understand how the taverna mobile application works.
> I added some functionality to list your own workflows (rather than all of
> them or your favourites). I  can get the app to request 'my' workflow list
> from myExperiment but when the app tries to parse it I get the following
> error:
>
> org.simpleframework.xml.core.AttributeException: Attribute 'uri' does not
> have a match in class org.apache.taverna.mobile.data.model.Workflows at
> line 2
>
> Here is the xml that is returned:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <user uri="http://www.myexperiment.org/user.xml?id=474" resource="
> http://www.myexperiment.org/users/474" id="474">
>   <workflows>
>     <workflow uri="http://www.myexperiment.org/workflow.xml?id=2770"
> resource="http://www.myexperiment.org/workflows/2770" id="2770"
> version="1">Disability estimates by year</workflow>
>     <workflow uri="http://www.myexperiment.org/workflow.xml?id=3628"
> resource="http://www.myexperiment.org/workflows/3628" id="3628"
> version="4">Free text search to Concept Wiki URI</workflow>
>   </workflows>
> </user>
>
>
> This is different from the format that the 'All workflows' returns within
> the app.
> I'm not sure what line 2 refers to here, is it the class or the xml? If it
> is the xml  then is it the <user> node that it doesn't like. The
> simpleframework docs seem to suggest that you can have optional elements
> http://simple.sourceforge.net/download/stream/doc/tutorial/
> tutorial.php#optional.
> Can it be told to ignore  elements?
> So....how can I change the org.apache.taverna.mobile.data.model.Workflows
> and I guess the org.apache.taverna.mobile.data.model.Workflow code to
> accept the above xml format as well?
>
> Cheers,
>
> Ian
>



-- 

*With warm regards  *
*Sincerely yours*
Sagar


*Student ,(6th Semester )B.Tech IT and mathematical innovation*
*Cluster Innovation Centre*
*University of Delhi *