On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.
Birt POJO Data Source POC
I am doing POC for Birt POJO Data source. I want to reuse the existing Spring based framework code in Birt POC.
In Open method, I am loading Spring Application context, executing business logic to get data and close method destroying the spring application context. Please advise, this is the correct way to load Spring Application context in open method?
public class ReportApplication {
private AnnotationConfigApplicationContext ctx = null; Iterator<? extends String> iterator; public void open(Object appContext, Map<String, Object> datasetParamValues) { try { ctx = new AnnotationConfigApplicationContext(); ctx.scan("com.****.****"); ctx.register(BirtConfig.class); IReferenceService refService = (IReferenceService) SpringContext.getBean("referenceService"); List<String> positions = null; positions = refService.refData(QueryType.NAMED); iterator = positions.iterator(); } catch (Exception e) { e.printStackTrace(); } } public Object next() { if (iterator != null && iterator.hasNext()) { return iterator.next(); } return null; } public void close() { iterator = null; if (ctx != null) { ctx.close(); } }
}
Categories
- All Categories
- Cloud Editions
- 1 Thrust Services
- cat as link
- 1 Core SaaS Application development
- 10 Developer Announcements
- 15 General Questions
- 33.4K TeamSite
- 141 Application Governance & Archiving
- 15.2K Designing Analytics Reports
- 1K DevShare Downloads
- Core SaaS Applications
- nested parent
- 4.3K Developing Analytics Applications
- 8.8K Documentum Developer Forum
- Media Management developer
- 159 Transactional Content Processing (TCP)
- 1.7K Web Experience Management
- 55 Tempo Social
- 1 XM Fax