Package org.apache.myfaces.trinidadinternal.share.config

Examples of org.apache.myfaces.trinidadinternal.share.config.Configuration


  // Uses the web server root and base image uri to determine the
  // location of the default cache
  private ImageProvider _getDefaultImageProvider()
  {
    ImageProvider provider = null;
    Configuration config = getConfiguration();
    try
    {
      // We explicitly avoid using the SHARED_CONTEXT_PATH for the
      // image cache.  That way, we can ensure that each application
      // creates its own local image cache.
      String contextPath = (String) _getContextProperty(CONTEXT_PATH_PROPERTY);
      String path = config.getPath(Configuration.IMAGES_CACHE_DIRECTORY,
                                   contextPath);

      provider = FileSystemImageCache.getSharedCache(path);
    }
    catch (Exception e)
View Full Code Here


    if (agent.getCapability(TrinidadAgent.CAP_TRANSPARENT_PNG_TYPE_IMAGE) == Boolean.TRUE)
       return true;

    // Otherwise, check GIF suport...
    Configuration config = context.getConfiguration();

    //return (((encodings & AdfFacesAgent.IMAGE_ENCODINGS_CAP_GIF) != 0) &&
    //          !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)));
    return ((agent.getCapability(TrinidadAgent.CAP_GIF_TYPE_IMAGE) == Boolean.TRUE) &&
               !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)));

  }
View Full Code Here

   */
  public static String getConfiguredURL(
    UIXRenderingContext context,
    Object           directoryKey)
  {
    Configuration config = context.getConfiguration();
    String contextURI = (String)context.getProperty(MARLIN_NAMESPACE,
                                   UIXRenderingContext.CONTEXT_URI_PROPERTY);

    String baseURL = config.getURI(directoryKey,
                                   contextURI);

    // Check for design time and modify URL if needed
    if (Beans.isDesignTime())
    {
View Full Code Here

    ImageType    type,
    Map<Object, Object> properties,
    Map<Object, Object> responseProperties
    ) throws CacheException
  {
    Configuration config = context.getConfiguration();
    // See if we don't want any image generation (which is basically
    // just for the renderkit test).  Always generate a width and a height,
    // and generate an area map if needed
    if (Boolean.TRUE.equals(config.getProperty(BLOCK_IMAGE_GENERATION)))
    {
      responseProperties.put(WIDTH_RESPONSE_KEY, _TEST_WIDTH);
      responseProperties.put(HEIGHT_RESPONSE_KEY, _TEST_HEIGHT);
      Object o = properties.get(TABS_KEY);
      if (o != null)
      {
        int length = ((Object[]) o).length;
        MapArea[] areas = new MapArea[length];
        for (int i = 0; i < length; i++)
        {
          areas[i] = new MapArea(new Rectangle(i, 0, 1, 1));
        }

        responseProperties.put(IMAGE_MAP_AREAS_RESPONSE_KEY, areas);
      }

      return new byte[0];
    }

    // Before we do any rendering check for Configuration.HEADLESS
    if (Boolean.TRUE.equals(config.getProperty(Configuration.HEADLESS)) ||
        !GraphicsUtils.isGraphicalEnvironment())
    {
      // We're special casing colorized icons so that we can generate
      // them even if we don't have an X server
      if (TECATE_NAMESPACE.equals(type.getNamespaceURI()) &&
View Full Code Here

  {
    String designTimeURL;
    String tempCacheDirectory;
    String resourceDirectoryPath;

    Configuration configInfo = context.getConfiguration();
    ExternalContext external = context.getFacesContext().getExternalContext();

    String contextURI = external.getRequestContextPath();

    // Ignore javascripts for design time
    boolean isJavascript =
       (baseURL.indexOf((String)Configuration.JSLIBS_DIRECTORY)!=-1);

    if (!baseURL.equals(configInfo.getURI(Configuration.IMAGES_CACHE_DIRECTORY,
                                          contextURI))
        && !baseURL.equals(configInfo.getURI(Configuration.STYLES_CACHE_DIRECTORY,
                                             contextURI))
        && !isJavascript)
    {
       designTimeURL =
         (ClassLoaderUtils.getResource( _BASE_DIRECTORY + baseURL)).toString();
View Full Code Here

    String encoding = (String)properties.get(ENCODING_TYPE_KEY);
    if (encoding != null)
      return encoding;

    // Pick an encoding based on the Configuration/Agent
    Configuration config = context.getConfiguration();
    TrinidadAgent agent = context.getAgent();
    //encodings was part of old Agent capabilities, not in new Agent Caps. So replaced
    //Object encodingsObj = agent.getCapability(AdfFacesAgent.CAP_IMAGE_ENCODINGS);
    //int encodings = ((encodingsObj == null)
    //                 ? (AdfFacesAgent.IMAGE_ENCODINGS_CAP_GIF |
    //                    AdfFacesAgent.IMAGE_ENCODINGS_CAP_PNG)
    //                 : ((Number) encodingsObj).intValue());

    // If GIF is enabled and supported, use it
    //if (((encodings & AdfFacesAgent.IMAGE_ENCODINGS_CAP_GIF) != 0) &&
    //      !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)))
    //{
    //  return ImageEncoderManager.GIF_TYPE;
    //}
    if ((agent.getCapability(TrinidadAgent.CAP_GIF_TYPE_IMAGE) == Boolean.TRUE) &&
            !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)))
    {
      return ImageEncoderManager.GIF_TYPE;
    }

    //encodings was part of old Agent capabilities, not in new Agent Caps. So replaced
View Full Code Here

  // Returns an XMLProvider to use for parsing XML documents
  private XMLProvider _getXMLProvider(ImageContext context)
    throws CacheException
  {
    // Create a parser to use for parsing IMX files
    Configuration config = context.getConfiguration();
    XMLProvider parser = XMLUtils.getXMLProvider(config);

    if (parser == null)
     _error(_XML_PROVIDER_ERROR);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.share.config.Configuration

Copyright © 2018 www.massapicom. 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.