Added logs

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@176636 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2019-01-17 14:15:09 +00:00
parent 60f4d47855
commit 043e0cfc66
12 changed files with 118 additions and 105 deletions

View File

@ -22,7 +22,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

17
pom.xml
View File

@ -43,9 +43,10 @@
<configDirectory>config</configDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<!-- Java -->
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- GWT configuration -->
<gwtVersion>2.6.1</gwtVersion>
@ -206,7 +207,7 @@
<artifactId>json</artifactId>
<version>20170516</version>
</dependency>
<!-- Notification -->
<dependency>
<groupId>org.gcube.portal</groupId>
@ -403,7 +404,17 @@
</dependency>
</dependencies>
</plugin>
<!-- Maven Compiler Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -63,8 +63,6 @@ public class StatAlgoImporterController {
private NewCodeEvent newCodeEvent;
private ItemDescription mainCodeItemDescription;
private ItemDescription binaryCodeItemDescription;
public StatAlgoImporterController() {
eventBus = new SimpleEventBus();
@ -260,7 +258,7 @@ public class StatAlgoImporterController {
if (eventType == null) {
return;
}
Log.info("StatAlgoRibbonEvent: " + event);
Log.info("StatAlgoRibbonEvent type: " + event);
switch (eventType) {
case PROJECT_CREATE:
@ -304,10 +302,11 @@ public class StatAlgoImporterController {
public void onSuccess(TextResource r) {
String s = r.getText();
//Window.open(s, "Statistical Algorithms Importer Wiki", "");
// Window.open(s, "Statistical Algorithms Importer Wiki",
// "");
BrowserWindowSupport browserWindowSupport = BrowserWindowSupport.open("", "_blank", "");
browserWindowSupport.setUrl(s);
}
});
} catch (ResourceException e) {
@ -320,43 +319,50 @@ public class StatAlgoImporterController {
}
private void doInputReadyCommand(InputReadyEvent event) {
if (!event.isValidData()) {
if (monitor != null) {
monitor.hide();
if (event != null) {
if (!event.isValidData()) {
if (monitor != null) {
monitor.hide();
}
Log.debug("Input not ready, invalid data.");
Log.debug("InputReadyEvent: " + event);
UtilsGXT3.alert("Attention", event.getError());
} else {
Log.info("Input Ready: " + inputRequestType);
if (inputRequestType == null) {
Log.debug("InputRequestType is null");
return;
}
switch (inputRequestType) {
case Save:
pm.saveProject(event.getInputData(), monitor);
break;
case SoftwareCreate:
pm.softwareCreate(event.getInputData(), monitor);
break;
case NewMainCodeSet:
pm.setNewCode(event.getInputData(), newCodeEvent, monitor);
break;
case MainCodeSet:
pm.setMainCode(event.getInputData(), mainCodeItemDescription);
break;
case BinaryCodeSet:
pm.setBinaryCode(event.getInputData(), binaryCodeItemDescription);
break;
default:
break;
}
}
UtilsGXT3.alert("Attention", event.getError());
return;
} else {
Log.info("Input Ready: "+inputRequestType);
if (inputRequestType == null) {
return;
}
switch (inputRequestType) {
case Save:
pm.saveProject(event.getInputData(), monitor);
break;
case SoftwareCreate:
pm.softwareCreate(event.getInputData(), monitor);
break;
case NewMainCodeSet:
pm.setNewCode(event.getInputData(),newCodeEvent, monitor);
break;
case MainCodeSet:
pm.setMainCode(event.getInputData(), mainCodeItemDescription);
break;
case BinaryCodeSet:
pm.setBinaryCode(event.getInputData(), binaryCodeItemDescription);
break;
default:
break;
}
Log.debug("InputReadyEvent is null");
}
}
private void projectSaveRequest() {
Log.debug("Project Save request");
monitor = new StatAlgoImporterMonitor();
inputRequestType = InputRequestType.Save;
InputRequestEvent inputRequestEvent = new InputRequestEvent();
@ -366,8 +372,8 @@ public class StatAlgoImporterController {
}
private void softwareCreateRequest() {
final ConfirmMessageBox mb = new ConfirmMessageBox("Attention",
Log.debug("SoftwareCreateRequest call");
ConfirmMessageBox mb = new ConfirmMessageBox("Attention",
"The creation of new software will overwrite the possible previous version, moreover"
+ " the compiled software will be notified to the Infrastructure Administrators"
+ " and will be published in the suggested VREs. The source code will not be shared."
@ -376,26 +382,33 @@ public class StatAlgoImporterController {
@Override
public void onDialogHide(DialogHideEvent event) {
Log.debug("DialogHideEvent: "+event);
switch (event.getHideButton()) {
case NO:
break;
case YES:
monitor = new StatAlgoImporterMonitor();
inputRequestType = InputRequestType.SoftwareCreate;
InputRequestEvent inputRequestEvent = new InputRequestEvent();
eventBus.fireEvent(inputRequestEvent);
Log.debug("SoftwareCreateRequest: " + inputRequestEvent);
softwareCreateRetrieveInfo();
break;
default:
break;
}
}
});
mb.setWidth(300);
mb.show();
}
private void softwareCreateRetrieveInfo() {
monitor = new StatAlgoImporterMonitor();
inputRequestType = InputRequestType.SoftwareCreate;
InputRequestEvent inputRequestEvent = new InputRequestEvent();
Log.debug("SoftwareCreateRequest fire: " + inputRequestEvent);
eventBus.fireEvent(inputRequestEvent);
}
private void softwareRepackage() {
pm.softwareRepackage();
@ -420,42 +433,43 @@ public class StatAlgoImporterController {
}
private void doMainCodeSetCommand(MainCodeSetEvent event) {
Log.debug("MainCodeSetEvent: "+event);
ItemDescription mainCodeItemDesc = event.getItemDescription();
if (mainCodeItemDesc != null && mainCodeItemDesc.getId() != null) {
mainCodeItemDescription = mainCodeItemDesc;
inputRequestType = InputRequestType.MainCodeSet;
InputRequestEvent inputRequestEvent = new InputRequestEvent();
eventBus.fireEvent(inputRequestEvent);
Log.debug("ProjectMainCodeSetRequest: " + inputRequestEvent);
eventBus.fireEvent(inputRequestEvent);
}
}
private void doBinaryCodeSetCommand(BinaryCodeSetEvent event) {
Log.debug("BinaryCodeSetEvent: "+event);
ItemDescription binaryCodeItemDesc = event.getItemDescription();
if (binaryCodeItemDesc != null && binaryCodeItemDesc.getId() != null) {
binaryCodeItemDescription = binaryCodeItemDesc;
inputRequestType = InputRequestType.BinaryCodeSet;
InputRequestEvent inputRequestEvent = new InputRequestEvent();
eventBus.fireEvent(inputRequestEvent);
Log.debug("ProjectBinaryCodeSetRequest: " + inputRequestEvent);
eventBus.fireEvent(inputRequestEvent);
}
}
private void doSetNewMainCodeEvent(NewCodeEvent event) {
Log.debug("NewCodeEvent "+event);
monitor = new StatAlgoImporterMonitor();
newCodeEvent = event;
inputRequestType = InputRequestType.NewMainCodeSet;
InputRequestEvent inputRequestEvent = new InputRequestEvent();
eventBus.fireEvent(inputRequestEvent);
Log.debug("ProjectNewMainCodeSetRequest: " + inputRequestEvent);
eventBus.fireEvent(inputRequestEvent);
}
private void doDeleteItemCommand(DeleteItemEvent event) {
ItemDescription itemDescription = event.getItemDescription();
if (itemDescription != null && itemDescription.getId() != null) {

View File

@ -13,22 +13,21 @@ import com.google.gwt.event.shared.HasHandlers;
*
*
*/
public class InputRequestEvent extends
GwtEvent<InputRequestEvent.InputRequestEventHandler> {
public class InputRequestEvent extends GwtEvent<InputRequestEvent.InputRequestEventHandler> {
public static Type<InputRequestEventHandler> TYPE = new Type<InputRequestEventHandler>();
private boolean requested;
public interface InputRequestEventHandler extends EventHandler {
void onInputRequest(InputRequestEvent event);
}
public interface HasInputRequestEventHandler extends HasHandlers {
public HandlerRegistration addInputRequestEventHandler(
InputRequestEventHandler handler);
public HandlerRegistration addInputRequestEventHandler(InputRequestEventHandler handler);
}
public InputRequestEvent() {
requested = true;
}
@Override
@ -41,19 +40,13 @@ public class InputRequestEvent extends
return TYPE;
}
public static Type<InputRequestEventHandler> getType() {
return TYPE;
}
public static void fire(HasHandlers source, InputRequestEvent inputSaveEvent) {
source.fireEvent(inputSaveEvent);
public boolean isRequested() {
return requested;
}
@Override
public String toString() {
return "InputRequestEvent []";
return "InputRequestEvent [requested=" + requested + "]";
}
}

View File

@ -375,7 +375,7 @@ public class ProjectManager {
}
public void softwareCreate(final InputData inputData, final StatAlgoImporterMonitor monitor) {
Log.debug("SoftwareCreate On Server");
StatAlgoImporterServiceAsync.INSTANCE.createSoftware(inputData, new AsyncCallback<Project>() {
@Override
@ -390,14 +390,13 @@ public class ProjectManager {
public void onFailure(Throwable caught) {
monitor.hide();
if (caught instanceof StatAlgoImporterSessionExpiredException) {
Log.error("Session Expired");
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error in create software: " + caught.getLocalizedMessage());
Log.error("Error in create software: " + caught.getLocalizedMessage(),caught);
UtilsGXT3.alert("Error", caught.getLocalizedMessage());
fireProjectStatusExplorerRefreshEvent();
}
caught.printStackTrace();
}
});
@ -727,6 +726,7 @@ public class ProjectManager {
}
private void softwarePublish(final StatAlgoImporterMonitor monitor) {
Log.debug("SoftwarePublish invocation");
if (project != null) {
softwarePublishOnServer(monitor);
@ -740,7 +740,7 @@ public class ProjectManager {
// TODO
private void softwarePublishOnServer(final StatAlgoImporterMonitor monitor) {
Log.info("Software Publish On Server");
Log.info("SoftwarePublish On Server");
StatAlgoImporterServiceAsync.INSTANCE.publishSoftware(new AsyncCallback<String>() {
public void onFailure(Throwable caught) {

View File

@ -420,7 +420,7 @@ public class HomeToolBar {
break;
}
} catch (Exception e) {
Log.error("setUI Error : " + e.getLocalizedMessage());
Log.error("setUI Error : " + e.getLocalizedMessage(),e);
}
}
}

View File

@ -35,6 +35,7 @@ public class ToolsPanel extends ContentPanel {
}
protected void init() {
setId("ToolsPanel");
forceLayoutOnResize = true;
setHeaderVisible(false);
setResize(true);

View File

@ -73,7 +73,7 @@ public class InputVariablePanel extends ContentPanel {
@Override
public void onInputRequest(InputRequestEvent event) {
Log.debug("Catch InputRequestEvent");
Log.debug("InputVariablePanel Catch InputRequestEvent");
manageInputRequestEvents(event);
}

View File

@ -29,7 +29,10 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
public class WorkAreaPanel extends SimpleContainer {
private EventBus eventBus;
private static MainDataPanel mainDataPanel;
private static ToolsPanel toolsPanel;
private static BorderLayoutContainer mainPanelLayout;
public WorkAreaPanel(EventBus eventBus) {
super();
this.eventBus = eventBus;
@ -44,6 +47,7 @@ public class WorkAreaPanel extends SimpleContainer {
}
private void create() {
Log.debug("WorkAreaPanel created");
// addStyleName(StatAlgoImporterResources.INSTANCE.saiStyles().getWorkAreaPanel());
// Image logo = new Image(StatAlgoImporterResources.INSTANCE.saiLogo());
// logo.addStyleName(StatAlgoImporterResources.INSTANCE.saiStyles().getLogo());
@ -113,25 +117,25 @@ public class WorkAreaPanel extends SimpleContainer {
}
private void createBlackBoxArea(Project project) {
ToolsPanel toolsPanel = new ToolsPanel(eventBus);
toolsPanel = new ToolsPanel(eventBus);
clear();
add(toolsPanel);
}
private void createRArea(Project project) {
// Main Panel
BorderLayoutContainer mainPanelLayout = new BorderLayoutContainer();
mainPanelLayout = new BorderLayoutContainer();
// mainPanelLayout.setId("mainPanelLayout");
mainPanelLayout.setBorders(false);
mainPanelLayout.setResize(true);
// Main
final MainDataPanel mainDataPanel = new MainDataPanel(eventBus);
mainDataPanel = new MainDataPanel(eventBus);
MarginData mainData = new MarginData(new Margins(2));
mainPanelLayout.setCenterWidget(mainDataPanel, mainData);
// Right
ToolsPanel toolsPanel = new ToolsPanel(eventBus);
toolsPanel = new ToolsPanel(eventBus);
BorderLayoutData eastData = new BorderLayoutData(500);
eastData.setCollapsible(true);
eastData.setSplit(false);
@ -151,18 +155,18 @@ public class WorkAreaPanel extends SimpleContainer {
private void createBashArea(Project project) {
// Main Panel
BorderLayoutContainer mainPanelLayout = new BorderLayoutContainer();
mainPanelLayout = new BorderLayoutContainer();
// mainPanelLayout.setId("mainPanelLayout");
mainPanelLayout.setBorders(false);
mainPanelLayout.setResize(true);
// Main
final MainDataPanel mainDataPanel = new MainDataPanel(eventBus);
mainDataPanel = new MainDataPanel(eventBus);
MarginData mainData = new MarginData(new Margins(2));
mainPanelLayout.setCenterWidget(mainDataPanel, mainData);
// Right
ToolsPanel toolsPanel = new ToolsPanel(eventBus);
toolsPanel = new ToolsPanel(eventBus);
BorderLayoutData eastData = new BorderLayoutData(500);
eastData.setCollapsible(true);
eastData.setSplit(false);
@ -174,10 +178,9 @@ public class WorkAreaPanel extends SimpleContainer {
mainPanelLayout.setEastWidget(toolsPanel, eastData);
toolsPanel.enable();
toolsPanel.collapse();
clear();
add(mainPanelLayout);
}
private void fireProjectStatusOpenEvent(final Project project) {

View File

@ -772,7 +772,7 @@ public class FilesStorage {
if (folderItem instanceof SharedFolder) {
SharedFolder sharedFolder = (SharedFolder) folderItem;
Metadata metadata = sharedFolder.getUsers();
shared = new ArrayList<>(metadata.getValues().keySet());
shared = new ArrayList<>(metadata.getMap().keySet());
} else {
logger.error("The folder is shared but is not of type SharedFolder: [itemId=" + itemId + "]");
if (folderItem.getOwner() != null && !folderItem.getOwner().isEmpty()) {

View File

@ -22,8 +22,7 @@
<!-- <inherits name="com.google.gwt.logging.Logging" /> -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<!-- Debug CSS style
<set-configuration-property name="CssResource.style"
<!-- Debug CSS style <set-configuration-property name="CssResource.style"
value="pretty" /> -->
<inherits name='org.gcube.portal.clientcontext.GCubeClientContext' />
@ -38,8 +37,8 @@
<!-- inherits GitHub Connector -->
<inherits name="org.gcube.portlets.widgets.githubconnector.githubman" />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.user.statisticalalgorithmsimporter.client.StatAlgoImporter' />
@ -55,19 +54,17 @@
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> -->
<!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> -->
/> -->
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
/> -->
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED"
/> -->

View File

@ -23,9 +23,8 @@
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<!-- Debug CSS style -->
<!--
<set-configuration-property name="CssResource.style"
value="pretty" /> -->
<!-- <set-configuration-property name="CssResource.style" value="pretty"
/> -->
<inherits name='org.gcube.portal.clientcontext.GCubeClientContext' />
<inherits name='edu.ycp.cs.dh.acegwt.acegwt' />
@ -38,9 +37,8 @@
name="org.gcube.portlets.widgets.workspaceuploader.WorkspaceUploader" />
<!-- inherits GitHub Connector -->
<inherits
name="org.gcube.portlets.widgets.githubconnector.githubman" />
<inherits name="org.gcube.portlets.widgets.githubconnector.githubman" />
<!-- Specify the app entry point class. -->
<entry-point
@ -57,19 +55,15 @@
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> -->
<!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> -->
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
/> -->
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED"
/> -->