package org.apache.taverna.mobile.data.model;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Text;

import android.os.Parcel;
import android.os.Parcelable;


public class Workflow implements Parcelable {
    @Attribute(name = "resource", required = false)
    String resource;
    @Attribute(name = "uri", required = false)
    String uri;
    @Attribute(name = "id", required = false)
    String id;
    @Attribute(name = "version", required = false)
    String version;
    @Text
    String content;

    public String getResource() {
        return resource;
    }

    public void setResource(String resource) {
        this.resource = resource;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.resource);
        dest.writeString(this.uri);
        dest.writeString(this.id);
        dest.writeString(this.version);
        dest.writeString(this.content);
    }

    public Workflow() {
    }

    protected Workflow(Parcel in) {
        this.resource = in.readString();
        this.uri = in.readString();
        this.id = in.readString();
        this.version = in.readString();
        this.content = in.readString();
    }

    public static final Creator<Workflow> CREATOR = new Creator<Workflow>() {
        @Override
        public Workflow createFromParcel(Parcel source) {
            return new Workflow(source);
        }

        @Override
        public Workflow[] newArray(int size) {
            return new Workflow[size];
        }
    };
}

@@ -113,19 +113,22 @@
 ork.xml.
-Tex
+Elemen
 t;%0A%0Aimpo
@@ -227,16 +227,17 @@
 lable %7B%0A
+%0A
     @Att
@@ -297,24 +297,25 @@
 g resource;%0A
+%0A
     @Attribu
@@ -361,24 +361,25 @@
 String uri;%0A
+%0A
     @Attribu
@@ -423,24 +423,25 @@
  String id;%0A
+%0A
     @Attribu
@@ -503,36 +503,298 @@
 on;%0A
+%0A
     @
-Text%0A    String content
+Element(name = %22title%22)%0A    private String title;%0A%0A    @Element(name = %22type%22)%0A    private Type type;%0A%0A    @Element(name = %22uploader%22)%0A    private Uploader uploader;%0A%0A    @Element(name = %22created-at%22)%0A    private String createdAt;%0A%0A    @Element(name = %22svg%22)%0A    private String svgUri
 ;%0A%0A 
@@ -1361,41 +1361,465 @@
  get
-Content() %7B%0A        return conten
+Title() %7B%0A        return title;%0A    %7D%0A%0A    public void setTitle(String title) %7B%0A        this.title = title;%0A    %7D%0A%0A    public Type getType() %7B%0A        return type;%0A    %7D%0A%0A    public void setType(Type type) %7B%0A        this.type = type;%0A    %7D%0A%0A    public Uploader getUploader() %7B%0A        return uploader;%0A    %7D%0A%0A    public void setUploader(Uploader uploader) %7B%0A        this.uploader = uploader;%0A    %7D%0A%0A    public String getCreatedAt() %7B%0A        return createdA
 t;%0A 
@@ -1844,21 +1844,23 @@
 oid setC
-onten
+reatedA
 t(String
@@ -1861,21 +1861,23 @@
 String c
-onten
+reatedA
 t) %7B%0A   
@@ -1891,24 +1891,170 @@
 is.c
-ontent = content
+reatedAt = createdAt;%0A    %7D%0A%0A    public String getSvgUri() %7B%0A        return svgUri;%0A    %7D%0A%0A    public void setSvgUri(String svgUri) %7B%0A        this.svgUri = svgUri
 ;%0A  
@@ -2050,32 +2050,33 @@
  svgUri;%0A    %7D%0A%0A
+%0A
     @Override%0A  
@@ -2386,23 +2386,202 @@
 ng(this.
-content
+title);%0A        dest.writeParcelable(this.type, flags);%0A        dest.writeParcelable(this.uploader, flags);%0A        dest.writeString(this.createdAt);%0A        dest.writeString(this.svgUri
 );%0A    %7D
@@ -2818,15 +2818,238 @@
 his.
-content
+title = in.readString();%0A        this.type = in.readParcelable(Type.class.getClassLoader());%0A        this.uploader = in.readParcelable(Uploader.class.getClassLoader());%0A        this.createdAt = in.readString();%0A        this.svgUri
  = i

update workflow model