[jboss-cvs] jboss-portal/core/src/main/org/jboss/portal/core/deployment ...

Chris Laprun chris.laprun at jboss.com
Mon Aug 14 16:34:51 EDT 2006


  User: claprun 
  Date: 06/08/14 16:34:51

  Modified:    core/src/main/org/jboss/portal/core/deployment 
                        JBossApplicationMetaDataFactory.java
  Log:
  JBPORTAL-981:
  - Added support for named meta tag. No current support for http-equiv meta tags.
  - Re-factored HeaderContentMetaData.
  - Cleaned-up HeaderInterceptor.
  
  Revision  Changes    Path
  1.3       +23 -8     jboss-portal/core/src/main/org/jboss/portal/core/deployment/JBossApplicationMetaDataFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JBossApplicationMetaDataFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/core/src/main/org/jboss/portal/core/deployment/JBossApplicationMetaDataFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- JBossApplicationMetaDataFactory.java	4 May 2006 00:51:15 -0000	1.2
  +++ JBossApplicationMetaDataFactory.java	14 Aug 2006 20:34:51 -0000	1.3
  @@ -21,16 +21,16 @@
   */
   package org.jboss.portal.core.deployment;
   
  -import org.xml.sax.Attributes;
  -import org.jboss.xb.binding.UnmarshallingContext;
   import org.jboss.portal.core.metadata.ServiceMetaData;
  +import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
   import org.jboss.portal.core.metadata.portlet.JBossApplicationMetaData;
   import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
  -import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
  +import org.jboss.xb.binding.UnmarshallingContext;
  +import org.xml.sax.Attributes;
   
   /**
    * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class JBossApplicationMetaDataFactory extends org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory
   {
  @@ -68,20 +68,35 @@
         }
         if (object instanceof HeaderContentMetaData)
         {
  -         if ("link".equals(localName))
  +         if ("link".equalsIgnoreCase(localName))
            {
               String href = attrs.getValue("href");
               String title = attrs.getValue("title");
               String type = attrs.getValue("type");
               String media = attrs.getValue("media");
               String rel = attrs.getValue("rel");
  -            child = new HeaderContentMetaData.Element(rel, type, href, title, media);
  +            child = HeaderContentMetaData.Element.createLinkElement(type, rel, href, title, media);
            }
  -         else if ("script".equals(localName))
  +         else if ("script".equalsIgnoreCase(localName))
            {
               String src = attrs.getValue("src");
               String type = attrs.getValue("type");
  -            child = new HeaderContentMetaData.Element(src, type);
  +            child = HeaderContentMetaData.Element.createScriptElement(type, src);
  +         }
  +         else if ("meta".equalsIgnoreCase(localName))
  +         {
  +            String name = attrs.getValue("name");
  +            String content = attrs.getValue("content");
  +            if (name == null)
  +            {
  +               throw new IllegalArgumentException("'name' attribute of meta element must NOT be null. http-equiv meta " +
  +                  "elements are not currently supported.");
  +            }
  +            if (content == null)
  +            {
  +               throw new IllegalArgumentException("Content attribute required for meta element: " + name);
  +            }
  +            child = HeaderContentMetaData.Element.createNamedMetaElement(name, content);
            }
         }
         if (child == null)
  
  
  



More information about the jboss-cvs-commits mailing list