Kawai Wiki

Rev

Rev 108 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.kawai.model;

import java.util.Date;

/**
 * Model class Preview.
 *
 * @author Sergio Oliveira
 *
 */

public class Preview {

    /** Attribute id of Preview. */
    private int id;
    /** Attribute userId of Preview. */
    private int userId;
    /** Attribute user of Preview. */
    private User user;
    /** Attribute name of Preview. */
    private String name;
    /** Attribute languageId of Preview. */
    private int languageId;
    /** Attribute title of Preview. */
    private String title;
    /** Attribute body of Preview. */
    private String body;
    /** Attribute createdOn of Preview. */
    private Date createdOn;
    /** Attribute isNew of Preview. */
    private boolean isNew;
    /** Attribute isSystemPage of Preview. */
    private boolean isSystemPage;
    /** Attribute comment of Preview. */
    private String comment;

    /**
     * Default constructor.
     */

    public Preview() { }

    public int getId() {
        return id;
    }

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

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getComment() {
        return comment;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLanguageId() {
        return languageId;
    }

    public void setLanguageId(int languageId) {
        this.languageId = languageId;
    }

    public void setNew(boolean b) {
        this.isNew = b;
    }

    public boolean isNew() {
        return isNew;
    }

    public void setSystemPage(boolean b) {
        this.isSystemPage = b;
    }

    public boolean isSystemPage() {
        return isSystemPage;
    }

    public Page getPage() {
        Page p = new Page();
        p.setId(-1);
        p.setName(name);
        p.setLanguageId(languageId);
        p.setTitle(title);
        p.setBody(body);
        p.setDeleted(false);
        p.setCreatedById(userId);
        p.setCreatedBy(user);
        p.setCreatedOn(createdOn);
        p.setPreview(true);
        p.setNew(isNew);
        p.setSystemPage(isSystemPage);
        p.setComment(comment);

        return p;
    }
}