Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Eclipse IDE and Birt is fine but...(how to add birt to target platform)
Eclipse IDE and Birt is fine but... [message #798995] Wed, 15 February 2012 10:09 Go to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 330
Registered: July 2009
Senior Member
Hi,

i am able to run the report designer in my ide.
but when i export my rcp application birt does not get "exported"
although i added all org.eclipse.birt plugins on my target platform
i can still not switch to "org.eclipse.birt.report.designer.ui.ReportPerspective"

tried all on default.
also tried to autostart the core and the report.designer.ui but then i run into exceptions.
installing birt into the rcp ide was easy, exporting my application drives me crazy.

iff there is a document how to do it let me know.

note: the viewer works! its the designer that does not work (yet)
Re: Eclipse IDE and Birt is fine but... [message #799073 is a reply to message #798995] Wed, 15 February 2012 12:12 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 330
Registered: July 2009
Senior Member
iff i open the file in my rcp in the resource explorer
i get the information that the content type is not assigned BUT it opens without any errors in the editor! so the file is correct...

[Updated on: Wed, 15 February 2012 12:19]

Report message to a moderator

Re: Eclipse IDE and Birt is fine but... [message #799074 is a reply to message #798995] Wed, 15 February 2012 12:12 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 330
Registered: July 2009
Senior Member
ok finally i got the designer running too, and i am able to switch to the designer perpective programmatically
but when i try to open an rptdesign file (located somewhere outside the workspace in a directory) by code
i run into exceptions

here is the code to open the editor:
final File file = new File(staticReport);
		SwitchPerspective.to(birtReportPerspective); // switch to the correct perspective
		IWorkbenchPage page = getActivePage();
		IEditorInput input = new IEditorInput() {

			@Override
			public Object getAdapter(Class adapter) {
				return file;
			}

			@Override
			public String getToolTipText() {
				return "Generated Template Report " + file.getAbsolutePath();
			}

			@Override
			public IPersistableElement getPersistable() {
				return null;
			}

			@Override
			public String getName() {
				return file.getName();
			}

			@Override
			public ImageDescriptor getImageDescriptor() {
				return null;
			}

			@Override
			public boolean exists() {
				System.out.println(file.getAbsolutePath() + " exists = "
						+ file.exists());
				return file.exists();
			}
		};
		try {
			page.openEditor(input,
					"org.eclipse.birt.report.designer.ui.editors.ReportEditor");
		} catch (Exception e) {
			e.printStackTrace();
		}

and here the exception:
Quote:

java.lang.ClassCastException: java.io.File cannot be cast to org.eclipse.core.resources.IFile
at org.eclipse.birt.report.designer.internal.ui.util.UIUtil.getProjectFromInput(UIUtil.java:2506)
at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.init(MultiPageReportEditor.java:346)
at org.eclipse.birt.report.designer.ui.editors.ReportEditorProxy.init(ReportEditorProxy.java:124)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:828)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:647)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
at ...

Re: Eclipse IDE and Birt is fine but... [message #799269 is a reply to message #799074] Wed, 15 February 2012 17:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ludwig,

Take a look at this thread:
http://www.eclipsezone.com/eclipse/forums/m92221730.html

Jason

On 2/15/2012 7:12 AM, Ludwig Moser wrote:
> cannot be cast to org.eclipse.core.resources.IFile
Re: Eclipse IDE and Birt is fine but... [message #799656 is a reply to message #799269] Thu, 16 February 2012 06:24 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 330
Registered: July 2009
Senior Member
maybe the problem is that the file is out of workspace (i store my reports in user home subdirectory)
when i use the transformation to ifile noted at your link i run into nullpointer
Quote:

java.lang.NullPointerException
at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.addPages(MultiPageReportEditor.java:377)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
at org.eclipse.birt.report.designer.ui.editors.ReportEditorProxy.createPartControl(ReportEditorProxy.java:138)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)


so after this failed i tried to create a project in my workspace "External Files" and add a link to the external file so i can create an ifile from that by:

public IFile getIFile(String fileName) {
		IWorkspace ws = ResourcesPlugin.getWorkspace();
		IProject project = ws.getRoot().getProject("External Files");
		try {
			if (!project.exists()) {
				project.create(null);
			}
			if (!project.isOpen()) {
				project.open(null);
			}
		} catch (CoreException e) {
			e.printStackTrace();
		}
		IPath location = new Path(fileName);
		IFile file = project.getFile(location.lastSegment());
		try {
			file.createLink(location, IResource.FILE, null);
		} catch (CoreException e) {
			e.printStackTrace();
		}
		return file;
	}


still resolves to a nullpointer.
any ideas?

[Updated on: Thu, 16 February 2012 06:47]

Report message to a moderator

Re: Eclipse IDE and Birt is fine but... [message #800181 is a reply to message #799656] Thu, 16 February 2012 19:46 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

can you not put the file in the workspace?

Jason

On 2/16/2012 1:24 AM, Ludwig Moser wrote:
> maybe the problem is that the file is out of workspace (i store my
> reports in user home subdirectory)
> when i use the transformation to ifile noted at your link i run into
> nullpointer
> Quote:
>> java.lang.NullPointerException
>> at
>> org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.addPages(MultiPageReportEditor.java:377)
>>
>> at
>> org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
>> at
>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
>>
>> at
>> org.eclipse.birt.report.designer.ui.editors.ReportEditorProxy.createPartControl(ReportEditorProxy.java:138)
>>
>> at
>> org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
>>
>> at
>> org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
>>
>> at
>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
>>
>> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
>> at
>> org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
>>
>> at
>> org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
>>
>> at
>> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
>>
>> at
>> org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
>>
>> at
>> org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
>>
>> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
>> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
>> at
>> org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
>>
>> at
>> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
>>
>> at
>> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
>>
>> at
>> org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
>>
>> at
>> org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
>>
>> at
>> org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
>>
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
>>
>> at
>> org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
>
Previous Topic:How to show series labels only for the last value
Next Topic:Two grouping levels
Goto Forum:
  


Current Time: Tue Sep 16 11:46:22 GMT 2014

Powered by FUDForum. Page generated in 0.01674 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software