groupd also repor ref in list reports

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@86888 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-12-12 15:39:48 +00:00
parent 5b66b78810
commit 64b7e8bc40
14 changed files with 177 additions and 152 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/reports-4.6.13-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/reports-4.6.15-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -19,11 +19,6 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
@ -31,5 +26,10 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/reports-4.6.13-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/reports-4.6.15-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -2,6 +2,6 @@
<<<<<<<=.mine
>>>>>>>=.r71295
eclipse.preferences.version=1
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.13-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.15-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -1,4 +1,3 @@
#Wed Feb 06 16:46:46 CET 2013
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="${module}">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -8,10 +7,28 @@
<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>
</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="reports-store-gateway-client-0.0.3-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="gcube-reporting-library-3.4.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-reporting-library/gcube-reporting-library">
<dependent-module archiveName="reports-store-gateway-support-model-0.0.3-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.3-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="reports-store-gateway-web-base-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-web-base/reports-store-gateway-web-base">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="reports-store-gateway-support-compiler-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-compiler/reports-store-gateway-support-compiler">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="reports-store-gateway-support-compiler-bridge-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-compiler-bridge/reports-store-gateway-support-compiler-bridge">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="reports-store-gateway-support-builder-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-builder/reports-store-gateway-support-builder">
<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">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

View File

@ -2,6 +2,6 @@
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="2.4"/>
<installed facet="java" version="1.6"/>
</faceted-project>

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>reports</artifactId>
<packaging>war</packaging>
<version>4.6.13-SNAPSHOT</version>
<version>4.6.15-SNAPSHOT</version>
<name>gCube Reports Manager</name>
<description>
gCube Reports Portlet.

View File

@ -52,7 +52,7 @@ public class Headerbar extends Composite{
private static final String EXPORT_HTML = "Export to HTML";
private static final String EXPORT_FIMES = "Export to FiMES XML";
private static final String EXPORT_XML = "Export to XML";
private static final String IMPORT_VME = "Import VME Report";
private static final String IMPORT_VME = "Open VME Report";
private static final String IMPORT_VME_REF = "Import VME Reference Report";
// private static final String EXPORT_ENCRYPTED_REPORT = "Save an Encrypted Version to Desktop";
@ -134,20 +134,22 @@ public class Headerbar extends Composite{
fileMenu = getFileMenu();
menuBar.addItem(fileMenu);
separator1 = menuBar.addSeparator();
vmeMenu = getVMEMenu();
menuBar.addItem(vmeMenu);
separator3 = menuBar.addSeparator();
viewMenu = getViewMenu();
menuBar.addItem(viewMenu);
// separator2 = menuBar.addSeparator();
// sectionsMenu = getSectionMenu();
// menuBar.addItem(sectionsMenu);
separator3 = menuBar.addSeparator();
biblioMenu = getBiblioMenu();
menuBar.addItem(biblioMenu);
// biblioMenu = getBiblioMenu();
// menuBar.addItem(biblioMenu);
separator4 = menuBar.addSeparator();
exportMenu = getExportsMenu();
menuBar.addItem(exportMenu);
menuBar.addSeparator();
vmeMenu = getVMEMenu();
menuBar.addItem(vmeMenu);
mainLayout.setSize("100%", "24px");
@ -311,7 +313,7 @@ public class Headerbar extends Composite{
MenuBar importMenu = new MenuBar(true);
importMenu.setAnimationEnabled(true);
MenuItem toReturn = new MenuItem("VME Options", importMenu);
MenuItem toReturn = new MenuItem("Edit VME", importMenu);
toReturn.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP);
Command importVMEReport = new Command() {
@ -324,17 +326,43 @@ public class Headerbar extends Composite{
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);
MenuItem item = new MenuItem("Edit VME General Measures", true, new Command() {
public void execute() {
presenter.showVMEReportRefImportDialog(VMETypeIdentifier.GeneralMeasure);
}
}
});
importMenu.addItem(item);
item = new MenuItem("Edit Information Sources", true, new Command() {
public void execute() {
presenter.showVMEReportRefImportDialog(VMETypeIdentifier.InformationSource);
}
});
importMenu.addItem(item);
item = new MenuItem("Edit Fishing footprint", true, new Command() {
public void execute() {
presenter.showVMEReportRefImportDialog(VMETypeIdentifier.FisheryAreasHistory);
}
});
importMenu.addItem(item);
item = new MenuItem("Edit Regional History of VMEs", true, new Command() {
public void execute() {
presenter.showVMEReportRefImportDialog(VMETypeIdentifier.VMEsHistory);
}
});
importMenu.addItem(item);
// item = new MenuItem("Edit Rfmo", true, new Command() {
// public void execute() {
// presenter.showVMEReportRefImportDialog(VMETypeIdentifier.Rfmo);
// }
// });
// importMenu.addItem(item);
importMenu.addSeparator();
MenuItem exportVME = new MenuItem("Export Current to VME-DB", true, importVMEReport);
importMenu.addItem(exportVME);

View File

@ -132,8 +132,8 @@ public class ReportStructurePanel extends ScrollPanel{
break;
}
case INSTRUCTION: {
ImageResource image = FimesReportTreeStructureResources.INSTANCE.instructions();
node = createNodeWidget(image, "Instructions","gwt-label-componentTree");
// ImageResource image = FimesReportTreeStructureResources.INSTANCE.instructions();
// node = createNodeWidget(image, "Instructions","gwt-label-componentTree");
break;
}
case COMMENT: {

View File

@ -31,7 +31,7 @@ import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
public class ImportVMEReportDialog extends Window {
private static final int WIDTH = 600;
private static final int WIDTH = 700;
private static final int HEIGHT = 450;
private ReportServiceAsync reportService = (ReportServiceAsync) GWT.create(ReportService.class);
@ -68,7 +68,7 @@ public class ImportVMEReportDialog extends Window {
return false;
}
};
filter.setEmptyText("Filter by Title");
filter.setEmptyText("Filter by ...");
filter.setWidth("250px");
hp.add(filter);
hp.setPixelSize(250, 20);
@ -78,23 +78,22 @@ public class ImportVMEReportDialog extends Window {
add(hp);
add(mainPanel);
showLoading();
setHeading(getHeading(type, isAssociation));
if (type == VMETypeIdentifier.Vme) {
setHeading("Select the VME");
reportService.listVMEReports(new AsyncCallback<ArrayList<VMEReportBean>>() {
@Override
public void onFailure(Throwable caught) {
mainPanel.unmask();
public void onFailure(Throwable caught) {
mainPanel.unmask();
}
@Override
public void onSuccess(ArrayList<VMEReportBean> reports) {
mainPanel.unmask();
showAvailableReports(reports);
public void onSuccess(ArrayList<VMEReportBean> refReports) {
mainPanel.unmask();
showAvailableReports(refReports, isAssociation);
}
});
}
else {
setHeading("Select the " + type.getId());
});
} else {
reportService.listVMEReportRefByType(type, new AsyncCallback<ArrayList<VMEReportBean>>() {
@Override
public void onFailure(Throwable caught) {
@ -104,113 +103,39 @@ public class ImportVMEReportDialog extends Window {
@Override
public void onSuccess(ArrayList<VMEReportBean> refReports) {
mainPanel.unmask();
showAvailableReferenceReports(refReports, isAssociation);
showAvailableReports(refReports, isAssociation);
}
});
}
}
/**
*
* @param reports
*/
public void showAvailableReferenceReports(List<VMEReportBean> reports, boolean isAssociation) {
ColumnModel cm = null;
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig column = new ColumnConfig();
column.setId("id");
column.setHeader("ID");
column.setHidden(false);
column.setWidth(50);
column.setRowHeader(true);
configs.add(column);
column = new ColumnConfig();
column.setId("name");
column.setHeader("Indentifier");
column.setWidth(150);
configs.add(column);
cm = new ColumnModel(configs);
/**
* load the grid data
*/
ListStore<VMEReportBean> store = new ListStore <VMEReportBean>();
store.add(reports);
filter.bind(store);
filter.setEmptyText("Filter by Identifier");
final Grid<VMEReportBean> grid = new Grid<VMEReportBean>(store, cm);
grid.getElement().getStyle().setBorderWidth(0, Unit.PX);
grid.setAutoExpandColumn("name");
grid.setBorders(false);
grid.setStripeRows(true);
ContentPanel gridPanel = new ContentPanel(new FitLayout());
gridPanel.setHeaderVisible(false);
gridPanel.add(grid);
gridPanel.addButton(new Button("Cancel", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
hide();
}
}));
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(), grid.getSelectionModel().getSelectedItem().getName(), type, true));
}
}));
}
else {
gridPanel.addButton(new Button("Edit Selected", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
hide();
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), grid.getSelectionModel().getSelectedItem().getName(), type, false));
}
}));
}
mainPanel.add(gridPanel);
mainPanel.setLayout(new FitLayout());
mainPanel.layout();
}
/**
* view for collections step
* @param vDesc
*/
public void showAvailableReports(List<VMEReportBean> reports) {
public void showAvailableReports(List<VMEReportBean> reports, boolean isAssociation) {
ColumnModel cm = null;
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig column = new ColumnConfig();
column.setId("rfmo");
column.setHeader("Owner");
column.setWidth(50);
column.setWidth(15);
configs.add(column);
column = new ColumnConfig();
column.setId("name");
column.setHeader("VME Title");
column.setHeader(type == VMETypeIdentifier.Vme ? "VME Title" : "Identifier");
column.setWidth(150);
configs.add(column);
column = new ColumnConfig();
column.setId("id");
column.setHeader("ID");
column.setWidth(30);
column.setWidth(6);
configs.add(column);
cm = new ColumnModel(configs);
@ -220,9 +145,9 @@ public class ImportVMEReportDialog extends Window {
GroupingStore<VMEReportBean> store = new GroupingStore<VMEReportBean>();
store.add(reports);
store.groupBy("rfmo");
filter.setEmptyText(type == VMETypeIdentifier.Vme ? "Filter by Title" : "Filter by Identifier");
filter.bind(store);
final Grid<VMEReportBean> grid = new Grid<VMEReportBean>(store, cm);
@ -251,13 +176,24 @@ public class ImportVMEReportDialog extends Window {
}
}));
gridPanel.addButton(new Button("Import Selected", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
hide();
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), grid.getSelectionModel().getSelectedItem().getName(), VMETypeIdentifier.Vme, false));
}
}));
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(), grid.getSelectionModel().getSelectedItem().getName(), type, true));
}
}));
}
else {
gridPanel.addButton(new Button("Open Selected", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
hide();
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), grid.getSelectionModel().getSelectedItem().getName(), type, false));
}
}));
}
mainPanel.add(gridPanel);
mainPanel.setLayout(new FitLayout());
mainPanel.layout();
@ -268,4 +204,38 @@ public class ImportVMEReportDialog extends Window {
private void showLoading() {
mainPanel.mask("Asking for available Reports, please wait ... ", "loading-indicator");
}
/**
* the heading of the window
* @param type
* @param isAssociation
* @return
*/
private String getHeading(VMETypeIdentifier type, boolean isAssociation) {
String toReturn = "";
switch (type) {
case Vme:
toReturn = "VME";
break;
case FisheryAreasHistory:
toReturn = "fishing foot print";
break;
case VMEsHistory:
toReturn = "regional history";
break;
case InformationSource:
toReturn = "Information Source";
break;
case GeneralMeasure:
toReturn = "General Measure";
break;
case Rfmo:
toReturn = "RFMO";
default:
toReturn = "Unknown Category!";
break;
}
toReturn = isAssociation ? "Associate " + toReturn : "Edit " + toReturn;
return toReturn;
}
}

View File

@ -206,7 +206,7 @@ public class TemplateComponent {
area.addStyleName("readOnlyText");
//area.addStyleName(getStyle(sc.getType()));
area.getElement().getStyle().setMarginTop(5, Unit.PX);
area.setWidth(width+"px");
area.setWidth((width-30)+"px");
String content = (String) sc.getPossibleContent();
area.setText(preserveLineBreaks(content));
this.content = area;

View File

@ -122,7 +122,7 @@ public class ClientReportReference extends Composite implements ClientSequence {
}
if (first.isSelectNewEnabled()) {
first = getMasterSequence(sequence);
first = getRefSequence(p, this, sequence, true, false);
myPanel.clear();
myPanel.add(first);
tupleList.clear();
@ -180,7 +180,7 @@ public class ClientReportReference extends Composite implements ClientSequence {
private SequenceWidget getRefSequence(Presenter p, ClientSequence owner, RepeatableSequence repSequence, boolean notRemovable, boolean isNew) {
SequenceWidget toReturn = new SequenceWidget(p, this, repSequence, notRemovable, isNew);
toReturn.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
toReturn.getElement().getStyle().setBackgroundColor("#FFF");
toReturn.addStyleName("seqWidget-shadow");
toReturn.alignButtonsLeft();
return toReturn;
}

View File

@ -46,7 +46,7 @@ public class SequenceWidget extends Composite {
myPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
myPanel.setStyleName("seqWidget");
int size = repSequence.getGroupedComponents().size();
GWT.log("SequenceWidget Size = " + size);
//GWT.log("SequenceWidget Size = " + size);
for (int j = 0; j < size; j++) {
BasicComponent sComp = repSequence.getGroupedComponents().get(j);
if (j == size-1) {
@ -66,13 +66,14 @@ public class SequenceWidget extends Composite {
}
TemplateComponent toAdd = new TemplateComponent(p.getModel(), sComp, p, false, null);
if (isNew && sComp.getType() == ComponentType.REPORT_REFERENCE ) { //when adding a new Sequence blanks the Ref
GWT.log("E' NOVA");
ClientReportReference cRef = (ClientReportReference) toAdd.getContent();
cRef.clear();
}
add(toAdd);
}
} //end for
initWidget(myPanel);
if (notRemovable) {

View File

@ -1527,7 +1527,8 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
}
Model model = null;
try {
model = new ReportManagerReportBuilder().buildReport(cr, id, name, "unknown author", new Date(), new Date(), "uknown last editor").getReportInstance();
model = new ReportManagerReportBuilder().buildReport(cr);
model.setTemplateName(name);
} catch (ReportBuilderException e) {
e.printStackTrace();
} catch (Exception e) {
@ -1543,7 +1544,7 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
CompiledReport cr = rsgClient.getReferenceReportById(new ReportType(refType.getId()), id);
Model model = null;
try {
model = new ReportManagerReportBuilder().buildReferenceReport(cr, id, "", "unknown author", new Date(), new Date(), "uknown last editor").getReportInstance();
model = new ReportManagerReportBuilder().buildReferenceReport(cr);
} catch (ReportBuilderException e) {
e.printStackTrace();
} catch (Exception e) {

View File

@ -188,8 +188,17 @@
.seqWidget {
margin-top: 10px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.seqWidget-shadow {
background-color: #FFF;
opacity: 0.9;
}
.grouping-inner {
background: url('images/grouping-border.png') repeat-x;
display: block;
@ -540,22 +549,22 @@ tableBorder td {
.heading2 {
background-image: url(images/heading_2.png);
font-size: 15px;
font-size: 14px;
}
.heading2-label {
font-size: 15px;
padding-left: 0px
font-size: 14px;
padding-left: 10px
}
.heading3 {
background-image: url(images/heading_3.png);
font-size: 13px;
font-size: 12px;
}
.heading3-label {
font-size: 13px;
padding-left: 2px;
font-size: 12px;
padding-left: 20px;
}
.heading4 {
@ -565,7 +574,7 @@ tableBorder td {
.heading4-label {
font-size: 11px;
padding-left: 10px;
padding-left: 30px;
}
.heading5 {
@ -575,7 +584,7 @@ tableBorder td {
.heading5-label {
font-size: 10px;
padding-left: 25px;
padding-left: 40px;
}
.simpleText {
@ -589,7 +598,7 @@ tableBorder td {
color: #333;
text-align:justify;
text-justify:inter-word;
padding-left: 5px;
padding-left: 20px;
}