Author: rfelden
Date: Tue Nov 20 11:34:43 2007
New Revision: 19229
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D19229&repname=
=3Djahia
Log:
Navigation menu updated
Container list is automatically created if not specified
Modified:
branches/JAHIA-INCLUDE-TAG-BRANCH/core/project.properties
branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/=
menus/NavMenuTag.java
branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/webapp/WEB-INF/etc/taglibs/j=
ahia-components.tld
Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/project.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/project.properties&rev=3D19229&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/project.properties (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/project.properties Tue Nov 20 11=
:34:43 2007
@@ -135,7 +135,7 @@
=
### gwt
# change google.webtoolkit.home to the path to where you have GWT installed
-google.webtoolkit.home=3D C:/gwt-windows-1.4.60 =
+google.webtoolkit.home=3D D:/gwt-windows-1.4.60 =
=
# set this to the correct jar for your platform
#maven.jar.gwt-dev-platform=3D${google.webtoolkit.home}/gwt-dev-windows.ja=
r(to be set in your build.properties)
@@ -144,5 +144,5 @@
# any args you want to pass to the JVM, note that XstartOnFirstThread is O=
NLY required on the Mac =
google.webtoolkit.style=3DPRETTY
google.webtoolkit.output =3D ${maven.war.webapp.dir}/jsp/jahia/gwt/
-google.webtoolkit.generatorDestinationPackage =3D C:\devel_jahia\
+google.webtoolkit.generatorDestinationPackage =3D E:/devel_jahia/
google.webtoolkit.logLevel=3DALL
\ No newline at end of file
Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs=
/html/menus/NavMenuTag.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/menus/NavMenuTag.java&rev=
=3D19229&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/=
menus/NavMenuTag.java (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/=
menus/NavMenuTag.java Tue Nov 20 11:34:43 2007
@@ -24,6 +24,7 @@
import org.jahia.data.beans.RequestBean;
import org.jahia.data.containers.JahiaContainer;
import org.jahia.data.containers.JahiaContainerList;
+import org.jahia.data.fields.FieldTypes;
import org.jahia.exceptions.JahiaException;
import org.jahia.gui.GuiBean;
import org.jahia.params.ProcessingContext;
@@ -35,6 +36,7 @@
import javax.servlet.jsp.JspWriter;
import java.io.IOException;
import java.util.Enumeration;
+import java.util.Vector;
=
public class NavMenuTag extends AbstractJahiaTag {
=
@@ -112,6 +114,7 @@
jData =3D (JahiaData) request.getAttribute("org.jahia.data.JahiaDa=
ta");
editMode =3D requestBean.isEditMode();
try {
+ createContainerList() ;
defaultSettings(jData.gui());
getPageSubTree(jData, jData.gui().getLevelID(startLevel), star=
tLevel);
} catch (JahiaException e) {
@@ -122,6 +125,22 @@
return SKIP_BODY;
}
=
+ private void createContainerList() throws JahiaException {
+ if (containerListName =3D=3D null && pageFieldName =3D=3D null) {
+ // use default names
+ containerListName =3D "default_navLinkList" ;
+ pageFieldName =3D "default_navLink" ;
+
+ // declare the container list and the page field
+ jData.containers().declareField(containerListName, pageFieldNa=
me, pageFieldName, FieldTypes.PAGE, "");
+ Vector linkField =3D new Vector() ;
+ linkField.add(pageFieldName) ;
+ jData.containers().declareContainer(containerListName, contain=
erListName, linkField);
+ } else if (containerListName !=3D null ^ pageFieldName !=3D null) {
+ throw new JahiaException("You must either declare both contain=
er list and page field or none", "Unable to create the navmenu container li=
st", JahiaException.TEMPLATE_SERVICE_ERROR, JahiaException.ERROR_SEVERITY) ;
+ }
+ }
+
private void defaultSettings(GuiBean gui) throws JahiaException {
=
// set the level of the page where the request is coming from
Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/webapp/WEB-INF/etc/tag=
libs/jahia-components.tld
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/src/webapp/WEB-INF/etc/taglibs/jahia-components.tld&rev=
=3D19229&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/webapp/WEB-INF/etc/taglibs/j=
ahia-components.tld (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/webapp/WEB-INF/etc/taglibs/j=
ahia-components.tld Tue Nov 20 11:34:43 2007
@@ -45,12 +45,12 @@
=
<attribute>
<name>containerListName</name>
- <required>true</required>
+ <required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>pageFieldName</name>
- <required>true</required>
+ <required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list