Examples of ContentTypeImpl


Examples of org.apache.jetspeed.om.portlet.impl.ContentTypeImpl

        assertNotNull(pc.getValueAt(0));

        portlet.addLanguage(portletRegistry.createLanguage(Locale.getDefault(), "Portlet 1", "Portlet 1",
                "This is Portlet 1", null));

        ContentTypeComposite html = new ContentTypeImpl();
        html.setContentType("html/text");
        ContentTypeComposite wml = new ContentTypeImpl();
        html.addPortletMode(new PortletMode(MODE_EDIT));
        html.addPortletMode(new PortletMode(MODE_VIEW));
        html.addPortletMode(new PortletMode(MODE_HELP));
        wml.setContentType("wml");
        wml.addPortletMode(new PortletMode(MODE_HELP));
        wml.addPortletMode(new PortletMode(MODE_VIEW));
        portlet.addContentType(html);
        portlet.addContentType(wml);

        app.setWebApplicationDefinition(webApp);
        portletRegistry.updatePortletApplication(app);
View Full Code Here

Examples of org.apache.jetspeed.om.portlet.impl.ContentTypeImpl

        assertNotNull(pc.getValueAt(0));

        portlet.addLanguage(registry.createLanguage(Locale.getDefault(), "Portlet 1", "Portlet 1", "This is Portlet 1",
                null));

        ContentTypeComposite html = new ContentTypeImpl();
        html.setContentType("html/text");
        ContentTypeComposite wml = new ContentTypeImpl();
        html.addPortletMode(new PortletMode(MODE_EDIT));
        html.addPortletMode(new PortletMode(MODE_VIEW));
        html.addPortletMode(new PortletMode(MODE_HELP));
        wml.setContentType("wml");
        wml.addPortletMode(new PortletMode(MODE_HELP));
        wml.addPortletMode(new PortletMode(MODE_VIEW));
        portlet.addContentType(html);
        portlet.addContentType(wml);

        app.setWebApplicationDefinition(webApp);
        registry.registerPortletApplication(app);
View Full Code Here

Examples of org.jasig.portal.container.om.portlet.ContentTypeImpl

    private ContentTypeSet getContentTypes(Element portletE) {
        ContentTypeSetImpl contentTypes = new ContentTypeSetImpl();
        NodeList supportsNL = portletE.getElementsByTagName("supports");
        for (int i = 0; i < supportsNL.getLength(); i += 1) {
            Element supportsE = (Element)supportsNL.item(i);
            ContentTypeImpl contentType = new ContentTypeImpl();
            contentType.setContentType(XML.getChildElementText(supportsE, "mime-type"));
            NodeList portletModeNL = supportsE.getElementsByTagName("portlet-mode");
            for (int j = 0; j < portletModeNL.getLength(); j += 1) {
                Element portletModeE = (Element)portletModeNL.item(j);
                contentType.addPortletMode(new PortletMode(XML.getElementText(portletModeE)));
            }
            contentTypes.add(contentType);         
        }
        return contentTypes;
    }
View Full Code Here

Examples of railo.commons.io.res.ContentTypeImpl

   
    String[] mimeCharset = HTTPUtil.splitMimeTypeAndCharset(header.getValue(), null);
    if(mimeCharset==null) return null;
   
    String[] typeSub = HTTPUtil.splitTypeAndSubType(mimeCharset[0]);
    return new ContentTypeImpl(typeSub[0],typeSub[1],mimeCharset[1]);
  }
View Full Code Here

Examples of railo.commons.io.res.ContentTypeImpl

      } catch (IOException e) {}
    }
    InputStream is=null;
    try {
      is = resource.getInputStream();
      return new ContentTypeImpl(is);
    }
    catch(IOException e) {
      return ContentTypeImpl.APPLICATION_UNKNOW;
    }
    finally {
View Full Code Here

Examples of railo.commons.io.res.ContentTypeImpl

            else if(ext.equals("doc")) {
                doc= WordDocument.getDocument(file);
            }
        }
        else {
          ContentTypeImpl ct = (ContentTypeImpl) ResourceUtil.getContentType(file);
          String type = ct.getMimeType();
          String c=ct.getCharset();
          if(c!=null) charset=c;
            //String type=ResourceUtil.getMimeType(file,"");
            if(type==null)  {}
            // HTML
            else if(type.equals("text/html")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.