Examples of Export


Examples of org.milyn.payload.Export

    @Test
    public void createMultipleExports()
    {
        Set<Export> results = new HashSet<Export>();
        results.add(new Export(StringResult.class));
        results.add(new Export(JavaResult.class));
        Exports exports = new Exports(results);

        Collection<Export> exportTypes = exports.getExports();
        assertEquals(2, exportTypes.size());
    }
View Full Code Here

Examples of org.pentaho.cdf.export.Export

      final ActionEngine actionEngine = ActionEngine.getInstance();
      if ( actionEngine.execute( requestParams, userSession, out ) ) {

        final String exportType = requestParams.getStringParameter( Parameter.EXPORT_TYPE, IExport.EXPORT_TYPE_EXCEL );

        Export export;

        if ( exportType.equals( IExport.EXPORT_TYPE_CSV ) ) {
          export = new ExportCSV( output );
          setResponseHeaders( MimeTypes.CSV, 0, "export" + export.getExtension() );
        } else {
          export = new ExportExcel( output );
          setResponseHeaders( MIME_XLS, 0, "export" + export.getExtension() );
        }

        export.exportFile( new JSONObject( out.toString() ) );
      }

    } catch ( IOException e ) {
      logger.error( "IOException  exporting file", e );
    } catch ( JSONException e ) {
View Full Code Here

Examples of org.pentaho.cdf.export.Export

    String value = determineCorrectPath( solution, action, path );

    if ( ActionEngine.getInstance().executeAction( value, contentType, request, response,
        PentahoSessionHolder.getSession(), Parameter.asHashMap( request ) ) ) {
      Export export;

      if ( IExport.EXPORT_TYPE_CSV.equalsIgnoreCase( exportType ) ) {
        export = new ExportCSV( response.getOutputStream() );
        response.setHeader( "Content-Type", MimeTypes.CSV );

      } else {
        export = new ExportExcel( response.getOutputStream() );
        response.setHeader( "Content-Type", MimeTypes.XLS );
      }

      response.setHeader( "Cache-Control", "max-age=0, no-store" );
      response.setHeader( "content-disposition", "attachment; filename=" + "export" + export.getExtension() );

      export.exportFile( new JSONObject( response.getOutputStream() ) );
    }
  }
View Full Code Here

Examples of org.pentaho.cdf.export.Export

            final ServiceCallAction serviceCallAction = ServiceCallAction.getInstance();
            if (serviceCallAction.execute(requestParams, userSession, out)) {

                final String exportType = requestParams.getStringParameter("exportType", "excel");

                Export export;

                if (exportType.equals("csv")) {
                    export = new ExportCSV(output);
                    setResponseHeaders(MIME_CSV, 0, "export" + export.getExtension());
                } else {
                    export = new ExportExcel(output);
                    setResponseHeaders(MIME_XLS, 0, "export" + export.getExtension());
                }

                export.exportFile(new JSONObject(out.toString()));
            }

        } catch (IOException e) {
            e.printStackTrace();
        } catch (JSONException e) {
View Full Code Here

Examples of org.timepedia.exporter.client.Export

 
  public boolean isExportable(JAbstractMethod method, JExportableClassType type) {
    boolean export = false;
    // Only public methods are exported
    if (method.isPublic()) {
      Export e;
      if (method instanceof JConstructor && isInstantiable(method.getEnclosingType()) && method.getParameters().length == 0) {
        // zero-arg constructors always exportable
        export =  true;
      } else if (isNotExportable(method.getAnnotation(NoExport.class))) {
        // Do not export methods annotated as NoExport, although the
        // method is marked as export in an interface or the entire class
        // is annotated as Export
        export = false;
      } else if (isExportable(method.getAnnotation(Export.class))) {
        // Export this method if has the Export annotation
        export = true;
      } else if (isExportable(method.getEnclosingType())) {
        // Export all method in a class annotated as Export
        export = true;
      } else if (type != null && (e = type.getType().getAnnotation(Export.class)) != null && e.all()) {
        // Export this method if the class has the Export.all attribute set
        // Filter some generic methods present in Object
        export = !method.getName().matches("getClass|hashCode|equals|notify|notifyAll|wait");
      } else {
        // Export methods which are annotated in implemented interfaces
View Full Code Here

Examples of org.timepedia.exporter.client.Export

    }
    return pkg + getJSExportName();
  }
 
  public String getJSExportName () {
    Export ann = type.getAnnotation(Export.class);
    JClassType type = getTypeToExport();
    return ann != null && !ann.value().isEmpty() ? ann.value() : type.getName();
  }
View Full Code Here

Examples of org.timepedia.exporter.client.Export

    if (isExportInstanceMethod()) {
      anValue = method.getAnnotation(ExportInstanceMethod.class).value();
    } else if (isExportStaticMethod()) {
      anValue = method.getAnnotation(ExportStaticMethod.class).value();
    } else {
      Export ann = method.getAnnotation(Export.class);
      anValue = ann != null ? ann.value().trim() : "";
    }

    if (!anValue.isEmpty()) {
      exportName = anValue;
     
View Full Code Here

Examples of org.timepedia.exporter.client.Export

  public JExportableField(JExportableClassType enclosingExportType,
      JField field) {
    this.enclosingExportType = enclosingExportType;
    this.field = field;
    Export ann = field.getAnnotation(Export.class);

    if (ann != null && ann.value().length() > 0) {
      exportName = ann.value();
    } else {
      exportName = field.getName();
    }
  }
View Full Code Here

Examples of org.timepedia.exporter.client.Export

  public JExportableMethod(JExportableClassType exportableEnclosingType,
      JAbstractMethod method) {
    this.exportableEnclosingType = exportableEnclosingType;
    this.method = method;
    Export ann = method.getAnnotation(Export.class);

    if (ann != null && ann.value().length() > 0) {
      exportName = ann.value();
    } else {
      exportName = method.getName();
    }
  }
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.