implemented adding new pages
This commit is contained in:
@@ -5,6 +5,7 @@ public class Paths {
|
||||
private Paths(){};
|
||||
|
||||
public static final String ADD = "add";
|
||||
public static final String AVAILABLE = "available";
|
||||
public static final String CSS = "css";
|
||||
public static final String COMMON_TEMPLATES = "common_templates";
|
||||
public static final String JSON = "json";
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.json.JSONObject;
|
||||
|
||||
public class WikiPage implements Mappable {
|
||||
|
||||
private long id;
|
||||
private final long id;
|
||||
private String title;
|
||||
private int version;
|
||||
private final List<Integer> versions = new ArrayList<>();
|
||||
@@ -50,11 +50,6 @@ public class WikiPage implements Mappable {
|
||||
return id;
|
||||
}
|
||||
|
||||
public WikiPage id(long newVal){
|
||||
id = newVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDirty(String field) {
|
||||
return dirtyFields.contains(field);
|
||||
}
|
||||
@@ -109,6 +104,13 @@ public class WikiPage implements Mappable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public WikiPage setNew(){
|
||||
dirtyFields.add(TITLE);
|
||||
dirtyFields.add(CONTENT);
|
||||
dirtyFields.add(MEMBERS);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String title(){
|
||||
return title;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user