Skip to content

Instantly share code, notes, and snippets.

View marpontes's full-sized avatar

Marcello Pontes marpontes

View GitHub Profile
@brenopolanski
brenopolanski / solving-cors-pentaho-cde.md
Last active February 23, 2021 17:40
Solving CORS problem on embedding Pentaho CDE dashboard in web application

Solving CORS problem on embedding Pentaho CDE dashboard in web application

Cross-Origin Resource Sharing (CORS) is a W3C spec that allows cross-domain communication from the browser. By building on top of the XMLHttpRequest object, CORS allows developers to work with the same idioms as same-domain requests.

Enable Cross Origin Resource Sharing (CORS) in the Community Dashboard Framework (CDF), Community Dashboard Editor (CDE), and Community Data Access (CDA). While you need CDE to embed the dashboard, you will access it from a different server other than the Pentaho Server, so CORS must be enabled in CDF, CDE and CDA. Open the following CDF, CDE, and CDA settings.xml files in a text editor:

  • For CDF: server/pentaho-server/pentaho-solutions/system/pentaho-cdf/settings.xml.
  • For CDE: server/pentaho-server/pentaho-solutions/system/pentaho-cdf-dd/settings.xml.
  • For CDA: server/pentaho-server/pentaho-solutions/system/cda/settings.xml.
@davidsommer
davidsommer / mergeExcel.java
Created December 5, 2013 14:01
Merge a List of Excel Files with POI Copies all Sheets, Fields of a List of Excel Files into a new one
public static void mergeExcelFiles(File file, List<FileInputStream> list) throws IOException {
HSSFWorkbook book = new HSSFWorkbook();
HSSFSheet sheet = book.createSheet(file.getName());
for (FileInputStream fin : list) {
HSSFWorkbook b = new HSSFWorkbook(fin);
for (int i = 0; i < b.getNumberOfSheets(); i++) {
copySheets(book, sheet, b.getSheetAt(i));
}
}