package org.zanata.rest.editor.dto;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.zanata.common.LocaleId;
import org.zanata.rest.dto.resource.TextFlow;

/**
 * TextFlow with added fields needed by the editor.
 *
 * This class holds extra TextFlow metadata for serialization so that it is
 * available in the editor without extra network traffic.
 *
 * @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a>
 */
@JsonPropertyOrder({ "id", "lang", "content", "contents", "plural",
    "extensions", "wordCount" })
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class EditorTextFlow extends TextFlow {

    public EditorTextFlow() {
        super(null, null, (String) null);
    }

    public EditorTextFlow(String id, LocaleId lang) {
        super(id, lang);
    }
    private int wordCount;

    public int getWordCount() {
        return wordCount;
    }

    public void setWordCount(int wordCount) {
        this.wordCount = wordCount;
    }
}

@@ -283,16 +283,40 @@
 tFlow;%0A%0A
+import java.util.Date;%0A%0A
 /**%0A * T
@@ -832,16 +832,245 @@
 Flow %7B%0A%0A
+    private int wordCount;%0A    private String msgCtxt;%0A    private String sourceReferences;%0A    private String sourceFlags;%0A    private String sourceComment;%0A    private String lastModifiedBy;%0A    private Date lastModifiedTime;%0A%0A
     publ
@@ -1228,35 +1228,8 @@
    %7D
-%0A    private int wordCount;
 %0A%0A  
@@ -1373,16 +1373,1111 @@
 dCount;%0A
-
     %7D%0A
+%0A    public String getMsgCtxt() %7B%0A        return msgCtxt;%0A    %7D%0A%0A    public void setMsgCtxt(String msgCtxt) %7B%0A        this.msgCtxt = msgCtxt;%0A    %7D%0A%0A    public String getSourceReferences() %7B%0A        return sourceReferences;%0A    %7D%0A%0A    public void setSourceReferences(String sourceReferences) %7B%0A        this.sourceReferences = sourceReferences;%0A    %7D%0A%0A    public String getsourceFlags() %7B%0A        return sourceFlags;%0A    %7D%0A%0A    public void setsourceFlags(String sourceFlags) %7B%0A        this.sourceFlags = sourceFlags;%0A    %7D%0A%0A    public String getSourceComment() %7B%0A        return sourceComment;%0A    %7D%0A%0A    public void setSourceComment(String sourceComment) %7B%0A        this.sourceComment = sourceComment;%0A    %7D%0A%0A    public String getLastModifiedBy() %7B%0A        return lastModifiedBy;%0A    %7D%0A%0A    public void setLastModifiedBy(String lastModifiedBy) %7B%0A        this.lastModifiedBy = lastModifiedBy;%0A    %7D%0A%0A    public Date getLastModifiedTime() %7B%0A        return lastModifiedTime;%0A    %7D%0A%0A    public void setLastModifiedTime(Date lastModifiedTime) %7B%0A        this.lastModifiedTime = lastModifiedTime;%0A    %7D%0A%0A
 %7D%0A

add required data to EditorTextFlow