From: <jbo...@li...> - 2005-11-18 16:55:08
|
Author: unibrew Date: 2005-11-18 11:54:48 -0500 (Fri, 18 Nov 2005) New Revision: 1590 Added: trunk/forge/portal-extensions/primates/ trunk/forge/portal-extensions/primates/forge-ads.iml trunk/forge/portal-extensions/primates/maven.xml trunk/forge/portal-extensions/primates/project.properties trunk/forge/portal-extensions/primates/project.xml trunk/forge/portal-extensions/primates/src/ trunk/forge/portal-extensions/primates/src/java/ trunk/forge/portal-extensions/primates/src/java/org/ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java trunk/forge/portal-extensions/primates/src/web/ trunk/forge/portal-extensions/primates/src/web/WEB-INF/ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/primates.jsp trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet.xml trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/ trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld trunk/forge/portal-extensions/primates/src/web/WEB-INF/web.xml Log: [PRIMATES] Adding primates. Added: trunk/forge/portal-extensions/primates/forge-ads.iml =================================================================== --- trunk/forge/portal-extensions/primates/forge-ads.iml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/forge-ads.iml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="true" type="JAVA_MODULE"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager"> + <output url="file://$MODULE_DIR$/target/classes" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntryProperties /> + </component> + <component name="org.mevenide.idea.module.ModuleSettings"> + <favoriteGoals> + <list size="0" /> + </favoriteGoals> + </component> +</module> + Added: trunk/forge/portal-extensions/primates/maven.xml =================================================================== --- trunk/forge/portal-extensions/primates/maven.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/maven.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,24 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> + <!-- Default war-project goals --> + + <goal name="all"> + <attainGoal name="prj-all" /> + </goal> + + <goal name="build"> + <attainGoal name="prj-war-build" /> + </goal> + + <goal name="deploy"> + <attainGoal name="prj-war-deploy" /> + </goal> + + <goal name="clean"> + <attainGoal name="prj-clean" /> + </goal> +</project> Added: trunk/forge/portal-extensions/primates/project.properties =================================================================== --- trunk/forge/portal-extensions/primates/project.properties 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/project.properties 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,3 @@ +maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ +maven.junit.fork=yes +maven.war.src=${basedir}/src/web Added: trunk/forge/portal-extensions/primates/project.xml =================================================================== --- trunk/forge/portal-extensions/primates/project.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/project.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,40 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<project> + <pomVersion>3</pomVersion> + <extend>../common.xml</extend> + <id>primates-portlet</id> + <name>Primates portlet</name> + <currentVersion>1.0</currentVersion> + <organization> + <name>Damon Sicore and JBoss portal team</name> + <url>http://damon.sicore.org and http://www.jboss.org</url> + </organization> + <description></description> + <dependencies> + <dependency> + <groupId>tmate</groupId> + <artifactId>javasvn</artifactId> + <version>1.0</version> + <jar>javasvn.jar</jar> + </dependency> + + <dependency> + <groupId>tmate</groupId> + <artifactId>jsch</artifactId> + <version>1.0</version> + <jar>jsch.jar</jar> + </dependency> + + <dependency> + <groupId>jboss-forge</groupId> + <artifactId>forge-common</artifactId> + <version>1.0</version> + </dependency> + + </dependencies> +</project> Added: trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java =================================================================== --- trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,121 @@ +package org.jbosslabs.portlets.primates; +// asdfasdf + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +import org.jboss.forge.common.XmlTools; +import org.jboss.forge.common.projects.AbstractDescriptor; +import org.jboss.portal.common.context.DelegateContext; +import org.jboss.shotoku.ContentManager; +import org.jboss.shotoku.exceptions.ResourceDoesNotExist; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * @author Damon Sicore + * @author adamw + * @author Rysiek + * A class representing a primate. + */ +public class Primate extends AbstractDescriptor { + final static String NAME_ELEMENT = "name"; + final static String TITLE_ELEMENT = "title"; + final static String PROJECT_ELEMENT = "project"; + final static String PROJECTS_ELEMENT = "projects"; + final static String MUGSHOT_ELEMENT = "mugshot"; + final static String STATUS_ELEMENT = "status"; + final static String BIO_ELEMENT = "bio"; + final static String COUNTRY_ELEMENT = "country"; + + /** + * <code>name</code> - The name this filthy primate calls itself. + */ + private String name; + /** + * <code>title</code> - A disgustingly self-important title. + */ + private String title; + /** + * <code>mugshot</code> - You will blow lunch when you see this. + */ + private String mugshot; + /** + * <code>status</code> - Whether or not this monkey is slacking. + */ + private String status; + /** + * <code>country</code> - Primate country. + */ + private String country; + /** + * <code>bio</code> - More self-promotion and hot air. + */ + private String bio; + + private Set<String> allProjects; + + + + public Primate(Node root) { + + NodeList nodes = root.getChildNodes(); + allProjects = new HashSet<String>(); + + for (int i = 0; i < nodes.getLength(); i++) { + Node n = nodes.item(i); + + if (n.getNodeType() == Node.ELEMENT_NODE) { + String nodeName = n.getNodeName(); + if (NAME_ELEMENT.equals(nodeName)) { + name = XmlTools.unmarshallText(n); + } else if (TITLE_ELEMENT.equals(nodeName)) { + title = XmlTools.unmarshallText(n); + } else if (MUGSHOT_ELEMENT.equals(nodeName)) { + mugshot = XmlTools.unmarshallText(n); + } else if (COUNTRY_ELEMENT.equals(nodeName)) { + country = XmlTools.unmarshallText(n); + } else if (PROJECTS_ELEMENT.equals(nodeName)) { + NodeList projectList = n.getChildNodes(); + for (int j = 0; j < projectList.getLength(); j++) { + Node project = projectList.item(j); + if (project.getNodeType()==Node.ELEMENT_NODE && PROJECT_ELEMENT.equals(project.getNodeName())) { + allProjects.add(XmlTools.unmarshallText(project)); + } + } + } else if (STATUS_ELEMENT.equals(nodeName)) { + status = XmlTools.unmarshallText(n); + } else if (BIO_ELEMENT.equals(nodeName)) { + bio = XmlTools.unmarshallText(n); + } + } + } + } + + /** + * Method puts primate in the context. + * @param portalName + * @param context + */ + public void setPrimateContextValues (String portalName, DelegateContext context) { + context.put(NAME_ELEMENT,name); + context.put(TITLE_ELEMENT,title); + if (allProjects.size()>0) { + for (String project:allProjects) { + DelegateContext projectCtx = context.next(PROJECTS_ELEMENT); + projectCtx.put(PROJECT_ELEMENT,project); + } + } + context.put(MUGSHOT_ELEMENT,PrimatesTools.getImgCmPath(portalName) + File.separator + mugshot); + context.put(COUNTRY_ELEMENT,country); + context.put(STATUS_ELEMENT,status); + ContentManager cm = ContentManager.getContentManager(); + try { + context.put(BIO_ELEMENT,cm.getNode(PrimatesTools.getBiosCmPath(portalName)+File.separator+bio).getContent()); + } catch (ResourceDoesNotExist e) { + System.out.println ("[PRIMATESPORTLET] Resource containing bios does not exist!"); + e.printStackTrace(); + } + } +} Property changes on: trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java ___________________________________________________________________ Name: svn:executable + * Added: trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java =================================================================== --- trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,67 @@ +package org.jbosslabs.portlets.primates; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import org.jboss.portal.common.context.DelegateContext; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * @author Damon Sicore + * @author adamw + * @author Rysiek + * A class holding other primates. + */ +public class Primates { + final static String PRIMATE_ELEMENT = "primate"; + + /** + * <code>primates</code> - a list of primates. + */ + private List<Primate> primates; + + public Primates(Node root) { + primates = new ArrayList<Primate>(); + + 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(PRIMATE_ELEMENT))) { + // Parsing and adding a new primate. + primates.add(new Primate(n)); + } + } + } + + /* + * Returns DelegateContext object containing all primates. + */ + public DelegateContext getPrimatesContext (String portalName) { + DelegateContext context = new DelegateContext(); + DelegateContext primateCtx=null; + for (Primate primate:primates) { + primateCtx=context.next("primate"); + primate.setPrimateContextValues(portalName,primateCtx); + } + return context; + } + + /* + * Returns DelegateContext object containging one random primate. + */ + public DelegateContext getRandomPrimateCtx (String portalName) { + DelegateContext context = new DelegateContext(); + Random random = new Random(); + int rndNbr = random.nextInt(primates.size()); + Primate primate = primates.get(rndNbr); + DelegateContext primateCtx = context.next("primate"); + primate.setPrimateContextValues(portalName,primateCtx); + return context; + } + +} Added: trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java =================================================================== --- trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,50 @@ +package org.jbosslabs.portlets.primates; + +import org.apache.xerces.parsers.DOMParser; +import org.jboss.portal.common.context.DelegateContext; +import org.jboss.shotoku.ContentManager; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; + +/** + * @author Damon Sicore + * @author adamw + * A class which handles xml parsing of the primates.xml + */ +public class PrimatesDescriptor { + private Primates primates; + + public PrimatesDescriptor(String portalName, ContentManager cm) { + try { + // Parsing the xml navigation descriptor. + DOMParser parser = new DOMParser(); + parser.parse(new InputSource(cm.getNode(PrimatesTools.getXmlCmPath(portalName)).getContentInputStream())); + Document doc = parser.getDocument(); + // Looking for the root menu element. + Node root = doc.getDocumentElement(); + if ((root.getNodeType() == Node.ELEMENT_NODE) + && (root.getNodeName().equals(PrimatesTools.PRIMATES_ELEMENT))) { + // Found a menu element, parsing and ending the loop. + primates = new Primates(root); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Returns DelegateContext object containing all primates. + */ + public DelegateContext getContext(String portalName) { + return primates.getPrimatesContext(portalName); + } + + /* + * Returns DelegateContext objcet containing one random primate. + */ + public DelegateContext getRandomPrimateCtx (String portalName) { + return primates.getRandomPrimateCtx(portalName); + } + +} Added: trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java =================================================================== --- trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,34 @@ +package org.jbosslabs.portlets.primates; + +import org.jboss.shotoku.ContentManager; +import org.jboss.forge.common.service.NodeWatcher; +import org.jboss.forge.common.service.ResourceWatcher; + +public class PrimatesNodeWatcher implements NodeWatcher { + private ResourceWatcher rw; + private ContentManager cm; + + public PrimatesNodeWatcher(ContentManager cm) { + this.cm = cm; + } + + private PrimatesDescriptor getDesc(String portalName) { + PrimatesDescriptor desc = new PrimatesDescriptor(portalName, cm); + + rw = new ResourceWatcher(cm); + rw.watchResource(PrimatesTools.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/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java =================================================================== --- trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,46 @@ +package org.jbosslabs.portlets.primates; + +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 + * @author Rysiek + * Primates portlet. + */ +public class PrimatesPortlet 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 context containing random primate. + DelegateContext primatesContext = PrimatesTools.getDesc(portalName).getRandomPrimateCtx(portalName); + + // Getting the context containing all primates. + //DelegateContext primatesContext = PrimatesTools.getDesc(portalName).getContext(portalName); + + // Displaying. + request.setAttribute(PortalJsp.CTX_REQUEST, primatesContext); + + // Getting JSP from portlet context. + //PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/primates.jsp"); + + // Getting JSP file from cms. + PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(ForgeHelper.createRepoAccessPath(portalName, PrimatesTools.getJspCmPath())); + + rd.include(request, response); + } +} Added: trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java =================================================================== --- trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,112 @@ +package org.jbosslabs.portlets.primates; + +import org.jboss.forge.common.ForgeHelper; +import java.io.File; +import org.jboss.shotoku.ContentManager; + +/** + * @author adamw + * Common constants and functions. + */ +public class PrimatesTools { + final static String PRIMATES_ELEMENT = "primates"; + + private final static String PRIMATES_XML = "primates.xml"; + private final static String PRIMATES_JSP = "primates.jsp"; + private final static String PRIMATES_DIR = "primates"; + private final static String BIOS_DIR = "html"; + private final static String MUGSHOTS_DIR = "images"; + + private static ContentManager cm; + + static { + cm = ForgeHelper.getContentManager(""); + } + + /** + * Method returns path to XML file. + * @param portalName + * @return + */ + static String getXmlCmPath(String portalName) { + return portalName + File.separator + PRIMATES_DIR + File.separator + PRIMATES_XML; + } + + /** + * Method returns path to JSP file. + * @param portalName + * @return + */ + static String getJspCmPath() { + return PRIMATES_DIR + File.separator + PRIMATES_JSP; + } + + /** + * Method returns images directory path. + * @param portalName + * @return + */ + static String getImgCmPath(String portalName) { + return PRIMATES_DIR + File.separator +MUGSHOTS_DIR; + } + + /** + * Method returns path to Bios directory. + * @param portalName + * @return + */ + static String getBiosCmPath(String portalName) { + return portalName+File.separator+PRIMATES_DIR + File.separator +BIOS_DIR; + } + + static synchronized PrimatesDescriptor getDesc(final String portalName) { + PrimatesDescriptor desc = (PrimatesDescriptor) ForgeHelper + .getForgeManagement().getFromCache(portalName, + PrimatesDescriptor.class.getName()); + + if (desc == null) + desc = (PrimatesDescriptor) ForgeHelper.getForgeManagement() + .addNodeWatcher(portalName, + PrimatesDescriptor.class.getName(), + new PrimatesNodeWatcher(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=")) && + (!ForgeHelper.isOutsideLink(link))) + 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)) + || ("//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; + } +} Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-app.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,3 @@ +<jboss-app> + <app-name>primates</app-name> +</jboss-app> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-portlet.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,6 @@ +<portlet-app> + <portlet> + <portlet-name>PrimatesPortlet</portlet-name> + <security></security> + </portlet> +</portlet-app> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-service.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,2 @@ +<server> +</server> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jboss-web.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<jboss-web> +</jboss-web> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/normal.jsp 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,27 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %> + <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="n" %> + <%@ taglib uri="/WEB-INF/tld/forge.tld" prefix="forge" %> + <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> + <%@ page isELIgnored ="false" %> + <portlet:defineObjects/> + + <h1>Die Mother Fucker Die</h1> +<div id="blog-entry"> + +<n:iterate ctx="menuentry"> + <!-- iterated menuentry --> + <div class="item"> + <a href="${n:out("menuentry.url")}"><img src="<forge:imagePath src="ads/images/${n:out('menuentry.name')}"/>" + width="175" height="64" border="0" /> + </a> + </div> +</n:iterate> + +</div> + + Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/primates.jsp =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/primates.jsp 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/jsp/primates.jsp 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,36 @@ +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %> + <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="n" %> + <%@ taglib uri="/WEB-INF/tld/forge.tld" prefix="forge" %> + <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> + <%@ page isELIgnored ="false" %> + <portlet:defineObjects/> + + <h1>Random Primate</h1> +<div id="blog-entry"> + +<n:iterate ctx="primate"> + <!-- iterated menuentry --> + <div class="item"> + <img src="<forge:imagePath src="${n:out('primate.mugshot')}" />" border="0" /> + <h3>name:</h3> ${n:out('primate.name')} + <h3>title:</h3> ${n:out('primate.title')} + <h3>bio:</h3> ${n:out('primate.bio')} + <h3>status:</h3> ${n:out("primate.status")} + <h3>country:</h3> ${n:out("primate.country")} + <n:iterate ctx="projects"> + <h3>project:</h3> ${n:out("primate.projects.project")} + <BR /> + </n:iterate> + <hr> + </div> +</n:iterate> + + +</div> + + Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet-instances.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,7 @@ +<?xml version="1.0" standalone="yes"?> +<instances> + <instance> + <instance-name>PrimatesPortletInstance</instance-name> + <component-ref>PrimatesPortlet</component-ref> + </instance> +</instances> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet.xml =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/portlet.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +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>PrimatesPortlet</portlet-name> + <portlet-class>org.jbosslabs.portlets.primates.PrimatesPortlet</portlet-class> + <supported-locale>en</supported-locale> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + </supports> + <portlet-info> + <title>JBoss Primates Portlet</title> + </portlet-info> + </portlet> +</portlet-app> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/forge.tld 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,139 @@ +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd" + version="2.0"> + <!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> + <tlib-version>1.1</tlib-version> + <jsp-version>2.0</jsp-version> + <shortname>forge</shortname> + <info>Forge tags</info> + + <tag> + <name>pageURL</name> + <tagclass>org.jboss.forge.common.taglib.PageURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>param</name> + <tagclass>org.jboss.forge.common.taglib.ParamTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>wikiURL</name> + <tagclass>org.jboss.forge.common.taglib.WikiURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>freezoneURL</name> + <tagclass>org.jboss.forge.common.taglib.FreezoneURLTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>projectURL</name> + <tagclass>org.jboss.forge.common.taglib.ProjectURLTag</tagclass> + <attribute> + <name>project</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>page</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>categoryURL</name> + <tagclass>org.jboss.forge.common.taglib.CategoryURLTag</tagclass> + <attribute> + <name>category</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>form</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>selectedProject</name> + <tagclass>org.jboss.forge.common.taglib.SelectedProjectTag</tagclass> + </tag> + + <tag> + <name>imagePath</name> + <tagclass>org.jboss.forge.common.taglib.ImagePathTag</tagclass> + <attribute> + <name>src</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>project</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrValue</name> + <tagclass>org.jboss.forge.common.taglib.AttrValueTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>attrIf</name> + <tagclass>org.jboss.forge.common.taglib.AttrIfTag</tagclass> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> +</taglib> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/tld/portlet.tld 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + JBoss, the OpenSource J2EE webOS + Distributable under LGPL license. + See terms of license at gnu.org. + --> +<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> + +<taglib> + + <tlib-version>1.0</tlib-version> + <jsp-version>1.2</jsp-version> + <short-name>portlet</short-name> + + <uri>http://java.sun.com/portlet</uri> + + <tag> + + <name>param</name> + <tag-class>org.jboss.portal.portlet.taglib.URLParameterTag</tag-class> + <body-content>empty</body-content> + + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>value</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + <function> + <name>i18n</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String getMessage(java.lang.String)</function-signature> + </function> + + <function> + <name>out</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String out(java.lang.String)</function-signature> + </function> + + <function> + <name>i18nout</name> + <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class> + <function-signature>java.lang.String i18nOut(java.lang.String)</function-signature> + </function> + + <tag> + <name>if</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tagclass> + <attribute> + <name>ctx</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>iterate</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tagclass> + <attribute> + <name>ctx</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>include</name> + <tagclass>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tagclass> + <attribute> + <name>page</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + + <name>defineObjects</name> + <tag-class>org.jboss.portal.portlet.taglib.DefineObjectsTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.DefineObjectsTagTEI</tei-class> + <body-content>empty</body-content> + + </tag> + <tag> + + <name>namespace</name> + <tag-class>org.jboss.portal.portlet.taglib.NamespaceTag</tag-class> + <body-content>empty</body-content> + + </tag> + <tag> + + <name>renderURL</name> + <tag-class>org.jboss.portal.portlet.taglib.RenderURLTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.GenerateURLTagTEI</tei-class> + <body-content>JSP</body-content> + + <attribute> + <name>portletMode</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>secure</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>var</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>windowState</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + <tag> + + <name>actionURL</name> + <tag-class>org.jboss.portal.portlet.taglib.ActionURLTag</tag-class> + <tei-class>org.jboss.portal.portlet.taglib.GenerateURLTagTEI</tei-class> + <body-content>JSP</body-content> + + <attribute> + <name>portletMode</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>secure</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>var</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + <attribute> + <name>windowState</name> + <rtexprvalue>true</rtexprvalue> + + </attribute> + </tag> + +</taglib> Added: trunk/forge/portal-extensions/primates/src/web/WEB-INF/web.xml =================================================================== --- trunk/forge/portal-extensions/primates/src/web/WEB-INF/web.xml 2005-11-18 16:28:49 UTC (rev 1589) +++ trunk/forge/portal-extensions/primates/src/web/WEB-INF/web.xml 2005-11-18 16:54:48 UTC (rev 1590) @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<!DOCTYPE web-app PUBLIC + "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd"> +<web-app> + <filter> + <filter-name>filesFromRepoFilter</filter-name> + <filter-class>org.jboss.forge.common.FilesFromRepoFilter</filter-class> + </filter> + + <filter-mapping> + <filter-name>filesFromRepoFilter</filter-name> + <url-pattern>/repo-access/*</url-pattern> + <dispatcher>INCLUDE</dispatcher> + </filter-mapping> +</web-app> |