01: /*
02: * Created on Oct 18, 2004
03: */
04: package com.openedit.modules.scheduler;
05:
06: import java.util.Iterator;
07: import java.util.List;
08:
09: import org.openedit.repository.RepositoryException;
10:
11: import com.openedit.WebPageRequest;
12: import com.openedit.modules.BaseModule;
13:
14: /**
15: * @author Matthew Avery, mavery@einnovation.com
16: */
17: public class TestModule extends BaseModule {
18: int count = 0;
19: int restrictedCount = 0;
20:
21: public void test(WebPageRequest inContext) {
22: count++;
23: System.out.println("Called TestModule.test " + count
24: + " times.");
25: }
26:
27: public void testRestricted(WebPageRequest inReq) {
28: restrictedCount++;
29: System.out.println("Called TestModule.testRestricted "
30: + getRestrictedCount() + " times.");
31: }
32:
33: public int getCount() {
34: return count;
35: }
36:
37: public int getRestrictedCount() {
38: return restrictedCount;
39: }
40:
41: public void files(WebPageRequest req) throws Exception {
42: if (req.getRequestParameter("path") == null)
43: return;
44: List list = getPageManager().getChildrenPaths(
45: req.getRequestParameter("path"));
46: //for (int i=list.size()-1; i>=0; i--) {
47: //String path=(String) list.get(i);
48: //if (!getPageManager().getPage(path).isImage())
49: //list.remove(i);
50: /*else if (path.lastIndexOf('.')!=-1) {
51: String ext=path.substring(path.lastIndexOf('.')+1);
52: if (!ext.equals("xconf"))
53: list.remove(i);
54: }*/
55: //}
56: req.putPageValue("childs", list);
57:
58: }
59: }
|