Package pt.webdetails.cdf.dd.model.core.reader

Examples of pt.webdetails.cdf.dd.model.core.reader.IThingReader


    }

    // 2. Obtain a reader to read the dashboard file
    MetaModel metaModel = MetaModelManager.getInstance().getModel();
    CdfdeJsThingReaderFactory thingReaderFactory = new CdfdeJsThingReaderFactory( metaModel );
    IThingReader reader;
    try {
      reader = thingReaderFactory.getReader( KnownThingKind.Dashboard, null, null );
    } catch ( UnsupportedThingException ex ) {
      throw new ThingReadException( "While obtaining a reader for a dashboard.", ex );
    }

    // 3. Read it
    IThingReadContext readContext = new CdfdeJsReadContext( thingReaderFactory, wcdf, metaModel );
    Dashboard.Builder dashBuilder = (Dashboard.Builder) reader.read( readContext, cdfdeDoc, cdeFilePath );

    // 4. Build it
    try {
      return dashBuilder.build( metaModel );
    } catch ( ValidationException ex ) {
View Full Code Here


        sourcePath);
   
    // 4. LAYOUT
    //JXPathContext layoutXP = source.getRelativeContext(source.getPointer("/layout"));
    // HACK: 'layout' key for getting the reader
    IThingReader reader;
    try
    {
      reader = context.getFactory().getReader(KnownThingKind.Component, "layout", null);
     
      // TOTO: HACK: Until layout is handled the right way, we need to detect
      // a null reader, returned when there is an error buildinf the layout inside
      // the factory :-(
      if(reader == null)
      {
        return;
      }
    }
    catch(UnsupportedThingException ex)
    {
      logger.error("While rendering dashboard. " + ex);
      return;
    }

    LayoutComponent.Builder compBuilder =
            (LayoutComponent.Builder)reader.read(context, source, sourcePath);

    builder.addComponent(compBuilder);
  }
View Full Code Here

      String className = (String)compXP.getValue("type");
     
      // Ignore label components (it's OK for current needs)
      if(className == null || !className.equalsIgnoreCase("label"))
      {
        IThingReader reader;
        try
        {
          reader = context.getFactory().getReader(thingKind, className, null);
        }
        catch (UnsupportedThingException ex)
        {
          logger.error("While rendering dashboard. " + ex);
          continue;
        }

        Component.Builder compBuilder =
                (Component.Builder)reader.read(context, compXP, sourcePath);

        builder.addComponent(compBuilder);
      }
    }
  }
View Full Code Here

TOP

Related Classes of pt.webdetails.cdf.dd.model.core.reader.IThingReader

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.