0
|
1 package nabble.model;
|
|
2
|
|
3 import fschmidt.db.DbDatabase;
|
|
4 import fschmidt.db.DbObject;
|
|
5 import fschmidt.db.NoKey;
|
|
6 import nabble.naml.compiler.Program;
|
|
7 import nabble.naml.compiler.Template;
|
|
8 import nabble.naml.compiler.CompileException;
|
|
9 import nabble.model.export.NodeData;
|
|
10
|
|
11 import java.io.File;
|
|
12 import java.sql.ResultSet;
|
|
13 import java.sql.SQLException;
|
|
14 import java.util.Collection;
|
|
15 import java.util.Date;
|
|
16 import java.util.List;
|
|
17 import java.util.Map;
|
|
18
|
|
19
|
|
20 public interface Site extends Message.Source, DbObject<NoKey,SiteImpl> {
|
|
21 public DbDatabase getDb();
|
|
22 public long getId();
|
|
23 public Node getRootNode();
|
|
24 public Date getWhenCreated();
|
|
25 public Program getProgram();
|
|
26 public Template getTemplate(String templateName,Class... base);
|
|
27 public void setCustomDomain(String customDomain);
|
|
28 public String getCustomDomain();
|
|
29 public String getBaseUrl();
|
|
30 public int getActivity();
|
|
31 public boolean isEmbarrassing();
|
|
32 public void setEmbarrassing(boolean isEmbarrassing);
|
|
33 public Date getDeleteDate();
|
|
34 public void clearDeleteDate();
|
|
35 public void deleteRootNode() throws ModelException; // root must have one child
|
|
36 public void delete();
|
|
37
|
|
38 public User getUser(long id);
|
|
39 public User getUserFromEmail(String email);
|
|
40 public User getUserFromName(String name);
|
|
41 public User getOrCreateUnregisteredUser(String email,String name) throws ModelException;
|
|
42 public User getOrCreateUser(String email);
|
|
43 public User getOrCreateUser(String email,String name); // for export/import
|
|
44 public String newRegistration(String email,String password,String name,String nextUrl) throws ModelException;
|
|
45 public User getRegistration(String registrationKey) throws ModelException;
|
|
46
|
|
47 public List<User> getUsers(String cnd);
|
|
48 public List<User> getUsersByNodeCount(int i, int n, String cnd);
|
|
49 public int getUserCount(String cnd);
|
|
50
|
|
51 public Person getAnonymous(String cookie, String name);
|
|
52 public String newAnonymousCookie();
|
|
53 public Person getPerson(String id);
|
|
54
|
|
55 public void addTag(Node node,User user,String label);
|
|
56 public void deleteTags(Node node,User user,String sqlCondition);
|
|
57 public void deleteTags(String sqlCondition); // doesn't clear caches
|
|
58 public boolean hasTags(Node node,User user,String sqlCondition);
|
|
59 public int countTags(String sqlCondition);
|
|
60 public List<String> findTagLabels(String sqlCondition);
|
|
61 public List<User> findTagUsers(String sqlCondition);
|
|
62 public List<Long> findTagUserIds(String sqlCondition);
|
|
63 public List<Node> findTagNodes(String sqlCondition);
|
|
64 public List<Long> findTagNodeIds(String sqlCondition);
|
|
65
|
|
66 public boolean isModuleEnabled(String moduleName);
|
|
67 public void setModuleEnabled(String moduleName,boolean isEnabled);
|
|
68 public Map<String,String> getCustomTweaks();
|
|
69 public void setCustomTweaks(Map<String,String> tweaks);
|
|
70 public boolean setTweakException(CompileException tweakException);
|
|
71 public CompileException getTweakException();
|
|
72 public void update();
|
|
73 public Site getGoodCopy();
|
|
74
|
|
75 // moved from ModelHome
|
|
76 public Node getNode(long id);
|
|
77 public Node getNode(ResultSet rs) throws SQLException;
|
|
78 public Collection<? extends Node> getNodes(Collection<Long> ids);
|
|
79 public NodeIterator<? extends Node> getNodeIterator(String sql,DbParamSetter paramSetter);
|
|
80
|
|
81 public String getProperty(String key);
|
|
82 public void setProperty(String key,String value);
|
|
83
|
|
84 public boolean isValidConfiguration(String name);
|
|
85 public void deleteConfiguration(String name);
|
|
86 public void saveConfiguration(String name,String value,String naml);
|
|
87 public String getConfigurationValue(String name);
|
|
88 public String getConfigurationTweak();
|
|
89
|
|
90 public String getNextUrl(String registrationKey);
|
|
91 public Node newNode(NodeData data) throws ModelException;
|
|
92 public Collection<Node> cacheLastNodes(Collection<Node> nodes);
|
|
93
|
|
94 public <T> T getExtension(ExtensionFactory<Site,T> factory);
|
|
95 public void addTask(String task);
|
|
96
|
|
97 public File backup();
|
|
98 public void backup(String filename);
|
|
99 public void backupSchema(String filename);
|
|
100 }
|