added multi reference option in UI
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@86210 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
17e5838657
commit
3d07be06cf
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/reports-4.6.4-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/reports-4.6.6-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
@ -31,5 +31,5 @@
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
||||||
<classpathentry kind="output" path="target/reports-4.6.4-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/reports-4.6.6-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
<<<<<<<=.mine
|
<<<<<<<=.mine
|
||||||
>>>>>>>=.r71295
|
>>>>>>>=.r71295
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.4-SNAPSHOT
|
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.6-SNAPSHOT
|
||||||
warSrcDir=src/main/webapp
|
warSrcDir=src/main/webapp
|
||||||
warSrcDirIsOutput=false
|
warSrcDirIsOutput=false
|
||||||
|
|
|
@ -8,15 +8,6 @@
|
||||||
<dependent-module archiveName="gcube-reporting-modeler-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-reporting-modeler/gcube-reporting-modeler">
|
<dependent-module archiveName="gcube-reporting-modeler-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-reporting-modeler/gcube-reporting-modeler">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<dependent-module archiveName="reports-store-gateway-client-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-client/reports-store-gateway-client">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="reports-store-gateway-support-model-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-model/reports-store-gateway-support-model">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="reports-store-gateway-interface-dto-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-interface-dto/reports-store-gateway-interface-dto">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="document-workflow-library-1.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/document-workflow-library/document-workflow-library">
|
<dependent-module archiveName="document-workflow-library-1.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/document-workflow-library/document-workflow-library">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
|
4
pom.xml
4
pom.xml
|
@ -12,8 +12,8 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>reports</artifactId>
|
<artifactId>reports</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>4.6.4-SNAPSHOT</version>
|
<version>4.6.6-SNAPSHOT</version>
|
||||||
<name>gCube Reports Portlet</name>
|
<name>gCube Reports Manager</name>
|
||||||
<description>
|
<description>
|
||||||
gCube Reports Portlet.
|
gCube Reports Portlet.
|
||||||
</description>
|
</description>
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.RunAsyncCallback;
|
import com.google.gwt.core.client.RunAsyncCallback;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||||
|
import com.google.gwt.dom.client.Style.WhiteSpace;
|
||||||
import com.google.gwt.user.client.Command;
|
import com.google.gwt.user.client.Command;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.ui.CellPanel;
|
import com.google.gwt.user.client.ui.CellPanel;
|
||||||
|
@ -113,7 +114,7 @@ public class Headerbar extends Composite{
|
||||||
MenuItem sectionsMenu;
|
MenuItem sectionsMenu;
|
||||||
MenuItem biblioMenu;
|
MenuItem biblioMenu;
|
||||||
MenuItem exportMenu;
|
MenuItem exportMenu;
|
||||||
MenuItem importMenu;
|
MenuItem vmeMenu;
|
||||||
MenuItemSeparator separator1;
|
MenuItemSeparator separator1;
|
||||||
MenuItemSeparator separator2;
|
MenuItemSeparator separator2;
|
||||||
MenuItemSeparator separator3;
|
MenuItemSeparator separator3;
|
||||||
|
@ -145,8 +146,9 @@ public class Headerbar extends Composite{
|
||||||
exportMenu = getExportsMenu();
|
exportMenu = getExportsMenu();
|
||||||
menuBar.addItem(exportMenu);
|
menuBar.addItem(exportMenu);
|
||||||
menuBar.addSeparator();
|
menuBar.addSeparator();
|
||||||
importMenu = getImportMenu();
|
vmeMenu = getVMEMenu();
|
||||||
menuBar.addItem(importMenu);
|
menuBar.addItem(vmeMenu);
|
||||||
|
|
||||||
|
|
||||||
mainLayout.setSize("100%", "24px");
|
mainLayout.setSize("100%", "24px");
|
||||||
mainLayout.setStyleName("menubar");
|
mainLayout.setStyleName("menubar");
|
||||||
|
@ -305,6 +307,41 @@ public class Headerbar extends Composite{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private MenuItem getVMEMenu() {
|
||||||
|
MenuBar importMenu = new MenuBar(true);
|
||||||
|
|
||||||
|
importMenu.setAnimationEnabled(true);
|
||||||
|
MenuItem toReturn = new MenuItem("VME Options", importMenu);
|
||||||
|
toReturn.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP);
|
||||||
|
|
||||||
|
Command importVMEReport = new Command() {
|
||||||
|
public void execute() {
|
||||||
|
presenter.showVMEImportDialog();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
importVME = new MenuItem(IMPORT_VME, true, importVMEReport);
|
||||||
|
|
||||||
|
importMenu.addItem(importVME);
|
||||||
|
importMenu.addSeparator();
|
||||||
|
//add the submenu items for editing report refs
|
||||||
|
for (final VMETypeIdentifier type : VMETypeIdentifier.values()) {
|
||||||
|
if (type != VMETypeIdentifier.Vme) {
|
||||||
|
MenuItem item = new MenuItem("Edit " + type.getId(), true, new Command() {
|
||||||
|
public void execute() {
|
||||||
|
presenter.showVMEReportRefImportDialog(type);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
importMenu.addItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
importMenu.addSeparator();
|
||||||
|
MenuItem exportVME = new MenuItem("Export Current to VME-DB", true, importVMEReport);
|
||||||
|
importMenu.addItem(exportVME);
|
||||||
|
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
|
@ -344,40 +381,6 @@ public class Headerbar extends Composite{
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MenuItem getImportMenu() {
|
|
||||||
MenuBar importMenu = new MenuBar(true);
|
|
||||||
|
|
||||||
importMenu.setAnimationEnabled(true);
|
|
||||||
MenuItem toReturn = new MenuItem("Import", importMenu);
|
|
||||||
|
|
||||||
Command importVMEReport = new Command() {
|
|
||||||
public void execute() {
|
|
||||||
presenter.showVMEImportDialog();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
importVME = new MenuItem(IMPORT_VME, true, importVMEReport);
|
|
||||||
|
|
||||||
MenuBar importVMERef = new MenuBar(true);
|
|
||||||
MenuItem importVMERefItem = new MenuItem(IMPORT_VME_REF, importVMERef);
|
|
||||||
|
|
||||||
//add the submenu items for report refs
|
|
||||||
for (final VMETypeIdentifier type : VMETypeIdentifier.values()) {
|
|
||||||
if (type != VMETypeIdentifier.Vme) {
|
|
||||||
MenuItem item = new MenuItem(type.getId(), true, new Command() {
|
|
||||||
public void execute() {
|
|
||||||
presenter.showVMERefAssociateDialog(type);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
importVMERef.addItem(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
importMenu.addItem(importVME);
|
|
||||||
importMenu.addItem(importVMERefItem);
|
|
||||||
return toReturn;
|
|
||||||
}
|
|
||||||
|
|
||||||
private MenuItem getExportsMenu() {
|
private MenuItem getExportsMenu() {
|
||||||
MenuBar exportsMenu = new MenuBar(true);
|
MenuBar exportsMenu = new MenuBar(true);
|
||||||
|
|
||||||
|
|
|
@ -145,15 +145,16 @@ public class Presenter {
|
||||||
eventBus.addHandler(SelectedReportEvent.TYPE, new SelectedReportEventHandler() {
|
eventBus.addHandler(SelectedReportEvent.TYPE, new SelectedReportEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onReportSelected(SelectedReportEvent event) {
|
public void onReportSelected(SelectedReportEvent event) {
|
||||||
if (event.getType() == VMETypeIdentifier.Vme) {
|
if (event.isAssociation()) {
|
||||||
importVMEReport(event.getId());
|
|
||||||
} else {
|
|
||||||
try {
|
try {
|
||||||
associateVMRReportRef(event.getType(), event.getId());
|
associateVMRReportRef(event.getType(), event.getId());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
importVMEReport(event.getId(), event.getType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -190,10 +191,10 @@ public class Presenter {
|
||||||
|
|
||||||
switch (event.getOperationResult()) {
|
switch (event.getOperationResult()) {
|
||||||
case SAVED:
|
case SAVED:
|
||||||
refreshWorkspace();
|
//refreshWorkspace();
|
||||||
break;
|
break;
|
||||||
case SAVED_OPEN:
|
case SAVED_OPEN:
|
||||||
refreshWorkspace();
|
// refreshWorkspace();
|
||||||
toolBoxPanel.showExportedVersion(event.getItemId(), event.getItemId());
|
toolBoxPanel.showExportedVersion(event.getItemId(), event.getItemId());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -263,7 +264,7 @@ public class Presenter {
|
||||||
|
|
||||||
public void onSuccess(Model wfReport) {
|
public void onSuccess(Model wfReport) {
|
||||||
dlg.hide();
|
dlg.hide();
|
||||||
loadModel(wfReport);
|
loadModel(wfReport, true);
|
||||||
header.setMenuForWorkflowDocument(sessionInfo.isEditable());
|
header.setMenuForWorkflowDocument(sessionInfo.isEditable());
|
||||||
titleBar.addWorkflowButtons(true);
|
titleBar.addWorkflowButtons(true);
|
||||||
pollServiceForLockRenewal();
|
pollServiceForLockRenewal();
|
||||||
|
@ -278,7 +279,7 @@ public class Presenter {
|
||||||
public void onSuccess(Model result) {
|
public void onSuccess(Model result) {
|
||||||
dlg.hide();
|
dlg.hide();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
loadModel(result);
|
loadModel(result, true);
|
||||||
header.enableExports();
|
header.enableExports();
|
||||||
} else
|
} else
|
||||||
commonCommands.newTemplate.execute();
|
commonCommands.newTemplate.execute();
|
||||||
|
@ -318,7 +319,7 @@ public class Presenter {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Model toLoad) {
|
public void onSuccess(Model toLoad) {
|
||||||
if (toLoad != null)
|
if (toLoad != null)
|
||||||
loadModel(toLoad);
|
loadModel(toLoad, true);
|
||||||
else
|
else
|
||||||
Window.alert("Could not Load template, error on server: ");
|
Window.alert("Could not Load template, error on server: ");
|
||||||
}
|
}
|
||||||
|
@ -455,20 +456,7 @@ public class Presenter {
|
||||||
return GWT.getHostPageBaseURL() + "../../";
|
return GWT.getHostPageBaseURL() + "../../";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void addTextToolBar() {
|
|
||||||
|
|
||||||
RichTextToolbar rtbar = new RichTextToolbar(new RichTextArea(), false, getCommands(), true);
|
|
||||||
SimplePanel deco = new SimplePanel();
|
|
||||||
rtbar.setEnabled(false);
|
|
||||||
deco.add(rtbar);
|
|
||||||
deco.setSize("100%", "25");
|
|
||||||
rtbar.setWidth("100%");
|
|
||||||
ReportGenerator.get().getToolbarPanel().clear();
|
|
||||||
ReportGenerator.get().getToolbarPanel().add(deco);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* remove the user-added components from the workspace, and from the model
|
* remove the user-added components from the workspace, and from the model
|
||||||
*
|
*
|
||||||
|
@ -595,56 +583,6 @@ public class Presenter {
|
||||||
this.@org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter::location = $wnd.location.href;
|
this.@org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter::location = $wnd.location.href;
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param area .
|
|
||||||
*/
|
|
||||||
public void disaableTextToolBar(RichTextArea area) {
|
|
||||||
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* used when the resizing textAreas depending on the content
|
|
||||||
* @param myY a
|
|
||||||
* @param pixel a
|
|
||||||
*/
|
|
||||||
public void shiftComponentsByTextArea(int myY, int pixel) {
|
|
||||||
int section = model.getCurrentPage();
|
|
||||||
List<TemplateComponent> comps = model.getSectionComponent(section);
|
|
||||||
|
|
||||||
if (comps != null) {
|
|
||||||
for (TemplateComponent tc : comps) {
|
|
||||||
if (tc.getType() != ComponentType.FAKE_TEXTAREA) {
|
|
||||||
if (tc.getY() > myY) {
|
|
||||||
GWT.log("FOUND " + tc.getX() + ", " + tc.getY(), null);
|
|
||||||
GWT.log("pixel " + pixel , null);
|
|
||||||
int newY = tc.getY()+pixel;// : tc.getY()-pixel;
|
|
||||||
//
|
|
||||||
tc.setY(newY);
|
|
||||||
GWT.log("moveWidget " + tc.getX() + ", " + tc.getY(), null);
|
|
||||||
moveWidget(tc.getContent(), tc.getX(),newY);
|
|
||||||
GWT.log("MOVED " + tc.getX() + ", " + tc.getY(), null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Window.alert("myY - tc.getY() " + myY + ", " + tc.getY());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param toMove .
|
|
||||||
* @param left .
|
|
||||||
* @param top .
|
|
||||||
*/
|
|
||||||
public void moveWidget(Widget toMove, int left, int top) {
|
|
||||||
//wp.getMainLayout().add(toMove);
|
|
||||||
wp.moveWidget(toMove, left, top);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import a Section in the View and in the Model
|
* Import a Section in the View and in the Model
|
||||||
* @param toLoad the SerializableModel instance where toget the section
|
* @param toLoad the SerializableModel instance where toget the section
|
||||||
|
@ -678,7 +616,22 @@ public class Presenter {
|
||||||
while (! ( model.getCurrentPage() == sect2Seek) )
|
while (! ( model.getCurrentPage() == sect2Seek) )
|
||||||
nextPageButtonClicked();
|
nextPageButtonClicked();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void addTextToolBar(boolean enableCommands) {
|
||||||
|
RichTextToolbar rtbar = new RichTextToolbar(new RichTextArea(), false, getCommands(), true);
|
||||||
|
rtbar.enableCommands(enableCommands);
|
||||||
|
|
||||||
|
currentSelectedToolbar = rtbar;
|
||||||
|
SimplePanel deco = new SimplePanel();
|
||||||
|
rtbar.setEnabled(false);
|
||||||
|
deco.add(rtbar);
|
||||||
|
deco.setSize("100%", "25");
|
||||||
|
rtbar.setWidth("100%");
|
||||||
|
ReportGenerator.get().getToolbarPanel().clear();
|
||||||
|
ReportGenerator.get().getToolbarPanel().add(deco);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* enable the format text toolbar for the given Rich Textarea passed as argument
|
* enable the format text toolbar for the given Rich Textarea passed as argument
|
||||||
* @param d4sArea the enabled text area
|
* @param d4sArea the enabled text area
|
||||||
|
@ -818,29 +771,11 @@ public class Presenter {
|
||||||
titleBar.getSectionSwitchPanel().showPrevButton();
|
titleBar.getSectionSwitchPanel().showPrevButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* load the template to edit in the MODEL and in the VIEW
|
|
||||||
* @param serializedpath the temp file to open
|
|
||||||
*/
|
|
||||||
public void openImportedFimesXML(String serializedpath) {
|
|
||||||
model.getModelService().readImportedModel(serializedpath, new AsyncCallback<Model>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Model toLoad) {
|
|
||||||
loadModel(toLoad);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
Window.alert("Could not Load report, please try again later: " + caught.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param toLoad
|
* @param toLoad
|
||||||
*/
|
*/
|
||||||
private void loadModel(Model toLoad) {
|
private void loadModel(Model toLoad, boolean savingEnabled) {
|
||||||
//reset the UI
|
//reset the UI
|
||||||
cleanAllNotSession();
|
cleanAllNotSession();
|
||||||
|
|
||||||
|
@ -854,7 +789,7 @@ public class Presenter {
|
||||||
titleBar.getSectionSwitchPanel().setVisible(true);
|
titleBar.getSectionSwitchPanel().setVisible(true);
|
||||||
resizeWorkingArea(model.getPageWidth(), model.getPageHeight());
|
resizeWorkingArea(model.getPageWidth(), model.getPageHeight());
|
||||||
|
|
||||||
addTextToolBar();
|
addTextToolBar(savingEnabled);
|
||||||
int currPage = model.getCurrentPage();
|
int currPage = model.getCurrentPage();
|
||||||
//load the UI components of the current page
|
//load the UI components of the current page
|
||||||
GWT.log("READ CURR PAGE"+currPage, null);
|
GWT.log("READ CURR PAGE"+currPage, null);
|
||||||
|
@ -904,7 +839,7 @@ public class Presenter {
|
||||||
titleBar.setTemplateName(model.getTemplateName());
|
titleBar.setTemplateName(model.getTemplateName());
|
||||||
titleBar.getSectionSwitchPanel().setPageDisplayer(model.getCurrentPage(), model.getTotalPages());
|
titleBar.getSectionSwitchPanel().setPageDisplayer(model.getCurrentPage(), model.getTotalPages());
|
||||||
titleBar.getSectionSwitchPanel().setVisible(true);
|
titleBar.getSectionSwitchPanel().setVisible(true);
|
||||||
addTextToolBar();
|
addTextToolBar(true);
|
||||||
int currPage = model.getCurrentPage();
|
int currPage = model.getCurrentPage();
|
||||||
//load the UI components of the current page
|
//load the UI components of the current page
|
||||||
GWT.log("READ CURR PAGE"+currPage, null);
|
GWT.log("READ CURR PAGE"+currPage, null);
|
||||||
|
@ -1248,21 +1183,28 @@ public class Presenter {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void showVMEImportDialog() {
|
public void showVMEImportDialog() {
|
||||||
ImportVMEReportDialog dlg = new ImportVMEReportDialog(getEventBus(), VMETypeIdentifier.Vme);
|
ImportVMEReportDialog dlg = new ImportVMEReportDialog(getEventBus(), VMETypeIdentifier.Vme, false);
|
||||||
dlg.show();
|
dlg.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void showVMEReportRefImportDialog(VMETypeIdentifier refType) {
|
||||||
|
ImportVMEReportDialog dlg = new ImportVMEReportDialog(getEventBus(), refType, false);
|
||||||
|
dlg.show();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void showVMERefAssociateDialog(VMETypeIdentifier refType) {
|
public void showVMERefAssociateDialog(VMETypeIdentifier refType) {
|
||||||
ImportVMEReportDialog dlg = new ImportVMEReportDialog(getEventBus(), refType);
|
ImportVMEReportDialog dlg = new ImportVMEReportDialog(getEventBus(), refType, true);
|
||||||
dlg.show();
|
dlg.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void importVMEReport(String reportId) {
|
private void importVMEReport(String reportId, final VMETypeIdentifier type) {
|
||||||
showLoading();
|
showLoading();
|
||||||
reportService.importVMEReport(reportId, new AsyncCallback<Model>() {
|
reportService.importVMEReport(reportId, type, new AsyncCallback<Model>() {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Window.alert("Could not Load Report Model, error on server.: " + caught.getMessage());
|
Window.alert("Could not Load Report Model, error on server.: " + caught.getMessage());
|
||||||
|
@ -1271,7 +1213,7 @@ public class Presenter {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Model toLoad) {
|
public void onSuccess(Model toLoad) {
|
||||||
if (toLoad != null)
|
if (toLoad != null)
|
||||||
loadModel(toLoad);
|
loadModel(toLoad, type == VMETypeIdentifier.Vme);
|
||||||
else
|
else
|
||||||
Window.alert("Could not Load Report Model, error on server.");
|
Window.alert("Could not Load Report Model, error on server.");
|
||||||
}
|
}
|
||||||
|
@ -1282,7 +1224,7 @@ public class Presenter {
|
||||||
private void associateVMRReportRef(VMETypeIdentifier type, String reportId) throws Exception {
|
private void associateVMRReportRef(VMETypeIdentifier type, String reportId) throws Exception {
|
||||||
GWT.log("Type="+type);
|
GWT.log("Type="+type);
|
||||||
GWT.log("Id"+reportId);
|
GWT.log("Id"+reportId);
|
||||||
reportService.importVMEReportRef(reportId, type, new AsyncCallback<Model>() {
|
reportService.getVMEReportRef2Associate(reportId, type, new AsyncCallback<Model>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class ReportGenerator implements EntryPoint {
|
||||||
eastPanel.add(workSpacePanel);
|
eastPanel.add(workSpacePanel);
|
||||||
eastPanel.add(divHidden);
|
eastPanel.add(divHidden);
|
||||||
bottomScrollerPanel.add(eastPanel);
|
bottomScrollerPanel.add(eastPanel);
|
||||||
presenter.addTextToolBar();
|
presenter.addTextToolBar(true);
|
||||||
|
|
||||||
// Add image and button to the RootPanel
|
// Add image and button to the RootPanel
|
||||||
RootPanel.get("ReportGeneratorDIV").add(mainLayout);
|
RootPanel.get("ReportGeneratorDIV").add(mainLayout);
|
||||||
|
|
|
@ -25,9 +25,9 @@ public interface ReportService extends RemoteService{
|
||||||
|
|
||||||
ArrayList<VMEReportBean> listVMEReportRefByType(VMETypeIdentifier refType);
|
ArrayList<VMEReportBean> listVMEReportRefByType(VMETypeIdentifier refType);
|
||||||
|
|
||||||
Model importVMEReport(String id);
|
Model importVMEReport(String id, VMETypeIdentifier refType);
|
||||||
|
|
||||||
Model importVMEReportRef(String id, VMETypeIdentifier refType);
|
Model getVMEReportRef2Associate(String id, VMETypeIdentifier refType);
|
||||||
|
|
||||||
String save(String filePath, String workspaceFolderId, String ItemName,
|
String save(String filePath, String workspaceFolderId, String ItemName,
|
||||||
TypeExporter type, boolean overwrite)
|
TypeExporter type, boolean overwrite)
|
||||||
|
|
|
@ -77,10 +77,11 @@ public interface ReportServiceAsync {
|
||||||
|
|
||||||
void listVMEReports(AsyncCallback<ArrayList<VMEReportBean>> callback);
|
void listVMEReports(AsyncCallback<ArrayList<VMEReportBean>> callback);
|
||||||
|
|
||||||
void importVMEReport(String id, AsyncCallback<Model> callback);
|
void importVMEReport(String id, VMETypeIdentifier refType,
|
||||||
|
AsyncCallback<Model> callback);
|
||||||
|
|
||||||
void listVMEReportRefByType(VMETypeIdentifier refType,
|
void listVMEReportRefByType(VMETypeIdentifier refType,
|
||||||
AsyncCallback<ArrayList<VMEReportBean>> callback);
|
AsyncCallback<ArrayList<VMEReportBean>> callback);
|
||||||
|
|
||||||
void importVMEReportRef(String id, VMETypeIdentifier refType, AsyncCallback<Model> callback);
|
void getVMEReportRef2Associate(String id, VMETypeIdentifier refType, AsyncCallback<Model> callback);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,8 @@ public class ToolboxPanel extends VerticalPanel {
|
||||||
|
|
||||||
public ToolboxPanel(AppControllerExplorer appController) {
|
public ToolboxPanel(AppControllerExplorer appController) {
|
||||||
this.appController = appController;
|
this.appController = appController;
|
||||||
AsyncTreePanel tp = appController.getTree(TOOLBOX_WIDTH, TOOLBOX_HEIGHT);
|
// AsyncTreePanel tp = appController.getTree(TOOLBOX_WIDTH, TOOLBOX_HEIGHT);
|
||||||
this.tp = tp;
|
// this.tp = tp;
|
||||||
// add(tp);
|
// add(tp);
|
||||||
// this.appController.hideSharingFacilities(); //sharing disabled we have problems from Reports
|
// this.appController.hideSharingFacilities(); //sharing disabled we have problems from Reports
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,10 @@ public class ImportVMEReportDialog extends Window {
|
||||||
*
|
*
|
||||||
* @param eventBus the bus to fire events into
|
* @param eventBus the bus to fire events into
|
||||||
*/
|
*/
|
||||||
public ImportVMEReportDialog(final HandlerManager eventBus, VMETypeIdentifier type) {
|
public ImportVMEReportDialog(final HandlerManager eventBus, VMETypeIdentifier type, final boolean isAssociation) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
setModal(true);
|
||||||
mainPanel.setHeaderVisible(false);
|
mainPanel.setHeaderVisible(false);
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
|
@ -78,7 +79,8 @@ public class ImportVMEReportDialog extends Window {
|
||||||
add(hp);
|
add(hp);
|
||||||
add(mainPanel);
|
add(mainPanel);
|
||||||
showLoading();
|
showLoading();
|
||||||
if (type == VMETypeIdentifier.Vme)
|
if (type == VMETypeIdentifier.Vme) {
|
||||||
|
setHeading("Select the VME");
|
||||||
reportService.listVMEReports(new AsyncCallback<ArrayList<VMEReportBean>>() {
|
reportService.listVMEReports(new AsyncCallback<ArrayList<VMEReportBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -91,7 +93,9 @@ public class ImportVMEReportDialog extends Window {
|
||||||
showAvailableReports(reports);
|
showAvailableReports(reports);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
setHeading("Select the " + type.getId());
|
||||||
reportService.listVMEReportRefByType(type, new AsyncCallback<ArrayList<VMEReportBean>>() {
|
reportService.listVMEReportRefByType(type, new AsyncCallback<ArrayList<VMEReportBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -101,7 +105,7 @@ public class ImportVMEReportDialog extends Window {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ArrayList<VMEReportBean> refReports) {
|
public void onSuccess(ArrayList<VMEReportBean> refReports) {
|
||||||
mainPanel.unmask();
|
mainPanel.unmask();
|
||||||
showAvailableReferenceReports(refReports);
|
showAvailableReferenceReports(refReports, isAssociation);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -110,7 +114,7 @@ public class ImportVMEReportDialog extends Window {
|
||||||
*
|
*
|
||||||
* @param reports
|
* @param reports
|
||||||
*/
|
*/
|
||||||
public void showAvailableReferenceReports(List<VMEReportBean> reports) {
|
public void showAvailableReferenceReports(List<VMEReportBean> reports, boolean isAssociation) {
|
||||||
|
|
||||||
ColumnModel cm = null;
|
ColumnModel cm = null;
|
||||||
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
|
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
|
||||||
|
@ -158,13 +162,24 @@ public class ImportVMEReportDialog extends Window {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if (isAssociation) {
|
||||||
|
gridPanel.addButton(new Button("Associate Selected", new SelectionListener<ButtonEvent>() {
|
||||||
|
@Override
|
||||||
|
public void componentSelected(ButtonEvent ce) {
|
||||||
|
hide();
|
||||||
|
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), type, true));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else {
|
||||||
gridPanel.addButton(new Button("Edit Selected", new SelectionListener<ButtonEvent>() {
|
gridPanel.addButton(new Button("Edit Selected", new SelectionListener<ButtonEvent>() {
|
||||||
@Override
|
@Override
|
||||||
public void componentSelected(ButtonEvent ce) {
|
public void componentSelected(ButtonEvent ce) {
|
||||||
hide();
|
hide();
|
||||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), type));
|
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), type, false));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
mainPanel.add(gridPanel);
|
mainPanel.add(gridPanel);
|
||||||
mainPanel.setLayout(new FitLayout());
|
mainPanel.setLayout(new FitLayout());
|
||||||
mainPanel.layout();
|
mainPanel.layout();
|
||||||
|
@ -245,7 +260,7 @@ public class ImportVMEReportDialog extends Window {
|
||||||
@Override
|
@Override
|
||||||
public void componentSelected(ButtonEvent ce) {
|
public void componentSelected(ButtonEvent ce) {
|
||||||
hide();
|
hide();
|
||||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), VMETypeIdentifier.Vme));
|
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), VMETypeIdentifier.Vme, false));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
mainPanel.add(gridPanel);
|
mainPanel.add(gridPanel);
|
||||||
|
|
|
@ -8,11 +8,13 @@ public class SelectedReportEvent extends GwtEvent<SelectedReportEventHandler>{
|
||||||
public static Type<SelectedReportEventHandler> TYPE = new Type<SelectedReportEventHandler>();
|
public static Type<SelectedReportEventHandler> TYPE = new Type<SelectedReportEventHandler>();
|
||||||
private final String id;
|
private final String id;
|
||||||
private final VMETypeIdentifier type;
|
private final VMETypeIdentifier type;
|
||||||
|
private final boolean isAssociation;
|
||||||
|
|
||||||
public SelectedReportEvent(String id, VMETypeIdentifier type) {
|
public SelectedReportEvent(String id, VMETypeIdentifier type, boolean isAssociation) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
this.isAssociation = isAssociation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
@ -23,6 +25,10 @@ public class SelectedReportEvent extends GwtEvent<SelectedReportEventHandler>{
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAssociation() {
|
||||||
|
return isAssociation;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Type<SelectedReportEventHandler> getAssociatedType() {
|
public Type<SelectedReportEventHandler> getAssociatedType() {
|
||||||
return TYPE;
|
return TYPE;
|
||||||
|
|
|
@ -377,10 +377,10 @@ public class TemplateComponent {
|
||||||
case REPORT_REFERENCE:
|
case REPORT_REFERENCE:
|
||||||
GWT.log("FOUND Master SEQUENCE trying getGroup");
|
GWT.log("FOUND Master SEQUENCE trying getGroup");
|
||||||
|
|
||||||
ReportReferences ref = (ReportReferences) sc.getPossibleContent();
|
ReportReferences refs = (ReportReferences) sc.getPossibleContent();
|
||||||
ArrayList<Tuple> tuple = ref.getTuples();
|
ArrayList<Tuple> tuple = refs.getTuples();
|
||||||
|
|
||||||
ClientReportReference cmSeq = new ClientReportReference(presenter, ref.getRefType(), tuple);
|
ClientReportReference cmSeq = new ClientReportReference(presenter, refs.getRefType(), tuple, refs.isSingleRelation());
|
||||||
this.content = cmSeq;
|
this.content = cmSeq;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -498,7 +498,7 @@ public class TemplateComponent {
|
||||||
break;
|
break;
|
||||||
case REPORT_REFERENCE:
|
case REPORT_REFERENCE:
|
||||||
ClientReportReference cRef = (ClientReportReference) this.content;
|
ClientReportReference cRef = (ClientReportReference) this.content;
|
||||||
ReportReferences ref = new ReportReferences(cRef.getRefType(), cRef.getTupleList());
|
ReportReferences ref = new ReportReferences(cRef.getRefType(), cRef.getTupleList(), cRef.isSingleRelation());
|
||||||
content = ref;
|
content = ref;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,14 @@ package org.gcube.portlets.user.reportgenerator.client.targets;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.d4sreporting.common.shared.Tuple;
|
import org.gcube.portlets.d4sreporting.common.shared.BasicComponent;
|
||||||
import org.gcube.portlets.d4sreporting.common.shared.RepeatableSequence;
|
import org.gcube.portlets.d4sreporting.common.shared.RepeatableSequence;
|
||||||
|
import org.gcube.portlets.d4sreporting.common.shared.Tuple;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
|
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.model.TemplateComponent;
|
import org.gcube.portlets.user.reportgenerator.client.model.TemplateComponent;
|
||||||
import org.gcube.portlets.user.reportgenerator.shared.VMETypeIdentifier;
|
import org.gcube.portlets.user.reportgenerator.shared.VMETypeIdentifier;
|
||||||
|
|
||||||
import com.google.gwt.core.shared.GWT;
|
import com.google.gwt.core.shared.GWT;
|
||||||
import com.google.gwt.event.dom.client.HasClickHandlers;
|
|
||||||
import com.google.gwt.user.client.Window;
|
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
/**
|
/**
|
||||||
|
@ -27,19 +26,23 @@ public class ClientReportReference extends Composite implements ClientSequence {
|
||||||
private ArrayList<Tuple> tupleList;
|
private ArrayList<Tuple> tupleList;
|
||||||
private SequenceWidget first;
|
private SequenceWidget first;
|
||||||
private Presenter p;
|
private Presenter p;
|
||||||
|
private boolean singleRelation; //allow or not to add new entries
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* s
|
* s
|
||||||
* @param p
|
* @param p
|
||||||
* @param ms
|
* @param ms
|
||||||
*/
|
*/
|
||||||
public ClientReportReference(Presenter p, String refType, ArrayList<Tuple> tupleList) {
|
public ClientReportReference(Presenter p, String refType, ArrayList<Tuple> tupleList, boolean singleRelation) {
|
||||||
this.p = p;
|
this.p = p;
|
||||||
this.refType = refType;
|
this.refType = refType;
|
||||||
this.tupleList = tupleList;
|
this.tupleList = tupleList;
|
||||||
|
this.singleRelation = singleRelation;
|
||||||
for (Tuple seq : tupleList) {
|
for (Tuple seq : tupleList) {
|
||||||
if (myPanel.getWidgetCount()==0) { // if is the first one
|
if (myPanel.getWidgetCount()==0) { // if is the first one
|
||||||
first = getMasterSequence(seq);
|
first = getMasterSequence(seq);
|
||||||
|
if (isSingleRelation())
|
||||||
|
first.removeAddAnotherButton();
|
||||||
myPanel.add(first);
|
myPanel.add(first);
|
||||||
} else {
|
} else {
|
||||||
SequenceWidget seqW = new SequenceWidget(p, this, seq, false, false);
|
SequenceWidget seqW = new SequenceWidget(p, this, seq, false, false);
|
||||||
|
@ -56,11 +59,23 @@ public class ClientReportReference extends Composite implements ClientSequence {
|
||||||
SequenceWidget toReturn = new SequenceWidget(p, this, seq, true, false);
|
SequenceWidget toReturn = new SequenceWidget(p, this, seq, true, false);
|
||||||
if (tupleList.size() == 1) {
|
if (tupleList.size() == 1) {
|
||||||
toReturn.enableClear();
|
toReturn.enableClear();
|
||||||
toReturn.removeAddAnotherButton();
|
if (isTupleEmpty(tupleList.get(0))) {
|
||||||
|
toReturn.clearAssociation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isTupleEmpty(Tuple toCheck) {
|
||||||
|
boolean toReturn = false;
|
||||||
|
for (BasicComponent bc : toCheck.getGroupedComponents()) {
|
||||||
|
if (bc.getPossibleContent() == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
return toReturn;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<Tuple> getTupleList() {
|
public ArrayList<Tuple> getTupleList() {
|
||||||
return tupleList;
|
return tupleList;
|
||||||
|
@ -72,6 +87,10 @@ public class ClientReportReference extends Composite implements ClientSequence {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isSingleRelation() {
|
||||||
|
return singleRelation;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<TemplateComponent> getGroupedComponents() {
|
public ArrayList<TemplateComponent> getGroupedComponents() {
|
||||||
return groupedComponents;
|
return groupedComponents;
|
||||||
|
|
|
@ -102,7 +102,6 @@ public class D4sRichTextarea extends ReportTextArea {
|
||||||
div.setHTML(area.getHTML());
|
div.setHTML(area.getHTML());
|
||||||
int newHeight = div.getOffsetHeight()+20 ;
|
int newHeight = div.getOffsetHeight()+20 ;
|
||||||
if (newHeight > height-10 && newHeight != currHeight) {
|
if (newHeight > height-10 && newHeight != currHeight) {
|
||||||
presenter.shiftComponentsByTextArea(myInstance.top, newHeight - currHeight);
|
|
||||||
resizePanel(width, div.getOffsetHeight());
|
resizePanel(width, div.getOffsetHeight());
|
||||||
//Window.alert("myInstance.top: " + myInstance.top);
|
//Window.alert("myInstance.top: " + myInstance.top);
|
||||||
presenter.resizeTemplateComponentInModel(myInstance, width, newHeight);
|
presenter.resizeTemplateComponentInModel(myInstance, width, newHeight);
|
||||||
|
@ -123,7 +122,6 @@ public class D4sRichTextarea extends ReportTextArea {
|
||||||
div.setHTML(area.getHTML());
|
div.setHTML(area.getHTML());
|
||||||
int newHeight = div.getOffsetHeight()+20 ;
|
int newHeight = div.getOffsetHeight()+20 ;
|
||||||
if (newHeight > height-10 && newHeight != currHeight) {
|
if (newHeight > height-10 && newHeight != currHeight) {
|
||||||
presenter.shiftComponentsByTextArea(myInstance.top, newHeight - currHeight);
|
|
||||||
resizePanel(myPanel.getOffsetWidth(), div.getOffsetHeight());
|
resizePanel(myPanel.getOffsetWidth(), div.getOffsetHeight());
|
||||||
//Window.alert("myInstance.top: " + myInstance.top);
|
//Window.alert("myInstance.top: " + myInstance.top);
|
||||||
presenter.resizeTemplateComponentInModel(myInstance, myPanel.getOffsetWidth()+5, newHeight);
|
presenter.resizeTemplateComponentInModel(myInstance, myPanel.getOffsetWidth()+5, newHeight);
|
||||||
|
|
|
@ -1556,9 +1556,11 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Model importVMEReport(String id) {
|
public Model importVMEReport(String id, VMETypeIdentifier refType) {
|
||||||
|
ReportsModeler rm = null;
|
||||||
|
if (refType == VMETypeIdentifier.Vme) {
|
||||||
String reportName = "Sample VME Report imported with id: " + id;
|
String reportName = "Sample VME Report imported with id: " + id;
|
||||||
ReportsModeler rm = new ReportsModeler(
|
rm = new ReportsModeler(
|
||||||
UUID.randomUUID().toString(),
|
UUID.randomUUID().toString(),
|
||||||
reportName,
|
reportName,
|
||||||
getASLSession().getUsername(),
|
getASLSession().getUsername(),
|
||||||
|
@ -1585,7 +1587,27 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
||||||
rp.setId(UUID.randomUUID().toString());
|
rp.setId(UUID.randomUUID().toString());
|
||||||
rp.setProperties(new Property("theId", "theValue"));
|
rp.setProperties(new Property("theId", "theValue"));
|
||||||
rm.add(rp);
|
rm.add(rp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
String reportName = refType.getId() + " VME Reference Report with id: " + id;
|
||||||
|
rm = new ReportsModeler(
|
||||||
|
UUID.randomUUID().toString(),
|
||||||
|
reportName,
|
||||||
|
getASLSession().getUsername(),
|
||||||
|
new Date(),
|
||||||
|
new Date(),
|
||||||
|
getASLSession().getUsername()
|
||||||
|
);
|
||||||
|
rm.add(new Title("Test" + refType.getId()));
|
||||||
|
rm.add(new Heading(2, "Year"));
|
||||||
|
rm.add(new TextInput());
|
||||||
|
rm.add(new Heading(2, "Validity Period - Start"));
|
||||||
|
rm.add(new TextInput());
|
||||||
|
rm.add(new Heading(2, "Validity Period - End"));
|
||||||
|
rm.add(new TextInput());
|
||||||
|
rm.add(getTestReference(ReferenceReportType.InformationSource, false));
|
||||||
|
rm.add(new Heading(1, "Ciao!"));
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return rm.getReportInstance();
|
return rm.getReportInstance();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -1594,8 +1616,8 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Model importVMEReportRef(String id, VMETypeIdentifier refType) {
|
public Model getVMEReportRef2Associate(String id, VMETypeIdentifier refType) {
|
||||||
String reportName = "Sample Reference Report: " + id;
|
String reportName = "Sample Reference Report: " + id;
|
||||||
ReportsModeler rm = new ReportsModeler(
|
ReportsModeler rm = new ReportsModeler(
|
||||||
UUID.randomUUID().toString(),
|
UUID.randomUUID().toString(),
|
||||||
|
@ -1623,7 +1645,7 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
||||||
rm.add(new ReferenceReport(ReferenceReportType.InformationSource, dBTableRows));
|
rm.add(new ReferenceReport(ReferenceReportType.InformationSource, dBTableRows));
|
||||||
try {
|
try {
|
||||||
Model toReturn = rm.getReportInstance();
|
Model toReturn = rm.getReportInstance();
|
||||||
ReportsReader.readReportStructure(toReturn);
|
//ReportsReader.readReportStructure(toReturn);
|
||||||
return toReturn;
|
return toReturn;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -1631,6 +1653,7 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private ReportsModeler addSection2(ReportsModeler rm) {
|
private ReportsModeler addSection2(ReportsModeler rm) {
|
||||||
rm.add(new Heading(1, "Specific Measure"));
|
rm.add(new Heading(1, "Specific Measure"));
|
||||||
ReportSequence seq = new ReportSequence(UUID.randomUUID().toString());
|
ReportSequence seq = new ReportSequence(UUID.randomUUID().toString());
|
||||||
|
@ -1640,22 +1663,31 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
||||||
seq.add(new TextInput());
|
seq.add(new TextInput());
|
||||||
seq.add(new Heading(2, "Validity Period - End"));
|
seq.add(new Heading(2, "Validity Period - End"));
|
||||||
seq.add(new TextInput());
|
seq.add(new TextInput());
|
||||||
|
seq.add(getTestReference(ReferenceReportType.InformationSource, true));
|
||||||
|
rm.add(seq);
|
||||||
|
return rm;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* TODO: remove
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private ReferenceReport getTestReference(ReferenceReportType type, boolean single) {
|
||||||
//construct the options (the references)
|
//construct the options (the references)
|
||||||
ArrayList<DBTableRow> dBTableRows = new ArrayList<DBTableRow>();
|
ArrayList<DBTableRow> dBTableRows = new ArrayList<DBTableRow>();
|
||||||
|
|
||||||
ArrayList<Column> md = new ArrayList<Column>();
|
ArrayList<Column> md = new ArrayList<Column>();
|
||||||
|
|
||||||
|
Random generator = new Random();
|
||||||
|
int year = generator.nextInt(15) + 2000;
|
||||||
//construct the references
|
//construct the references
|
||||||
md.add(new Column("Meeting Date", "2009"));
|
md.add(new Column("Meeting Date", ""+year));
|
||||||
md.add(new Column("Report Summary", "Aenean vulputate ac dui eu interdum. Nullam tincidunt hendrerit sollicitudin."));
|
md.add(new Column("Report Summary", "Aenean vulputate ac dui eu interdum. Nullam tincidunt hendrerit sollicitudin."));
|
||||||
md.add(new Column("Committee", "Lorem ipsum dolor sit amet, consectetur adipiscing elit"));
|
md.add(new Column("Committee", "Lorem ipsum dolor sit amet, consectetur adipiscing elit"));
|
||||||
md.add(new Column("URL", "http://archive.nafo.int/open/fc/2012/fcdoc12-01.pdf"));
|
md.add(new Column("URL", "http://archive.nafo.int/open/fc/2012/fcdoc12-01.pdf"));
|
||||||
md.add(new Column("Citation", "(Rossi et Al) adipiscing elit oekfha lfkahjf lakjfha lkfahjf alkjdfh "));
|
md.add(new Column("Citation", "(Rossi et Al) adipiscing elit oekfha lfkahjf lakjfha lkfahjf alkjdfh "));
|
||||||
md.add(new Column("Type", "The type"));
|
md.add(new Column("Type", "The type"));
|
||||||
dBTableRows.add(new DBTableRow("primaryKey", md));
|
dBTableRows.add(new DBTableRow("primaryKey", md));
|
||||||
seq.add(new ReferenceReport(ReferenceReportType.InformationSource, dBTableRows));
|
return new ReferenceReport(type, dBTableRows, single);
|
||||||
rm.add(seq);
|
|
||||||
return rm;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* TODO: remove once you get real names
|
* TODO: remove once you get real names
|
||||||
|
@ -1663,9 +1695,8 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
||||||
*/
|
*/
|
||||||
private static String generateRandomWord() {
|
private static String generateRandomWord() {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
char[] word = new char[random.nextInt(8)+3]; // words of length 3 through 10. (1 and 2 letter words are boring.)
|
char[] word = new char[random.nextInt(7)+5]; // words of length 5 through 12
|
||||||
for(int j = 0; j < word.length; j++)
|
for(int j = 0; j < word.length; j++) {
|
||||||
{
|
|
||||||
word[j] = (char)('a' + random.nextInt(26));
|
word[j] = (char)('a' + random.nextInt(26));
|
||||||
}
|
}
|
||||||
return new String(word);
|
return new String(word);
|
||||||
|
|
Reference in New Issue