Package com.github.dandelion.datatables.core.asset

Examples of com.github.dandelion.datatables.core.asset.JsResource


    // Init the web resources generator
    WebResourceGenerator contentGenerator = new WebResourceGenerator(htmlTable);

    // Generate the web resources (JS, CSS) and wrap them into a
    // WebResources POJO
    JsResource jsResource = contentGenerator.generateWebResources();
    logger.debug("Web content generated successfully");

    applyCssConfiguration(arguments, request, htmlTable);
   
    // Asset stack update
View Full Code Here


   * @throws JspException
   *             if something went wrong during the processing.
   */
  protected int setupHtmlGeneration() throws JspException {

    JsResource jsResource = null;

    this.table.getTableConfiguration().setExporting(false);

    try {
      // Init the web resources generator
View Full Code Here

  public JsResource generateWebResources() {

    /**
     * Main configuration file building
     */
    JsResource mainJsFile = new JsResource(table.getId(), table.getOriginalId());
   
    // Init the "configuration" map with the table informations
    // The configuration may be updated depending on the user's choices
    configGenerator = new DatatablesGenerator();
    Map<String, Object> mainConf = configGenerator.generateConfig(table);

    /**
     * Extension loading
     */
    logger.debug("Loading extensions...");
    ExtensionLoader extensionLoader = new ExtensionLoader(table);
    extensionLoader.loadExtensions(mainJsFile, mainConf);
   
    /**
     * Main configuration generation
     */
    logger.debug("Transforming configuration to JSON...");
    // Allways pretty prints the JSON
    try {
      Writer writer = new JsonIndentingWriter();
      JSONValue.writeJSONString(mainConf, writer);
      mainJsFile.appendToDataTablesConf(writer.toString());
    } catch (IOException e) {
      throw new WebResourceGenerationException("Unable to generate the JSON configuration", e);
    }

    return mainJsFile;
View Full Code Here

    table = new HtmlTable("fakeId", request, response);
    table.getTableConfiguration().getConfigurations().clear();
    table.addHeaderRow();
    table.getLastHeaderRow().addHeaderColumn("column1");
    table.getLastHeaderRow().addHeaderColumn("column2");
    mainJsFile = new JsResource("fakeId", "fakeOriginalId");
    mainConfig = new HashMap<String, Object>();
    extensionProcessor = new ExtensionProcessor(table, mainJsFile, mainConfig);
  }
View Full Code Here

TOP

Related Classes of com.github.dandelion.datatables.core.asset.JsResource

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.