Examples of ResourceManager


Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager

    final ProcessingContext processingContext = new DefaultProcessingContext();
    final DebugExpressionRuntime runtime = new DebugExpressionRuntime(new DefaultTableModel(), 0, processingContext);

    final URL target = LineBreakTest.class.getResource("linebreak-test.xml"); //$NON-NLS-1$
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
    final Resource directly = rm.createDirectly(target, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();

    final DebugRenderer debugLayoutSystem = new DebugRenderer();
    debugLayoutSystem.startReport(report);
    debugLayoutSystem.startSection(Renderer.TYPE_NORMALFLOW);
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager

    {
      throw new NullPointerException("Error: Could not find the data-factory meta-data description file");
    }
    try
    {
      final ResourceManager resourceManager = new ResourceManager();
      resourceManager.registerDefaults();
      final Resource resource = resourceManager.createDirectly(dataFactoryMetaSource,
          DataFactoryMetaDataCollection.class);
      final DataFactoryMetaDataCollection typeCollection = (DataFactoryMetaDataCollection) resource.getResource();
      final DataFactoryMetaData[] types = typeCollection.getFactoryMetaData();
      for (int i = 0; i < types.length; i++)
      {
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager

      // Using the classloader, get the URL to the reportDefinition file
      final ClassLoader classloader = this.getClass().getClassLoader();
      final URL reportDefinitionURL = classloader.getResource("org/pentaho/reporting/engine/classic/samples/Sample1.prpt");

      // Parse the report file
      final ResourceManager resourceManager = new ResourceManager();
      resourceManager.registerDefaults();
      final Resource directly = resourceManager.createDirectly(reportDefinitionURL, MasterReport.class);
      return (MasterReport) directly.getResource();
    }
    catch (ResourceException e)
    {
      e.printStackTrace();
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager

    }
    if (o instanceof byte[])
    {
      try
      {
        final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
        final Resource resource = resManager.createDirectly(o, Image.class);
        return new DefaultImageReference(resource);
      }
      catch (ResourceException e)
      {
        if (ImageLoadFilter.logger.isDebugEnabled())
        {
          ImageLoadFilter.logger.debug("Error while loading the image from a blob", e);
        }
        else if (ImageLoadFilter.logger.isWarnEnabled())
        {
          ImageLoadFilter.logger.warn("Error while loading the image from a blob: " + e.getMessage());
        }
        return null;
      }
    }
    else if (o instanceof Blob)
    {
      try
      {
        final Blob b = (Blob) o;
        final byte[] data = IOUtils.getInstance().readBlob(b);
        final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
        final Resource resource = resManager.createDirectly(data, Image.class);
        return new DefaultImageReference(resource);
      }
      catch (Exception e)
      {
        if (ImageLoadFilter.logger.isDebugEnabled())
        {
          ImageLoadFilter.logger.debug("Error while loading the image from a blob", e);
        }
        else if (ImageLoadFilter.logger.isWarnEnabled())
        {
          ImageLoadFilter.logger.warn("Error while loading the image from a blob: " + e.getMessage());
        }
        return null;
      }
    }
    else if (o instanceof URL)
    {
      // a valid url is found, lookup the url in the cache, maybe the image is loaded and
      // still there.
      final URL url = (URL) o;
      final String urlText = String.valueOf(url);
      if (failureCache.contains(urlText))
      {
        return null;
      }
      try
      {
        final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
        final Resource resource = resManager.createDirectly(url, Image.class);
        return new DefaultImageReference(resource);
      }
      catch (ResourceException e)
      {
        if (ImageLoadFilter.logger.isDebugEnabled())
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager

   */
  protected void startParsing(final Attributes attrs) throws SAXException
  {
    super.startParsing(attrs);

    final ResourceManager resourceManager = getRootHandler().getResourceManager();
    final ResourceKey context = getRootHandler().getContext();

    final Configuration configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
    final Iterator keys = configuration.findPropertyKeys(ElementMetaDataParser.GLOBAL_INCLUDES_PREFIX);
    while (keys.hasNext())
    {
      final String key = (String) keys.next();
      final String href = configuration.getConfigProperty(key);
      if (StringUtils.isEmpty(href, true))
      {
        continue;
      }
      try
      {
        final ResourceKey resourceKey = resourceManager.deriveKey(context, href);
        final Resource resource = resourceManager.create(resourceKey, null, GlobalMetaDefinition.class);
        globalMetaDefinition.merge((GlobalMetaDefinition) resource.getResource());
      }
      catch (ResourceException e)
      {
        logger.warn("Failed to parse included global definitions: " + getLocator(), e);
View Full Code Here

Examples of org.springmodules.resource.ResourceManager

   */
  public void setBeanFactory(BeanFactory beanFactory) {
    if (this.resourceInterceptor.getResourceManager() == null &&
        beanFactory instanceof ListableBeanFactory) {
      ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;
      ResourceManager rm = (ResourceManager)
          BeanFactoryUtils.beanOfTypeIncludingAncestors(lbf, ResourceManager.class);
      this.resourceInterceptor.setResourceManager(rm);
    }
  }
View Full Code Here

Examples of org.uberfire.security.ResourceManager

        final AuthenticationScheme rememberMeAuthScheme = getRememberMeAuthScheme( options, cookieStorage );
        final String forceURL = getForceURL( options );
        final AuthenticationScheme authScheme = getAuthenticationScheme( options );
        final AuthenticationManager authManager = getAuthenticationManager( options );
        final AuthenticationProvider authProvider = getAuthenticationProvider( options );
        final ResourceManager resourceManager = getResourceManager( options );
        final AuthorizationManager authzManager = getAuthorizationManager( options );
        final VotingStrategy urlVotingStrategy = getURLVotingStrategy( options );
        final ResourceDecisionManager accessDecisionManager = getURLAccessDecisionManager( options );
        final RoleDecisionManager roleDecisionManager = getRoleDecisionManager( options );
        final RoleProvider roleProvider = getRoleProvider( options );
View Full Code Here

Examples of org.wikier.trioo.jtrioo.ResourceManager

   *
   * @param resource resource to introspect
   * @return resource uri
   */
  public static String getURI(Object resource) {
    ResourceManager rm = ResourceManagerFactory.getResourceManager();
    return rm.getURI(resource);
  }
View Full Code Here

Examples of pt.webdetails.cdf.dd.ResourceManager


  public static String getEditor( String wcdfPath, boolean debugMode, String scheme, boolean isDefault )
    throws Exception {

    ResourceManager resMgr = ResourceManager.getInstance();
    IReadAccess sysReader = CdeEnvironment.getPluginSystemReader();

    final HashMap<String, String> tokens = buildReplacementTokenMap( wcdfPath, scheme, debugMode, resMgr, sysReader );

    return getProcessedEditor( wcdfPath, resMgr, tokens, sysReader, isDefault );
View Full Code Here

Examples of test.crud.backend.ResourceManager

        this.component = component;
        this.implementation = implementation;
    }

    public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
        CRUDInvoker invoker = new CRUDInvoker(operation, new ResourceManager(implementation.getDirectory()));
        return invoker;
    }
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.