This commit is contained in:
parent
d1b245f55d
commit
2e3b66a22f
15 changed files with 699 additions and 34 deletions
|
|
@ -26,18 +26,26 @@ import wa.server.WAAbstractPage;
|
|||
import wa.server.WAContext;
|
||||
import wa.server.page.struct.WANavigation;
|
||||
import wa.server.plugin.WAService;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.Templator;
|
||||
import zutil.plugin.PluginManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2015-04-06.
|
||||
*/
|
||||
public class ServicesPage implements WAPage {
|
||||
private static final Logger log = LogUtil.getLogger();
|
||||
private static final String TMPL_FILE = "";
|
||||
|
||||
private ArrayList<WAService> plugins;
|
||||
|
||||
public ServicesPage(PluginManager pluginManager){
|
||||
|
|
@ -56,6 +64,18 @@ public class ServicesPage implements WAPage {
|
|||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) {
|
||||
|
||||
try {
|
||||
WAService obj = getPlugin(context);
|
||||
|
||||
if (obj != null) {
|
||||
Templator tmpl = new Templator(FileUtil.find(TMPL_FILE));
|
||||
tmpl.set("nav", context.getBreadcrumb().get(1));
|
||||
return tmpl;
|
||||
}
|
||||
}catch (IOException e){
|
||||
log.log(Level.SEVERE, null, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -64,6 +84,17 @@ public class ServicesPage implements WAPage {
|
|||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private WAService getPlugin(WAContext context){
|
||||
if(context.getBreadcrumb().size() >= 2){
|
||||
int i = plugins.indexOf(context.getBreadcrumb().get(1).getResource());
|
||||
if(i >= 0)
|
||||
return plugins.get(i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue