You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(233) |
Sep
(199) |
Oct
(206) |
Nov
(185) |
Dec
(270) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(232) |
Feb
(426) |
Mar
(623) |
Apr
(592) |
May
(506) |
Jun
(389) |
Jul
(160) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2007 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(5) |
Oct
(9) |
Nov
(6) |
Dec
(6) |
2008 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(2) |
Sep
(12) |
Oct
(10) |
Nov
(54) |
Dec
(49) |
2009 |
Jan
(19) |
Feb
(13) |
Mar
(20) |
Apr
(24) |
May
(44) |
Jun
(29) |
Jul
(32) |
Aug
(10) |
Sep
(7) |
Oct
(10) |
Nov
(4) |
Dec
(17) |
2010 |
Jan
(14) |
Feb
(5) |
Mar
(23) |
Apr
(50) |
May
(31) |
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(12) |
Feb
(5) |
Mar
(5) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jbo...@li...> - 2005-09-16 15:25:31
|
Author: aron.gombas Date: 2005-09-16 11:25:24 -0400 (Fri, 16 Sep 2005) New Revision: 1141 Modified: trunk/labs/kosmos/build/build.xml trunk/labs/kosmos/build/kosmos-project.properties Log: HTML docs generation fixed Modified: trunk/labs/kosmos/build/build.xml =================================================================== --- trunk/labs/kosmos/build/build.xml 2005-09-16 14:12:08 UTC (rev 1140) +++ trunk/labs/kosmos/build/build.xml 2005-09-16 15:25:24 UTC (rev 1141) @@ -115,6 +115,7 @@ <target name="manual-html" depends="init" description="Creates the manual in HTML format"> <mkdir dir="${dist-bin.docs.reference.dir}/html"/> <java jar="${saxon.dir}/saxon8.jar" fork="true" output="${dist-bin.docs.reference.dir}/html/reference-manual.html"> + <arg line="-novw"/><!-- supress versin warning --> <arg line="${reference.dir}/reference-manual.xml"/> <arg line="${docbook.dir}/html/docbook.xsl"/> </java> Modified: trunk/labs/kosmos/build/kosmos-project.properties =================================================================== --- trunk/labs/kosmos/build/kosmos-project.properties 2005-09-16 14:12:08 UTC (rev 1140) +++ trunk/labs/kosmos/build/kosmos-project.properties 2005-09-16 15:25:24 UTC (rev 1141) @@ -1,3 +1,3 @@ project.name=Kosmos project.name.short=kosmos -project.version=0.1.0RC3 +project.version=0.1.0RC4 |
From: <jbo...@li...> - 2005-09-16 14:12:15
|
Author: szimano Date: 2005-09-16 10:12:08 -0400 (Fri, 16 Sep 2005) New Revision: 1140 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java Log: small bug that caused NumberFormatException Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-16 09:24:05 UTC (rev 1139) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-16 14:12:08 UTC (rev 1140) @@ -13,10 +13,12 @@ String attachementName = (String)wikiSession.getAttribute("var1"); Object rollbackToVer = wikiSession.getAttribute("var2"); + System.out.println(rollbackToVer); + String attURL = (String)wikiSession.getAttribute("hostURL")+"/wiki/"+wikiPage.getName()+"/"; String actionURL = (String)wikiSession.getAttribute("actionURL"); - if ((rollbackToVer != null)&(wikiSession.getAttribute("user") != null)&(Integer.valueOf((String)rollbackToVer) < wikiEngine.getAttachementDataSource().getLastAttachementVersion(wikiPage.getName(),attachementName))) { + if ((rollbackToVer != null)&&(wikiSession.getAttribute("user") != null)&&(Integer.valueOf((String)rollbackToVer) < wikiEngine.getAttachementDataSource().getLastAttachementVersion(wikiPage.getName(),attachementName))) { WikiAttachment wikiAttachment = wikiEngine.getAttachementDataSource().getAttachement(wikiPage.getName(),attachementName, Integer.valueOf((String)rollbackToVer)); wikiEngine.getAttachementDataSource().addAtachement(wikiAttachment.getFile(), attachementName, wikiPage, (String)wikiSession.getAttribute("user")); } |
From: <jbo...@li...> - 2005-09-16 09:24:19
|
Author: adamw Date: 2005-09-16 05:24:05 -0400 (Fri, 16 Sep 2005) New Revision: 1139 Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java Log: JBLAB-387 fix. JBLAB-389, JBLAB-390, JBLAB-391 done. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java 2005-09-15 23:23:12 UTC (rev 1138) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java 2005-09-16 09:24:05 UTC (rev 1139) @@ -82,9 +82,13 @@ getProjectPropertiesHandler(), getProjectExtendedPropertiesMap(), opm); + // Checking if the ids match. + if (!projectId.equals(thisProject.getId())) + throw new IOException("Ids do not match"); + // Adding properties set by the administrator. if (adminProperties != null) { - thisProject.addProperties(adminProperties); + thisProject.addProperties(adminProperties, true); } // Trying to create a downloads descriptor. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java 2005-09-15 23:23:12 UTC (rev 1138) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java 2005-09-16 09:24:05 UTC (rev 1139) @@ -158,7 +158,7 @@ String type = XmlTools.getAttributeValue(node, TYPE_ATTRIBUTE); pm.add(TYPE_ATTRIBUTE, type == null ? "" : null); - thisElement.addProperties(pm); + thisElement.addProperties(pm, false); } } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java 2005-09-15 23:23:12 UTC (rev 1138) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java 2005-09-16 09:24:05 UTC (rev 1139) @@ -233,24 +233,26 @@ * Adds to the currently held properties, properties from the * given properties map. * @param pm Properties map from which to add the properties. + * @param overwrite True iff the properties should be overriden, that + * is, old values deleted, if any. */ - public void addProperties(PropertiesMap pm) { - properties.add(pm); + public void addProperties(PropertiesMap pm, boolean overwrite) { + properties.add(pm, overwrite); // Adding any possible outside bindings for the new properties. - for (String property : properties.getKeySet()) - if (opm.checkSupport(property)) { - ElementDescriptor ed = opm.getElementsDescriptor(property) - .getElementWithId(properties.get(property).getFirstValue()); - - // Not only the property must be supported, there must also - // exist an element with an appropriate id. - if (ed != null) { - addBinding(property, ed); - ed.addBinding(opm.getBindingKeyForBound(property), - this); + for (String property : pm.getKeySet()) + if (opm.checkSupport(property)) { + ElementDescriptor ed = opm.getElementsDescriptor(property) + .getElementWithId(properties.get(property).getFirstValue()); + + // Not only the property must be supported, there must also + // exist an element with an appropriate id. + if (ed != null) { + addBinding(property, ed); + ed.addBinding(opm.getBindingKeyForBound(property), + this); + } } - } } /** Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java 2005-09-15 23:23:12 UTC (rev 1138) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java 2005-09-16 09:24:05 UTC (rev 1139) @@ -104,8 +104,11 @@ * map. * @param pm A properties map from which to add all the properties. */ - public void add(PropertiesMap pm) { + public void add(PropertiesMap pm, boolean overwrite) { for (String key : pm.properties.keySet()) { + if (overwrite) + properties.remove(key); + add(key, pm.properties.get(key)); } } Modified: trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java =================================================================== --- trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-15 23:23:12 UTC (rev 1138) +++ trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-16 09:24:05 UTC (rev 1139) @@ -8,6 +8,8 @@ *****************************************/ package org.jboss.forge.projects.freezone; +import java.io.BufferedReader; +import java.io.FileReader; import java.io.IOException; import org.jboss.forge.common.content.ContentManager; @@ -73,17 +75,20 @@ } /** - * Figures out if a link is an off-site link. This recognizes the most - * common protocols by checking how it starts. (clears all white space in - * case the link starts with '\n' or [space] + * Figures out if a link is qualified for changing: this is the case when + * either it is an off-site link, or it starts with '/'. This recognizes the most + * common protocols by checking how it starts (clears all white space in + * case the link starts with '\n' or [space]). * * @author Janne Jalkanen + * @author adamw */ - private boolean isExternalLink(String link) { + private boolean qualifyLink(String link) { link = link.trim(); return link.startsWith("http:") || link.startsWith("ftp:") || link.startsWith("https:") || link.startsWith("mailto:") - || link.startsWith("news:") || link.startsWith("file:"); + || link.startsWith("news:") || link.startsWith("file:") + || link.startsWith("/"); } // modifies path to page/resource so folder structure can be supported @@ -94,9 +99,7 @@ return path + element; } else if (element.startsWith("./")) { - System.out.println("found a match"); element = element.substring(2); - System.out.println("and element is now " + element); }// ignore ./ only clutters the code int pre = path.lastIndexOf('/'); @@ -158,7 +161,7 @@ pagePath = ForgeHelper.replace(pagePath, ForgeHelper.FREEZONE_SEPARATOR, "/"); - // If the tried to break into other files, denying access to him. + // If the user tried to break into other files, denying access to him. if (pagePath.indexOf("..") != -1) throw new Exception(); @@ -186,7 +189,7 @@ // Replacing links while ((nextRef = findNextReference(pageContent, "link")) != null) { - if (!isExternalLink(nextRef)) { + if (!qualifyLink(nextRef)) { // it would be relative not outside link nextRef2 = modifyPath(pagePath, nextRef); if (nextRef2.endsWith(".png")) { @@ -213,12 +216,12 @@ // Replacing images while ((nextRef = findNextReference(pageContent, "image")) != null) { - if (!isExternalLink(nextRef)) { + if (!qualifyLink(nextRef)) { nextRef2 = modifyPath(pagePath, nextRef); - + pageContent = ForgeHelper.replace(pageContent, "<img src=" - + '"' + nextRef + '"', "*img src=" + '"' + fileAccessPrepend - + nextRef2 + '"'); + + '"' + nextRef + '"', "*img src=" + '"' + fileAccessPrepend + + nextRef2 + '"'); } else pageContent = ForgeHelper.replace(pageContent, "<img src=" + '"' + nextRef + '"', "*img src=" + '"' @@ -259,4 +262,115 @@ "The page you requested cannot be accessed "); } } + + // + // + // + // + // + + public void test(String portalName, String projectId, String pagePath, + String pageContent) { + try { + String nextRef; + String nextRef2; + String fileAccessPrepend = "/file-access/" + portalName + "/" + + ProjectsHelper.MEMBERS_DIR + "/" + projectId + "/" + + ProjectsHelper.FREEZONE_DIR + "/"; + while (pageContent.indexOf("HREF=") != -1) { + pageContent = pageContent.replace("HREF=", "href="); + } + + while (pageContent.indexOf("<IMG SRC=") != -1) { + pageContent = pageContent.replace("<IMG SRC=", + "<img src="); + } + + // Replacing links + while ((nextRef = findNextReference(pageContent, "link")) != null) { + if (!qualifyLink(nextRef)) { + // it would be relative not outside link + nextRef2 = modifyPath(pagePath, nextRef); + if (nextRef2.endsWith(".png")) { + nextRef2 = fileAccessPrepend + nextRef2 + + "\" target=\"_blank\""; + pageContent = ForgeHelper + .replace(pageContent, "href=" + '"' + nextRef + + '"', "*ref=" + '"' + nextRef2); + } if (nextRef2.endsWith(".css")) { + nextRef2 = fileAccessPrepend + nextRef2 + "\""; + pageContent = pageContent.replace("href=" + '"' + nextRef + + '"', "*ref=" + '"' + nextRef2); + } else + pageContent = pageContent.replace("href=" + + '"' + nextRef + '"', ""); + } else { + pageContent = pageContent.replace("href=" + + '"' + nextRef, "$" + nextRef + '"'); + } + } + + // Replacing images + while ((nextRef = findNextReference(pageContent, "image")) != null) { + if (!qualifyLink(nextRef)) { + nextRef2 = modifyPath(pagePath, nextRef); + + pageContent = pageContent.replace("<img src=" + + '"' + nextRef + '"', "*img src=" + '"' + fileAccessPrepend + + nextRef2 + '"'); + } else + pageContent = pageContent.replace("<img src=" + + '"' + nextRef + '"', "*img src=" + '"' + + nextRef + '"'); + } + + // fix back internal links + while (pageContent.indexOf("*ref=") != -1) + pageContent = pageContent.replace("*ref=", + " href="); + + while (pageContent.indexOf(" /portal/index.html?ctrl:id") != -1) + pageContent = pageContent.replace( + " /portal/index.html?ctrl:id", " href=" + '"' + + "/portal/index.html?ctrl:id"); + + // fix back external links + + while (pageContent.indexOf("$http:") != -1 + || pageContent.indexOf("$ftp:") != -1 + || pageContent.indexOf("$https:") != -1 + || pageContent.indexOf("$file:") != -1 + || pageContent.indexOf("$mailto:") != -1 + || pageContent.indexOf("$news:") != -1) { + pageContent = pageContent.replace("$", + " href=" + '"'); + } + // fix back image links + while (pageContent.indexOf("*img src=") != -1) { + pageContent = pageContent.replace("*img src=", + "<img src="); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main(String[] argv) throws IOException { + BufferedReader bf = new BufferedReader(new FileReader( + "/home/adamw/portal-content/default/members/jbossejb3/freezone/index.html")); + + StringBuffer sf = new StringBuffer(); + while (true) { + String line = bf.readLine(); + if (line == null) + break; + sf.append(line); + sf.append('\n'); + } + + String pageContent = sf.toString(); + bf.close(); + + new Freezone().test("default", "jbossejb3", "index.html", pageContent); + } } Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-15 23:23:12 UTC (rev 1138) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-16 09:24:05 UTC (rev 1139) @@ -11,6 +11,7 @@ import org.jboss.forge.common.projects.permissions.PermissionsChecker; import org.jboss.forge.common.projects.permissions.RenderRequestPermissionsChecker; import org.jboss.portal.common.context.DelegateContext; +import org.jboss.portal.core.model.User; import org.jboss.portlet.JBossRenderRequest; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -27,6 +28,7 @@ final static String SPECIAL_LINK_ATTRIBUTE = "special-link"; final static String PROJECTS_MENU_ATTRIBUTE = "projects-menu"; final static String LEVEL_ATTRIBUTE = "level"; + final static String PERMISSION_ATTRIBUTE = "permission"; final static String TRUE_ATTR_VALUE = "true"; /** @@ -63,12 +65,19 @@ * is not a special link. */ private String specialLink; + /** + * <code>permission</code> - role that the user is required to have to display + * this entry, or null if + */ + private String permission; private Set<String> allLinks; public Entry(String portalName, Node root) { + permission = XmlTools.getAttributeValue(root, PERMISSION_ATTRIBUTE); + projectsMenu = TRUE_ATTR_VALUE.equals( XmlTools.getAttributeValue(root, PROJECTS_MENU_ATTRIBUTE)); @@ -131,14 +140,21 @@ if ("logout".equals(specialLink)) { if (request.getRemoteUser() == null) return; - } else if ("admin".equals(specialLink)) { - if (!request.hasPermission("Admin")) - return; } else // Unsupported special link. return; } + if (permission != null) { + // Checking for role. + User user = request.getUser(); + + if ((user == null) || + (!user.getRoleNames().contains(permission))) + // The user doesn't have the given role. + return; + } + if (projectsMenu) { String portalName = ForgeHelper.getPortalName(request); Projects projects = ProjectsHelper.getProjects(portalName); |
From: <jbo...@li...> - 2005-09-15 22:52:02
|
Author: adamw Date: 2005-09-15 18:51:51 -0400 (Thu, 15 Sep 2005) New Revision: 1136 Added: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/XmlTools.java Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/AbstractDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadsDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/BindingsHandlerIterSingleKey.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementsDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java Log: JBLAB-384: Project leveling Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -26,6 +26,7 @@ import org.jboss.mx.util.MBeanProxyExt; import org.jboss.mx.util.MBeanServerLocator; import org.jboss.portlet.JBossRenderRequest; +import org.w3c.dom.Node; /** * Common constants and functions for the forge. @@ -374,4 +375,40 @@ ".WikiPortletWindow&ctrl:type=action&page=" + capitilizeFirstLetter(page); } + + /** + * Creates a link of a given type, having some type-specific + * content information. + * @param portalName Name of the portal for which to create the link. + * @param linkType Type of the link. + * @param linkContent Type-specific content of the link. + * @return A link or null if the type is incorrect. + */ + public static String createLink(String portalName, String linkType, + String linkContent) { + if ((linkType == null) || ("".equals(linkType))) { + return linkContent; + } else if ("page".equals(linkType)) { + return createPageLink(portalName, linkContent); + } else if ("freezone".equals(linkType)) { + return createFreezonePageLink(portalName, linkContent); + } else if ("wiki".equals(linkType)) { + return createWikiLink(portalName, linkContent); + } else { + // Unsupported type. + return null; + } + } + + /** + * Creates a link from a link node. The link is created basing on the + * type attribute. + * @param portalName Name of the portal for which to create the link. + * @param root Node which holds the information. + * @return A link or null if type attribute is incorrect. + */ + public static String createLink(String portalName, Node root) { + return createLink(portalName, XmlTools.getAttributeValue(root, "type"), + XmlTools.unmarshallText(root)); + } } Added: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/XmlTools.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/XmlTools.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/XmlTools.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -0,0 +1,109 @@ +package org.jboss.forge.common; + +import javax.xml.transform.TransformerException; + +import org.jboss.forge.common.projects.DomToXmlTransformer; +import org.jboss.forge.common.projects.elements.PropertiesMap; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * @author adamw + * Common helper xml parsing functions. + */ +public class XmlTools { + /** + * This class cannot be instatiated. + */ + private XmlTools() { + + } + + /** + * Reads all attributes of the given node and returns them as a properties map. + * @param root Node from which to read the attributes. + * @return A properties map holding all attributes of the given node. + */ + public static PropertiesMap getPropertiesFromNodeAttributes(Node root) { + PropertiesMap properties = new PropertiesMap(); + NamedNodeMap nnm = root.getAttributes(); + + if (nnm != null) { + Node n; + + for (int i=0; i<nnm.getLength(); i++) { + n = nnm.item(i); + if (n.getNodeType() == Node.ATTRIBUTE_NODE) { + properties.add(n.getNodeName(), XmlTools.unmarshallText(n)); + } + } + } + + return properties; + } + + /** + * From the given node, gets the value of the specified attribute. + * @param root Node to read the attribute from. + * @param attrName Name of the attribute to read. + * @return Value of the given attribute or null, if no such attribute + * is present. + */ + public static String getAttributeValue(Node root, String attrName) { + Node n = root.getAttributes().getNamedItem(attrName); + + if (n == null) return null; + + return unmarshallText(n); + } + + /** + * Reads and returns a HTML block contained in the children of the specified + * node. + * @param root Node from which's children to get the HTML block. + * @param xht An instance of a dom to xml transformer. + * @return A string representation of the html contained in the given + * node. + */ + public static String unmarshallHtml(Node root, DomToXmlTransformer xht) { + StringBuffer buf = new StringBuffer(); + + Node n; + NodeList nodes = root.getChildNodes(); + + for (int i = 0; i < nodes.getLength(); i++) { + n = nodes.item(i); + + try { + buf.append(xht.transformNode(n)); + } catch (TransformerException e) { + return "Transformation error"; + } + } + + return buf.toString(); + } + + /** + * Reads text contained in a tag of the form <tag>text</tag>. + * @param textNode Node to read text from. + * @return Text contained in the given node. + */ + public static String unmarshallText(Node textNode) { + StringBuffer buf = new StringBuffer(); + + Node n; + NodeList nodes = textNode.getChildNodes(); + + for (int i = 0; i < nodes.getLength(); i++) { + n = nodes.item(i); + + if (n.getNodeType() == Node.TEXT_NODE) { + buf.append(n.getNodeValue()); + } + } + + return buf.toString(); + } +} Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/AbstractDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/AbstractDescriptor.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/AbstractDescriptor.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -8,64 +8,26 @@ *****************************************/ package org.jboss.forge.common.projects; -import javax.xml.transform.TransformerException; - +import org.jboss.forge.common.XmlTools; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** - * A base class for XML descriptors, contains some common unmarshalling - * functions. + * A base class for XML descriptors. * * @author adamw */ public abstract class AbstractDescriptor { /** - * Reads and returns a HTML block contained in the children of the specified - * node. - * @param root Node from which's children to get the HTML block. - * @param xht An instance of a dom to xml transformer. - * @return A string representation of the html contained in the given - * node. + * @deprecated */ protected String unmarshallHtml(Node root, DomToXmlTransformer xht) { - StringBuffer buf = new StringBuffer(); - - Node n; - NodeList nodes = root.getChildNodes(); - - for (int i = 0; i < nodes.getLength(); i++) { - n = nodes.item(i); - - try { - buf.append(xht.transformNode(n)); - } catch (TransformerException e) { - return "Transformation error"; - } - } - - return buf.toString(); + return XmlTools.unmarshallHtml(root, xht); } /** - * Reads text contained in a tag of the form <tag>text</tag>. - * @param textNode Node to read text from. - * @return Text contained in the given node. + * @deprecated */ protected String unmarshallText(Node textNode) { - StringBuffer buf = new StringBuffer(); - - Node n; - NodeList nodes = textNode.getChildNodes(); - - for (int i = 0; i < nodes.getLength(); i++) { - n = nodes.item(i); - - if (n.getNodeType() == Node.TEXT_NODE) { - buf.append(n.getNodeValue()); - } - } - - return buf.toString(); + return XmlTools.unmarshallText(textNode); } } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadsDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadsDescriptor.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/DownloadsDescriptor.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -279,7 +279,7 @@ epm.addPropertySupport("button", getButtonPropertiesHandler(downloadPrefix, pathCategoryContext, separator, portalName, projectId), - new BindingsHandlerIterSingleKey("button", "buttons")); + new BindingsHandlerIterSingleKey("button", "buttons", new Boolean(false))); return epm; } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -121,7 +121,8 @@ (PropertiesHandler) EXTENDED_PROPERTIES[i][2], new BindingsHandlerIterSingleKey( (String) EXTENDED_PROPERTIES[i][0], - (String) EXTENDED_PROPERTIES[i][1])); + (String) EXTENDED_PROPERTIES[i][1], + new Boolean(false))); return epm; } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -68,6 +68,16 @@ return getProjectsDescriptor() .getOutsidePropertyContext(pc, "category", id); } + + /** + * Gets context of the given level. + * @param pc Permissions checker to use. + * @param id Id of the level to get. + */ + public DelegateContext getLevelContext(PermissionsChecker pc, String id) { + return getProjectsDescriptor() + .getOutsidePropertyContext(pc, "level", id); + } /** * Gets a context describing all projects. @@ -91,8 +101,7 @@ */ public DelegateContext getDownloadsContext(PermissionsChecker pc, String projectId, String categoryId) { - ProjectDescriptor pd = getProjectsDescriptor().getProjectDescriptor( - pc, projectId); + ProjectDescriptor pd = getProjectsDescriptor().getProjectDescriptor(projectId); if (pd == null) return null; @@ -117,6 +126,20 @@ public String getProjectLink(String projectId) { return getProjectsDescriptor().getProjectLink(projectId); } + + /** + * Gets level of the given project. + * @param projectId Id of the project. + * @return Level of the given project. + */ + public String getProjectLevel(String projectId) { + ProjectDescriptor pd = getProjectsDescriptor().getProjectDescriptor(projectId); + + if (pd == null) + return null; + + return pd.getProperty("level"); + } /** * Searches for the given string in project's names and descriptions. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -13,12 +13,14 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; -import java.util.TreeMap; import org.apache.xerces.parsers.DOMParser; +import org.jboss.forge.common.ForgeHelper; import org.jboss.forge.common.SearchTools; +import org.jboss.forge.common.XmlTools; import org.jboss.forge.common.projects.XmlInputFactory.XmlNotFoundException; import org.jboss.forge.common.projects.elements.BindingsHandlerIterSingleKey; import org.jboss.forge.common.projects.elements.ElementDescriptor; @@ -46,7 +48,9 @@ * <code>INFO_PAGE_ATTRIBUTE</code> - name of an xml attribute in which information * on whether a freezone info page should be displayed instead of the standard one. */ - static final String INFO_PAGE_ATTRIBUTE = "info-page"; + static final String INFO_PAGE_ATTRIBUTE = "info-page"; + static final String LINK_ELEMENT = "link"; + static final String TYPE_ATTRIBUTE = "type"; private static final Logger log = Logger.getLogger(ProjectsDescriptor.class); @@ -80,18 +84,18 @@ * @param portalName Name of the portal to which projects belongs to. */ public ProjectsDescriptor(XmlInputFactory isf, String portalName) { - projects = new TreeMap<String, ProjectDescriptor>(); + projects = new LinkedHashMap<String, ProjectDescriptor>(); projectWithErrorsDescriptors = new HashSet<String>(); projectsContexts = Collections.synchronizedMap( - new TreeMap<String, DelegateContext>()); + new LinkedHashMap<String, DelegateContext>()); contexts = Collections.synchronizedMap( new HashMap<String, DelegateContext>()); try { DomToXmlTransformer xht = new DomToXmlTransformer(); - opm = getProjectOutsidePropertiesMap(isf, xht); + opm = getProjectOutsidePropertiesMap(isf, xht, portalName); DOMParser parser = new DOMParser(); parser.parse(isf.getInputSource(ProjectsHelper.PROJECTS_DESC)); @@ -135,6 +139,38 @@ return phs; } + private static PropertiesHandler getLevelsPropertiesHandler(final String portalName) { + PropertiesHandlerStack phs = new PropertiesHandlerStack(); + phs.addHandler(new PropertiesHandlerDefault()); + phs.addHandler(new PropertiesHandler() { + public void fillContext(PropertiesMap properties, DelegateContext context, + PermissionsChecker pc) { + context.put("link", ForgeHelper.createLink(portalName, + properties.get(TYPE_ATTRIBUTE).getFirstValue(), + properties.get(LINK_ELEMENT).getFirstValue())); + } + + public void processNode(ElementDescriptor thisElement, Node node) { + if (LINK_ELEMENT.equals(node.getNodeName())) { + // Adding the type attribute to the properties. + PropertiesMap pm = new PropertiesMap(); + + String type = XmlTools.getAttributeValue(node, TYPE_ATTRIBUTE); + + pm.add(TYPE_ATTRIBUTE, type == null ? "" : null); + thisElement.addProperties(pm); + } + } + + public void collect(PropertiesMap properties, Object data, + PermissionsChecker pc) { + + } + }); + + return phs; + } + private static PropertiesHandler getPagesPropertiesHandler() { PropertiesHandlerStack phs = new PropertiesHandlerStack(); phs.addHandler(new PropertiesHandlerDefault()); @@ -159,22 +195,32 @@ return phs; } + private void addOutsideProperty(XmlInputFactory isf, DomToXmlTransformer xht, + OutsidePropertiesMap opm, Object[] data) + throws SAXException, IOException, XmlNotFoundException { + opm.addPropertySupport((String) data[1], + new ElementsDescriptor( + isf.getInputSource((String) data[0]), isf, + xht, (String) data[1], + (PropertiesHandler) data[3]), + new BindingsHandlerIterSingleKey((String) data[1], + (String) data[2], new Boolean(false)), + PROJECTS_PROP_KEY, + new BindingsHandlerIterSingleKey(PROJECTS_PROP_KEY, + PROJECTS_CTX_KEY, new Boolean(true))); + } + private OutsidePropertiesMap getProjectOutsidePropertiesMap(XmlInputFactory isf, - DomToXmlTransformer xht) throws SAXException, IOException, XmlNotFoundException { + DomToXmlTransformer xht, String portalName) + throws SAXException, IOException, XmlNotFoundException { OutsidePropertiesMap opm = new OutsidePropertiesMap(); for (int i=0; i<OUTSIDE_PROPERTIES.length; i++) - opm.addPropertySupport((String) OUTSIDE_PROPERTIES[i][1], - new ElementsDescriptor( - isf.getInputSource((String) OUTSIDE_PROPERTIES[i][0]), isf, - xht, (String) OUTSIDE_PROPERTIES[i][1], - (PropertiesHandler) OUTSIDE_PROPERTIES[i][3]), - new BindingsHandlerIterSingleKey((String) OUTSIDE_PROPERTIES[i][1], - (String) OUTSIDE_PROPERTIES[i][2]), - PROJECTS_PROP_KEY, - new BindingsHandlerIterSingleKey(PROJECTS_PROP_KEY, - PROJECTS_CTX_KEY)); + addOutsideProperty(isf, xht, opm, OUTSIDE_PROPERTIES[i]); + addOutsideProperty(isf, xht, opm, new Object[] { ProjectsHelper.LEVELS_DESC, + "level", "levels", getLevelsPropertiesHandler(portalName) }); + return opm; } @@ -225,14 +271,9 @@ (n.getNodeName().equals(PROJECT_EL))) { PropertiesMap adminProperties = null; - Node infoPageAttribute = n.getAttributes().getNamedItem(INFO_PAGE_ATTRIBUTE); - if ((infoPageAttribute != null) && - (infoPageAttribute.getNodeType() == Node.ATTRIBUTE_NODE)) { - adminProperties = new PropertiesMap(); - adminProperties.add(INFO_PAGE_ATTRIBUTE, unmarshallText(infoPageAttribute)); - } + adminProperties = XmlTools.getPropertiesFromNodeAttributes(n); - String projectId = unmarshallText(n); + String projectId = XmlTools.unmarshallText(n); ProjectDescriptor pd = null; try { pd = new ProjectDescriptor(projectId, @@ -288,19 +329,11 @@ /** * Gets a descriptor of a specified project. - * @param pc Permissions checker to use. * @param projectId Id of the project for which to get the descriptor. - * @return A descriptor of the given project or null if access to the project is not - * allowed. + * @return A descriptor of the given project. */ - public ProjectDescriptor getProjectDescriptor(PermissionsChecker pc, String projectId) { - ProjectDescriptor pd = (ProjectDescriptor) projects.get(projectId); - - // Checking if this project can be read. - if (!pd.permissionAllowed(pc)) - return null; - - return pd; + public ProjectDescriptor getProjectDescriptor(String projectId) { + return (ProjectDescriptor) projects.get(projectId); } @@ -413,3 +446,4 @@ return toFill; } } + Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -34,6 +34,11 @@ */ public final static String PROJECT_ID = "projectId"; /** + * <code>LEVEL_ID</code> - name of the attribute under which the + * selected level's id can be found in a servlet response object. + */ + public final static String LEVEL_ID = "levelId"; + /** * <code>PROJECT_NAME</code> - name of the attribute under which the * selected project's name can be found in a servlet response object. */ @@ -55,6 +60,7 @@ */ private static Map<String, Projects> projectsObjects; + protected final static String LEVELS_DESC = "levels.xml"; protected final static String PAGES_DESC = "pages.xml"; protected final static String JEMS_DESC = "jems.xml"; protected final static String CATEGORIES_DESC = "categories.xml"; @@ -145,7 +151,10 @@ */ public static void prepareRequest(JBossRenderRequest request) { ForgeHelper.prepareRequest(request); - request.setAttribute(PROJECT_ID, getSelectedProjectId(request)); + String projectId = getSelectedProjectId(request); + request.setAttribute(PROJECT_ID, projectId); + request.setAttribute(LEVEL_ID, getProjects( + ForgeHelper.getPortalName(request)).getProjectLevel(projectId)); } /** Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/BindingsHandlerIterSingleKey.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/BindingsHandlerIterSingleKey.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/BindingsHandlerIterSingleKey.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -22,6 +22,7 @@ public class BindingsHandlerIterSingleKey implements BindingsHandler { private String key; private String contextKey; + private Boolean fullFill; /** * @param key @@ -29,10 +30,14 @@ * @param contextKey * Context name under which consecutive element's contexts will * be stored. + * @param fullFill + * True iff the context should be filled with full information. */ - public BindingsHandlerIterSingleKey(String key, String contextKey) { + public BindingsHandlerIterSingleKey(String key, String contextKey, + Boolean fullFill) { this.key = key; this.contextKey = contextKey; + this.fullFill = fullFill; } public void fillContext(BindingsMap bindings, DelegateContext context, @@ -44,7 +49,10 @@ if (!ed.permissionAllowed(pc)) continue; - ed.fillContextShallow(context.next(contextKey), pc); + if (fullFill) + ed.fillContext(context.next(contextKey), pc); + else + ed.fillContextShallow(context.next(contextKey), pc); } } } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -8,11 +8,11 @@ *****************************************/ package org.jboss.forge.common.projects.elements; +import org.jboss.forge.common.XmlTools; import org.jboss.forge.common.projects.AbstractDescriptor; import org.jboss.forge.common.projects.DomToXmlTransformer; import org.jboss.forge.common.projects.permissions.PermissionsChecker; import org.jboss.portal.common.context.DelegateContext; -import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -133,16 +133,8 @@ private void unmarshallElement(Node root, DomToXmlTransformer xht) { Node n; - // Processing attributes. - NamedNodeMap nnm = root.getAttributes(); - if (nnm != null) { - for (int i=0; i<nnm.getLength(); i++) { - n = nnm.item(i); - if (n.getNodeType() == Node.ATTRIBUTE_NODE) { - properties.add(n.getNodeName(), unmarshallText(n)); - } - } - } + // Adding all attributes - not needed right now. + // properties.add(XmlTools.getPropertiesFromNodeAttributes(root)); // Processing nested elements. NodeList nodes = root.getChildNodes(); @@ -152,10 +144,10 @@ if (n.getNodeType() == Node.ELEMENT_NODE) { String nodeName = n.getNodeName(); if (nodeName.equals(PROP_ID)) - id = unmarshallText(n); + id = XmlTools.unmarshallText(n); // Adding the corresponding property. - properties.add(nodeName, unmarshallHtml(n, xht)); + properties.add(nodeName, XmlTools.unmarshallHtml(n, xht)); // Executing possible property-specific actions. ph.processNode(this, n); @@ -170,7 +162,7 @@ // possible. if (opm.checkSupport(nodeName)) { ElementDescriptor ed = opm.getElementsDescriptor(nodeName) - .getElementWithId(unmarshallText(n)); + .getElementWithId(XmlTools.unmarshallText(n)); // Not only the property must be supported, there must also // exist an element with an appropriate id. @@ -244,6 +236,21 @@ */ public void addProperties(PropertiesMap pm) { properties.add(pm); + + // Adding any possible outside bindings for the new properties. + for (String property : properties.getKeySet()) + if (opm.checkSupport(property)) { + ElementDescriptor ed = opm.getElementsDescriptor(property) + .getElementWithId(properties.get(property).getFirstValue()); + + // Not only the property must be supported, there must also + // exist an element with an appropriate id. + if (ed != null) { + addBinding(property, ed); + ed.addBinding(opm.getBindingKeyForBound(property), + this); + } + } } /** Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementsDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementsDescriptor.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementsDescriptor.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -244,7 +244,7 @@ DelegateContext context = (DelegateContext) contexts.get(mapKey); if (context == null) { context = new DelegateContext(); - ElementDescriptor ed = (ElementDescriptor) elements.get(mapKey); + ElementDescriptor ed = (ElementDescriptor) elements.get(id); ed.fillContext(context, pc); contexts.put(mapKey, context); Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -10,6 +10,7 @@ import java.util.Map; import java.util.HashMap; +import java.util.Set; /** * A class describing properties with multiple or single values. @@ -108,4 +109,12 @@ add(key, pm.properties.get(key)); } } + + /** + * Gets a set of all keys held in this map. + * @return A set of all keys in this map. + */ + public Set<String> getKeySet() { + return properties.keySet(); + } } Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-15 22:51:18 UTC (rev 1135) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-15 22:51:51 UTC (rev 1136) @@ -4,6 +4,7 @@ import java.util.Set; import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.XmlTools; import org.jboss.forge.common.projects.AbstractDescriptor; import org.jboss.forge.common.projects.Projects; import org.jboss.forge.common.projects.ProjectsHelper; @@ -20,14 +21,12 @@ */ public class Entry extends AbstractDescriptor { final static String LINK_ELEMENT = "link"; - final static String PAGE_LINK_ELEMENT = "page-link"; - final static String FREEZONE_LINK_ELEMENT = "freezone-link"; - final static String WIKI_LINK_ELEMENT = "wiki-link"; final static String DISPLAY_ELEMENT = "display"; final static String FOLDABLE_ATTRIBUTE = "foldable"; final static String SPECIAL_LINK_ATTRIBUTE = "special-link"; final static String PROJECTS_MENU_ATTRIBUTE = "projects-menu"; + final static String LEVEL_ATTRIBUTE = "level"; final static String TRUE_ATTR_VALUE = "true"; /** @@ -55,6 +54,11 @@ */ private boolean projectsMenu; /** + * <code>level</code> - valid only if <code>projectsMenu == true</code>. + * Indicates the level of projects that should be shown. + */ + private String level; + /** * <code>specialLink</code> - name of a special link or null, if this entry * is not a special link. */ @@ -62,30 +66,22 @@ private Set<String> allLinks; - /** - * From the given node, gets the value of the specified attribute. - * @param root Node to read the attribute from. - * @param attrName Name of the attribute to read. - * @return Value of the given attribute or null, if no such attribute - * is present. - */ - private String getAttributeValue(Node root, String attrName) { - Node n = root.getAttributes().getNamedItem(attrName); - - if (n == null) return null; - - return unmarshallText(n); - } + public Entry(String portalName, Node root) { - projectsMenu = TRUE_ATTR_VALUE.equals(getAttributeValue(root, PROJECTS_MENU_ATTRIBUTE)); + projectsMenu = TRUE_ATTR_VALUE.equals( + XmlTools.getAttributeValue(root, PROJECTS_MENU_ATTRIBUTE)); - if (projectsMenu) + if (projectsMenu) { + level = XmlTools.getAttributeValue(root, LEVEL_ATTRIBUTE); + // No need for further processing if this is a project's menu. return; + } else level = null; - specialLink = getAttributeValue(root, SPECIAL_LINK_ATTRIBUTE); - foldable = TRUE_ATTR_VALUE.equals(getAttributeValue(root, FOLDABLE_ATTRIBUTE)); + specialLink = XmlTools.getAttributeValue(root, SPECIAL_LINK_ATTRIBUTE); + foldable = TRUE_ATTR_VALUE.equals( + XmlTools.getAttributeValue(root, FOLDABLE_ATTRIBUTE)); NodeList nodes = root.getChildNodes(); @@ -96,15 +92,9 @@ String nodeName = n.getNodeName(); if (LINK_ELEMENT.equals(nodeName)) { - link = unmarshallText(n); - } else if (PAGE_LINK_ELEMENT.equals(nodeName)) { - link = ForgeHelper.createPageLink(portalName, unmarshallText(n)); - } else if (FREEZONE_LINK_ELEMENT.equals(nodeName)) { - link = ForgeHelper.createFreezonePageLink(portalName, unmarshallText(n)); - } else if (WIKI_LINK_ELEMENT.equals(nodeName)) { - link = ForgeHelper.createWikiLink(portalName, unmarshallText(n)); + link = ForgeHelper.createLink(portalName, n); } else if (DISPLAY_ELEMENT.equals(nodeName)) { - display = unmarshallText(n); + display = XmlTools.unmarshallText(n); } else if (NavigationTools.MENU_ELEMENT.equals(nodeName)) { // Creating a sub-menu. menu = new Menu(portalName, n); @@ -149,24 +139,30 @@ return; } - // Creating a context that will be filled, now that we know that we do - // add a new entry. - DelegateContext toFill = context.next("entries"); - if (projectsMenu) { - toFill.put("is-projects-menu", "true"); - // Appending the project's context. String portalName = ForgeHelper.getPortalName(request); Projects projects = ProjectsHelper.getProjects(portalName); PermissionsChecker pc = new RenderRequestPermissionsChecker(request); - DelegateContext prjContext = projects.getProjectsContext(pc); + DelegateContext prjContext = projects.getLevelContext(pc, level); - toFill.append("projects-menu", prjContext); + // Appending the project's context only if there are any projects + // in it. + if (prjContext.childIterator("projects").hasNext()) { + DelegateContext toFill = context.next("entries"); + toFill.append("projects-menu", prjContext); + toFill.put("is-projects-menu", "true"); + } + return; - } else - toFill.put("is-projects-menu", "false"); + } + // Creating a context that will be filled, now that we know that we do + // add a new entry. + DelegateContext toFill = context.next("entries"); + + toFill.put("is-projects-menu", "false"); + boolean selected = allLinks.contains(currentLink); if (selected) |
From: <jbo...@li...> - 2005-09-15 22:51:37
|
Author: szimano Date: 2005-09-15 18:51:18 -0400 (Thu, 15 Sep 2005) New Revision: 1135 Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiAttachment.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiCommon.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiPage.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java Log: attachment history http://jira.jboss.com/jira/browse/JBWIKI-42 direct prev version links like http://forge.sicore.org:8080/wiki/Main:4 and some idiot proofness Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -49,7 +49,7 @@ } public void processAction(JBossActionRequest rReq, JBossActionResponse rResp) { - + // wikiContext is null - to get refernece to actual page WikiContext wikiContext = null; @@ -104,6 +104,9 @@ .getParameter("page"), null); pageWithAtt.addAttachement(serverFile, fileName, rReq .getUser().getUserName()); + + // at the end delete the temp file + serverFile.delete(); } } } catch (FileUploadException fue) { @@ -118,7 +121,13 @@ } if (rReq.getParameter("page") != null) { - rResp.setRenderParameter("page", rReq.getParameter("page")); + String page = rReq.getParameter("page"); + if (Character.isLowerCase(page.charAt(0))) { + // change first letter to upper if it isn't + page = Character.toUpperCase(page.charAt(0)) + + page.substring(1); + } + rResp.setRenderParameter("page", page); } @@ -132,6 +141,14 @@ rResp.setRenderParameter("page", "FindResult"); } + int i = 1; + + while (rReq.getParameter("var" + i) != null) { + rReq.getPortletSession().setAttribute("var" + i, + rReq.getParameter("var" + i)); + i++; + } + if (rReq.getParameter("action") != null) { rResp.setRenderParameter("action", rReq.getParameter("action")); } @@ -172,7 +189,8 @@ if (edPage == null) { edPage = new WikiPage(rReq.getParameter("editedPage"), credentials, "", 0, 0, new Date(), wikiEngine - .getMediaDataSource()); + .getMediaDataSource(), wikiEngine + .getAttachementDataSource()); } // set new content @@ -206,17 +224,27 @@ rReq.setAttribute("actionURL", wikiURL.toString()); // Create server host and put it into session for plugins - String hostURL = ((rReq.isSecure()) ? "https" : "http") + "://"+rReq.getServerName()+((rReq.getServerPort() == 80) ? "" : ":"+ rReq.getServerPort()); - + String hostURL = ((rReq.isSecure()) ? "https" : "http") + + "://" + + rReq.getServerName() + + ((rReq.getServerPort() == 80) ? "" : ":" + + rReq.getServerPort()); + + // prepare some data for plugins in session + if (rReq.getUser() != null) { + rReq.getPortletSession().setAttribute("user", + rReq.getUser().getUserName()); + } rReq.getPortletSession().setAttribute("hostURL", hostURL); rReq.getPortletSession().setAttribute("actionURL", wikiURL.toString()); - + rReq.getPortletSession().setAttribute("isSecure", new Boolean(rReq.isSecure())); WikiPage noSuchPage = new WikiPage("", new Credentials(""), "There is no such page. Click on EDIT to start it.", 0, 0, - null, wikiEngine.getMediaDataSource()); + null, wikiEngine.getMediaDataSource(), wikiEngine + .getAttachementDataSource()); String page = "Wiki.jsp"; @@ -247,9 +275,13 @@ System.out.println("Getting page " + wikiPage + " at version " + rReq.getParameter("version")); - pageToShow = wikiEngine.getByName(wikiPage, null, Integer - .valueOf(rReq.getParameter("version"))); + if ((pageToShow.getLastVersion() > Integer.valueOf(rReq + .getParameter("version")))) { + pageToShow = wikiEngine.getByName(wikiPage, null, Integer + .valueOf(rReq.getParameter("version"))); + } + if (pageToShow.getLastVersion() != pageToShow.getVersion()) { rReq.setAttribute("showedVersion", Integer.valueOf(rReq .getParameter("version"))); @@ -264,7 +296,8 @@ pageToShow = new WikiPage(wikiPage, new Credentials(rReq .getUser().getUserName()), "", 0, 0, new Date(), - wikiEngine.getMediaDataSource()); + wikiEngine.getMediaDataSource(), wikiEngine + .getAttachementDataSource()); // wikiEngine.getByName(wikiPage, wikiContext); } @@ -308,12 +341,13 @@ if (rReq.getParameter("type") != null) { type = rReq.getParameter("type"); - //System.out.println("Getting type: " + type); + // System.out.println("Getting type: " + type); } - wikiContext = new WikiContext((rReq.getUser() != null) ? rReq.getUser().getUserName() : "", wikiEngine - .getWikiType(type), new PortletWikiSession(rReq - .getPortletSession())); + wikiContext = new WikiContext((rReq.getUser() != null) ? rReq + .getUser().getUserName() : "", + wikiEngine.getWikiType(type), new PortletWikiSession(rReq + .getPortletSession())); if (rReq.getParameter("version") != null) { // show previous version of page @@ -342,16 +376,21 @@ } } - + rReq .setAttribute( "wikiName", - "<img src=\""+hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/JBossWikiLogoMedium.png\" width=\"100\" border=\"0\" style=\"vertical-align: middle\"/>"); + "<img src=\"" + + hostURL + + "/wiki/" + + WikiCommon.wikiButtons + + "/JBossWikiLogoMedium.png\" width=\"100\" border=\"0\" style=\"vertical-align: middle\"/>"); rReq.setAttribute("wikiContent", pageToShow.getContent()); - - rReq.setAttribute("wikiImagesUrl", hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/"); + rReq.setAttribute("wikiImagesUrl", hostURL + "/wiki/" + + WikiCommon.wikiButtons + "/"); + rReq.setAttribute("wikiPage", wikiPage); rReq.setAttribute("editDate", pageToShow.getEditDate()); @@ -365,22 +404,23 @@ // FIXME make this more elegant (ie. plugin) // pass friendly link - /*Properties props = new Properties(); - props.load(WikiPlugin.class - .getResourceAsStream("wikiPlugins.properties")); - String href = props.getProperty("htmlTranslatorURL") + "wiki/" - + pageToShow.getName(); - String[] replaces = props.getProperty("sslRedirectReplaces").split(","); + /* + * Properties props = new Properties(); props.load(WikiPlugin.class + * .getResourceAsStream("wikiPlugins.properties")); String href = + * props.getProperty("htmlTranslatorURL") + "wiki/" + + * pageToShow.getName(); String[] replaces = + * props.getProperty("sslRedirectReplaces").split(","); + * + * if (rReq.isSecure() && (replaces.length % 2 == 0)) { // chage normal + * url to secure for (int i = 0; i < replaces.length; i += 2) href = + * href.replaceAll(replaces[i], replaces[i + 1]); } + */ - if (rReq.isSecure() && (replaces.length % 2 == 0)) { - // chage normal url to secure - for (int i = 0; i < replaces.length; i += 2) - href = href.replaceAll(replaces[i], replaces[i + 1]); - }*/ + rReq.setAttribute("friendlyLink", hostURL + "/wiki/" + + pageToShow.getName()); + rReq.setAttribute("rssLink", hostURL + "/wiki/rss/" + + pageToShow.getName()); - rReq.setAttribute("friendlyLink", hostURL+"/wiki/"+pageToShow.getName()); - rReq.setAttribute("rssLink", hostURL+"/wiki/rss/"+pageToShow.getName()); - rRes.setTitle("Wiki"); if (javax.portlet.WindowState.NORMAL.equals(rReq.getWindowState()) || javax.portlet.WindowState.MAXIMIZED.equals(rReq Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -29,6 +29,7 @@ import org.jboss.wiki.FileDataSource; import org.jboss.wiki.ServletWikiSession; +import org.jboss.wiki.WikiAttachment; import org.jboss.wiki.WikiCommon; import org.jboss.wiki.WikiContext; import org.jboss.wiki.WikiEngine; @@ -53,8 +54,6 @@ * file and sending it to the client. */ - public static final String specialPage = "!WikiButtons"; - private final int BUF_SIZE = 32768; private String attachementsPath; @@ -127,19 +126,29 @@ wikiSession.setAttribute("hostURL", hostURL); String requestURI = httpRequest.getRequestURI(); + int version = -1; + + if (requestURI.matches(".*:\\d+")) { + // there is a ":" at the end of request uri - pick a version + + int verStart = requestURI.lastIndexOf(":"); + version = Integer.valueOf(requestURI.substring(verStart + 1)); + requestURI = requestURI.substring(0, verStart); + } // Parse URI to get filename and page name String[] tokens = requestURI.split("[/]"); // System.out.println("length " + tokens.length); - if (tokens[tokens.length - 2].equals(specialPage)) { + if (tokens[tokens.length - 2].equals(WikiCommon.wikiButtons)) { // show apropriate buttons InputStream imageIS = WikiFileAccessFilter.class .getResourceAsStream("/" + tokens[tokens.length - 1]); ServletOutputStream os = response.getOutputStream(); - response.setContentType(mimeTypes.getContentType(tokens[tokens.length - 1])); + response.setContentType(mimeTypes + .getContentType(tokens[tokens.length - 1])); // Transferring the bytes try { @@ -157,9 +166,18 @@ } } else if (tokens.length == 3) { - httpResponse.sendRedirect(hostURL + wikiHome + "&page=" - + tokens[tokens.length - 1]); + if (Character.isUpperCase(tokens[tokens.length - 1].charAt(0))) { + httpResponse.sendRedirect(hostURL + wikiHome + "&page=" + + tokens[tokens.length - 1] + + ((version != -1) ? "&version=" + version : "")); + } else { + PrintWriter out = httpResponse.getWriter(); + httpResponse.setContentType("text/html"); + out + .println("<html><body><h3>ERROR</h3><br />\nPage name must start with upper case letter.</body></html>"); + } + } else { // get fileName of attachement and page which is connected to String firstToken = tokens[tokens.length - 2]; @@ -170,58 +188,46 @@ String pageName = firstToken; String fileName = secondToken; - Properties props = new Properties(); + WikiAttachment wikiAttachment; - try { - props.load(new FileInputStream(new File( - attachementsPath + "/" + pageName + "-att/" - + fileName - + "-dir/attachment.properties"))); - } catch (IOException e) { - System.err.println(e); + if (version == -1) { + wikiAttachment = wikiEngine.getAttachementDataSource() + .getAttachement(pageName, fileName); + } else { + wikiAttachment = wikiEngine.getAttachementDataSource() + .getAttachement(pageName, fileName, version); } - // looking for the newest version - int version = 1; + if (wikiAttachment != null) { + InputStream fileIS = wikiAttachment.getInputStream(); - while (props.getProperty((version + 1) + ".author") != null) { - version++; - } + ServletOutputStream os = response.getOutputStream(); - tokens = fileName.split("\\."); + response.setContentType(mimeTypes + .getContentType(fileName)); + // response.setContentLength((int) fileIS.); - File file = new File( - attachementsPath - + "/" - + pageName - + "-att/" - + fileName - + "-dir/" - + version - + "." - + ((fileName.indexOf(".") != -1) ? tokens[tokens.length - 1] - : "bin")); + // Transferring the bytes + try { + byte[] buffer = new byte[BUF_SIZE]; + int read; + while ((read = fileIS.read(buffer)) != -1) + os.write(buffer, 0, read); + } catch (Exception e2) { + // Nothing that we can really do. Just send an + // incomplete + // file. + } finally { + os.close(); + fileIS.close(); + } + } else { + ServletOutputStream os = response.getOutputStream(); - FileInputStream fileIS = new FileInputStream(file); + response.setContentType("text/html"); - ServletOutputStream os = response.getOutputStream(); - - response.setContentType(mimeTypes.getContentType(file)); - response.setContentLength((int) file.length()); - - // Transferring the bytes - try { - byte[] buffer = new byte[BUF_SIZE]; - int read; - while ((read = fileIS.read(buffer)) != -1) - os.write(buffer, 0, read); - } catch (Exception e2) { - // Nothing that we can really do. Just send an - // incomplete - // file. - } finally { - os.close(); - fileIS.close(); + os + .println("<html><body><h3>ERROR</h3><br />\nThere is no such file or there is no such version of file</body></html>"); } } else { // SHOW wikiType firstToken with page secondToken @@ -234,14 +240,21 @@ .getWikiType(wikiTypeName), wikiSession)); PrintWriter out = httpResponse.getWriter(); - httpResponse.setContentType("text/xml"); - httpResponse.setContentLength(page.getPageContent() - .length()); - out.print(page.getPageContent()); + if (Character.isUpperCase(pageName.charAt(0))) { - out.flush(); + httpResponse.setContentLength(page.getPageContent() + .length()); + + out.print(page.getPageContent()); + + out.flush(); + } else { + httpResponse.setContentType("text/html"); + out + .println("<html><body><h3>ERROR</h3><br />\nPage name must start with upper case letter.</body></html>"); + } } } } else { @@ -252,148 +265,7 @@ private void doServletDispatch(HttpServletRequest rReq, HttpServletResponse rResp) { - /* - * //FIXME wrong url String wikiURL = rReq.getRequestURI(); - * - * rReq.setAttribute("actionURL", wikiURL); // Create server host and - * put it into session for plugins String hostURL = ((rReq.isSecure()) ? - * "https" : "http") + "://"+rReq.getServerName()+((rReq.getServerPort() == - * 80) ? "" : ":"+ rReq.getServerPort()); - * - * rReq.getPortletSession().setAttribute("hostURL", hostURL); - * rReq.getPortletSession().setAttribute("actionURL", - * wikiURL.toString()); - * - * rReq.getPortletSession().setAttribute("isSecure", new - * Boolean(rReq.isSecure())); - * - * WikiPage noSuchPage = new WikiPage("", new Credentials(""), "There is - * no such page. Click on EDIT to start it.", 0, 0, null, - * wikiEngine.getMediaDataSource()); - * - * String page = "Wiki.jsp"; - * - * String wikiPage = defaultPage; - * - * WikiPage pageToShow = null; - * - * WikiContext wikiContext = null; - * - * if (rReq.getParameter("page") != null) { wikiPage = - * rReq.getParameter("page"); } - * - * if ((rReq.getParameter("action") != null) && - * (rReq.getParameter("action").equals("Attach"))) { - * rReq.setAttribute("fileAttach", "true"); } - * - * if ((rReq.getParameter("action") != null) && - * (rReq.getParameter("action").equals("Edit")) && (rReq.getUser() != - * null)) { page = "Edit.jsp"; - * - * pageToShow = wikiEngine.getByName(wikiPage, null); - * - * if (rReq.getParameter("version") != null) { // show previous version - * of page - * - * System.out.println("Getting page " + wikiPage + " at version " + - * rReq.getParameter("version")); pageToShow = - * wikiEngine.getByName(wikiPage, null, Integer - * .valueOf(rReq.getParameter("version"))); - * - * if (pageToShow.getLastVersion() != pageToShow.getVersion()) { - * rReq.setAttribute("showedVersion", Integer.valueOf(rReq - * .getParameter("version"))); } } else { pageToShow = - * wikiEngine.getByName(wikiPage, null); } - * - * if (pageToShow == null) { // start editing new page // wikiPage = - * defaultPage; - * - * pageToShow = new WikiPage(wikiPage, new Credentials(rReq - * .getUser().getUserName()), "", 0, 0, new Date(), - * wikiEngine.getMediaDataSource()); // wikiEngine.getByName(wikiPage, - * wikiContext); } - * - * Date dateLock = pageToShow.lock(rReq.getUser()); - * - * if (dateLock != null) { rReq .setAttribute( "lockMsg", "Page is - * locked by " + pageToShow.getLockUser() + " from " + dateLock + ".<br> - * I won't stop you from saving, but you or he can erease each other - * changes. Lock will expire: "); } } else if - * ((rReq.getParameter("action") != null) && - * (rReq.getParameter("action").equals("Info"))) { page = - * "PageInfo.jsp"; - * - * pageToShow = wikiEngine.getByName(wikiPage, null); - * - * if (pageToShow == null) { // if somebody entered a link to info // - * non-existing page page = "Wiki.jsp"; try { pageToShow = (WikiPage) - * noSuchPage.clone(); } catch (CloneNotSupportedException cnse) { - * System.out.println(cnse); } - * - * pageToShow.setName(wikiPage); } else { rReq.setAttribute("pageAtTop", - * pageToShow); } } else { page = "Wiki.jsp"; - * - * String type = "HTML"; - * - * if (rReq.getParameter("type") != null) { type = - * rReq.getParameter("type"); //System.out.println("Getting type: " + - * type); } - * - * wikiContext = new WikiContext(rReq.getUser(), wikiEngine - * .getWikiType(type), new PortletWikiSession(rReq - * .getPortletSession())); - * - * if (rReq.getParameter("version") != null) { // show previous version - * of page System.out.println("Getting page " + wikiPage + " at version " + - * rReq.getParameter("version")); pageToShow = - * wikiEngine.getByName(wikiPage, wikiContext, - * Integer.valueOf(rReq.getParameter("version"))); - * - * if (pageToShow.getLastVersion() != pageToShow.getVersion()) { - * rReq.setAttribute("showedVersion", Integer.valueOf(rReq - * .getParameter("version"))); } } else { pageToShow = - * wikiEngine.getByName(wikiPage, wikiContext); } - * - * if (pageToShow == null) { - * - * try { pageToShow = (WikiPage) noSuchPage.clone(); } catch - * (CloneNotSupportedException cnse) { System.out.println(cnse); } - * - * pageToShow.setName(wikiPage); } } - * - * rReq .setAttribute( "wikiName", "<img - * src=\""+hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/JBossWikiLogoMedium.png\" - * width=\"100\" border=\"0\" style=\"vertical-align: middle\"/>"); - * - * rReq.setAttribute("wikiContent", pageToShow.getContent()); - * - * rReq.setAttribute("wikiImagesUrl", - * hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/"); - * - * rReq.setAttribute("wikiPage", wikiPage); - * - * rReq.setAttribute("editDate", pageToShow.getEditDate()); - * - * rReq.setAttribute("author", pageToShow.getLastAuthor()); - * - * rReq.setAttribute("logedIn", (rReq.getUser() != null) ? "true" : - * "false"); - * - * rReq.setAttribute("defaultPage", defaultPage); // FIXME make this - * more elegant (ie. plugin) // pass friendly link - * - * - * rReq.setAttribute("friendlyLink", - * hostURL+"/wiki/"+pageToShow.getName()); - * - * rRes.setTitle("Wiki"); if - * (javax.portlet.WindowState.NORMAL.equals(rReq.getWindowState()) || - * javax.portlet.WindowState.MAXIMIZED.equals(rReq .getWindowState())) { - * rRes.setContentType("text/html"); - * javax.portlet.PortletRequestDispatcher pRD = this - * .getPortletContext().getRequestDispatcher(jspPath + page); - * pRD.include(rReq, rRes); return; } doDispatch(rReq, rRes); - */ + } public void destroy() { Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-15 22:51:18 UTC (rev 1135) @@ -19,7 +19,6 @@ <h2><a href="<%=actionURL%>&page=<%=defaultPage%>"><%=wikiName%></a>/ <%=wikiPage%> </h2> - <!--<hr /> <a href="<%=actionURL%>&page=<%=defaultPage%>"><%=defaultPage%></a> <div class="wikiTrail">Your trail: <i>TODO</i></div> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-15 22:51:18 UTC (rev 1135) @@ -56,9 +56,13 @@ <name>RSSPlugin</name> <class>org.jboss.wiki.plugins.RSSPlugin</class> </plugin> - <!--<plugin> - <name>HTMLPartTranslator</name> - <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> - </plugin>--> </wikiType> + <wikiType> + <name>fileInfo</name> + <class>org.jboss.wiki.plugins.DefaultWikiType</class> + <plugin> + <name>AttachementInfoPlugin</name> + <class>org.jboss.wiki.plugins.AttachementInfoPlugin</class> + </plugin> + </wikiType> </wikiTypes> \ No newline at end of file Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/AttchementDataSource.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -0,0 +1,21 @@ +package org.jboss.wiki; + +import java.io.File; +import java.io.InputStream; +import java.util.Set; + +public interface AttchementDataSource { + public void addAtachement(File attFile, String attName, WikiPage page, String user); + + public Set<String> getAttachementsSet(WikiPage page); + + public Set<String> getAllPageNames(); + + public WikiAttachment getAttachement(String pageName, String attachementName); + + public WikiAttachment getAttachement(String pageName, String attachementName, int version); + + public int getLastAttachementVersion(String pageName, String attachementName); + + public long getAttachementSize(String pageName, String attachementName, int version); +} Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/FileDataSource.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -13,6 +13,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; import java.util.Date; import java.util.HashSet; import java.util.Properties; @@ -23,7 +24,7 @@ * </p> * */ -public class FileDataSource implements MediaDataSource { +public class FileDataSource implements MediaDataSource, AttchementDataSource { /** * <p> @@ -326,7 +327,7 @@ } page = new WikiPage(pageName, author, pageContent.toString(), - i, i, new Date(pageFile.lastModified()), this); + i, i, new Date(pageFile.lastModified()), this, this); page.setLength(pageFile.length()); } @@ -514,9 +515,6 @@ } } - // at the end delete the temp file - attFile.delete(); - attProps.setProperty(lastVersion + ".author", user); saveAttProps(attProps, pageName, attName); @@ -566,4 +564,63 @@ return attSet; } + public WikiAttachment getAttachement(String pageName, String attachementName) { + return getAttachement(pageName, attachementName, getLastAttachementVersion(pageName, attachementName)); + } + + public WikiAttachment getAttachement(String pageName, String attachementName, int version) { + + String[] tokens = attachementName.split("\\."); + + Properties props = getAttProps(pageName, attachementName); + + String user = props.getProperty(version+".author"); + + File file = new File( + pathToAttachments + + "/" + + pageName + + "-att/" + + attachementName + + "-dir/" + + version + + "." + + ((attachementName.indexOf(".") != -1) ? tokens[tokens.length - 1] + : "bin")); + + return new WikiAttachment(attachementName,new Date(file.lastModified()),user,file.length(),file,version); + } + + public int getLastAttachementVersion(String pageName, String attachementName) { + + Properties props = getAttProps(pageName, attachementName); + + // looking for the newest version + int version = 1; + + while (props.getProperty((version + 1) + ".author") != null) { + version++; + } + + return version; + } + + public long getAttachementSize(String pageName, String attachementName, int version) { + String[] tokens = attachementName.split("\\."); + + File file = new File( + pathToAttachments + + "/" + + pageName + + "-att/" + + attachementName + + "-dir/" + + version + + "." + + ((attachementName.indexOf(".") != -1) ? tokens[tokens.length - 1] + : "bin")); + + return file.length(); + } + } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/MediaDataSource.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -81,12 +81,6 @@ public void getContentAtVersion(WikiPage page, boolean loadContent, int version); - - public void addAtachement(File attFile, String attName, WikiPage page, String user); - - public Set<String> getAttachementsSet(WikiPage page); - - public Set<String> getAllPageNames(); } Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiAttachment.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiAttachment.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiAttachment.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -0,0 +1,65 @@ +package org.jboss.wiki; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; + +public class WikiAttachment { + private Date date; + + private String user; + + private long size; + + private File file; + + private String name; + + private int version; + + public WikiAttachment(String name, Date date, String user, long size, + File file, int version) { + this.date = date; + this.user = user; + this.size = size; + this.file = file; + this.name = name; + this.version = version; + } + + public Date getDate() { + return date; + } + + public String getName() { + return name; + } + + public long getSize() { + return size; + } + + public String getUser() { + return user; + } + + public InputStream getInputStream() { + try { + return new FileInputStream(file); + } catch (IOException e) { + System.err.println("Couldn't open file: " + file.getName()); + e.printStackTrace(); + return null; + } + } + + public File getFile() { + return file; + } + + public int getVersion() { + return version; + } +} Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiCommon.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiCommon.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiCommon.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -8,6 +8,8 @@ public class WikiCommon { + public static final String wikiButtons = "!WikiButtons"; + public static final String WIKI_SERVICE_NAME = "wiki:service=wikiService"; private WikiServiceMenagement wikiServiceMenagement; Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -48,6 +48,8 @@ private MediaDataSource mediaDataSource; + private AttchementDataSource attachementDataSource; + WikiPage noSuchPage; /** @@ -188,12 +190,14 @@ */ public void init() { mediaDataSource = new FileDataSource(); + attachementDataSource = new FileDataSource(); + pages = new HashMap<String, WikiPage>(); wikiTypes = new HashMap<String, WikiType>(); noSuchPage = new WikiPage("", new Credentials(""), "There is no such page. Click on EDIT to start it.", 0, 0, - null, mediaDataSource); + null, mediaDataSource, attachementDataSource); loadWikiTypes(); } @@ -328,7 +332,7 @@ WikiContext wc = new WikiContext(null, wt, null); WikiPage wp = new WikiPage("name", new Credentials("tomek"), - "[content|ble sme]", 1, 1, new Date(), we.getMediaDataSource()); + "[content|ble sme]", 1, 1, new Date(), we.getMediaDataSource(), we.getAttachementDataSource()); wp = wc.process(wp); @@ -347,7 +351,7 @@ Map<String, Integer> resPages = new HashMap<String, Integer>(); - Set<String> pages = getMediaDataSource().getAllPageNames(); + Set<String> pages = getAttachementDataSource().getAllPageNames(); for (String name : pages) { WikiPage temp = getByName(name, null); @@ -384,4 +388,8 @@ // System.out.println("Search completed"); return resPages; } + + public AttchementDataSource getAttachementDataSource() { + return attachementDataSource; + } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiPage.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiPage.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiPage.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -94,6 +94,8 @@ * */ private MediaDataSource mediaDataSource; + + private AttchementDataSource attachementDataSource; /** * <p> @@ -113,7 +115,7 @@ public WikiPage(String pageName, Credentials pageAuthor, - String pageContent, int pageLastVersion, int thisVersion, Date editDate, MediaDataSource mediaDataSource) { + String pageContent, int pageLastVersion, int thisVersion, Date editDate, MediaDataSource mediaDataSource, AttchementDataSource attachementDataSource) { name = pageName; lastAuthor = pageAuthor; this.pageContent = pageContent; @@ -121,6 +123,7 @@ version = thisVersion; this.editDate = editDate; this.mediaDataSource = mediaDataSource; + this.attachementDataSource = attachementDataSource; } /** @@ -305,7 +308,7 @@ @Override public Object clone() throws CloneNotSupportedException { WikiPage clonedPage = new WikiPage(getName(), getLastAuthor(), - getPageContent(), getLastVersion(), getVersion(), getEditDate(), mediaDataSource); + getPageContent(), getLastVersion(), getVersion(), getEditDate(), mediaDataSource, attachementDataSource); clonedPage.setLength(getLength()); @@ -379,10 +382,10 @@ } public void addAttachement(File attFile, String attName, String user) { - mediaDataSource.addAtachement(attFile, attName, this, user); + attachementDataSource.addAtachement(attFile, attName, this, user); } public Set<String> getAttachementsSet() { - return mediaDataSource.getAttachementsSet(this); + return attachementDataSource.getAttachementsSet(this); } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiType.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -92,6 +92,14 @@ newPage = (plugins.get(i)).process(newPage, wikiSession); } + // clear session attributes passed in uri + int i = 1; + + while (wikiSession.getAttribute("var"+i) != null) { + wikiSession.removeAttribute("var"+i); + i++; + } + return newPage; } Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachementInfoPlugin.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -0,0 +1,54 @@ +package org.jboss.wiki.plugins; + +import org.jboss.wiki.WikiAttachment; +import org.jboss.wiki.WikiPage; +import org.jboss.wiki.WikiPlugin; +import org.jboss.wiki.WikiSession; + +public class AttachementInfoPlugin extends WikiPlugin { + + @Override + public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { + StringBuilder history = new StringBuilder(); + String attachementName = (String)wikiSession.getAttribute("var1"); + Object rollbackToVer = wikiSession.getAttribute("var2"); + + String attURL = (String)wikiSession.getAttribute("hostURL")+"/wiki/"+wikiPage.getName()+"/"; + String actionURL = (String)wikiSession.getAttribute("actionURL"); + + if ((rollbackToVer != null)&(wikiSession.getAttribute("user") != null)&(Integer.valueOf((String)rollbackToVer) < wikiEngine.getAttachementDataSource().getLastAttachementVersion(wikiPage.getName(),attachementName))) { + WikiAttachment wikiAttachment = wikiEngine.getAttachementDataSource().getAttachement(wikiPage.getName(),attachementName, Integer.valueOf((String)rollbackToVer)); + wikiEngine.getAttachementDataSource().addAtachement(wikiAttachment.getFile(), attachementName, wikiPage, (String)wikiSession.getAttribute("user")); + } + + history.append("<h3>History of file: ").append(attachementName).append(" page: ").append(wikiPage.getName()).append("</h3>\n"); + history.append("<hr>\n").append("<table border=\"1\">\n"); + history.append("<tr><td><b>Version</b></td><td><b>Date</b></td><td><b>Author</b></td><td><b>Size</b></td><td><b>Rollback</b></td></tr>\n"); + + int lastVer = wikiEngine.getAttachementDataSource().getLastAttachementVersion(wikiPage.getName(),attachementName); + for (int i = lastVer; i > 0; i--) { + WikiAttachment wikiAttachment = wikiEngine.getAttachementDataSource().getAttachement(wikiPage.getName(), attachementName, i); + history.append("<tr><td>").append("<a href=\"").append(attURL).append(attachementName).append((i != lastVer) ? ":"+i : "").append("\" >").append(i).append("</a></td>").append("<td>").append(wikiAttachment.getDate()).append("</td>").append("<td>").append(wikiAttachment.getUser()).append("</td>").append("<td>").append(wikiAttachment.getSize()).append("</td>"); + + if (i != lastVer) { + history.append("<td><a href=\"").append(actionURL).append("&type=fileInfo&page=").append(wikiPage.getName()).append("&var1=").append(attachementName).append("&var2=").append(i).append("\" >").append("Rollback version ").append(i).append("</a></td>"); + } + else { + history.append("<td></td>"); + } + + history.append("</tr>\n"); + } + history.append("</table>\n"); + wikiPage.setPageContent(history.toString()); + + return wikiPage; + } + + @Override + public void init() { + // TODO Auto-generated method stub + + } + +} Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java 2005-09-15 19:36:50 UTC (rev 1134) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/AttachmentListPlugin.java 2005-09-15 22:51:18 UTC (rev 1135) @@ -11,6 +11,7 @@ import java.util.Set; +import org.jboss.wiki.WikiCommon; import org.jboss.wiki.WikiPage; import org.jboss.wiki.WikiPlugin; import org.jboss.wiki.WikiSession; @@ -22,6 +23,7 @@ @Override public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { host = (String)wikiSession.getAttribute("hostURL")+"/wiki/"; + String fileEditURL = (String)wikiSession.getAttribute("actionURL")+"&type=fileInfo&page="+wikiPage.getName(); WikiPage newPage = null; @@ -36,13 +38,15 @@ if (attachements != null) { String newContent = newPage.getPageContent(); - newContent += "\n<hr />\n<h3>Attachments:</h3>\n"; + newContent += "\n<hr />\n<h3>Attachments:</h3>\n<table border='0'>"; - for (String s : attachements) { - String href = host+newPage.getName() + "/" + s; - newContent += "<a href=\""+href+"\">"+href + "</a><br>\n"; + for (String file : attachements) { + String href = host+newPage.getName() + "/" + file; + newContent += "<tr><td><a href=\""+href+"\">"+href + "</a></td>"; + newContent += "<td><a href=\""+fileEditURL+"&var1="+file+"\" ><img border=\"0\" src=\""+host+WikiCommon.wikiButtons+"/historyButton.png\" /></a></td></tr>\n"; } - + newContent += "</table>\n"; + newPage.setPageContent(newContent); } |
From: <jbo...@li...> - 2005-09-15 19:36:53
|
Author: soh...@jb... Date: 2005-09-15 15:36:50 -0400 (Thu, 15 Sep 2005) New Revision: 1134 Removed: branches/forge/sohil/ Log: Removing my silly branch |
Author: adamw Date: 2005-09-15 05:24:18 -0400 (Thu, 15 Sep 2005) New Revision: 1133 Removed: trunk/forge/portal-extensions/forge-navigation/src/java/org/jbosslabs/ Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/WikiURLTag.java trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/ trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/jira_monitoring_help.jsp trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp trunk/forge/portal-extensions/forge-kosmos/kosmos-server/ trunk/forge/portal-extensions/forge-login-portlet/ trunk/forge/portal-extensions/forge-login-portlet/src/web/WEB-INF/ trunk/forge/portal-extensions/forge-navigation/project.xml trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java trunk/forge/portal-extensions/forge-navigation/src/web/WEB-INF/portlet.xml trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/AttributesFilter.java Log: JBLAB-384 - New navigation (continued) Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-15 09:24:18 UTC (rev 1133) @@ -334,7 +334,44 @@ * @return A link to the given page. */ public static String createFreezonePageLink(String portalName, String page) { + String pageLink = replace(page, "/", FREEZONE_SEPARATOR); + if (pageLink.charAt(0) == '+') + pageLink = pageLink.substring(1); + return "/portal/index.html?ctrl:id=page." + portalName - + ".freezone&page=" + replace(page, "/", FREEZONE_SEPARATOR); + + ".freezone&page=" + pageLink; } + + /** + * Creates a link to a portal page based on the given parameters. + * @param portalName Name of the portal. + * @param page Page to display. + * @return A link to the given portal page. + */ + public static String createPageLink(String portalName, String page) { + return "/portal/index.html?ctrl:id=page." + portalName + + "." + page; + } + + /** + * Captializes the first letter of the given string. + * @param value String to modify. + * @return The same string, with the first letter capitalized. + */ + public static String capitilizeFirstLetter(String value) { + return value.substring(0,1).toUpperCase() + + value.substring(1,value.length()); + } + + /** + * Creates a link to a wiki page based on the given parameters. + * @param portalName Name of the portal. + * @param page Wiki page to display. + * @return A link to the given portal page. + */ + public static String createWikiLink(String portalName, String page) { + return "/portal/index.html?ctrl:id=window." + portalName + + ".WikiPortletWindow&ctrl:type=action&page=" + + capitilizeFirstLetter(page); + } } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-15 09:24:18 UTC (rev 1133) @@ -126,8 +126,9 @@ projectId = DEFAULT_PROJECT; } else if ((!withDefault) && (DEFAULT_PROJECT.equals(projectId))) { projectId = null; - } else if (getProjects(ForgeHelper.getPortalName(request)).getProjectContext( - new RenderRequestPermissionsChecker(request), projectId) == null) { + } else if ((!DEFAULT_PROJECT.equals(projectId)) && + (getProjects(ForgeHelper.getPortalName(request)).getProjectContext( + new RenderRequestPermissionsChecker(request), projectId) == null)) { // No project context --> project does not exist. projectId = null; } @@ -160,9 +161,13 @@ */ public static String createFreezonePageLink(String portalName, String projectId, String page) { - return "/portal/index.html?ctrl:id=page." + portalName + String pageLink = ForgeHelper.replace(page, "/", ForgeHelper.FREEZONE_SEPARATOR); + if (pageLink.charAt(0) == '+') + pageLink = pageLink.substring(1); + + return "/portal/index.html?ctrl:id=page." + portalName + ".freezone&project=" + projectId + "&page=" - + ForgeHelper.replace(page, "/", ForgeHelper.FREEZONE_SEPARATOR); + + pageLink; } /** Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/WikiURLTag.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/WikiURLTag.java 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/WikiURLTag.java 2005-09-15 09:24:18 UTC (rev 1133) @@ -10,6 +10,7 @@ import javax.servlet.jsp.JspException; +import org.jboss.forge.common.ForgeHelper; import org.jboss.forge.common.projects.ProjectsHelper; public class WikiURLTag extends URLTag { @@ -25,18 +26,13 @@ this.page = page; } - private String capitilizeFirstLetter(String value) { - return value.substring(0,1).toUpperCase() + - value.substring(1,value.length()); - } - public int doStartTag() throws JspException { String pageName = page.equals(SELECTED_PROJECT) ? pageContext.getRequest().getAttribute( ProjectsHelper.PROJECT_ID).toString() : page; return writeURL("/portal/index.html", "ctrl:id", - WIKI_URL+"&page="+capitilizeFirstLetter(pageName)+"&project="+ + WIKI_URL+"&page="+ForgeHelper.capitilizeFirstLetter(pageName)+"&project="+ pageName); } } Property changes on: trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet ___________________________________________________________________ Name: svn:ignore - dist-bin-portlet + dist-bin-portlet .classpath .project .settings Modified: trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/jira_monitoring_help.jsp =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/jira_monitoring_help.jsp 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/jira_monitoring_help.jsp 2005-09-15 09:24:18 UTC (rev 1133) @@ -9,3 +9,5 @@ <%@include file="includes/legend.jsp"%> <%@include file="includes/about.jsp"%> + +<a href="<portlet:renderURL portletMode="view"/>">Back</a> \ No newline at end of file Modified: trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp 2005-09-15 09:24:18 UTC (rev 1133) @@ -10,4 +10,4 @@ <%@include file="includes/about.jsp"%> -<a href="<portlet:renderURL/>">Back</a> +<a href="<portlet:renderURL portletMode="view"/>">Back</a> Property changes on: trunk/forge/portal-extensions/forge-kosmos/kosmos-server ___________________________________________________________________ Name: svn:ignore - dist-bin-server + dist-bin-server .classpath .settings .project Property changes on: trunk/forge/portal-extensions/forge-login-portlet ___________________________________________________________________ Name: svn:ignore + target Property changes on: trunk/forge/portal-extensions/forge-login-portlet/src/web/WEB-INF ___________________________________________________________________ Name: svn:ignore + tld Modified: trunk/forge/portal-extensions/forge-navigation/project.xml =================================================================== --- trunk/forge/portal-extensions/forge-navigation/project.xml 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-navigation/project.xml 2005-09-15 09:24:18 UTC (rev 1133) @@ -56,5 +56,33 @@ <war.bundle>true</war.bundle> </properties> </dependency> + + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + <version>2.6.2</version> + </dependency> + + <dependency> + <groupId>xerces</groupId> + <artifactId>xmlParserAPIs</artifactId> + <version>2.6.2</version> + </dependency> + + <dependency> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + <version>2.6.0</version> + </dependency> + + <dependency> + <id>rome</id> + <version>0.5</version> + </dependency> + + <dependency> + <id>jdom</id> + <version>1.0</version> + </dependency> </dependencies> </project> Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-15 09:24:18 UTC (rev 1133) @@ -30,17 +30,45 @@ final static String PROJECTS_MENU_ATTRIBUTE = "projects-menu"; final static String TRUE_ATTR_VALUE = "true"; + /** + * <code>link</code> - link held by this entry. + */ private String link; + /** + * <code>display</code> - display text of the link held by this entry. + */ private String display; + /** + * <code>menu</code> - a sub-menu, or null, if no such menu is present. + */ private Menu menu; + /** + * <code>foldable</code> - true if sub-menu of this entry are foldable, + * that is, should be shown only when this entry is selected. + */ private boolean foldable; + /** + * <code>projectsMenu</code> - true iff this entry is just a dummy entry + * for inserting a project menu. + */ private boolean projectsMenu; + /** + * <code>specialLink</code> - name of a special link or null, if this entry + * is not a special link. + */ private String specialLink; private Set<String> allLinks; + /** + * From the given node, gets the value of the specified attribute. + * @param root Node to read the attribute from. + * @param attrName Name of the attribute to read. + * @return Value of the given attribute or null, if no such attribute + * is present. + */ private String getAttributeValue(Node root, String attrName) { Node n = root.getAttributes().getNamedItem(attrName); Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java 2005-09-15 09:24:18 UTC (rev 1133) @@ -40,6 +40,8 @@ mainMenu = new Menu(portalName, root); } + // Getting all links that are present in the menu, for fast checking in the + // future. allLinks = new HashSet<String>(); mainMenu.collectAllLinks(allLinks); } catch (Exception e) { @@ -68,12 +70,14 @@ // Getting the selected link only if there is no project selected. requestedLink = (String) request.getAttribute("nav-url"); + // Preparing link. requestedLink = NavigationTools.prepareLinkForChecking( ForgeHelper.getPortalName(request), requestedLink); + // Checking if this link is in the menu. if (!allLinks.contains(requestedLink)) { - // Trying to readd the last good link. + // Trying to read the last good link. requestedLink = (String) request.getPortletSession() .getAttribute("nav-last-url"); } else { @@ -82,6 +86,7 @@ } } + // Creating a context specific to this request. DelegateContext context = new DelegateContext(); mainMenu.fillContext(request, context, requestedLink); Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java 2005-09-15 09:24:18 UTC (rev 1133) @@ -3,70 +3,79 @@ import org.jboss.forge.common.ForgeHelper; import org.jboss.forge.common.content.ContentManager; +/** + * @author adamw + * Common constants and functions. + */ public class NavigationTools { - final static String MENU_ELEMENT = "menu"; - + final static String MENU_ELEMENT = "menu"; + private final static String NAVIGATION_XML = "navigation.xml"; + private final static String NAVIGATION_JSP = "navigation.jsp"; + private final static String NAVIGATION_DIR = "navigation"; - + private static ContentManager cm; - + static { cm = ForgeHelper.getContentManager(""); } - + static String getXmlCmPath(String portalName) { return portalName + "/" + NAVIGATION_DIR + "/" + NAVIGATION_XML; } - + static String getJspCmPath() { return NAVIGATION_DIR + "/" + NAVIGATION_JSP; } - + static synchronized NavigationDescriptor getDesc(final String portalName) { - NavigationDescriptor desc = (NavigationDescriptor) ForgeHelper.getForgeManagement(). - getFromCache(portalName, NavigationDescriptor.class.getName()); - - if (desc == null) - desc = (NavigationDescriptor) ForgeHelper.getForgeManagement(). - addNodeWatcher(portalName, NavigationDescriptor.class.getName(), - new NavigationNodeWatcher(cm)); - + NavigationDescriptor desc = (NavigationDescriptor) ForgeHelper + .getForgeManagement().getFromCache(portalName, + NavigationDescriptor.class.getName()); + + if (desc == null) + desc = (NavigationDescriptor) ForgeHelper.getForgeManagement() + .addNodeWatcher(portalName, + NavigationDescriptor.class.getName(), + new NavigationNodeWatcher(cm)); + return desc; } - + private static String NO_PROJECT_PARAM = "&noproject=true"; - + static String prepareLinkForDisplay(String link) { - if (link == null) + if (link == null) return link; - + // To each link, adding a noproject param, unless it's a project link. if ((!link.contains(NO_PROJECT_PARAM)) && (!link.contains("project="))) return link + NO_PROJECT_PARAM; - + return link; } - + static String prepareLinkForChecking(String portalName, String link) { - if (link == null) + if (link == null) return link; - - if (("/portal/".equals(link)) || ("/portal".equals(link))) + + if (("/portal/".equals(link)) || ("/portal".equals(link)) + || ("//portal".equals(link))) return ForgeHelper.createPageLink(portalName, "default"); - + // Deleting the noproject parameter, as it is not present in the generated links. int i = link.indexOf(NO_PROJECT_PARAM); if (i != -1) link = link.substring(0, i); - + // Deleting the project=default parameter from freezone link, as it is a dummy // project and not present in the generated links. if (link.contains("freezone")) { link = link.replace("&project=default", ""); } - + return link; } } Modified: trunk/forge/portal-extensions/forge-navigation/src/web/WEB-INF/portlet.xml =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/web/WEB-INF/portlet.xml 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-navigation/src/web/WEB-INF/portlet.xml 2005-09-15 09:24:18 UTC (rev 1133) @@ -4,7 +4,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd" version="1.0"> <portlet> <portlet-name>NavigationPortlet</portlet-name> - <portlet-class>org.jbosslabs.portlet.navigation.NavigationPortlet</portlet-class> + <portlet-class>org.jboss.forge.navigation.NavigationPortlet</portlet-class> <supported-locale>en</supported-locale> <supports> <mime-type>text/html</mime-type> @@ -12,19 +12,7 @@ </supports> <supported-window-states> <window-state>normal</window-state> - <window-state>minimized</window-state> - <window-state>maximized</window-state> </supported-window-states> - <init-param> - <description>URL of the used svn repository.</description> - <name>svnpath</name> - <value>http://sicore.org/forge/trunk/forge/portal-content</value> - </init-param> - <init-param> - <description>Local path where a working copy can be checked out.</description> - <name>localpath</name> - <value>/usr/local/forge/portal/content</value> - </init-param> <portlet-info> <title>JBoss Navigation Portlet</title> </portlet-info> Modified: trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/AttributesFilter.java =================================================================== --- trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/AttributesFilter.java 2005-09-14 22:10:47 UTC (rev 1132) +++ trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/AttributesFilter.java 2005-09-15 09:24:18 UTC (rev 1133) @@ -42,6 +42,13 @@ httpRequest.setAttribute("project", project); } } + + // Putting the full requested url into session for navigation. + String fullUrl = httpRequest.getRequestURI(); + if (httpRequest.getQueryString() != null) + fullUrl += "?" + httpRequest.getQueryString(); + + httpRequest.setAttribute("nav-url", fullUrl); } chain.doFilter(request, response); |
From: <jbo...@li...> - 2005-09-14 21:52:33
|
Author: adamw Date: 2005-09-14 17:52:27 -0400 (Wed, 14 Sep 2005) New Revision: 1131 Added: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Menu.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationNodeWatcher.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationPortlet.java trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java Log: JBLAB-384 - New navigation (partial) Added: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-14 21:35:15 UTC (rev 1130) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Entry.java 2005-09-14 21:52:27 UTC (rev 1131) @@ -0,0 +1,153 @@ +package org.jboss.forge.navigation; + +import java.util.HashSet; +import java.util.Set; + +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.projects.AbstractDescriptor; +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.common.projects.ProjectsHelper; +import org.jboss.forge.common.projects.permissions.PermissionsChecker; +import org.jboss.forge.common.projects.permissions.RenderRequestPermissionsChecker; +import org.jboss.portal.common.context.DelegateContext; +import org.jboss.portlet.JBossRenderRequest; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * @author adamw + * A class representing a single menu entry. + */ +public class Entry extends AbstractDescriptor { + final static String LINK_ELEMENT = "link"; + final static String PAGE_LINK_ELEMENT = "page-link"; + final static String FREEZONE_LINK_ELEMENT = "freezone-link"; + final static String WIKI_LINK_ELEMENT = "wiki-link"; + final static String DISPLAY_ELEMENT = "display"; + + final static String FOLDABLE_ATTRIBUTE = "foldable"; + final static String SPECIAL_LINK_ATTRIBUTE = "special-link"; + final static String PROJECTS_MENU_ATTRIBUTE = "projects-menu"; + final static String TRUE_ATTR_VALUE = "true"; + + private String link; + private String display; + + private Menu menu; + + private boolean foldable; + private boolean projectsMenu; + private String specialLink; + + private Set<String> allLinks; + + private String getAttributeValue(Node root, String attrName) { + Node n = root.getAttributes().getNamedItem(attrName); + + if (n == null) return null; + + return unmarshallText(n); + } + + public Entry(String portalName, Node root) { + projectsMenu = TRUE_ATTR_VALUE.equals(getAttributeValue(root, PROJECTS_MENU_ATTRIBUTE)); + + if (projectsMenu) + // No need for further processing if this is a project's menu. + return; + + specialLink = getAttributeValue(root, SPECIAL_LINK_ATTRIBUTE); + foldable = TRUE_ATTR_VALUE.equals(getAttributeValue(root, FOLDABLE_ATTRIBUTE)); + + NodeList nodes = root.getChildNodes(); + + for (int i = 0; i < nodes.getLength(); i++) { + Node n = nodes.item(i); + + if (n.getNodeType() == Node.ELEMENT_NODE) { + String nodeName = n.getNodeName(); + + if (LINK_ELEMENT.equals(nodeName)) { + link = unmarshallText(n); + } else if (PAGE_LINK_ELEMENT.equals(nodeName)) { + link = ForgeHelper.createPageLink(portalName, unmarshallText(n)); + } else if (FREEZONE_LINK_ELEMENT.equals(nodeName)) { + link = ForgeHelper.createFreezonePageLink(portalName, unmarshallText(n)); + } else if (WIKI_LINK_ELEMENT.equals(nodeName)) { + link = ForgeHelper.createWikiLink(portalName, unmarshallText(n)); + } else if (DISPLAY_ELEMENT.equals(nodeName)) { + display = unmarshallText(n); + } else if (NavigationTools.MENU_ELEMENT.equals(nodeName)) { + // Creating a sub-menu. + menu = new Menu(portalName, n); + } + } + } + + // Gathering information about links that are in this entry or below + // this entry. + allLinks = new HashSet<String>(); + collectAllLinks(allLinks); + } + + /** + * To the given set, add all links that are in this or any of the sub-menus. + * @param toFill Set to fill. + */ + void collectAllLinks(Set<String> toFill) { + if (projectsMenu) + // No links for a project's menu. + return; + + // Adding the link that this menu represents. + toFill.add(link); + + // Adding links from the sub-menu, if one exists. + if (menu != null) + menu.collectAllLinks(toFill); + } + + void fillContext(JBossRenderRequest request, DelegateContext context, String currentLink) { + if (specialLink != null) { + // Checking if we can show this link. + if ("logout".equals(specialLink)) { + if (request.getRemoteUser() == null) + return; + } else if ("admin".equals(specialLink)) { + if (!request.hasPermission("Admin")) + return; + } else + // Unsupported special link. + return; + } + + // Creating a context that will be filled, now that we know that we do + // add a new entry. + DelegateContext toFill = context.next("entries"); + + if (projectsMenu) { + toFill.put("is-projects-menu", "true"); + // Appending the project's context. + String portalName = ForgeHelper.getPortalName(request); + Projects projects = ProjectsHelper.getProjects(portalName); + PermissionsChecker pc = new RenderRequestPermissionsChecker(request); + + DelegateContext prjContext = projects.getProjectsContext(pc); + + toFill.append("projects-menu", prjContext); + return; + } else + toFill.put("is-projects-menu", "false"); + + boolean selected = allLinks.contains(currentLink); + + if (selected) + toFill.next("selected"); + + toFill.put("link", NavigationTools.prepareLinkForDisplay(link)); + toFill.put("display", display); + + if ((menu != null) && ((foldable && selected) || (!foldable))) + menu.fillContext(request, toFill, currentLink); + } +} Added: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Menu.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Menu.java 2005-09-14 21:35:15 UTC (rev 1130) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/Menu.java 2005-09-14 21:52:27 UTC (rev 1131) @@ -0,0 +1,60 @@ +package org.jboss.forge.navigation; + +import java.util.List; +import java.util.ArrayList; +import java.util.Set; + +import org.jboss.portal.common.context.DelegateContext; +import org.jboss.portlet.JBossRenderRequest; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * @author adamw + * A class holding other menu entries. + */ +public class Menu { + final static String ENTRY_ELEMENT = "entry"; + + /** + * <code>entries</code> - a list of entries in this menu. + */ + private List<Entry> entries; + + public Menu(String portalName, Node root) { + entries = new ArrayList<Entry>(); + + NodeList nodes = root.getChildNodes(); + + for (int i = 0; i < nodes.getLength(); i++) { + Node n = nodes.item(i); + + if ((n.getNodeType() == Node.ELEMENT_NODE) + && (n.getNodeName().equals(ENTRY_ELEMENT))) { + // Parsing and adding a new entry. + entries.add(new Entry(portalName, n)); + } + } + } + + /** + * To the given set, add all links that are in this or any of the sub-menus. + * @param toFill Set to fill. + */ + void collectAllLinks(Set<String> toFill) { + for (Entry e : entries) + e.collectAllLinks(toFill); + } + + /** + * Fills the given context with menu information. + * @param request Request for which the context is to be filled. + * @param context Context to fill. + * @param currentLink Currently selected link. + */ + void fillContext(JBossRenderRequest request, DelegateContext context, + String currentLink) { + for (Entry e : entries) + e.fillContext(request, context, currentLink); + } +} Added: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java 2005-09-14 21:35:15 UTC (rev 1130) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationDescriptor.java 2005-09-14 21:52:27 UTC (rev 1131) @@ -0,0 +1,90 @@ +package org.jboss.forge.navigation; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.xerces.parsers.DOMParser; +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.content.ContentManager; +import org.jboss.forge.common.projects.ProjectsHelper; +import org.jboss.portal.common.context.DelegateContext; +import org.jboss.portlet.JBossRenderRequest; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; + +/** + * @author adamw + * A class which handles xml parsing with navigation layout and accessing the parsed + * information. + */ +public class NavigationDescriptor { + private Menu mainMenu; + + private Set<String> allLinks; + + public NavigationDescriptor(String portalName, ContentManager cm) { + try { + // Parsing the xml navigation descriptor. + DOMParser parser = new DOMParser(); + parser.parse(new InputSource(cm.getInputStream(NavigationTools + .getXmlCmPath(portalName)))); + Document doc = parser.getDocument(); + + // Looking for the root menu element. + Node root = doc.getDocumentElement(); + + if ((root.getNodeType() == Node.ELEMENT_NODE) + && (root.getNodeName().equals(NavigationTools.MENU_ELEMENT))) { + // Found a menu element, parsing and ending the loop. + mainMenu = new Menu(portalName, root); + } + + allLinks = new HashSet<String>(); + mainMenu.collectAllLinks(allLinks); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Checks if the given link is present in the menu. + * @param link Link to check. + * @return True iff the given link is present in the menu. + */ + public boolean linkInMenu(String link) { + return allLinks.contains(link); + } + + /** + * Fills the given context with menu information. + * @param request Request for which the context should be filled. + * @return A filled context with menu information. + */ + public DelegateContext getContext(JBossRenderRequest request) { + String requestedLink = null; + + if (ProjectsHelper.getSelectedProjectId(request) == null) { + // Getting the selected link only if there is no project selected. + requestedLink = (String) request.getAttribute("nav-url"); + + requestedLink = NavigationTools.prepareLinkForChecking( + ForgeHelper.getPortalName(request), + requestedLink); + + if (!allLinks.contains(requestedLink)) { + // Trying to readd the last good link. + requestedLink = (String) request.getPortletSession() + .getAttribute("nav-last-url"); + } else { + request.getPortletSession().setAttribute("nav-last-url", + requestedLink); + } + } + + DelegateContext context = new DelegateContext(); + mainMenu.fillContext(request, context, requestedLink); + + return context; + } +} Added: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationNodeWatcher.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationNodeWatcher.java 2005-09-14 21:35:15 UTC (rev 1130) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationNodeWatcher.java 2005-09-14 21:52:27 UTC (rev 1131) @@ -0,0 +1,34 @@ +package org.jboss.forge.navigation; + +import org.jboss.forge.common.content.ContentManager; +import org.jboss.forge.common.service.NodeWatcher; +import org.jboss.forge.common.service.ResourceWatcher; + +public class NavigationNodeWatcher implements NodeWatcher { + private ResourceWatcher rw; + private ContentManager cm; + + public NavigationNodeWatcher(ContentManager cm) { + this.cm = cm; + } + + private NavigationDescriptor getDesc(String portalName) { + NavigationDescriptor desc = new NavigationDescriptor(portalName, cm); + + rw = new ResourceWatcher(cm); + rw.watchResource(NavigationTools.getXmlCmPath(portalName)); + + return desc; + } + + public Object init(String portalName) { + return getDesc(portalName); + } + + public Object nodeUpdate(String portalName, Object currentValue) { + if ((currentValue == null) || (rw.checkResources())) + return getDesc(portalName); + else + return null; + } +} Added: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationPortlet.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationPortlet.java 2005-09-14 21:35:15 UTC (rev 1130) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationPortlet.java 2005-09-14 21:52:27 UTC (rev 1131) @@ -0,0 +1,41 @@ +package org.jboss.forge.navigation; + +import java.io.IOException; + +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; + +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.projects.ProjectsHelper; +import org.jboss.portal.common.context.DelegateContext; +import org.jboss.portal.core.servlet.jsp.PortalJsp; +import org.jboss.portlet.JBossPortlet; +import org.jboss.portlet.JBossRenderRequest; +import org.jboss.portlet.JBossRenderResponse; + +/** + * @author adamw + * Navigation portlet. + */ +public class NavigationPortlet extends JBossPortlet { + public void doView(JBossRenderRequest request, JBossRenderResponse response) + throws IOException, PortletException { + response.setContentType("text/html"); + + String portalName = ForgeHelper.getPortalName(request); + + ProjectsHelper.prepareRequest(request); + + // Getting the navigation context. + DelegateContext navContext = NavigationTools.getDesc(portalName) + .getContext(request); + + // Displaying. + request.setAttribute(PortalJsp.CTX_REQUEST, navContext); + + PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher( + ForgeHelper.createRepoAccessPath(portalName, NavigationTools + .getJspCmPath())); + rd.include(request, response); + } +} Added: trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java 2005-09-14 21:35:15 UTC (rev 1130) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jboss/forge/navigation/NavigationTools.java 2005-09-14 21:52:27 UTC (rev 1131) @@ -0,0 +1,72 @@ +package org.jboss.forge.navigation; + +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.content.ContentManager; + +public class NavigationTools { + final static String MENU_ELEMENT = "menu"; + + private final static String NAVIGATION_XML = "navigation.xml"; + private final static String NAVIGATION_JSP = "navigation.jsp"; + private final static String NAVIGATION_DIR = "navigation"; + + private static ContentManager cm; + + static { + cm = ForgeHelper.getContentManager(""); + } + + static String getXmlCmPath(String portalName) { + return portalName + "/" + NAVIGATION_DIR + "/" + NAVIGATION_XML; + } + + static String getJspCmPath() { + return NAVIGATION_DIR + "/" + NAVIGATION_JSP; + } + + static synchronized NavigationDescriptor getDesc(final String portalName) { + NavigationDescriptor desc = (NavigationDescriptor) ForgeHelper.getForgeManagement(). + getFromCache(portalName, NavigationDescriptor.class.getName()); + + if (desc == null) + desc = (NavigationDescriptor) ForgeHelper.getForgeManagement(). + addNodeWatcher(portalName, NavigationDescriptor.class.getName(), + new NavigationNodeWatcher(cm)); + + return desc; + } + + private static String NO_PROJECT_PARAM = "&noproject=true"; + + static String prepareLinkForDisplay(String link) { + if (link == null) + return link; + + // To each link, adding a noproject param, unless it's a project link. + if ((!link.contains(NO_PROJECT_PARAM)) && (!link.contains("project="))) + return link + NO_PROJECT_PARAM; + + return link; + } + + static String prepareLinkForChecking(String portalName, String link) { + if (link == null) + return link; + + if (("/portal/".equals(link)) || ("/portal".equals(link))) + return ForgeHelper.createPageLink(portalName, "default"); + + // Deleting the noproject parameter, as it is not present in the generated links. + int i = link.indexOf(NO_PROJECT_PARAM); + if (i != -1) + link = link.substring(0, i); + + // Deleting the project=default parameter from freezone link, as it is a dummy + // project and not present in the generated links. + if (link.contains("freezone")) { + link = link.replace("&project=default", ""); + } + + return link; + } +} |
From: <jbo...@li...> - 2005-09-14 21:35:21
|
Author: dam...@jb... Date: 2005-09-14 17:35:15 -0400 (Wed, 14 Sep 2005) New Revision: 1130 Modified: qa/forge/portal-extensions/jbosswiki/maven.xml qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java Log: MERGED: -r 1126:1129 https://svn.labs.jboss.com/trunk/forge This is a QA bug fix merge for 1.0.3 release. Modified: qa/forge/portal-extensions/jbosswiki/maven.xml =================================================================== --- qa/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 21:23:42 UTC (rev 1129) +++ qa/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 21:35:15 UTC (rev 1130) @@ -35,6 +35,22 @@ <attainGoal name="ear" /> </goal> + <goal name="wiki:localbuild"> + <maven:reactor includes="wiki-common/project.xml" excludes="" basedir="." + banner="Making wiki-common for the repo" + goals="clean,build" ignoreFailures="false" /> + <maven:reactor includes="wiki-management/project.xml" excludes="" basedir="." + banner="Building and deploying EJB3 service for wiki" + goals="clean,build" ignoreFailures="false" /> + <maven:reactor includes="forge-wiki/project.xml" excludes="" basedir="." + banner="Building and deploying wiki portlet/servlet" + goals="clean,build" ignoreFailures="false" /> + + <attainGoal name="prepare-ear" /> + + <attainGoal name="ear" /> + </goal> + <goal name="prepare-ear"> <ant:delete dir="target/ear" /> @@ -56,7 +72,7 @@ </goal> <goal name="wiki:all"> - <attainGoal name="wiki:build" /> + <attainGoal name="wiki:localbuild" /> <attainGoal name="wiki:deploy" /> </goal> Modified: qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 21:23:42 UTC (rev 1129) +++ qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 21:35:15 UTC (rev 1130) @@ -42,7 +42,7 @@ String content; if (i > 1) { - content = differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("&", "&").replaceAll("\n","<br />\n"); + content = differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("&", "&").replaceAll("<","<").replaceAll(">",">").replaceAll("\n","<br />\n"); } else { content = "This is first version of the page so it doesn't have diff yet"; |
From: <jbo...@li...> - 2005-09-14 21:23:47
|
Author: szimano Date: 2005-09-14 17:23:42 -0400 (Wed, 14 Sep 2005) New Revision: 1129 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java Log: < and > issue in XML Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 21:05:06 UTC (rev 1128) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 21:23:42 UTC (rev 1129) @@ -42,7 +42,7 @@ String content; if (i > 1) { - content = differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("&", "&").replaceAll("\n","<br />\n"); + content = differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("&", "&").replaceAll("<","<").replaceAll(">",">").replaceAll("\n","<br />\n"); } else { content = "This is first version of the page so it doesn't have diff yet"; |
From: <jbo...@li...> - 2005-09-14 21:05:11
|
Author: szimano Date: 2005-09-14 17:05:06 -0400 (Wed, 14 Sep 2005) New Revision: 1128 Modified: trunk/forge/portal-extensions/jbosswiki/maven.xml Log: repaired maven all in the jbosswiki directory Modified: trunk/forge/portal-extensions/jbosswiki/maven.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 20:46:50 UTC (rev 1127) +++ trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 21:05:06 UTC (rev 1128) @@ -35,6 +35,22 @@ <attainGoal name="ear" /> </goal> + <goal name="wiki:localbuild"> + <maven:reactor includes="wiki-common/project.xml" excludes="" basedir="." + banner="Making wiki-common for the repo" + goals="clean,build" ignoreFailures="false" /> + <maven:reactor includes="wiki-management/project.xml" excludes="" basedir="." + banner="Building and deploying EJB3 service for wiki" + goals="clean,build" ignoreFailures="false" /> + <maven:reactor includes="forge-wiki/project.xml" excludes="" basedir="." + banner="Building and deploying wiki portlet/servlet" + goals="clean,build" ignoreFailures="false" /> + + <attainGoal name="prepare-ear" /> + + <attainGoal name="ear" /> + </goal> + <goal name="prepare-ear"> <ant:delete dir="target/ear" /> @@ -56,7 +72,7 @@ </goal> <goal name="wiki:all"> - <attainGoal name="wiki:build" /> + <attainGoal name="wiki:localbuild" /> <attainGoal name="wiki:deploy" /> </goal> |
From: <jbo...@li...> - 2005-09-14 20:46:55
|
Author: dam...@jb... Date: 2005-09-14 16:46:50 -0400 (Wed, 14 Sep 2005) New Revision: 1127 Modified: qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java Log: MERGED: -r 1124:1126 https://svn.labs.jboss.com/trunk/forge This is a QA bug fix merge for 1.0.3 release. Modified: qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 20:43:38 UTC (rev 1126) +++ qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 20:46:50 UTC (rev 1127) @@ -39,17 +39,10 @@ rssFeed.append("<language>en</language>\n"); for (int i = wikiPage.getLastVersion(); i > 0; i--) { - String content;/* = HTMLTranslatorParts.pagePartRegexStart - + wikiPage.getPageAtVersion(true, i).getPageContent() - + HTMLTranslatorParts.pagePartRegexEnd;*/ + String content; if (i > 1) { - //try { - content = /*differenceEngine.colorizeDiff(*/differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("\n","<br />\n")/*) + "<br />\n<br />\n"+ content*/; - /*} - catch (IOException ioe) { - System.err.println("Couldn't get diff from pages: "+ioe); - }*/ + content = differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("&", "&").replaceAll("\n","<br />\n"); } else { content = "This is first version of the page so it doesn't have diff yet"; |
From: <jbo...@li...> - 2005-09-14 20:43:45
|
Author: szimano Date: 2005-09-14 16:43:38 -0400 (Wed, 14 Sep 2005) New Revision: 1126 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java Log: amps in diff Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 20:18:47 UTC (rev 1125) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 20:43:38 UTC (rev 1126) @@ -39,17 +39,10 @@ rssFeed.append("<language>en</language>\n"); for (int i = wikiPage.getLastVersion(); i > 0; i--) { - String content;/* = HTMLTranslatorParts.pagePartRegexStart - + wikiPage.getPageAtVersion(true, i).getPageContent() - + HTMLTranslatorParts.pagePartRegexEnd;*/ + String content; if (i > 1) { - //try { - content = /*differenceEngine.colorizeDiff(*/differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("\n","<br />\n")/*) + "<br />\n<br />\n"+ content*/; - /*} - catch (IOException ioe) { - System.err.println("Couldn't get diff from pages: "+ioe); - }*/ + content = differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("&", "&").replaceAll("\n","<br />\n"); } else { content = "This is first version of the page so it doesn't have diff yet"; |
From: <jbo...@li...> - 2005-09-14 20:18:53
|
Author: dam...@jb... Date: 2005-09-14 16:18:47 -0400 (Wed, 14 Sep 2005) New Revision: 1125 Added: qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.gif Modified: qa/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java Log: MERGED: -r 1118:1124 https://svn.labs.jboss.com/trunk/forge This is a QA bug fix merge for 1.0.3 release. Modified: qa/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf =================================================================== --- qa/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf 2005-09-14 20:08:14 UTC (rev 1124) +++ qa/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf 2005-09-14 20:18:47 UTC (rev 1125) @@ -40,7 +40,7 @@ # Specify options to pass to the Java VM. # if [ "x$JAVA_OPTS" = "x" ]; then - JAVA_OPTS="-server -Xms128m -Xmx128m" + JAVA_OPTS="-server -Xms256m -Xmx256m" fi # Sample JPDA settings for remote socket debuging Modified: qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java =================================================================== --- qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-14 20:08:14 UTC (rev 1124) +++ qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-14 20:18:47 UTC (rev 1125) @@ -139,7 +139,7 @@ ServletOutputStream os = response.getOutputStream(); - response.setContentType("image/png"); + response.setContentType(mimeTypes.getContentType(tokens[tokens.length - 1])); // Transferring the bytes try { Modified: qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 20:08:14 UTC (rev 1124) +++ qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 20:18:47 UTC (rev 1125) @@ -62,7 +62,7 @@ <% if ((type == null)||(type.equals("HTML"))) { out.println("<a href=\""+actionURL+"&action=Info&page="+wikiPage+"\"><img alt=\"HISTORY\" src=\""+wikiImagesUrl+"historyButton.png\" border=\"0\" /></a>"); - out.println("<a href=\""+rssLink+"\"><img alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.png\" border=\"0\" /></a><br />"); + out.println("<a href=\""+rssLink+"\"><img alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.gif\" border=\"0\" /></a><br />"); } %> <input type="text" name="searchQuery" /> Copied: qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.gif (from rev 1124, trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.gif) Modified: qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml =================================================================== --- qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-14 20:08:14 UTC (rev 1124) +++ qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-14 20:18:47 UTC (rev 1125) @@ -56,9 +56,9 @@ <name>RSSPlugin</name> <class>org.jboss.wiki.plugins.RSSPlugin</class> </plugin> - <plugin> + <!--<plugin> <name>HTMLPartTranslator</name> <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> - </plugin> + </plugin>--> </wikiType> </wikiTypes> \ No newline at end of file Modified: qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 20:08:14 UTC (rev 1124) +++ qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 20:18:47 UTC (rev 1125) @@ -39,18 +39,21 @@ rssFeed.append("<language>en</language>\n"); for (int i = wikiPage.getLastVersion(); i > 0; i--) { - String content = HTMLTranslatorParts.pagePartRegexStart + String content;/* = HTMLTranslatorParts.pagePartRegexStart + wikiPage.getPageAtVersion(true, i).getPageContent() - + HTMLTranslatorParts.pagePartRegexEnd; + + HTMLTranslatorParts.pagePartRegexEnd;*/ if (i > 1) { - try { - content = differenceEngine.colorizeDiff(differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent())) + "<br />\n<br />\n"+ content; - } + //try { + content = /*differenceEngine.colorizeDiff(*/differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("\n","<br />\n")/*) + "<br />\n<br />\n"+ content*/; + /*} catch (IOException ioe) { System.err.println("Couldn't get diff from pages: "+ioe); - } + }*/ } + else { + content = "This is first version of the page so it doesn't have diff yet"; + } addItem(rssFeed, wikiPage.getName() + " rev: " + i, (String) wikiSession.getAttribute("hostURL") |
From: <jbo...@li...> - 2005-09-14 20:08:26
|
Author: szimano Date: 2005-09-14 16:08:14 -0400 (Wed, 14 Sep 2005) New Revision: 1124 Modified: trunk/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf Log: use 256/256 of memory instead of 128/128 Modified: trunk/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf =================================================================== --- trunk/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf 2005-09-14 19:57:45 UTC (rev 1123) +++ trunk/forge/portal-extensions/jboss-as-binaries/to-copy/bin/run.conf 2005-09-14 20:08:14 UTC (rev 1124) @@ -40,7 +40,7 @@ # Specify options to pass to the Java VM. # if [ "x$JAVA_OPTS" = "x" ]; then - JAVA_OPTS="-server -Xms128m -Xmx128m" + JAVA_OPTS="-server -Xms256m -Xmx256m" fi # Sample JPDA settings for remote socket debuging |
From: <jbo...@li...> - 2005-09-14 19:58:08
|
Author: szimano Date: 2005-09-14 15:57:45 -0400 (Wed, 14 Sep 2005) New Revision: 1123 Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.gif Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java Log: changed RSS button, and the description of rss feed Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-14 19:00:59 UTC (rev 1122) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-14 19:57:45 UTC (rev 1123) @@ -139,7 +139,7 @@ ServletOutputStream os = response.getOutputStream(); - response.setContentType("image/png"); + response.setContentType(mimeTypes.getContentType(tokens[tokens.length - 1])); // Transferring the bytes try { Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 19:00:59 UTC (rev 1122) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 19:57:45 UTC (rev 1123) @@ -62,7 +62,7 @@ <% if ((type == null)||(type.equals("HTML"))) { out.println("<a href=\""+actionURL+"&action=Info&page="+wikiPage+"\"><img alt=\"HISTORY\" src=\""+wikiImagesUrl+"historyButton.png\" border=\"0\" /></a>"); - out.println("<a href=\""+rssLink+"\"><img alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.png\" border=\"0\" /></a><br />"); + out.println("<a href=\""+rssLink+"\"><img alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.gif\" border=\"0\" /></a><br />"); } %> <input type="text" name="searchQuery" /> Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.gif =================================================================== (Binary files differ) Property changes on: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-14 19:00:59 UTC (rev 1122) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-14 19:57:45 UTC (rev 1123) @@ -56,9 +56,9 @@ <name>RSSPlugin</name> <class>org.jboss.wiki.plugins.RSSPlugin</class> </plugin> - <plugin> + <!--<plugin> <name>HTMLPartTranslator</name> <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> - </plugin> + </plugin>--> </wikiType> </wikiTypes> \ No newline at end of file Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 19:00:59 UTC (rev 1122) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 19:57:45 UTC (rev 1123) @@ -39,18 +39,21 @@ rssFeed.append("<language>en</language>\n"); for (int i = wikiPage.getLastVersion(); i > 0; i--) { - String content = HTMLTranslatorParts.pagePartRegexStart + String content;/* = HTMLTranslatorParts.pagePartRegexStart + wikiPage.getPageAtVersion(true, i).getPageContent() - + HTMLTranslatorParts.pagePartRegexEnd; + + HTMLTranslatorParts.pagePartRegexEnd;*/ if (i > 1) { - try { - content = differenceEngine.colorizeDiff(differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent())) + "<br />\n<br />\n"+ content; - } + //try { + content = /*differenceEngine.colorizeDiff(*/differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent()).replaceAll("\n","<br />\n")/*) + "<br />\n<br />\n"+ content*/; + /*} catch (IOException ioe) { System.err.println("Couldn't get diff from pages: "+ioe); - } + }*/ } + else { + content = "This is first version of the page so it doesn't have diff yet"; + } addItem(rssFeed, wikiPage.getName() + " rev: " + i, (String) wikiSession.getAttribute("hostURL") |
From: <jbo...@li...> - 2005-09-14 19:01:08
|
Author: soh...@jb... Date: 2005-09-14 15:00:59 -0400 (Wed, 14 Sep 2005) New Revision: 1122 Added: branches/forge/sohil/forge/ Log: Branch of forge for Sohil Copied: branches/forge/sohil/forge (from rev 1121, trunk/forge) |
From: <jbo...@li...> - 2005-09-14 18:09:39
|
Author: dam...@jb... Date: 2005-09-14 14:09:34 -0400 (Wed, 14 Sep 2005) New Revision: 1120 Added: branches/forge/sohil/ Log: Added a branch dir for sohil. |
Author: dam...@jb... Date: 2005-09-14 14:03:47 -0400 (Wed, 14 Sep 2005) New Revision: 1119 Added: qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.png Modified: qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java Log: MERGED: -r 1115:1118 https://svn.labs.jboss.com/trunk/forge into qa forge. This is a QA bug fix merge for 1.0.3 release. Modified: qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java =================================================================== --- qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-14 17:40:30 UTC (rev 1118) +++ qa/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-14 18:03:47 UTC (rev 1119) @@ -379,7 +379,8 @@ }*/ rReq.setAttribute("friendlyLink", hostURL+"/wiki/"+pageToShow.getName()); - + rReq.setAttribute("rssLink", hostURL+"/wiki/rss/"+pageToShow.getName()); + rRes.setTitle("Wiki"); if (javax.portlet.WindowState.NORMAL.equals(rReq.getWindowState()) || javax.portlet.WindowState.MAXIMIZED.equals(rReq Modified: qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 17:40:30 UTC (rev 1118) +++ qa/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 18:03:47 UTC (rev 1119) @@ -13,6 +13,7 @@ String wikiPage = (String)request.getAttribute("wikiPage"); String defaultPage = (String)request.getAttribute("defaultPage"); String friendlyLink = (String)request.getAttribute("friendlyLink"); + String rssLink = (String)request.getAttribute("rssLink"); String type = (String)request.getParameter("type"); java.util.Date editDate = (java.util.Date)request.getAttribute("editDate"); org.jboss.wiki.Credentials author = (org.jboss.wiki.Credentials)request.getAttribute("author"); @@ -35,7 +36,8 @@ <table style="width: 100%" border="0"> <tr style="vertical-align: bottom;"> <td style="vertical-align: bottom; align-bottom: 0px;"> -<div><a href="<%=friendlyLink%>"><img style="vertical-align: middle" alt="PERM LINK" src="<%=wikiImagesUrl%>permaLinkButton.png" border="0"/></a> <a href="<%=friendlyLink%>"><%=friendlyLink%></a></div> +<div><a href="<%=friendlyLink%>"><img style="vertical-align: middle" alt="PERM LINK" src="<%=wikiImagesUrl%>permaLinkButton.png" border="0"/></a> <a href="<%=friendlyLink%>"><%=friendlyLink%></a> </div> + </td> <td style="text-align: right;vertical-align: bottom; align-bottom: 0px;"> @@ -59,7 +61,8 @@ <% if ((type == null)||(type.equals("HTML"))) { - out.println("<a href=\""+actionURL+"&action=Info&page="+wikiPage+"\"><img alt=\"HISTORY\" src=\""+wikiImagesUrl+"historyButton.png\" border=\"0\" /></a><br />"); + out.println("<a href=\""+actionURL+"&action=Info&page="+wikiPage+"\"><img alt=\"HISTORY\" src=\""+wikiImagesUrl+"historyButton.png\" border=\"0\" /></a>"); + out.println("<a href=\""+rssLink+"\"><img alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.png\" border=\"0\" /></a><br />"); } %> <input type="text" name="searchQuery" /> Copied: qa/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.png (from rev 1118, trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.png) Modified: qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java =================================================================== --- qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 17:40:30 UTC (rev 1118) +++ qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 18:03:47 UTC (rev 1119) @@ -75,9 +75,6 @@ public final static String pagePartRegexEnd = "<!--page:end-->"; - private final String pagePartRegex = pagePartRegexStart + ".*" - + pagePartRegexEnd; - private String wikiHome = ""; // private String actionType = "&ctrl:type="; @@ -823,14 +820,14 @@ // external link if (isExternalLink(link)) { if (checkImageLink(link)) { - result = "<img src=\"" + link + "\" alt=\"" + text + "\">";// external + result = "<img src=\"" + link + "\" alt=\"" + text + "\" />";// external // image } else result = "<a href=\"" + link + "\" target=\"_blank\">" + text - + "</a><img src=\"/file-access/default/members/jbosswiki/images/out.png\"/>"; + + "</a><img src=\"/file-access/default/members/jbosswiki/images/out.png\" />"; } // internal link else { @@ -851,7 +848,7 @@ // check if not an image link as well else if (checkImageLink(link)) { result = "<img src=\"" + imagePath + "/" + pageName + "/" - + link + "\" alt=\"" + text + "\">"; + + link + "\" alt=\"" + text + "\" />"; } // check for attachments later on |
From: <jbo...@li...> - 2005-09-14 17:40:36
|
Author: szimano Date: 2005-09-14 13:40:30 -0400 (Wed, 14 Sep 2005) New Revision: 1118 Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp Log: fixed style of rss button Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 17:32:49 UTC (rev 1117) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 17:40:30 UTC (rev 1118) @@ -62,7 +62,7 @@ <% if ((type == null)||(type.equals("HTML"))) { out.println("<a href=\""+actionURL+"&action=Info&page="+wikiPage+"\"><img alt=\"HISTORY\" src=\""+wikiImagesUrl+"historyButton.png\" border=\"0\" /></a>"); - out.println("<a href=\""+rssLink+"\"><img style=\"vertical-align: middle\" alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.png\" border=\"0\" /></a><br />"); + out.println("<a href=\""+rssLink+"\"><img alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.png\" border=\"0\" /></a><br />"); } %> <input type="text" name="searchQuery" /> |
Author: szimano Date: 2005-09-14 13:32:49 -0400 (Wed, 14 Sep 2005) New Revision: 1117 Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.png Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java Log: added rss button, fixed problems with img in rssfeed Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-14 16:12:41 UTC (rev 1116) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-14 17:32:49 UTC (rev 1117) @@ -379,7 +379,8 @@ }*/ rReq.setAttribute("friendlyLink", hostURL+"/wiki/"+pageToShow.getName()); - + rReq.setAttribute("rssLink", hostURL+"/wiki/rss/"+pageToShow.getName()); + rRes.setTitle("Wiki"); if (javax.portlet.WindowState.NORMAL.equals(rReq.getWindowState()) || javax.portlet.WindowState.MAXIMIZED.equals(rReq Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 16:12:41 UTC (rev 1116) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 17:32:49 UTC (rev 1117) @@ -13,6 +13,7 @@ String wikiPage = (String)request.getAttribute("wikiPage"); String defaultPage = (String)request.getAttribute("defaultPage"); String friendlyLink = (String)request.getAttribute("friendlyLink"); + String rssLink = (String)request.getAttribute("rssLink"); String type = (String)request.getParameter("type"); java.util.Date editDate = (java.util.Date)request.getAttribute("editDate"); org.jboss.wiki.Credentials author = (org.jboss.wiki.Credentials)request.getAttribute("author"); @@ -35,7 +36,8 @@ <table style="width: 100%" border="0"> <tr style="vertical-align: bottom;"> <td style="vertical-align: bottom; align-bottom: 0px;"> -<div><a href="<%=friendlyLink%>"><img style="vertical-align: middle" alt="PERM LINK" src="<%=wikiImagesUrl%>permaLinkButton.png" border="0"/></a> <a href="<%=friendlyLink%>"><%=friendlyLink%></a></div> +<div><a href="<%=friendlyLink%>"><img style="vertical-align: middle" alt="PERM LINK" src="<%=wikiImagesUrl%>permaLinkButton.png" border="0"/></a> <a href="<%=friendlyLink%>"><%=friendlyLink%></a> </div> + </td> <td style="text-align: right;vertical-align: bottom; align-bottom: 0px;"> @@ -59,7 +61,8 @@ <% if ((type == null)||(type.equals("HTML"))) { - out.println("<a href=\""+actionURL+"&action=Info&page="+wikiPage+"\"><img alt=\"HISTORY\" src=\""+wikiImagesUrl+"historyButton.png\" border=\"0\" /></a><br />"); + out.println("<a href=\""+actionURL+"&action=Info&page="+wikiPage+"\"><img alt=\"HISTORY\" src=\""+wikiImagesUrl+"historyButton.png\" border=\"0\" /></a>"); + out.println("<a href=\""+rssLink+"\"><img style=\"vertical-align: middle\" alt=\"RSS\" src=\""+wikiImagesUrl+"RSSButton.png\" border=\"0\" /></a><br />"); } %> <input type="text" name="searchQuery" /> Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.png =================================================================== (Binary files differ) Property changes on: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/RSSButton.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 16:12:41 UTC (rev 1116) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 17:32:49 UTC (rev 1117) @@ -75,9 +75,6 @@ public final static String pagePartRegexEnd = "<!--page:end-->"; - private final String pagePartRegex = pagePartRegexStart + ".*" - + pagePartRegexEnd; - private String wikiHome = ""; // private String actionType = "&ctrl:type="; @@ -823,14 +820,14 @@ // external link if (isExternalLink(link)) { if (checkImageLink(link)) { - result = "<img src=\"" + link + "\" alt=\"" + text + "\">";// external + result = "<img src=\"" + link + "\" alt=\"" + text + "\" />";// external // image } else result = "<a href=\"" + link + "\" target=\"_blank\">" + text - + "</a><img src=\"/file-access/default/members/jbosswiki/images/out.png\"/>"; + + "</a><img src=\"/file-access/default/members/jbosswiki/images/out.png\" />"; } // internal link else { @@ -851,7 +848,7 @@ // check if not an image link as well else if (checkImageLink(link)) { result = "<img src=\"" + imagePath + "/" + pageName + "/" - + link + "\" alt=\"" + text + "\">"; + + link + "\" alt=\"" + text + "\" />"; } // check for attachments later on |
From: <jbo...@li...> - 2005-09-14 16:12:49
|
Author: dam...@jb... Date: 2005-09-14 12:12:41 -0400 (Wed, 14 Sep 2005) New Revision: 1116 Modified: qa/forge/portal-extensions/jbosswiki/maven.xml qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java Log: MERGED: -r 1112:1115 https://svn.labs.jboss.com/trunk/forge into qa forge. This is a QA bug fix merge for 1.0.3 release. Modified: qa/forge/portal-extensions/jbosswiki/maven.xml =================================================================== --- qa/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 16:06:30 UTC (rev 1115) +++ qa/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 16:12:41 UTC (rev 1116) @@ -20,13 +20,13 @@ </goal> <goal name="wiki:build"> - <maven:reactor includes="wiki-common/project.xml" excludes="" basedir="." + <maven:reactor includes="jbosswiki/wiki-common/project.xml" excludes="" basedir="." banner="Making wiki-common for the repo" goals="clean,build" ignoreFailures="false" /> - <maven:reactor includes="wiki-management/project.xml" excludes="" basedir="." + <maven:reactor includes="jbosswiki/wiki-management/project.xml" excludes="" basedir="." banner="Building and deploying EJB3 service for wiki" goals="clean,build" ignoreFailures="false" /> - <maven:reactor includes="forge-wiki/project.xml" excludes="" basedir="." + <maven:reactor includes="jbosswiki/forge-wiki/project.xml" excludes="" basedir="." banner="Building and deploying wiki portlet/servlet" goals="clean,build" ignoreFailures="false" /> Modified: qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java =================================================================== --- qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 16:06:30 UTC (rev 1115) +++ qa/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 16:12:41 UTC (rev 1116) @@ -823,7 +823,7 @@ // external link if (isExternalLink(link)) { if (checkImageLink(link)) { - result = "<img src=\"" + link + "\"alt=\"" + text + "\">";// external + result = "<img src=\"" + link + "\" alt=\"" + text + "\">";// external // image } else result = "<a href=\"" |
From: <jbo...@li...> - 2005-09-14 16:06:37
|
Author: szimano Date: 2005-09-14 12:06:30 -0400 (Wed, 14 Sep 2005) New Revision: 1115 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java Log: changed worng link (for xml like rss feeds) Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 15:53:03 UTC (rev 1114) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 16:06:30 UTC (rev 1115) @@ -823,7 +823,7 @@ // external link if (isExternalLink(link)) { if (checkImageLink(link)) { - result = "<img src=\"" + link + "\"alt=\"" + text + "\">";// external + result = "<img src=\"" + link + "\" alt=\"" + text + "\">";// external // image } else result = "<a href=\"" |
From: <jbo...@li...> - 2005-09-14 15:53:11
|
Author: szimano Date: 2005-09-14 11:53:03 -0400 (Wed, 14 Sep 2005) New Revision: 1114 Modified: trunk/forge/portal-extensions/jbosswiki/maven.xml Log: fixed build issie Modified: trunk/forge/portal-extensions/jbosswiki/maven.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 15:49:59 UTC (rev 1113) +++ trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 15:53:03 UTC (rev 1114) @@ -20,13 +20,13 @@ </goal> <goal name="wiki:build"> - <maven:reactor includes="wiki-common/project.xml" excludes="" basedir="." + <maven:reactor includes="jbosswiki/wiki-common/project.xml" excludes="" basedir="." banner="Making wiki-common for the repo" goals="clean,build" ignoreFailures="false" /> - <maven:reactor includes="wiki-management/project.xml" excludes="" basedir="." + <maven:reactor includes="jbosswiki/wiki-management/project.xml" excludes="" basedir="." banner="Building and deploying EJB3 service for wiki" goals="clean,build" ignoreFailures="false" /> - <maven:reactor includes="forge-wiki/project.xml" excludes="" basedir="." + <maven:reactor includes="jbosswiki/forge-wiki/project.xml" excludes="" basedir="." banner="Building and deploying wiki portlet/servlet" goals="clean,build" ignoreFailures="false" /> |
From: <jbo...@li...> - 2005-09-14 15:37:53
|
Author: szimano Date: 2005-09-14 11:37:49 -0400 (Wed, 14 Sep 2005) New Revision: 1112 Modified: trunk/forge/portal-extensions/forge-wiki/maven.xml Log: once again Modified: trunk/forge/portal-extensions/forge-wiki/maven.xml =================================================================== --- trunk/forge/portal-extensions/forge-wiki/maven.xml 2005-09-14 15:35:46 UTC (rev 1111) +++ trunk/forge/portal-extensions/forge-wiki/maven.xml 2005-09-14 15:37:49 UTC (rev 1112) @@ -36,9 +36,6 @@ <!--<ant:copy tofile="${local.deploy.dir}/wiki.ear/META-INF/application.xml" file="src/etc/application.xml" /> - <!--<ant:copy - tofile="${local.deploy.dir}/wiki.ear/wiki-common.jar" - file="target/wiki-1.0.jar" />--> <ant:copy todir="${local.deploy.dir}/wiki.ear" flatten="true"> <ant:fileset dir="."> <ant:filename name="target/*.war" /> |