Package com.github.dandelion.core

Examples of com.github.dandelion.core.Context


  @Before
  public void setup() {
    MockServletContext mockServletContext = new MockServletContext();
    MockPageContext mockPageContext = new MockPageContext(mockServletContext);
    request = (HttpServletRequest) mockPageContext.getRequest();
    request.setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
    confToBeApplied = new HashMap<ConfigToken<?>, Object>();
    tableConfiguration = new TableConfiguration(confToBeApplied, null, request);
    columnConfiguration = new ColumnConfiguration();
  }
View Full Code Here


  public void setup() {
    processor = getProcessor();
    MockServletContext mockServletContext = new MockServletContext();
    MockPageContext mockPageContext = new MockPageContext(mockServletContext);
    request = (HttpServletRequest) mockPageContext.getRequest();
    request.setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
    confToBeApplied = new HashMap<ConfigToken<?>, Object>();
    tableConfiguration = new TableConfiguration(confToBeApplied, null, request);
    tableConfiguration.setTableId("fakeId");
  }
View Full Code Here

 
  /**
   * @return the Dandelion {@link Context}.
   */
  public Context getContext(){
    Context context = (Context) table.getTableConfiguration().getRequest().getAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE);
    return context;
  }
View Full Code Here

    // mock ServletContext
    MockServletContext mockServletContext = new MockServletContext();

    // mock PageContext
    mockPageContext = new MockPageContext(mockServletContext);
    mockPageContext.getRequest().setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
    buildTable();
   
    try {
      tableTagBuilder.getTableTag().doStartTag();
      for (int i = 0; i < Mock.persons.size(); i++) {
View Full Code Here

  public void setupTest() throws JspException {
   
    MockServletContext mockServletContext = new MockServletContext();

    mockPageContext = new MockPageContext(mockServletContext);
    mockPageContext.getRequest().setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
   
    tableTagBuilder = new TableTagBuilder(Mock.persons, "myTableId").context(mockPageContext).defaultTable();
    tableTag = tableTagBuilder.getTableTag();

    extraHtmlTag = new ExtraHtmlTag();
View Full Code Here

    }
    else {
      locale = Locale.getDefault();
    }

    Context context = (Context) request.getAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE);
    if (context == null) {
      LOGGER.warn("The Dandelion context doesn't seem to be available. Did you forget to declare the DandelionFilter in your web.xml file?");
    }
    else if (context.isDevModeEnabled()) {
      clear();
    }

    if (!configurationStore.containsKey(locale)) {
      resolveGroupsForLocale(locale, request);
View Full Code Here

  protected Map<String, Object> mainConfig;
 
  @Before
  public void setup() {
    request = new MockHttpServletRequest();
    request.setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
    table = new HtmlTable("fakeId", request, response);
    table.getTableConfiguration().getConfigurations().clear();
    table.addHeaderRow();
    table.getLastHeaderRow().addHeaderColumn("column1");
    table.getLastHeaderRow().addHeaderColumn("column2");
View Full Code Here

  @Before
  public void setup(){
    mockServletContext = new MockServletContext();
    mockPageContext = new MockPageContext(mockServletContext);
    request = (HttpServletRequest) mockPageContext.getRequest();
    request.setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
    fakeExportConf = new ExportConf.Builder("csv")
      .header(true)
      .exportClass(new CsvExport())
      .build();
  }
View Full Code Here

  @Before
  public void setup() {
    mockServletContext = new MockServletContext();
    mockPageContext = new MockPageContext(mockServletContext);
    request = (HttpServletRequest) mockPageContext.getRequest();
    request.setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
  }
View Full Code Here

  private HtmlColumn firstColumn;

  @Before
  public void createMainGenerator() {
    request = new MockHttpServletRequest();
    request.setAttribute(WebConstants.DANDELION_CONTEXT_ATTRIBUTE, new Context(new MockFilterConfig()));
    response = new MockHttpServletResponse();
    generator = new ColumnFilteringGenerator();
  }
View Full Code Here

TOP

Related Classes of com.github.dandelion.core.Context

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.