Skip to content
Browse files

Latest changes

  • Loading branch information...
1 parent 1a043f4 commit f8db644ad67462054f501fc3e5e3570595212ba7 InterCommIT committed Aug 3, 2011
View
15 README
@@ -27,4 +27,17 @@ There are still some TODO's left in the code, but 95% is working fine.
-- Building --
-Use maven as such: mvn clean install , it will then build and test the library and place it in your local repository. From there you can create a dependency in your own Tapestry project and Weaves will be auto-loaded by Tapestry.
+Use maven as such: mvn clean install , it will then build and test the library and place it in your local repository. From there you can create a dependency in your own Tapestry project and Weaves will be auto-loaded by Tapestry.
+
+-- Testing --
+
+Currently at around 70% coverage. Still some work to do to increase coverage.
+
+-- DEMO --
+
+A working demo can be found at: http://intercommitweavesdemo.intercommit.cloudbees.net/
+There are 3 parts still not (correctly) working at the demo site:
+
+TextMarker demo - Crashes with a internal Tapestry exception
+ModalBox demo - Crashes with a internal Tapestry exception
+Hibernate demo - Seems to ignore the Layout component
View
2 pom.xml
@@ -14,7 +14,7 @@
</organization>
<properties>
- <tapestry.version>5.2.4</tapestry.version>
+ <tapestry.version>5.2.6</tapestry.version>
</properties>
<dependencies>
View
37 src/main/java/nl/intercommit/weaves/components/DropDownMenu.java
@@ -57,6 +57,8 @@
@Property
private MenuItem level3;
+ private boolean matched = false;
+
@SetupRender
private void initJavaScript() {
js.addScript("initMenu();", "");
@@ -92,7 +94,7 @@ public boolean getHasLevel1() {
public boolean getHasLevel2() {
if (getHasLevel1()) {
- return menu.get(level1).keySet() != null;
+ return menu.get(level1) != null;
}
return false;
}
@@ -110,15 +112,17 @@ public String getSelectedClass() {
if (matchesRequest(topLevel,topLevel)) {
return "toplevelselected";
}
- for (MenuItem level2: menu.get(topLevel).keySet()) {
- if (matchesRequest(level2,topLevel)) {
- return "toplevelselected";
- }
- if (menu.get(topLevel).get(level2) !=null ) {
-
- for (Object level3: menu.get(topLevel).get(level2).toArray()) {
- if (matchesRequest((MenuItem)level3,topLevel)) {
- return "toplevelselected";
+ if (menu.get(topLevel) != null) {
+ for (MenuItem level2: menu.get(topLevel).keySet()) {
+ if (matchesRequest(level2,topLevel)) {
+ return "toplevelselected";
+ }
+ if (menu.get(topLevel).get(level2) !=null ) {
+
+ for (Object level3: menu.get(topLevel).get(level2).toArray()) {
+ if (matchesRequest((MenuItem)level3,topLevel)) {
+ return "toplevelselected";
+ }
}
}
}
@@ -128,13 +132,18 @@ public String getSelectedClass() {
}
private boolean matchesRequest(final MenuItem menu,final MenuItem currentLevel) {
-
+ if (matched) {
+ return false;
+ }
+ String basePath = menu.getUrl().getBasePath();
String reqPath = request.getPath();
if (!request.getContextPath().equals("")) {
- reqPath = request.getContextPath() + reqPath;
+ basePath = basePath.substring(request.getContextPath().length());
}
- return (menu.getUrl().getBasePath().startsWith(reqPath) &&
- currentLevel == level1) ;
+ matched = (basePath.startsWith(reqPath) &&
+ currentLevel == level1 &&
+ reqPath.length() > 1) ;
+ return matched;
}
}
View
1 src/main/java/nl/intercommit/weaves/components/EditableSelectBox.java
@@ -70,7 +70,6 @@
@Inject
private ComponentDefaultProvider defaultProvider;
- // Maybe this should default to property "<componentId>Model"?
/**
* The model used to identify the option groups and options to be presented to the user. This can be generated
* automatically for Enum types.
View
5 src/main/java/nl/intercommit/weaves/components/Grid.java
@@ -22,12 +22,9 @@
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.SetupRender;
/**
- * This class is needed because its the only way to override the default grid pager component
- * Or you have a better idea ?
+ * This class is needed because we needed to override the Pager component
*
* @see org.apache.tapestry5.corelib.components.Grid
- *
- * @author antalk
*
*/
public class Grid extends org.apache.tapestry5.corelib.components.Grid {
View
3 src/main/java/nl/intercommit/weaves/components/ModalBox.java
@@ -38,8 +38,6 @@
* href='http://okonet.ru/projects/modalbox/index.html'>ModalBox</a> for details
* This component uses version 1.5.5
*
- * @author Taha Hafeez
- * @contributor antalk
* @notes copied from : http://tapestry.1045711.n5.nabble.com/Modalbox-Integration-Example-td4248936.html#a4257039
*
*/
@@ -118,7 +116,6 @@ void afterRender(final MarkupWriter writer) {
if (EVENT_TYPE.equalsIgnoreCase(type)) {
link = resources.createEventLink(event, contextArray);
} else { // if(PAGE_TYPE.equals(type)){
- System.out.println("Page Link");
link = pageRenderLinkSource.createPageRenderLinkWithContext(
pageName, contextArray);
}
View
5 src/main/java/nl/intercommit/weaves/components/PagedGrid.java
@@ -70,11 +70,6 @@
* Also when using checkboxes, make sure the rowidentifier function returns a unique index for the datasource, in case
* of hibernate this will be a primary key so not a problem. But in case of a Collection the source may have been altered in
* the meantime and thus give back the wrong rows.
- *
- * TODO: you cannot use 2 pagedgrid at a time on one page(!!)
- * well.. you can but one of them is not working correctly..
- *
- * @author antalk
*
*/
@Events(value=PagedGrid.ROW_SELECTED_EVENT)
View
3 src/main/java/nl/intercommit/weaves/components/PagedGridPager.java
@@ -97,9 +97,6 @@ void beginRender(final MarkupWriter writer)
final Element divPagerRows = writer.element("div", "class","paged_rows");
for (final Long size: pagination) {
-
-
-
/*
* Generate an eventlink for the container which normally is the org.apache.tapestry5.corelib.components.Grid component
* and generate an event for it, the PagedGrid for example catches this event..
View
2 src/main/java/nl/intercommit/weaves/components/PopupWindow.java
@@ -37,8 +37,6 @@
* Ajax popup window based on chenillekit window {@link Window}
*
* Must have a zoneName parameter, this will allow the window to listen to zone update events and show this window.
- *
- * @author antalk
*
*/
@Import(library={"PopupWindow.js"})
View
3 src/main/java/nl/intercommit/weaves/components/Switch.java
@@ -29,10 +29,7 @@
/**
* A switch component for enum types or anything based on a object array
* Items in the list should have a decent toString method
- *
- * @author antalk
*/
-
@SupportsInformalParameters
public class Switch extends BasicClientElement {
View
4 src/main/java/nl/intercommit/weaves/components/TextMarker.java
@@ -23,10 +23,10 @@
import nl.intercommit.weaves.base.BasicClientElement;
-import org.apache.tapestry5.annotations.BeginRender;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SetupRender;
/**
* Marks specific keywords in a text with a yellow background.
*
@@ -54,7 +54,7 @@
@Property
private Match match;
- @BeginRender
+ @SetupRender
public void makeMatches() {
final String[] lowerCaseKeywords= new String[keywords.length];
View
5 src/main/java/nl/intercommit/weaves/grid/CollectionFilter.java
@@ -18,11 +18,6 @@
*/
package nl.intercommit.weaves.grid;
-/*
- *
- * TODO: check Is there some existing library forthis ??
- *
- */
public class CollectionFilter {
private String name;
View
2 src/main/java/nl/intercommit/weaves/grid/HibernatePagedGridDataSource.java
@@ -30,8 +30,6 @@
*
* When you want to enable checkboxes on the grid, the only allowed entitytypes are the ones with a Long as primary key !
* Otherwise you can also use composite keys
- *
- * @author antalk
*
*/
public class HibernatePagedGridDataSource extends PagedGridDataSource {
View
2 src/main/java/nl/intercommit/weaves/grid/PagedGridDataSource.java
@@ -29,8 +29,6 @@
*
* Warning: the preparedResults are internally (Tapestry) cached, each request for a row will return a new implementation of THIS class.
* Meaning that you cannot store any values in this class!
- *
- * @author antalk
*
*/
public abstract class PagedGridDataSource implements GridDataSource {
View
2 src/main/java/nl/intercommit/weaves/util/HoverlinkStreamResponse.java
@@ -57,8 +57,6 @@ public InputStream getStream() throws IOException {
@Override
public void prepareResponse(Response response) {
- // TODO Auto-generated method stub
-
}
private String encodeHTML(String s)
View
2 src/test/java/nl/intercommit/weaves/TestConfirm.java
@@ -29,7 +29,7 @@ public void testConfirmationPopup() {
assertNull(dom.getElementById("t-error"));
assertFalse(dom.toString().contains("<h1 class=\"t-exception-report\">"));
- System.err.println(dom);
+ //System.err.println(dom);
assertNotNull(dom.getElementById("actionlink"));
assertTrue(dom.toString().contains("new Confirm('actionlink', 'Are you sure?')"));
View
2 src/test/java/nl/intercommit/weaves/TestModalBox.java
@@ -28,7 +28,7 @@
public void testModalBox() {
org.apache.tapestry5.dom.Document dom = getTester().renderPage("ModalBoxPage");
- System.err.println(dom);
+ //System.err.println(dom);
assertNotNull(dom);
assertNull(dom.getElementById("t-error"));
View
4 src/test/java/util/WeaveTestCase.java
@@ -24,7 +24,7 @@
public abstract class WeaveTestCase extends TestCase {
- private PageTester tester;
+ private static PageTester tester;
@Override
protected void setUp() throws Exception {
@@ -36,9 +36,11 @@ protected void setUp() throws Exception {
@Override
protected void tearDown() throws Exception {
+ /*
if (tester != null) {
tester.shutdown();
}
+ */
}
public PageTester getTester() {

0 comments on commit f8db644

Please sign in to comment.
Something went wrong with that request. Please try again.