diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..bd73bdb --- /dev/null +++ b/.classpath @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..56536b5 --- /dev/null +++ b/.project @@ -0,0 +1,53 @@ + + + data-miner-manager + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + com.google.gdt.eclipse.core.webAppProjectValidator + + + + + com.google.gwt.eclipse.core.gwtProjectValidator + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + com.google.gwt.eclipse.core.gwtNature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/dataminermanager.launch b/dataminermanager.launch new file mode 100644 index 0000000..4589cb1 --- /dev/null +++ b/dataminermanager.launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/distro/LICENSE b/distro/LICENSE new file mode 100644 index 0000000..2d9616a --- /dev/null +++ b/distro/LICENSE @@ -0,0 +1 @@ +${gcube.license} \ No newline at end of file diff --git a/distro/README b/distro/README new file mode 100644 index 0000000..21a6f3b --- /dev/null +++ b/distro/README @@ -0,0 +1,68 @@ +The gCube System - ${name} +-------------------------------------------------- + +${description} + + +${gcube.description} + +${gcube.funding} + + +Version +-------------------------------------------------- + +${version} (${buildDate}) + +Please see the file named "changelog.xml" in this directory for the release notes. + + +Authors +-------------------------------------------------- + +* Giancarlo Panichi (giancarlo.panichi-AT-isti.cnr.it), + Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" CNR, Pisa IT + + +Maintainers +----------- + +* Giancarlo Panichi (giancarlo.panichi-AT-isti.cnr.it), + Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" CNR, Pisa IT + + +Download information +-------------------------------------------------- + +Source code is available from SVN: + ${scm.url} + +Binaries can be downloaded from the gCube website: + ${gcube.website} + + +Installation +-------------------------------------------------- + +Installation documentation is available on-line in the gCube Wiki: + https://gcube.wiki.gcube-system.org/gcube/Data_Miner_Manager + + +Documentation +-------------------------------------------------- + +Documentation is available on-line in the gCube Wiki: + https://gcube.wiki.gcube-system.org/gcube/Data_Miner_Manager + + +Support +-------------------------------------------------- + +Bugs and support requests can be reported in the gCube issue tracking tool: + ${gcube.issueTracking} + + +Licensing +-------------------------------------------------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. diff --git a/distro/changelog.xml b/distro/changelog.xml new file mode 100644 index 0000000..845b89f --- /dev/null +++ b/distro/changelog.xml @@ -0,0 +1,6 @@ + + + First release + + \ No newline at end of file diff --git a/distro/descriptor.xml b/distro/descriptor.xml new file mode 100644 index 0000000..b468e51 --- /dev/null +++ b/distro/descriptor.xml @@ -0,0 +1,32 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + changelog.xml + profile.xml + + 755 + true + + + + + target/${build.finalName}.${project.packaging} + /${artifactId} + + + + \ No newline at end of file diff --git a/distro/profile.xml b/distro/profile.xml new file mode 100644 index 0000000..6a7af9b --- /dev/null +++ b/distro/profile.xml @@ -0,0 +1,29 @@ + + + + Service + + ${project.description} + PortletsUser + ${project.artifactId} + 1.0.0 + + + ${project.description} + ${project.artifactId} + ${version} + + ${project.groupId} + ${project.artifactId} + ${project.version} + + webapplication + + ${project.build.finalName}.${project.packaging} + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..374d739 --- /dev/null +++ b/pom.xml @@ -0,0 +1,573 @@ + + 4.0.0 + + + + maven-parent + org.gcube.tools + 1.0.0 + + + + org.gcube.portlets.user + data-miner-manager + 1.0.0-SNAPSHOT + war + + data-miner-manager + data-miner-manager offers a unique access to perform data mining and statistical operations on heterogeneous data + + + https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager + + + + + + Giancarlo Panichi + g.panichi@isti.cnr.it + CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" + + architect + developer + + + + + + ${project.build.directory}/${project.build.finalName} + distro + config + + + + 1.7 + + + 2.6.1 + 3.3.2 + 3.1.1 + 2.6.1 + + ${env.KEYS} + + UTF-8 + UTF-8 + + + + + localRun + + + + org.slf4j + slf4j-api + compile + + + org.slf4j + slf4j-log4j12 + runtime + + + + + + org.gcube.contentmanagement + storage-manager-core + runtime + + + org.gcube.contentmanagement + storage-manager-wrapper + runtime + + + + + org.gcube.common + home-library + runtime + + + org.gcube.common + home-library-jcr + runtime + + + org.gcube.common + home-library-model + runtime + + + + org.gcube.common + common-authorization + runtime + + + + org.gcube.common + authorization-client + runtime + + + + + + + + + + + com.google.gwt + gwt-user + ${gwtVersion} + + + + com.google.gwt + gwt-servlet + ${gwtVersion} + + + + + + + + com.sencha.gxt + gxt + ${gxtVersion} + + + + + + javax.portlet + portlet-api + + + org.gcube.applicationsupportlayer + accesslogger + + + + org.gcube.portal + custom-portal-handler + + + + org.gcube.core + common-scope-maps + compile + + + + org.gcube.applicationsupportlayer + aslcore + provided + + + xalan + xalan + + + + + + + + + org.gcube.common + common-authorization + provided + + + + org.gcube.common + authorization-client + provided + + + + + org.gcube.portlets.user + gcube-widgets + + + + + org.gcube.portlets.widgets + session-checker + [0.0.0-SNAPSHOT,1.0.0-SNAPSHOT) + + + + + org.gcube.applicationsupportlayer + aslsocial + + + + + + + + + + + + org.gcube.contentmanagement + storage-manager-core + provided + + + + org.gcube.contentmanagement + storage-manager-wrapper + provided + + + + + org.gcube.resources.discovery + ic-client + + + + + + + + org.n52.wps + 52n-wps-client-lib + 3.2.0 + + + gt-opengis + org.geotools + + + xerces + xercesImpl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.gcube.common + home-library + provided + + + + org.gcube.common + home-library-jcr + provided + + + + org.gcube.common + home-library-model + provided + + + + + + + + + org.gcube.common + csv4j + [1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT) + + + + + + + + org.gcube.portlets.widgets + workspace-explorer + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + + + + + org.gcube.portlets.widgets + workspace-uploader + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + + + + + + com.allen-sauer.gwt.log + gwt-log + ${gwtLogVersion} + + + + org.slf4j + slf4j-api + provided + + + org.slf4j + slf4j-log4j12 + provided + + + + + + + gCubeExternal + gcube-externals + http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-externals/ + + + + n52-releases + 52n Releases + http://52north.org/maven/repo/releases/ + + true + + + true + + + + + + + + + + + + + + + + + org.gcube.distribution + maven-portal-bom + LATEST + pom + import + + + + + + + ${webappDirectory}/WEB-INF/classes + + + src/main/resources + + **/*.* + + + + + + + + + + + org.codehaus.mojo + gwt-maven-plugin + ${gwtVersion} + + + + -Xss512m -Xmx3072m -XX:MaxPermSize=2048m + + + compile + test + + + + + DataMinerManager.html + ${webappDirectory} + org.gcube.portlets.user.dataminermanager.dataminermanager + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + compile + + + + ${webappDirectory} + ${project.build.finalName} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + ${javaVersion} + ${javaVersion} + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2 + + + ${distroDirectory}/descriptor.xml + + + + + servicearchive + install + + single + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/DataMinerManager.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/DataMinerManager.java new file mode 100644 index 0000000..18734ed --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/DataMinerManager.java @@ -0,0 +1,401 @@ +package org.gcube.portlets.user.dataminermanager.client; + +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification; +import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; +import org.gcube.portlets.user.dataminermanager.client.dataspace.DataSpacePanel; +import org.gcube.portlets.user.dataminermanager.client.events.MaskEvent; +import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent; +import org.gcube.portlets.user.dataminermanager.client.experimentArea.ExperimentPanel; +import org.gcube.portlets.user.dataminermanager.client.resources.Resources; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletService; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; +import org.gcube.portlets.user.dataminermanager.shared.Constants; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; +import com.google.gwt.event.dom.client.MouseDownEvent; +import com.google.gwt.event.dom.client.MouseDownHandler; +//import com.google.gwt.event.logical.shared.ResizeEvent; +//import com.google.gwt.event.logical.shared.ResizeHandler; +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Image; +import com.google.gwt.user.client.ui.RootPanel; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer; +import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.Viewport; + +/** + * Entry point classes define onModuleLoad(). + */ +public class DataMinerManager implements EntryPoint { + + public static final Resources resources = GWT.create(Resources.class); + private static final DataMinerPortletServiceAsync dataMinerService = GWT + .create(DataMinerPortletService.class); + private static final String SM_DIV = "contentDiv"; + + private static List operatorsClassifications = null; + + private DataMinerManagerController dataMinerManagerController; + + + private DataSpacePanel dataSpacePanel = new DataSpacePanel(); + // private InputSpacePanel inputSpacePanel = new InputSpacePanel(); + private ExperimentPanel experimentPanel = new ExperimentPanel(); + // private JobsPanel jobsPanel = new JobsPanel(); + + // private VerticalPanel verticalPanel = new VerticalPanel(); + + private SimpleContainer previousPanel; + private SimpleContainer homeMenu; + private SimpleContainer centerPanel; + + /* + * private BorderLayoutData centerPanelData; private LayoutContainer + * dataMinerManagerLayout; + */ + + public enum MenuItem { + DATA_SPACE, EXPERIMENT, COMPUTATIONS + }; + + private Header header; + + // Main Panel + private static BorderLayoutContainer mainPanelLayout; + + /** + * {@inheritDoc} + */ + public void onModuleLoad() { + + /* + * Install an UncaughtExceptionHandler which will produce + * FATAL log messages + */ + Log.setUncaughtExceptionHandler(); + + // use deferred command to catch initialization exceptions in + // onModuleLoad2 + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + public void execute() { + loadMainPanel(); + } + }); + + } + + protected void loadMainPanel() { + // AccountingManagerResources.INSTANCE.accountingManagerCSS().ensureInjected(); + // ScriptInjector.fromString(AccountingManagerResources.INSTANCE.jqueryJs().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject(); + + dataMinerManagerController = new DataMinerManagerController(); + + + + // Layout + mainPanelLayout = new BorderLayoutContainer(); + mainPanelLayout.setId("mainPanelLayout"); + mainPanelLayout.setBorders(false); + mainPanelLayout.setResize(true); + mainPanelLayout.getElement().getStyle().setBackgroundColor("#FFFFFF"); + + // mainPanelLayout.getElement().getStyle().setBackgroundColor("rgb(3, 126, 207)"); + + centerPanel = new SimpleContainer(); + MarginData mainData = new MarginData(new Margins(2)); + mainPanelLayout.setCenterWidget(centerPanel, mainData); + + // Menu + header = new Header() { + + @Override + public void select(MenuItem menuItem) { + if (menuItem == null) + switchTo(homeMenu); + else if (menuItem == MenuItem.EXPERIMENT) + switchTo(experimentPanel); + + else if (menuItem == MenuItem.DATA_SPACE) + switchTo(dataSpacePanel); + + /* + * else if (menuItem == MenuItem.COMPUTATIONS) + * switchTo(jobsPanel); + */ + + } + }; + + BorderLayoutData menuData = new BorderLayoutData(58); + menuData.setMargins(new Margins(5)); + menuData.setCollapsible(false); + menuData.setSplit(false); + + mainPanelLayout.setNorthWidget(header, menuData); + + // Filters + /* + * FiltersPanel filtersPanel=new FiltersPanel(eventBus); + * BorderLayoutData westData = new BorderLayoutData(410); + * westData.setCollapsible(false); westData.setSplit(false); + * westData.setFloatable(false); westData.setCollapseMini(false); + * westData.setMargins(new Margins(2, 7, 2, 7)); + * westData.setCollapseHidden(true); westData.setMaxSize(410); + * westData.setMinSize(410); mainPanelLayout.setWestWidget(filtersPanel, + * westData); filtersPanel.expand(); filtersPanel.enable(); + */ + + homeMenu = createMenuPanel(); + centerPanel.add(homeMenu); + previousPanel = homeMenu; + + bind(mainPanelLayout); + + bindEvents(); + /* + * dataMinerManagerController.setMainPanelLayout(mainPanelLayout); + * dataMinerManagerController.restoreUISession(); + */ + + } + + protected void bind(BorderLayoutContainer mainWidget) { + try { + RootPanel root = RootPanel.get(SM_DIV); + Log.info("Root Panel: " + root); + if (root == null) { + Log.info("Div with id " + SM_DIV + + " not found, starting in dev mode"); + Viewport viewport = new Viewport(); + viewport.setWidget(mainWidget); + viewport.onResize(); + RootPanel.get().add(viewport); + } else { + Log.info("Application div with id " + SM_DIV + + " found, starting in portal mode"); + PortalViewport viewport = new PortalViewport(); + Log.info("Created Viewport"); + viewport.setEnableScroll(false); + viewport.setWidget(mainWidget); + Log.info("Set Widget"); + Log.info("getOffsetWidth(): " + viewport.getOffsetWidth()); + Log.info("getOffsetHeight(): " + viewport.getOffsetHeight()); + viewport.onResize(); + root.add(viewport); + Log.info("Added viewport to root"); + } + } catch (Exception e) { + e.printStackTrace(); + Log.error("Error in attach viewport:" + e.getLocalizedMessage()); + } + } + + /* + * private void updateSize() { RootPanel smDiv = RootPanel.get(SM_DIV); + * + * int topBorder = smDiv.getAbsoluteTop(); int leftBorder = + * smDiv.getAbsoluteLeft(); + * + * int rootHeight = Window.getClientHeight() - topBorder - 4;// - ((footer + * // == // null)?0:(footer.getOffsetHeight()-15)); int rootWidth = + * Window.getClientWidth() - 2 * leftBorder - 5; // - // rightScrollBar; + * + * // + * System.out.println("New Data Miner Manager dimension Width: "+rootWidth + * +"; Height: "+rootHeight); + * + * if (previousPanel == menu) dataMinerManagerLayout.setSize(rootWidth, + * 700); else dataMinerManagerLayout.setSize(rootWidth, rootHeight); } + */ + + /** + * + */ + private void bindEvents() { + EventBusProvider.INSTANCE.addHandler(MaskEvent.getType(), + new MaskEvent.MaskHandler() { + @Override + public void onMask(MaskEvent event) { + if (mainPanelLayout == null) + return; + + String message = event.getMessage(); + if (message == null) + mainPanelLayout.unmask(); + else + mainPanelLayout.mask(message); + + // Constants.maskLoadingStyle); + } + }); + + /* + * EventBusProvider.getInstance().addHandler( + * SessionExpiredEvent.getType(), new + * SessionExpiredEvent.SessionExpiredHandler() { + * + * @Override public void onSessionExpired(SessionExpiredEvent event) { + * Window.alert("The session has expired. Please refresh the page."); } + * }); + */ + + EventBusProvider.INSTANCE.addHandler( + ResubmitComputationEvent.getType(), + new ResubmitComputationEvent.ResubmitComputationHandler() { + @Override + public void onResubmitComputation( + ResubmitComputationEvent event) { + switchTo(experimentPanel); + header.setMenuSelected(MenuItem.EXPERIMENT); + } + }); + } + + /** + * @return + */ + private SimpleContainer createMenuPanel() { + SimpleContainer topLc = new SimpleContainer(); + VerticalLayoutContainer lc = new VerticalLayoutContainer(); + // lc.setSize(640, 400); + lc.addStyleName("smLayoutContainer"); + lc.addStyleName("smMenu"); + + /* + * LayoutContainer itemDataSpace = createMenuItem( + * "Access to the Data Space", + * "The data space contains the set of input and output data sets of the users. It is possible to upload and share tables. Data sources can be chosen from those hosted by the infrastructure. Outputs of the computations can be even saved in this space." + * , resources.inputSpaceIcon(), new Listener() { + * + * @Override public void handleEvent(BaseEvent be) { + * switchTo(dataSpacePanel); + * header.setMenuSelected(MenuItem.DATA_SPACE); } }); + * lc.add(itemDataSpace); + */ + + HorizontalLayoutContainer itemExperiment = createMenuItem( + "Execute an Experiment", + "This section allows to execute or prepare a Niche Modeling experiment. The section is endowed with a list of algorithms for training and executing statistical models for biological applications. Evaluation of the performances is possible by means of several kinds of measurement systems and processes.", + resources.computationIcon(), new MouseDownHandler() { + + @Override + public void onMouseDown(MouseDownEvent event) { + switchTo(experimentPanel); + header.setMenuSelected(MenuItem.EXPERIMENT); + + } + }); + lc.add(itemExperiment); + /* + * LayoutContainer itemJobs = createMenuItem( "Check the Computations", + * "This section allows to check the status of the computation. A list of processes launched by the user is shown along with meta-information. By clicking on the completed jobs it is possible to visualize the data set contents." + * , resources.jobsIcon(), new Listener() { + * + * @Override public void handleEvent(BaseEvent be) { + * switchTo(jobsPanel); header.setMenuSelected(MenuItem.COMPUTATIONS); } + * }); lc.add(itemJobs); + */ + topLc.add(lc); + return topLc; + } + + /** + * + */ + private void switchTo(SimpleContainer lc) { + // boolean updt = (previousPanel != lc && (previousPanel == homeMenu || + // lc == homeMenu)); + + centerPanel.remove(previousPanel); + centerPanel.add(lc); + centerPanel.forceLayout(); + previousPanel = lc; + + /* + * if (updt) updateSize(); + */ + } + + private HorizontalLayoutContainer createMenuItem(String title, + String description, ImageResource imgResource, + MouseDownHandler handle) { + HorizontalLayoutContainer horiz = new HorizontalLayoutContainer(); + horiz.addDomHandler(handle, MouseDownEvent.getType()); + HorizontalLayoutData layoutData = new HorizontalLayoutData(100, 100, + new Margins(5)); + + Image img = new Image(imgResource); + + HTML text = new HTML("" + title + "
" + description); + text.addStyleName("smMenuItemText"); + + horiz.add(text, layoutData); + horiz.add(img, layoutData); + return horiz; + } + + /** + * @return the operatorsClassification + */ + public static List getOperatorsClassifications() { + return operatorsClassifications; + } + + /** + * @param operatorsClassification + * the operatorsClassification to set + */ + public static void setOperatorsClassifications( + List operatorsClassifications) { + DataMinerManager.operatorsClassifications = operatorsClassifications; + } + + public static OperatorsClassification getDefaultOperatorsClassification() { + if (operatorsClassifications == null) + return null; + OperatorsClassification find = null; + for (OperatorsClassification oc : operatorsClassifications) + // Constants.ComputationClassificationName + if (oc.getName().equals(Constants.UserClassificationName)) + find = oc; + return find; + } + + public static OperatorsClassification getOperatorsClassificationByName( + String classificationName) { + if (operatorsClassifications == null) + return null; + OperatorsClassification find = null; + for (OperatorsClassification oc : operatorsClassifications) + if (oc.getName().equals(classificationName)) + find = oc; + return (find == null ? getDefaultOperatorsClassification() : find); + } + + public static DataMinerPortletServiceAsync getService() { + return dataMinerService; + } + + /** + * @return + */ + /* + * public static TabularData getTabularData() { if (tabularData == null) + * tabularData = new TabularData(Constants.TD_DATASOURCE_FACTORY_ID); return + * tabularData; } + */ + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/DataMinerManagerController.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/DataMinerManagerController.java new file mode 100644 index 0000000..34c26a2 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/DataMinerManagerController.java @@ -0,0 +1,145 @@ +package org.gcube.portlets.user.dataminermanager.client; + +import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; +import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent; +import org.gcube.portlets.user.dataminermanager.client.events.SessionExpiredEvent; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; +import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaEventType; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException; +import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo; +import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea; +import org.gcube.portlets.widgets.sessionchecker.client.CheckSession; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.event.shared.EventBus; +import com.google.gwt.user.client.Timer; +import com.google.gwt.user.client.rpc.AsyncCallback; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class DataMinerManagerController { + private EventBus eventBus; + private UserInfo userInfo; + private DataMinerWorkArea dataMinerWorkArea; + + public DataMinerManagerController() { + eventBus = EventBusProvider.INSTANCE; + init(); + } + + public UserInfo getUserInfo() { + return userInfo; + } + + public DataMinerWorkArea getDataMinerWorkArea() { + return dataMinerWorkArea; + } + + private void init() { + callHello(); + checkSession(); + bindToEvents(); + } + + private void checkSession() { + // if you do not need to something when the session expire + CheckSession.getInstance().startPolling(); + } + + private void sessionExpiredShow() { + CheckSession.showLogoutDialog(); + } + + private void sessionExpiredShowDelayed() { + Timer timeoutTimer = new Timer() { + public void run() { + sessionExpiredShow(); + + } + }; + int TIMEOUT = 3; // 3 second timeout + + timeoutTimer.schedule(TIMEOUT * 1000); // timeout is in milliseconds + + } + + private void callHello() { + DataMinerPortletServiceAsync.INSTANCE + .hello(new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Log.info("No valid user found: " + caught.getMessage()); + if (caught instanceof ExpiredSessionServiceException) { + UtilsGXT3.alert("Error", "Expired Session"); + sessionExpiredShowDelayed(); + } else { + UtilsGXT3.alert( + "Error", + "No user found: " + + caught.getLocalizedMessage()); + } + } + + @Override + public void onSuccess(UserInfo result) { + userInfo = result; + Log.info("Hello: " + userInfo.getUsername()); + retrieveDataMinerWorkArea(); + } + + }); + + } + + private void bindToEvents() { + + EventBusProvider.INSTANCE.addHandler(SessionExpiredEvent.TYPE, + new SessionExpiredEvent.SessionExpiredEventHandler() { + + @Override + public void onChange(SessionExpiredEvent event) { + Log.debug("Catch Event SessionExpiredEvent"); + sessionExpiredShow(); + + } + }); + } + + private void retrieveDataMinerWorkArea() { + DataMinerPortletServiceAsync.INSTANCE + .getDataMinerWorkArea(new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Log.info("No valid user found: " + caught.getMessage()); + if (caught instanceof ExpiredSessionServiceException) { + UtilsGXT3.alert("Error", "Expired Session"); + sessionExpiredShowDelayed(); + } else { + UtilsGXT3.alert("Error", + "Error retrieving DataMiner work area info: " + + caught.getLocalizedMessage()); + } + } + + @Override + public void onSuccess(DataMinerWorkArea result) { + Log.debug("DataMinerWorkArea: " + result); + dataMinerWorkArea = result; + DataMinerWorkAreaEvent dataMinerWorkAreaEvent = new DataMinerWorkAreaEvent( + DataMinerWorkAreaEventType.UPDATE, result); + eventBus.fireEvent(dataMinerWorkAreaEvent); + + } + + }); + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/Header.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/Header.java new file mode 100644 index 0000000..0c712c2 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/Header.java @@ -0,0 +1,162 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager.MenuItem; + +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Image; + +/** + * @author ceras + * + */ +public abstract class Header extends HorizontalPanel { + + public abstract void select(MenuItem menuItem); + + Image menuGoBack, menuExperiment; // menuInputSpace, menuComputations; + MenuItem currentSelection = null; + Image currentImageSelection = null; + //private Image menuDataSpace; + + /** + * + */ + public Header() { + super(); + // this.setStyleAttribute("background-color", "#FFFFFF"); + Image logo = new Image(DataMinerManager.resources.logoLittle()); + logo.setAltText("Data Miner Manager"); + logo.setTitle("Data Miner Manager"); + logo.addStyleName("menuImgLogo"); + + menuGoBack = new Image(DataMinerManager.resources.goBack()); + menuGoBack.addStyleName("menuItemImage"); + menuGoBack.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + if (setMenuSelected(null)) + select(null); + } + }); + + /* + menuDataSpace = new Image( + DataMinerManager.resources.menuItemInputspace()); + menuDataSpace.addStyleName("menuItemImage"); + menuDataSpace.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + if (setMenuSelected(MenuItem.DATA_SPACE)) + select(MenuItem.DATA_SPACE); + } + }); + */ + + menuExperiment = new Image( + DataMinerManager.resources.menuItemExperiment()); + menuExperiment.addStyleName("menuItemImage"); + menuExperiment.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + if (setMenuSelected(MenuItem.EXPERIMENT)) + select(MenuItem.EXPERIMENT); + } + }); + + /* + * menuComputations = new Image( + * DataMinerManager.resources.menuItemComputations()); + * menuComputations.addStyleName("menuItemImage"); + * menuComputations.addClickHandler(new ClickHandler() { + * + * @Override public void onClick(ClickEvent event) { if + * (setMenuSelected(MenuItem.COMPUTATIONS)) + * select(MenuItem.COMPUTATIONS); } }); + */ + + this.add(logo); + this.add(menuGoBack); + //this.add(menuDataSpace); + this.add(menuExperiment); + // this.add(menuComputations); + + this.setCellWidth(logo, "100px"); + this.setCellWidth(menuGoBack, "100px"); + //this.setCellWidth(menuDataSpace, "80px"); + this.setCellWidth(menuExperiment, "80px"); + // this.setCellWidth(menuComputations, "80px"); + + menuGoBack.setVisible(false); + //menuDataSpace.setVisible(false); + menuExperiment.setVisible(false); + // menuComputations.setVisible(false); + } + + /** + * @param inputSpace + */ + public boolean setMenuSelected(MenuItem menuItem) { + // return true if the menu was changed + + if (menuItem == currentSelection) + return false; // nothing to change + + if (menuItem == null) { + menuGoBack.setVisible(false); + //menuDataSpace.setVisible(false); + menuExperiment.setVisible(false); + // menuComputations.setVisible(false); + + if (currentSelection == MenuItem.EXPERIMENT) + menuExperiment.removeStyleName("menuItemImage-selected"); + /* + else if (currentSelection == MenuItem.DATA_SPACE) + menuDataSpace.removeStyleName("menuItemImage-selected"); + */ + /* + * else if (currentSelection == MenuItem.COMPUTATIONS) + * menuComputations.removeStyleName("menuItemImage-selected"); + */ + } else { + if (currentSelection == null) { + + menuGoBack.setVisible(true); + //menuDataSpace.setVisible(true); + menuExperiment.setVisible(true); + // menuComputations.setVisible(true); + } + + if (currentSelection == MenuItem.EXPERIMENT) + menuExperiment.removeStyleName("menuItemImage-selected"); + /*else if (currentSelection == MenuItem.DATA_SPACE) + menuDataSpace.removeStyleName("menuItemImage-selected");*/ + + /* + * else if (currentSelection == MenuItem.COMPUTATIONS) + * menuComputations.removeStyleName("menuItemImage-selected"); + */ + + Image imgNew=menuExperiment; + + /* + Image imgNew = (menuItem == MenuItem.DATA_SPACE ? menuDataSpace + : menuExperiment); + */ + /* + * Image imgNew = (menuItem == MenuItem.DATA_SPACE ? menuDataSpace : + * (menuItem == MenuItem.EXPERIMENT ? menuExperiment : + * menuComputations)); + */ + + imgNew.addStyleName("menuItemImage-selected"); + } + + currentSelection = menuItem; + return true; + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/PortalViewport.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/PortalViewport.java new file mode 100644 index 0000000..ce8b7e0 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/PortalViewport.java @@ -0,0 +1,153 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Element; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.user.client.Window; +import com.sencha.gxt.core.client.dom.XDOM; +import com.sencha.gxt.core.client.dom.XElement; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.Viewport.ViewportAppearance; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class PortalViewport extends SimpleContainer { + + protected int rightScrollBarSize = 17; + + protected boolean enableScroll; + + + /** + * Creates a viewport layout container with the default appearance. + */ + public PortalViewport() { + this(GWT. create(ViewportAppearance.class)); + } + + /** + * Creates a viewport layout container with the specified appearance. + * + * @param appearance + * the appearance of the viewport layout container + */ + public PortalViewport(ViewportAppearance appearance) { + super(true); + try { + + SafeHtmlBuilder sb = new SafeHtmlBuilder(); + appearance.render(sb); + XElement element=XDOM.create(sb.toSafeHtml()); + setElement((Element)element); + monitorWindowResize = true; + forceLayoutOnResize = true; + getFocusSupport().setIgnore(false); + resize(); + } catch (Exception e) { + Log.error("PortalViewport: constructor error " + + e.getLocalizedMessage()); + } + } + + /** + * Returns true if window scrolling is enabled. + * + * @return true if window scrolling is enabled + */ + public boolean isEnableScroll() { + return enableScroll; + } + + /** + * Sets whether window scrolling is enabled. + * + * @param enableScroll + * true to enable window scrolling + */ + public void setEnableScroll(boolean enableScroll) { + this.enableScroll = enableScroll; + Window.enableScrolling(enableScroll); + } + + /** + * @return the rightScrollBarSize + */ + public int getRightScrollBarSize() { + return rightScrollBarSize; + } + + /** + * @param rightScrollBarSize + * the rightScrollBarSize to set + */ + public void setRightScrollBarSize(int rightScrollBarSize) { + this.rightScrollBarSize = rightScrollBarSize; + } + + @Override + protected void onAttach() { + super.onAttach(); + setEnableScroll(enableScroll); + resize(); + + } + + protected void resize() { + int viewWidth; + if(enableScroll){ + viewWidth= calculateWidth() - rightScrollBarSize; + } else { + viewWidth = calculateWidth(); + } + + int viewHeight = calculateHeight(); + Log.info("AM resize viewWidth: " + viewWidth + " viewHeight: " + + viewHeight + " clientWidth: " + Window.getClientWidth() + + " clientHeight: " + Window.getClientHeight()); + try { + setPixelSize(viewWidth, viewHeight); + } catch (Exception e) { + Log.error("PortalViewport: error in resize() at setPixelSize " + + e.getLocalizedMessage()); + } + } + + /** + * {@inheritDoc} + */ + @Override + protected void onWindowResize(int width, int height) { + int viewWidth = calculateWidth(); + int viewHeight = calculateHeight(); + Log.trace("AM onWindowResize viewWidth: " + viewWidth + + " viewHeight: " + viewHeight + " clientWidth: " + + Window.getClientWidth() + " clientHeight: " + + Window.getClientHeight()); + setPixelSize(viewWidth, viewHeight); + } + + + + protected int calculateWidth() { + int leftBorder = getAbsoluteLeft(); + Log.info("AM width: " + + String.valueOf(Window.getClientWidth() - 2 * leftBorder)); + return Window.getClientWidth() - 2 * leftBorder; + } + + protected int calculateHeight() { + int topBorder = getAbsoluteTop(); + Log.info("AM height: " + + String.valueOf(Window.getClientHeight() - topBorder - 34)); + return Window.getClientHeight() - topBorder - 34; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ComputationItem.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ComputationItem.java new file mode 100644 index 0000000..001585e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ComputationItem.java @@ -0,0 +1,130 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.io.Serializable; +import java.util.Date; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; + + + + + +public class ComputationItem implements Serializable{ + + private static final long serialVersionUID = 7948340340190844208L; + + // force to implement these objects in javascript + private ComputationId computationId; + + + private String id; + private String name; + private String description; + private String categoryId; + private String operatorId; + private String infrastructure; + private Date creationDate; + private Date endDate; + private ComputationStatus status; + private Resource resource; + private Operator operator; + + + + /** + * + */ + public ComputationItem() { + super(); + } + + public ComputationItem(ComputationId computationId, String name, String description, + String categoryId, String operatorId, String infrastructure, + Date creationDate, Date endDate, + ComputationStatus status, Resource resource) { + super(); + this.computationId=computationId; + this.id=computationId.getId(); + this.name=name; + this.description=description; + this.categoryId=categoryId; + this.operatorId=operatorId; + this.infrastructure=infrastructure; + this.creationDate=creationDate; + this.endDate=endDate; + this.status=status; + this.resource=resource; + } + + public OperatorCategory getOperatorCategory() { + OperatorsClassification classification = DataMinerManager.getDefaultOperatorsClassification(); + if (classification==null) + return null; + else + return classification.getCategoryById(categoryId); + } + + public Operator getOperator() { + if (operator==null) { + OperatorsClassification classification = DataMinerManager.getDefaultOperatorsClassification(); + if (classification!=null) + operator=classification.getOperatorById(operatorId); + } + return operator; + } + + + public ComputationId getComputationId() { + return computationId; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getCategoryId() { + return categoryId; + } + + public String getOperatorId() { + return operatorId; + } + + public String getInfrastructure() { + return infrastructure; + } + + public Date getCreationDate() { + return creationDate; + } + + public Date getEndDate() { + return endDate; + } + + public ComputationStatus getStatus() { + return status; + } + + public Resource getResource() { + return resource; + } + + public void setEndDate(Date endDate) { + this.endDate=endDate; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ComputationStatus.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ComputationStatus.java new file mode 100644 index 0000000..f8f2a8d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ComputationStatus.java @@ -0,0 +1,130 @@ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.io.Serializable; +import java.util.Date; + +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; + + +public class ComputationStatus implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -1943128398882978439L; + + public enum Status{ + PENDING, + RUNNING, + COMPLETE, + FAILED + }; + + + private double percentage; + private Status status; + private Date endDate; + private String message; + private Resource errResource; + + + public ComputationStatus() { + this.status = Status.PENDING; + } + + public ComputationStatus(double percentage) { + super(); + this.percentage = percentage; + this.status = Status.RUNNING; + } + + public ComputationStatus(Status status, double percentage) { + super(); + this.percentage = percentage; + this.status = status; + } + + public double getPercentage() { + return percentage; + } + + public void setPercentage(float percentage) { + this.percentage = percentage; + } + + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + public boolean isComplete() { + return this.status == Status.COMPLETE; + } + + public boolean isFailed() { + return this.status == Status.FAILED; + } + + public boolean isRunning() { + return this.status == Status.RUNNING; + } + + public boolean isPending() { + return this.status == Status.PENDING; + } + + public boolean isTerminated() { + return status==Status.COMPLETE || status==Status.FAILED; + } + + /** + * @param endDate the endDate to set + */ + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + /** + * @return the endDate + */ + public Date getEndDate() { + return endDate; + } + + /** + * @param message the message to set + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * @return the message + */ + public String getMessage() { + return message; + } + + public Resource getErrResource() + { + return errResource; + } + + public void setErrResource(Resource errRes) + { + this.errResource= errRes; + } + + @Override + public String toString() { + return "ComputationStatus [percentage=" + percentage + ", status=" + + status + ", endDate=" + endDate + ", message=" + message + + ", errResource=" + errResource + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/CsvMetadata.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/CsvMetadata.java new file mode 100644 index 0000000..67ed1af --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/CsvMetadata.java @@ -0,0 +1,166 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.io.Serializable; + +/** + * @author ceras + * + */ +public class CsvMetadata implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -6513418575213232121L; + + private boolean hasHeader; + private String fileAbsolutePath, template, tableName, description, delimiterChar, commentChar; + + + public CsvMetadata() { + super(); + } + + + + /** + * @param hasHeader + * @param fileAbsolutePath + * @param tableName + * @param delimiterChar + * @param commentChar + */ + public CsvMetadata(boolean hasHeader, String fileAbsolutePath, String delimiterChar, String commentChar) { + super(); + this.hasHeader = hasHeader; + this.fileAbsolutePath = fileAbsolutePath; + this.delimiterChar = delimiterChar; + this.commentChar = commentChar; + } + + + /** + * @return the hasHeader + */ + public boolean isHasHeader() { + return hasHeader; + } + + + /** + * @param hasHeader the hasHeader to set + */ + public void setHasHeader(boolean hasHeader) { + this.hasHeader = hasHeader; + } + + + /** + * @return the fileAbsolutePath + */ + public String getFileAbsolutePath() { + return fileAbsolutePath; + } + + + /** + * @param fileAbsolutePath the fileAbsolutePath to set + */ + public void setFileAbsolutePath(String fileAbsolutePath) { + this.fileAbsolutePath = fileAbsolutePath; + } + + + /** + * @return the template + */ + public String getTemplate() { + return template; + } + + + /** + * @param template the template to set + */ + public void setTemplate(String template) { + this.template = template; + } + + + /** + * @return the tableName + */ + public String getTableName() { + return tableName; + } + + + /** + * @param tableName the tableName to set + */ + public void setTableName(String tableName) { + this.tableName = tableName; + } + + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + + /** + * @return the delimiterChar + */ + public String getDelimiterChar() { + return delimiterChar; + } + + + /** + * @param delimiterChar the delimiterChar to set + */ + public void setDelimiterChar(String delimiterChar) { + this.delimiterChar = delimiterChar; + } + + + /** + * @return the commentChar + */ + public String getCommentChar() { + return commentChar; + } + + + /** + * @param commentChar the commentChar to set + */ + public void setCommentChar(String commentChar) { + this.commentChar = commentChar; + } + + + /** + * @return the serialversionuid + */ + public static long getSerialversionuid() { + return serialVersionUID; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/FileMetadata.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/FileMetadata.java new file mode 100644 index 0000000..023b1eb --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/FileMetadata.java @@ -0,0 +1,129 @@ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.io.Serializable; + +public class FileMetadata implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + private String fileAbsolutePath, fileTaxaPath,fileVernaculaPath, fileName, description, type; + + + public FileMetadata() { + super(); + } + public FileMetadata( String fileAbsolutePath,String type) { + super(); + this.fileAbsolutePath = fileAbsolutePath; + this.fileTaxaPath=null; + this.fileVernaculaPath=null; + this.type=type; + } + public FileMetadata( String fileAbsolutePath,String fileTaxaPath, String fileVernacularPath,String type) { + super(); + this.fileAbsolutePath = fileAbsolutePath; + this.fileTaxaPath=fileTaxaPath; + this.fileVernaculaPath=fileVernacularPath; + this.type=type; + } + + + + public String getType() + { + return type; + + } + public void setType(String type) + { + this.type=type; + } + + + + + /** + * @return the fileAbsolutePath + */ + public String getTaxaFileAbsolutePath() { + return fileTaxaPath; + } + + + /** + * @param fileAbsolutePath the fileAbsolutePath to set + */ + public void setTaxaFileAbsolutePath(String fileTaxaPath) { + this.fileTaxaPath = fileTaxaPath; + } + + + /** + * @return the fileAbsolutePath + */ + public String getVernacularFileAbsolutePath() { + return fileVernaculaPath; + } + + + /** + * @param fileAbsolutePath the fileAbsolutePath to set + */ + public void setVernacularFileAbsolutePath(String fileVernaculaPath) { + this.fileVernaculaPath = fileVernaculaPath; + } + + + + /** + * @return the fileAbsolutePath + */ + public String getFileAbsolutePath() { + return fileAbsolutePath; + } + + + /** + * @param fileAbsolutePath the fileAbsolutePath to set + */ + public void setFileAbsolutePath(String fileAbsolutePath) { + this.fileAbsolutePath = fileAbsolutePath; + } + + + + + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + + /** + * @return the fileName + */ + public String getFileName() { + return fileName; + } + + + /** + * @param fileName the tableName to set + */ + public void setFileName(String fileName) { + this.fileName = fileName; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ImportStatus.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ImportStatus.java new file mode 100644 index 0000000..c4490ff --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ImportStatus.java @@ -0,0 +1,139 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.io.Serializable; +import java.util.Date; + +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; + + +/** + * @author ceras + * + */ +public class ImportStatus implements Serializable { + /** + * + */ + private static final long serialVersionUID = 190974315819110637L; + Status status; + String id, fileName, resourceId; + Date date; + Resource resource; + + /** + * + */ + public ImportStatus() { + super(); + } + + /** + * @param id + * @param fileName + * @param isCompleted + */ + public ImportStatus(String id, String fileName, Status status, Date date) { + super(); + this.id = id; + this.fileName = fileName; + this.status = status; + this.date = date; + this.resource=new Resource(); + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the fileName + */ + public String getFileName() { + return fileName; + } + + /** + * @param fileName the fileName to set + */ + public void setFileName(String fileName) { + this.fileName = fileName; + } + + /** + * @return the status + */ + public Status getStatus() { + return status; + } + + /** + * @param status the status to set + */ + public void setStatus(Status status) { + this.status = status; + } + + /** + * @return the date + */ + public Date getDate() { + return date; + } + + /** + * @return the resourceId + */ + public String getResourceId() { + return resourceId; + } + + /** + * @param resourceId the resourceId to set + */ + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public void setResource(Resource resource) + { + this.resource=resource; + } + + public Resource getResoruce() + { + return resource; + } + + /** + * @param date the date to set + */ + public void setDate(Date date) { + this.date = date; + } + + public boolean isFailed() { + return this.status == Status.FAILED; + } + + public boolean isComplete() { + return this.status == Status.COMPLETE; + } + + public boolean isTerminated() { + return this.status==Status.COMPLETE || this.status==Status.FAILED; + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/Operator.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/Operator.java new file mode 100644 index 0000000..1f60e37 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/Operator.java @@ -0,0 +1,232 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.shared.StringUtil; + +/** + * @author ceras + * + */ +public class Operator implements Serializable { + + private static final long serialVersionUID = -4084498655645951188L; + private String id; + private String name; + private String briefDescription; + private String description; + private OperatorCategory category; + private List operatorParameters = new ArrayList(); + private boolean hasImage = false; + + /** + * + */ + public Operator() { + super(); + } + + /** + * @param id + * @param briefDescription + * @param description + * @param category + */ + public Operator(String id, String briefDescription, String description, + OperatorCategory category) { + super(); + this.id = id; + if (id != null) + this.name = StringUtil.getCapitalWords(id); + this.briefDescription = briefDescription; + this.description = description; + this.category = category; + } + + /** + * @param id + * @param briefDescription + * @param description + * @param category + * @param hasImage + */ + public Operator(String id, String briefDescription, String description, + OperatorCategory category, boolean hasImage) { + super(); + this.id = id; + if (id != null) + this.name = StringUtil.getCapitalWords(id); + this.briefDescription = briefDescription; + this.description = description; + this.category = category; + this.hasImage = hasImage; + } + + + /** + * @param id + * @param briefDescription + * @param description + * @param category + */ + public Operator(String id, String name, String briefDescription, + String description, OperatorCategory category) { + super(); + this.id = id; + if (name != null) + this.name = StringUtil.getCapitalWords(name); + this.briefDescription = briefDescription; + this.description = description; + this.category = category; + } + + + /** + * @param id + * @param name + * @param briefDescription + * @param description + * @param category + * @param operatorParameters + * @param hasImage + */ + public Operator(String id, String name, String briefDescription, + String description, OperatorCategory category, + List operatorParameters, boolean hasImage) { + super(); + this.id = id; + if (name != null) + this.name = StringUtil.getCapitalWords(name); + this.briefDescription = briefDescription; + this.description = description; + this.category = category; + this.operatorParameters = operatorParameters; + this.hasImage = hasImage; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id + * the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the briefDescription + */ + public String getBriefDescription() { + return briefDescription; + } + + /** + * @param briefDescription + * the briefDescription to set + */ + public void setBriefDescription(String briefDescription) { + this.briefDescription = briefDescription; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description + * the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the category + */ + public OperatorCategory getCategory() { + return category; + } + + /** + * @param category + * the category to set + */ + public void setCategory(OperatorCategory category) { + this.category = category; + } + + /** + * @return the operatorParameters + */ + public List getOperatorParameters() { + return operatorParameters; + } + + /** + * @param operatorParameters + * the operatorParameters to set + */ + public void setOperatorParameters(List operatorParameters) { + this.operatorParameters = operatorParameters; + } + + public void addOperatorParameter(Parameter operatorParameter) { + this.operatorParameters.add(operatorParameter); + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + public boolean hasImage() { + return hasImage; + } + + /** + * @param hasImage + * the hasImage to set + */ + public void setHasImage(boolean hasImage) { + this.hasImage = hasImage; + } + + public Operator clone() { + return new Operator(id, name, briefDescription, description, category, + new ArrayList(operatorParameters), hasImage); + } + + @Override + public String toString() { + return "Operator [id=" + id + ", name=" + name + ", briefDescription=" + + briefDescription + ", description=" + description + +", operatorParameters=" + + operatorParameters + ", hasImage=" + hasImage + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/OperatorCategory.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/OperatorCategory.java new file mode 100644 index 0000000..6537455 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/OperatorCategory.java @@ -0,0 +1,219 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class OperatorCategory implements IsSerializable { + + private String id; + private String name; + private String briefDescription; + private String description; + private List operators = new ArrayList(); + private boolean hasImage = false; + + /** + * + */ + public OperatorCategory() { + super(); + } + + /** + * @param id + * @param briefDescription + * @param description + */ + public OperatorCategory(String id, String briefDescription, String description) { + super(); + this.id = id; + setNameFromId(); + this.briefDescription = briefDescription; + this.description = description; + } + + /** + * @param string + * @param string2 + * @param string3 + * @param b + */ + public OperatorCategory(String id, String briefDescription, String description, boolean hasImage) { + super(); + this.id = id; + setNameFromId(); + this.briefDescription = briefDescription; + this.description = description; + this.hasImage = hasImage; + } + + + /** + * @param id + * @param briefDescription + * @param description + * @param operators + */ + public OperatorCategory(String id, String briefDescription, + String description, List operators) { + super(); + this.id = id; + setNameFromId(); + this.briefDescription = briefDescription; + this.description = description; + this.operators = operators; + } + + + /** + * @param id + * @param briefDescription + * @param description + * @param operators + */ + public OperatorCategory(String id, String name, String briefDescription, + String description, List operators) { + super(); + this.id = id; + this.name = name; + this.briefDescription = briefDescription; + this.description = description; + this.operators = operators; + } + + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the briefDescription + */ + public String getBriefDescription() { + return briefDescription; + } + + /** + * @param briefDescription the briefDescription to set + */ + public void setBriefDescription(String briefDescription) { + this.briefDescription = briefDescription; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the operators + */ + public List getOperators() { + return operators; + } + + /** + * @param operators the operators to set + */ + public void setOperators(List operators) { + this.operators = operators; + } + + public void addOperator(Operator operator) { + this.operators.add(operator); + } + + /** + * + */ + private void setNameFromId() { + if (id!=null) { + String name = ""; + + boolean precUnderscore = true; + for (int i=0; i(operators)); + op.setHasImage(hasImage); + return op; + } + + @Override + public String toString() { + return "OperatorCategory [id=" + id + ", name=" + name + + ", briefDescription=" + briefDescription + ", description=" + + description + ", operators=" + operators + ", hasImage=" + + hasImage + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/OperatorsClassification.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/OperatorsClassification.java new file mode 100644 index 0000000..fb6b3e3 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/OperatorsClassification.java @@ -0,0 +1,117 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class OperatorsClassification implements IsSerializable { + + private String name; + private List operatorCategories = new ArrayList(); + private List operators = new ArrayList(); + + public OperatorsClassification() { + super(); + } + + /** + * + */ + public OperatorsClassification(String name) { + super(); + this.name = name; + } + + /** + * @param operatorCategories + * @param operators + */ + public OperatorsClassification(String name, List operatorCategories, + List operators) { + this(name); + this.operatorCategories = operatorCategories; + this.operators = operators; + } + + /** + * @return the operatorCategories + */ + public List getOperatorCategories() { + return operatorCategories; + } + + /** + * @param operatorCategories the operatorCategories to set + */ + public void setOperatorCategories(List operatorCategories) { + this.operatorCategories = operatorCategories; + } + + /** + * @return the operators + */ + public List getOperators() { + return operators; + } + + /** + * @param operators the operators to set + */ + public void setOperators(List operators) { + this.operators = operators; + } + + public Operator getOperatorById(String id) { + if (id==null) + return null; + Operator operator = null; + for (Operator op: operators) + if (op.getId().contentEquals(id)) { + operator = op; + break; + } + return operator; + } + + public OperatorCategory getCategoryById(String id) { + OperatorCategory category = null; + for (OperatorCategory cat: operatorCategories) + if (cat.getId().contentEquals(id)) { + category = cat; + break; + } + return category; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "OperatorsClassification [name=" + name + + ", operatorCategories=" + operatorCategories + ", operators=" + + operators + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ResourceItem.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ResourceItem.java new file mode 100644 index 0000000..c69048d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/ResourceItem.java @@ -0,0 +1,150 @@ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.io.Serializable; +import java.util.Date; +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; + + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class ResourceItem implements Serializable { + + private static final long serialVersionUID = 2814548224382024267L; + private List columnNames = new ArrayList(); + + private Type type; + private String id; + private String name; + private String description; + private String template; + private Provenance provenance; + private Date creationDate; + private String operatorId; + private String url; + private Operator operator; + + + + public enum Provenance { + IMPORTED, + COMPUTED, + SYSTEM + }; + + public enum Type { + TABLE, + FILE + } + + public ResourceItem() { + super(); + } + + + public ResourceItem(Type type, String id, String name, String description, + String template, Provenance provenance, Date creationDate, + String operatorId, String url) { + this.type=type; + this.id= id; + this.name=name; + this.description=description; + this.template=template; + this.provenance=provenance; + this.creationDate=creationDate; + this.operatorId=operatorId; + this.url=url; + } + + + public void setColumnNames(List columnNames) { + this.columnNames = columnNames; + } + + /** + * @return the columnNames + */ + public List getColumnNames() { + return columnNames; + } + + /** + * @param columnName + */ + public void addColumnName(String columnName) { + this.columnNames.add(columnName); + } + + public Operator getOperator() { + if (operator==null) { + OperatorsClassification classification = DataMinerManager.getDefaultOperatorsClassification(); + if (classification!=null) + operator=classification.getOperatorById(operatorId); + } + return operator; + } + + + + public boolean isFile() { + return type==Type.FILE; + } + + public boolean isTable() { + return type==Type.TABLE; + } + + + public Type getType() { + return type; + } + + + public String getId() { + return id; + } + + + public String getName() { + return name; + } + + + public String getDescription() { + return description; + } + + + public String getTemplate() { + return template; + } + + + public Provenance getProvenance() { + return provenance; + } + + + public Date getCreationDate() { + return creationDate; + } + + + public String getOperatorId() { + return operatorId; + } + + + public String getUrl() { + return url; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/TemplateDescriptor.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/TemplateDescriptor.java new file mode 100644 index 0000000..b4bca35 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/TemplateDescriptor.java @@ -0,0 +1,116 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean; + +import java.util.HashMap; +import java.util.Map; + + +/** + * @author ceras + * + */ +public class TemplateDescriptor { + + public static TemplateDescriptor descriptors[] = { + new TemplateDescriptor("HCAF", "HCAF Data Set", ""), + new TemplateDescriptor("OCCURRENCE_SPECIES", "Occurrence Species Data Set", ""), + new TemplateDescriptor("OCCURRENCE_AQUAMAPS", "Occurrence Aquamaps", ""), + new TemplateDescriptor("HSPEN", "HSPEN Data Set", ""), + new TemplateDescriptor("HSPEC", "HSPEC Data Set", ""), + new TemplateDescriptor("CLUSTER", "Cluster Data Set", ""), + new TemplateDescriptor("TRAININGSET", "Neural Network Training Set", ""), + new TemplateDescriptor("TESTSET", "Neural Network Test Set", ""), + new TemplateDescriptor("GENERIC", "Generic Data set", ""), + new TemplateDescriptor("MINMAXLAT", "Min Max Lat Data Set", ""), + new TemplateDescriptor("TIMESERIES", "time Series Data Set", ""), + }; + + public static String[] s = new String[]{""}; + public static Map map; + static { + map = new HashMap(); + map.put("HCAF", new String[][]{ + {"csquarecode", "string"}, + {"depthmin", "real"}, + {"depthmax", "real"}, + {"depthmean", "real"}, + {"depthsd", "real"}, + {"sstanmean", "real"}, + {"sstansd", "real"}, + {"sstmnmax", "real"}, + {"sstmnmin", "real"}, + {"sstmnrange", "real"}, + {"sbtanmean", "real"}, + {"salinitymean", "real"}, + {"salinitysd", "real"}, + {"salinitymax", "real"}, + {"salinitymin", "real"}, + {"salinitybmean", "real"}, + {"primprodmean", "integer"}, + {"iceconann", "real"}, + {"iceconspr", "real"}, + {"iceconsum", "real"}, + {"iceconfal", "real"}, + {"iceconwin", "real"}, + {"faoaream", "integer"}, + {"eezall", "string"}, + {"lme", "integer"}, + {"landdist", "integer"}, + {"oceanarea", "real"}, + {"centerlat", "real"}, + {"centerlong", "real"}, + }); + } + public static TemplateDescriptor defaultDescriptor = descriptors[0]; + + // public enum Template { + // HCAF, + // OCCURRENCE_SPECIES, + // OCCURRENCE_AQUAMAPS, + // HSPEN, + // HSPEC, + // CLUSTER, + // TRAININGSET, + // TESTSET, + // GENERIC, + // MINMAXLAT, + // TIMESERIES, + // } + + + private String id, title, description; + + /** + * @param title + * @param description + */ + public TemplateDescriptor(String id, String title, String description) { + super(); + this.id = id; + this.title = title; + this.description = description; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the name + */ + public String getTitle() { + return title; + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ErrorResource.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ErrorResource.java new file mode 100644 index 0000000..e70dc30 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ErrorResource.java @@ -0,0 +1,48 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.output; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ErrorResource extends Resource implements Serializable { + + private static final long serialVersionUID = -5452797429958563962L; + private String stackTrace; + + public ErrorResource() { + super(); + this.setResourceType(ResourceType.ERROR); + } + + public ErrorResource(String stackTrace) { + super(); + this.stackTrace = stackTrace; + this.setResourceType(ResourceType.ERROR); + } + + public String getStackTrace() { + return stackTrace; + } + + public void setStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + } + + @Override + public String toString() { + return "ErrorResource [getResourceId()=" + getResourceId() + + ", getDescription()=" + getDescription() + ", getName()=" + + getName() + ", getResourceType()=" + getResourceType() + + ", stackTrace=" + stackTrace + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/FileResource.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/FileResource.java new file mode 100644 index 0000000..8fa87e1 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/FileResource.java @@ -0,0 +1,84 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.output; + +import java.io.Serializable; + +/** + * @author ceras + * + */ +public class FileResource extends Resource implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 799627064179136509L; + + private String url; + private String mimeType; + + /** + * + */ + public FileResource() { + super(); + this.setResourceType(ResourceType.FILE); + } + + /** + * + * @param resourceId + * @param name + * @param description + * @param url + * @param mimeType + */ + public FileResource(String resourceId, String name, String description, + String url, String mimeType) { + super(resourceId, name, description, ResourceType.FILE); + this.url=url; + this.mimeType =mimeType; + } + + /** + * @return the url + */ + public String getUrl() { + return url; + } + + /** + * @param url the url to set + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * @return the mimeType + */ + public String getMimeType() { + return mimeType; + } + + /** + * @param mimeType the mimeType to set + */ + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + @Override + public String toString() { + return "FileResource [url=" + url + ", mimeType=" + mimeType + + ", getResourceId()=" + getResourceId() + ", getName()=" + + getName() + ", getDescription()=" + getDescription() + + ", getResourceType()=" + getResourceType() + "]"; + } + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ImagesResource.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ImagesResource.java new file mode 100644 index 0000000..eaa431f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ImagesResource.java @@ -0,0 +1,75 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.output; + +import java.io.Serializable; + +/** + * @author ceras + * + */ +public class ImagesResource extends Resource implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 8772836076910728324L; + private String link; + private String mimeType; + + /** + * + */ + public ImagesResource() { + super(); + this.setResourceType(ResourceType.IMAGES); + } + + /** + * + * @param resourceId + * @param name + * @param description + * @param link + */ + public ImagesResource(String resourceId, String name, String description, + String link, String mimeType) { + super(resourceId, name, description, ResourceType.IMAGES); + this.link = link; + this.mimeType = mimeType; + } + + /** + * + * @return link + */ + public String getLink() { + return link; + } + + /** + * + * @param link + */ + public void setLink(String link) { + this.link = link; + } + + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + @Override + public String toString() { + return "ImagesResource [link=" + link + ", mimeType=" + mimeType + + ", getResourceId()=" + getResourceId() + ", getName()=" + + getName() + ", getDescription()=" + getDescription() + + ", getResourceType()=" + getResourceType() + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/MapResource.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/MapResource.java new file mode 100644 index 0000000..acc8f1d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/MapResource.java @@ -0,0 +1,51 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.output; + +import java.io.Serializable; +import java.util.Map; + +/** + * @author ceras + * + */ +public class MapResource extends Resource implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 8772836076910728324L; + private Map map; + + /** + * + */ + public MapResource() { + super(); + this.setResourceType(ResourceType.MAP); + } + + public MapResource(String resourceId, String name, String description, + Map map) { + super(resourceId, name, description, ResourceType.MAP); + this.map = map; + } + + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + @Override + public String toString() { + return "MapResource [map=" + map + ", getResourceId()=" + + getResourceId() + ", getName()=" + getName() + + ", getDescription()=" + getDescription() + + ", getResourceType()=" + getResourceType() + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ObjectResource.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ObjectResource.java new file mode 100644 index 0000000..273299c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/ObjectResource.java @@ -0,0 +1,60 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.output; + +import java.io.Serializable; + +/** + * @author ceras + * + */ +public class ObjectResource extends Resource implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 8772836076910728324L; + private String value; + + /** + * + */ + public ObjectResource() { + super(); + this.setResourceType(ResourceType.OBJECT); + } + + /** + * + */ + public ObjectResource(String resourceId, String name, String description, + String value) { + super(resourceId, name, description, ResourceType.OBJECT); + this.value = value; + } + + /** + * @return the url + */ + public String getValue() { + return value; + } + + /** + * @param url + * the url to set + */ + public void setValue(String value) { + this.value = value; + } + + @Override + public String toString() { + return "ObjectResource [value=" + value + ", getResourceId()=" + + getResourceId() + ", getName()=" + getName() + + ", getDescription()=" + getDescription() + + ", getResourceType()=" + getResourceType() + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/Resource.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/Resource.java new file mode 100644 index 0000000..d85cc66 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/Resource.java @@ -0,0 +1,140 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.output; + +import java.io.Serializable; + +/** + * @author ceras + * + */ +public class Resource implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1417885805472591661L; + + public enum ResourceType { + OBJECT, FILE, TABULAR, MAP, IMAGES, ERROR + }; + + private String resourceId, name, description; + private ResourceType resourceType; + + /** + * + */ + public Resource() { + super(); + } + + /** + * + * @param resourceId + * @param name + * @param description + * @param resourceType + */ + public Resource(String resourceId, String name, String description, + ResourceType resourceType) { + super(); + this.resourceId = resourceId; + this.name = name; + this.description = description; + this.resourceType = resourceType; + } + + /** + * @return the resourceId + */ + public String getResourceId() { + return resourceId; + } + + /** + * @param resourceId + * the resourceId to set + */ + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description + * the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the resourceType + */ + public ResourceType getResourceType() { + return resourceType; + } + + /** + * @param resourceType + * the resourceType to set + */ + public void setResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + } + + public boolean isTabular() { + return this.resourceType == ResourceType.TABULAR; + } + + public boolean isObject() { + return this.resourceType == ResourceType.OBJECT; + } + + public boolean isFile() { + return this.resourceType == ResourceType.FILE; + } + + public boolean isMap() { + return this.resourceType == ResourceType.MAP; + } + + public boolean isImages() { + return this.resourceType == ResourceType.IMAGES; + } + + public boolean isError() { + return this.resourceType == ResourceType.ERROR; + } + + @Override + public String toString() { + return "Resource [resourceId=" + resourceId + ", name=" + name + + ", description=" + description + ", resourceType=" + + resourceType + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/TableResource.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/TableResource.java new file mode 100644 index 0000000..5c4d8e4 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/output/TableResource.java @@ -0,0 +1,52 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.output; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class TableResource extends Resource implements IsSerializable { + + private static final long serialVersionUID = -1506902532089828988L; + private String template; + + public TableResource() { + super(); + this.setResourceType(ResourceType.TABULAR); + } + + public TableResource(String resourceId, String name, String description, String template) { + super(resourceId, name, description, ResourceType.TABULAR); + this.template = template; + } + + /** + * @return the template + */ + public String getTemplate() { + return template; + } + + /** + * @param template + * the template to set + */ + public void setTemplate(String template) { + this.template = template; + } + + @Override + public String toString() { + return "TableResource [template=" + template + ", getResourceId()=" + + getResourceId() + ", getName()=" + getName() + + ", getDescription()=" + getDescription() + + ", getResourceType()=" + getResourceType() + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ColumnListParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ColumnListParameter.java new file mode 100644 index 0000000..8711d73 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ColumnListParameter.java @@ -0,0 +1,68 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * @author ceras + * + */ +public class ColumnListParameter extends Parameter implements Serializable { + + private static final long serialVersionUID = -6743494426144267089L; + String referredTabularParameterName; + List columnNames = new ArrayList(); + String value; + private String separator; + + public ColumnListParameter() { + super(); + this.typology = ParameterTypology.COLUMN_LIST; + } + + public ColumnListParameter(String name, String description, String referredTabularParameterName, String separator) { + super(name, ParameterTypology.COLUMN_LIST, description); + this.referredTabularParameterName = referredTabularParameterName; + this.separator = separator; + } + + /** + * @param referredTabularParameterName the referredTabularParameterName to set + */ + public void setReferredTabularParameterName(String referredTabularParameterName) { + this.referredTabularParameterName = referredTabularParameterName; + } + + /** + * @return the referredTabularParameterName + */ + public String getReferredTabularParameterName() { + return referredTabularParameterName; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + + /** + * @return the separator + */ + public String getSeparator() { + return separator; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ColumnParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ColumnParameter.java new file mode 100644 index 0000000..ba6f876 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ColumnParameter.java @@ -0,0 +1,82 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import java.io.Serializable; + + +/** + * @author ceras + * + */ +public class ColumnParameter extends Parameter implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -5084557326770554659L; + String referredTabularParameterName; + String defaultColumn; + String value; + + /** + * + */ + public ColumnParameter() { + super(); + this.typology = ParameterTypology.COLUMN; + } + + /** + * + */ + public ColumnParameter(String name, String description, String referredTabularParameterName, String defaultColumn) { + super(name, ParameterTypology.COLUMN, description); + this.referredTabularParameterName = referredTabularParameterName; + this.defaultColumn = defaultColumn; + } + + /** + * @param referredTabularParameterName the referredTabularParameterName to set + */ + public void setReferredTabularParameterName( + String referredTabularParameterName) { + this.referredTabularParameterName = referredTabularParameterName; + } + + /** + * @return the referredTabularParameterName + */ + public String getReferredTabularParameterName() { + return referredTabularParameterName; + } + + /** + * @return the defaultValue + */ + public String getDefaultColumn() { + return defaultColumn; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefaultColumn(String defaultColumn) { + this.defaultColumn = defaultColumn; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/EnumParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/EnumParameter.java new file mode 100644 index 0000000..6ec786c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/EnumParameter.java @@ -0,0 +1,89 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class EnumParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = 1673874854501249519L; + List values = new ArrayList(); + String defaultValue; + String value; + + + /** + * + */ + public EnumParameter() { + super(); + this.typology = ParameterTypology.ENUM; + } + + /** + * @param type + * @param defaultValue + * @param value + */ + public EnumParameter(String name, String description, List values, String defaultValue) { + super(name, ParameterTypology.ENUM, description); + this.values = values; + this.defaultValue = defaultValue; + } + + + /** + * @return the defaultValue + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * @param values the values to set + */ + public void setValues(List values) { + this.values = values; + } + + /** + * @return the values + */ + public List getValues() { + return values; + } + + public void addValue(String value) { + this.values.add(value); + } + + /** + * @return the value + */ + @Override + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/FileParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/FileParameter.java new file mode 100644 index 0000000..ea7cf97 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/FileParameter.java @@ -0,0 +1,71 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class FileParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = -2967577990287112937L; + private String mimeType; + private String value; + + /** + * + */ + public FileParameter() { + super(); + this.typology = ParameterTypology.FILE; + } + + /** + * + * @param name + * @param description + * @param fileName + * @param mimeType + */ + public FileParameter(String name, String description, String mimeType) { + super(name, ParameterTypology.FILE, description); + this.mimeType = mimeType; + } + + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + + + /** + * + */ + public String getValue() { + return value; + } + + /** + * + */ + @Override + public void setValue(String value) { + this.value=value; + } + + @Override + public String toString() { + return "FileParameter [mimeType=" + mimeType + ", value=" + value + + ", name=" + name + ", description=" + description + + ", typology=" + typology + "]"; + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ListParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ListParameter.java new file mode 100644 index 0000000..b8b5609 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ListParameter.java @@ -0,0 +1,81 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import com.google.gwt.user.client.rpc.IsSerializable; + + +/** + * @author ceras + * + */ +public class ListParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = 5405965026753332225L; + private String type; + private String value; + private String separator; + + /** + * + */ + public ListParameter() { + super(); + this.typology = ParameterTypology.LIST; + } + + /** + * @param defaultValue + * @param value + */ + public ListParameter(String name, String description, String type, String separator) { + super(name, ParameterTypology.LIST, description); + this.type = type; + this.separator = separator; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + + + @Override + public String getValue() { + return value; + } + + /** + * @return the separator + */ + public String getSeparator() { + return separator; + } + + @Override + public String toString() { + return "ListParameter [type=" + type + ", value=" + value + + ", separator=" + separator + ", name=" + name + + ", description=" + description + ", typology=" + typology + + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ObjectParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ObjectParameter.java new file mode 100644 index 0000000..eb46ee1 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/ObjectParameter.java @@ -0,0 +1,88 @@ + +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class ObjectParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = 1058462575242430851L; + private String type; + private String defaultValue; + private String value; + + + /** + * + */ + public ObjectParameter() { + super(); + this.typology = ParameterTypology.OBJECT; + } + + + public ObjectParameter(String name, String description, String type, String defaultValue) { + super(name, ParameterTypology.OBJECT, description); + this.type = type; + this.defaultValue = defaultValue; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the defaultValue + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + + + @Override + public String toString() { + return "ObjectParameter [type=" + type + ", defaultValue=" + + defaultValue + ", value=" + value + ", name=" + name + + ", description=" + description + ", typology=" + typology + + "]"; + } + + + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/Parameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/Parameter.java new file mode 100644 index 0000000..a2b8737 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/Parameter.java @@ -0,0 +1,135 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import java.io.Serializable; + + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public abstract class Parameter implements Serializable { + + + /** + * + */ + private static final long serialVersionUID = -555286289487491703L; + public enum ParameterTypology {OBJECT, TABULAR, FILE, ENUM, LIST, COLUMN, COLUMN_LIST, TABULAR_LIST}; + + String name; + String description; + ParameterTypology typology; + + /** + * + */ + public Parameter() { + super(); + } + + /** + * @param name + * @param type + * @param description + * @param defaultValue + * @param value + */ + public Parameter(String name, ParameterTypology type, String description) { + super(); + this.name = name; + this.typology = type; + this.description = description; + } + + public abstract void setValue(String value); + + public abstract String getValue(); + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the typology + */ + public ParameterTypology getTypology() { + return typology; + } + + /** + * @param typology the typology to set + */ + public void setTypology(ParameterTypology typology) { + this.typology = typology; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + public boolean isObject() { + return this.typology == ParameterTypology.OBJECT; + } + + public boolean isTabular() { + return this.typology == ParameterTypology.TABULAR; + } + + public boolean isFile() { + return this.typology == ParameterTypology.FILE; + } + + public boolean isEnum() { + return this.typology == ParameterTypology.ENUM; + } + + public boolean isList() { + return this.typology == ParameterTypology.LIST; + } + + public boolean isColumn() { + return this.typology == ParameterTypology.COLUMN; + } + + public boolean isColumnList() { + return this.typology == ParameterTypology.COLUMN_LIST; + } + + public boolean isTabularList() { + return this.typology == ParameterTypology.TABULAR_LIST; + } + + @Override + public String toString() { + return "Parameter [name=" + name + ", description=" + description + + ", typology=" + typology + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/TabularListParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/TabularListParameter.java new file mode 100644 index 0000000..036447d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/TabularListParameter.java @@ -0,0 +1,85 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import java.io.Serializable; +import java.util.ArrayList; + + +/** + * @author ceras + * + */ +public class TabularListParameter extends Parameter implements Serializable { + + private static final long serialVersionUID = -1786477950530892502L; + private String value; + private String separator; + private ArrayList templates = new ArrayList(); + //private List tableNames = new ArrayList(); + + + public TabularListParameter() { + super(); + this.typology = ParameterTypology.TABULAR_LIST; + } + + /** + * @param defaultValue + * @param value + */ + public TabularListParameter(String name, String description, String separator) { + super(name, ParameterTypology.TABULAR_LIST, description); + this.separator = separator; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + + + @Override + public String getValue() { + return value; + } + + /** + * @return the separator + */ + public String getSeparator() { + return separator; + } + + /** + * @param templates the templates to set + */ + public void setTemplates(ArrayList templates) { + this.templates = templates; + } + + /** + * @return the templates + */ + public ArrayList getTemplates() { + return templates; + } + + public void addTemplate(String template) { + templates.add(template); + } + + @Override + public String toString() { + return "TabularListParameter [value=" + value + ", separator=" + + separator + ", templates=" + templates + ", name=" + name + + ", description=" + description + ", typology=" + typology + + "]"; + } + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/TabularParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/TabularParameter.java new file mode 100644 index 0000000..4ca8990 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/bean/parameters/TabularParameter.java @@ -0,0 +1,87 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.bean.parameters; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * @author ceras + * + */ +public class TabularParameter extends Parameter implements Serializable { + + private static final long serialVersionUID = 8038591467145151553L; + private String tableName; + private ArrayList templates = new ArrayList(); + + /** + * + */ + public TabularParameter() { + super(); + this.typology = ParameterTypology.TABULAR; + } + + + /** + * + * @param name + * @param description + * @param tableName + */ + public TabularParameter(String name, String description, String tableName) { + super(name, ParameterTypology.TABULAR, description); + this.tableName = tableName; + this.templates = null; + } + + /** + * + * @param name + * @param description + * @param tableName + * @param templates + */ + public TabularParameter(String name, String description, String tableName, + ArrayList templates) { + super(name, ParameterTypology.TABULAR, description); + this.tableName = tableName; + this.templates = templates; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public ArrayList getTemplates() { + return templates; + } + + public void setTemplates(ArrayList templates) { + this.templates = templates; + } + + @Override + public String getValue() { + return getTableName(); + } + + @Override + public void setValue(String value) { + this.setTableName(value); + } + + @Override + public String toString() { + return "TabularParameter [tableName=" + tableName + ", templates=" + + templates + ", name=" + name + ", description=" + description + + ", typology=" + typology + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/common/EventBusProvider.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/common/EventBusProvider.java new file mode 100644 index 0000000..45987f8 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/common/EventBusProvider.java @@ -0,0 +1,19 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.common; + +import com.google.gwt.event.shared.EventBus; +import com.google.gwt.event.shared.SimpleEventBus; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class EventBusProvider { + + public static final EventBus INSTANCE = new SimpleEventBus(); + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/custom/Gxt2ZIndexXDOM.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/custom/Gxt2ZIndexXDOM.java new file mode 100644 index 0000000..b202c00 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/custom/Gxt2ZIndexXDOM.java @@ -0,0 +1,21 @@ +package org.gcube.portlets.user.dataminermanager.client.custom; + +/** + * Fix for z-index bug between GXT3 and GXT2 + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public class Gxt2ZIndexXDOM extends + com.sencha.gxt.core.client.dom.XDOM.XDOMImpl { + + /* + public int getTopZIndex() { + return com.extjs.gxt.ui.client.core.XDOM.getTopZIndex(); + } + + public int getTopZIndex(int i) { + return com.extjs.gxt.ui.client.core.XDOM.getTopZIndex(i); + }*/ +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/ComputedDataPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/ComputedDataPanel.java new file mode 100644 index 0000000..cc5f300 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/ComputedDataPanel.java @@ -0,0 +1,19 @@ +package org.gcube.portlets.user.dataminermanager.client.dataspace; + +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class ComputedDataPanel extends SimpleContainer{ + + public ComputedDataPanel() { + HTML html=new HTML("Ciao"); + add(html); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/DataSpacePanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/DataSpacePanel.java new file mode 100644 index 0000000..f378a37 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/DataSpacePanel.java @@ -0,0 +1,27 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.dataspace; + +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; + + +public class DataSpacePanel extends SimpleContainer { + + /** + * + */ + public DataSpacePanel() { + super(); + VerticalLayoutContainer v=new VerticalLayoutContainer(); + ImportedDataPanel importedDataPanel=new ImportedDataPanel(); + ComputedDataPanel computedDataPanel=new ComputedDataPanel(); + v.add(importedDataPanel,new VerticalLayoutData(1, 0.5, new Margins(0))); + v.add(computedDataPanel,new VerticalLayoutData(1, 0.5, new Margins(0))); + add(v); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/ImportedDataPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/ImportedDataPanel.java new file mode 100644 index 0000000..d80159d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/dataspace/ImportedDataPanel.java @@ -0,0 +1,354 @@ +package org.gcube.portlets.user.dataminermanager.client.dataspace; + +import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; +import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent; +import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemEvent; +import org.gcube.portlets.user.dataminermanager.client.events.SessionExpiredEvent; +import org.gcube.portlets.user.dataminermanager.client.events.UIStateEvent; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription; +import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener; +import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload.UPLOAD_TYPE; +import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload; +import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel; +import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale; +import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign; +import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.toolbar.ToolBar; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ImportedDataPanel extends ContentPanel { + + private Item selectedItem; + private MultipleDNDUpload dnd; + private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel; + private TextButton btnOpen; + private TextButton btnDelete; + private TextButton btnReload; + private VerticalLayoutContainer v; + + public ImportedDataPanel() { + super(); + Log.debug("ImportedDataPanel"); + + // msgs = GWT.create(ServiceCategoryMessages.class); + init(); + bindToEvents(); + + } + + private void init() { + setId("ImportedDataPanel"); + forceLayoutOnResize = true; + setBodyBorder(true); + setBorders(true); + setHeaderVisible(true); + setResize(true); + setAnimCollapse(false); + setHeadingText("Imported Data"); + + } + + private void bindToEvents() { + + EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE, + new UIStateEvent.UIStateEventHandler() { + + @Override + public void onChange(UIStateEvent event) { + manageStateEvents(event); + + } + }); + + EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaEvent.TYPE, + new DataMinerWorkAreaEvent.DataMinerWorkAreaEventHandler() { + + @Override + public void onChange(DataMinerWorkAreaEvent event) { + manageDataMinerWorkAreaEvents(event); + + } + + }); + + } + + private void manageStateEvents(UIStateEvent event) { + Log.debug("ImportedDataPanel recieved UIStateEvent: " + + event.toString()); + switch (event.getUiStateType()) { + case START: + break; + case WAITING: + break; + case UPDATE: + break; + default: + break; + } + } + + private void manageDataMinerWorkAreaEvents(DataMinerWorkAreaEvent event) { + + + Log.debug("ImportedDataPanel recieved UIStateEvent: " + + event.toString()); + switch (event.getDataMinerWorkAreaEventType()) { + case OPEN: + case UPDATE: + reloadWSResourceExplorerPanel(event); + break; + default: + break; + } + + + } + + private void create(DataMinerWorkAreaEvent event) { + try { + + if(event==null|| event.getDataMinerWorkArea()==null|| + event.getDataMinerWorkArea().getImportedData()==null|| + event.getDataMinerWorkArea().getImportedData().getFolder()==null|| + event.getDataMinerWorkArea().getImportedData().getFolder().getId()==null + ||event.getDataMinerWorkArea().getImportedData().getFolder().getId().isEmpty()){ + if(v!=null){ + remove(v); + forceLayout(); + } + return; + + } + + wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel( + event.getDataMinerWorkArea().getImportedData().getFolder().getId(), + false); + + WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() { + @Override + public void onSelectedItem(Item item) { + Log.debug("Listener Selected Item " + item); + selectedItem = item; + + } + + @Override + public void onFailed(Throwable throwable) { + Log.error(throwable.getLocalizedMessage()); + throwable.printStackTrace(); + } + + @Override + public void onAborted() { + + } + + @Override + public void onNotValidSelection() { + selectedItem = null; + } + }; + + wsResourcesExplorerPanel + .addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener); + wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel"); + + VerticalLayoutContainer vResourcesExplorerContainer = new VerticalLayoutContainer(); + vResourcesExplorerContainer.setScrollMode(ScrollMode.AUTO); + vResourcesExplorerContainer.add(wsResourcesExplorerPanel, + new VerticalLayoutData(1, -1, new Margins(0))); + + // DND + + dnd = new MultipleDNDUpload(); + dnd.setParameters(event.getDataMinerWorkArea().getImportedData().getFolder().getId(), UPLOAD_TYPE.File); + dnd.addUniqueContainer(vResourcesExplorerContainer); + WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() { + + @Override + public void onUploadCompleted(String parentId, String itemId) { + Log.debug("Upload completed: [parentID: " + parentId + + ", itemId: " + itemId + "]"); + wsResourcesExplorerPanel.refreshRootFolderView(); + forceLayout(); + + } + + @Override + public void onUploadAborted(String parentId, String itemId) { + Log.debug("Upload Aborted: [parentID: " + parentId + + ", itemId: " + itemId + "]"); + } + + @Override + public void onError(String parentId, String itemId, + Throwable throwable) { + Log.debug("Upload Error: [parentID: " + parentId + + ", itemId: " + itemId + "]"); + throwable.printStackTrace(); + } + + @Override + public void onOverwriteCompleted(String parentId, String itemId) { + Log.debug("Upload Override Completed: [parentID: " + + parentId + ", itemId: " + itemId + "]"); + wsResourcesExplorerPanel.refreshRootFolderView(); + forceLayout(); + } + }; + + dnd.addWorkspaceUploadNotificationListener(workspaceUploaderListener); + + // ToolBar + btnOpen = new TextButton("Open"); + // btnOpen.setIcon(StatAlgoImporterResources.INSTANCE.download16()); + btnOpen.setScale(ButtonScale.SMALL); + btnOpen.setIconAlign(IconAlign.LEFT); + btnOpen.setToolTip("Open"); + btnOpen.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + openFile(); + } + + }); + + btnDelete = new TextButton("Delete"); + // btnDelete.setIcon(StatAlgoImporterResources.INSTANCE.delete16()); + btnDelete.setScale(ButtonScale.SMALL); + btnDelete.setIconAlign(IconAlign.LEFT); + btnDelete.setToolTip("Delete"); + btnDelete.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + deleteItem(event); + } + + }); + + btnReload = new TextButton("Reload"); + // btnReload.setIcon(StatAlgoImporterResources.INSTANCE.reload16()); + btnReload.setScale(ButtonScale.SMALL); + btnReload.setIconAlign(IconAlign.LEFT); + btnReload.setToolTip("Reload"); + btnReload.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + reloadWSResourceExplorerPanel(); + } + + }); + + ToolBar toolBar = new ToolBar(); + toolBar.add(btnOpen, new BoxLayoutData(new Margins(0))); + toolBar.add(btnDelete, new BoxLayoutData(new Margins(0))); + toolBar.add(btnReload, new BoxLayoutData(new Margins(0))); + + v = new VerticalLayoutContainer(); + + v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); + v.add(dnd, new VerticalLayoutData(1, 1, new Margins(0))); + add(v); + forceLayout(); + + } catch (Exception e) { + Log.error("Error opening wsResourceExplorerPanel"); + e.printStackTrace(); + } + } + + private void reloadWSResourceExplorerPanel(){ + if (wsResourcesExplorerPanel != null) { + wsResourcesExplorerPanel.refreshRootFolderView(); + } + } + + + private void reloadWSResourceExplorerPanel(DataMinerWorkAreaEvent event) { + if(v!=null){ + remove(v); + create(event); + } else { + create(event); + } + } + + private void deleteItem(SelectEvent event) { + ItemDescription itemDescription = new ItemDescription( + selectedItem.getId(), selectedItem.getName(), + selectedItem.getOwner(), selectedItem.getPath(), selectedItem + .getType().name()); + DeleteItemEvent deleteItemEvent = new DeleteItemEvent(itemDescription); + EventBusProvider.INSTANCE.fireEvent(deleteItemEvent); + Log.debug("Fired: " + deleteItemEvent); + } + + + + private void openFile() { + if (selectedItem != null && !selectedItem.isFolder()) { + + final ItemDescription itemDescription = new ItemDescription( + selectedItem.getId(), selectedItem.getName(), + selectedItem.getOwner(), selectedItem.getPath(), + selectedItem.getType().name()); + + DataMinerPortletServiceAsync.INSTANCE.getPublicLink( + itemDescription, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + if (caught instanceof ExpiredSessionServiceException) { + EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent()); + } else { + Log.error("Error open file: " + + caught.getLocalizedMessage()); + UtilsGXT3.alert("Error", + caught.getLocalizedMessage()); + } + caught.printStackTrace(); + + } + + @Override + public void onSuccess(String link) { + Log.debug("Retrieved link: " + link); + Window.open(link, itemDescription.getName(), ""); + } + + }); + + } else { + UtilsGXT3.info("Attention", "Select a file!"); + } + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/DataMinerWorkAreaEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/DataMinerWorkAreaEvent.java new file mode 100644 index 0000000..8788d03 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/DataMinerWorkAreaEvent.java @@ -0,0 +1,77 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaEventType; +import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea; + +import com.google.gwt.event.shared.EventHandler; +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.event.shared.HasHandlers; + +/** + * Data Miner Work Area Event + * + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class DataMinerWorkAreaEvent extends + GwtEvent { + + public static Type TYPE = new Type(); + private DataMinerWorkAreaEventType dataMinerWorkAreaEventType; + private DataMinerWorkArea dataMinerWorkArea; + + public interface DataMinerWorkAreaEventHandler extends EventHandler { + void onChange(DataMinerWorkAreaEvent event); + } + + public interface HasDataMinerWorkAreaEventHandler extends HasHandlers { + public HandlerRegistration addDataMinerWorkAreaEventHandler( + DataMinerWorkAreaEventHandler handler); + } + + public DataMinerWorkAreaEvent( + DataMinerWorkAreaEventType dataMinerWorkAreaEventType, DataMinerWorkArea dataMinerWorkArea) { + this.dataMinerWorkAreaEventType = dataMinerWorkAreaEventType; + this.dataMinerWorkArea=dataMinerWorkArea; + } + + @Override + protected void dispatch(DataMinerWorkAreaEventHandler handler) { + handler.onChange(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, + DataMinerWorkAreaEvent dataMinerWorkAreaEvent) { + source.fireEvent(dataMinerWorkAreaEvent); + } + + public DataMinerWorkAreaEventType getDataMinerWorkAreaEventType() { + return dataMinerWorkAreaEventType; + } + + public DataMinerWorkArea getDataMinerWorkArea() { + return dataMinerWorkArea; + } + + @Override + public String toString() { + return "DataMinerWorkAreaEvent [dataMinerWorkAreaEventType=" + + dataMinerWorkAreaEventType + ", dataMinerWorkArea=" + + dataMinerWorkArea + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/DeleteItemEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/DeleteItemEvent.java new file mode 100644 index 0000000..4a4c6b5 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/DeleteItemEvent.java @@ -0,0 +1,68 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + + +import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription; + +import com.google.gwt.event.shared.EventHandler; +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.event.shared.HasHandlers; + +/** + * Delete Item Event + * + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class DeleteItemEvent extends + GwtEvent { + + public static Type TYPE = new Type(); + private ItemDescription itemDescription; + + public interface DeleteItemEventHandler extends EventHandler { + void onDelete(DeleteItemEvent event); + } + + public interface HasDeleteItemEventHandler extends HasHandlers { + public HandlerRegistration addDeleteItemEventHandler( + DeleteItemEventHandler handler); + } + + public DeleteItemEvent(ItemDescription itemDescription) { + this.itemDescription = itemDescription; + } + + @Override + protected void dispatch(DeleteItemEventHandler handler) { + handler.onDelete(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, DeleteItemEvent deleteItemEvent) { + source.fireEvent(deleteItemEvent); + } + + public ItemDescription getItemDescription() { + return itemDescription; + } + + @Override + public String toString() { + return "DeleteItemEvent [itemDescription=" + itemDescription + "]"; + } + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ImportCreatedEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ImportCreatedEvent.java new file mode 100644 index 0000000..081fe1a --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ImportCreatedEvent.java @@ -0,0 +1,43 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.EventHandler; +import java.lang.String; +import com.google.gwt.event.shared.HasHandlers; + +public class ImportCreatedEvent extends + GwtEvent { + + public static Type TYPE = new Type(); + private String importId; + + public interface ImportCreatedHandler extends EventHandler { + void onImportCreated(ImportCreatedEvent event); + } + + public ImportCreatedEvent(String importId) { + this.importId = importId; + } + + public String getImportId() { + return importId; + } + + @Override + protected void dispatch(ImportCreatedHandler handler) { + handler.onImportCreated(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, String importId) { + source.fireEvent(new ImportCreatedEvent(importId)); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ImportTerminatedEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ImportTerminatedEvent.java new file mode 100644 index 0000000..50fdb54 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ImportTerminatedEvent.java @@ -0,0 +1,44 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus; + +import com.google.gwt.event.shared.EventHandler; +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.HasHandlers; + +public class ImportTerminatedEvent extends + GwtEvent { + + public static Type TYPE = new Type(); + private ImportStatus importStatus; + + public interface ImportTerminatedHandler extends EventHandler { + void onImportTerminated(ImportTerminatedEvent event); + } + + public ImportTerminatedEvent(ImportStatus importStatus) { + this.importStatus = importStatus; + } + + public ImportStatus getImportStatus() { + return importStatus; + } + + @Override + protected void dispatch(ImportTerminatedHandler handler) { + handler.onImportTerminated(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, ImportStatus importStatus) { + source.fireEvent(new ImportTerminatedEvent(importStatus)); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/JobsGridGotDirtyEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/JobsGridGotDirtyEvent.java new file mode 100644 index 0000000..199ccbd --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/JobsGridGotDirtyEvent.java @@ -0,0 +1,35 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.EventHandler; +import com.google.gwt.event.shared.HasHandlers; + +public class JobsGridGotDirtyEvent extends GwtEvent { + + public static Type TYPE = new Type(); + + public interface JobsGridGotDirtyHandler extends EventHandler { + void onJobsGridGotDirty(JobsGridGotDirtyEvent event); + } + + public JobsGridGotDirtyEvent() { + } + + @Override + protected void dispatch(JobsGridGotDirtyHandler handler) { + handler.onJobsGridGotDirty(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source) { + source.fireEvent(new JobsGridGotDirtyEvent()); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/JobsGridHandler.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/JobsGridHandler.java new file mode 100644 index 0000000..20d200e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/JobsGridHandler.java @@ -0,0 +1,18 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.events; + +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem; + +/** + * @author ceras + * + */ +public interface JobsGridHandler { + + public void jobSelected(ComputationItem jobItem); + + public void removeComputation(ComputationItem jobItem); + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/MaskEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/MaskEvent.java new file mode 100644 index 0000000..d16a98f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/MaskEvent.java @@ -0,0 +1,42 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.EventHandler; +import java.lang.String; +import com.google.gwt.event.shared.HasHandlers; + +public class MaskEvent extends GwtEvent { + + public static Type TYPE = new Type(); + private String message; + + public interface MaskHandler extends EventHandler { + void onMask(MaskEvent event); + } + + public MaskEvent(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + @Override + protected void dispatch(MaskHandler handler) { + handler.onMask(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, String message) { + source.fireEvent(new MaskEvent(message)); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ResubmitComputationEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ResubmitComputationEvent.java new file mode 100644 index 0000000..8d2b7ea --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/ResubmitComputationEvent.java @@ -0,0 +1,45 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.EventHandler; + +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem; + +import com.google.gwt.event.shared.HasHandlers; + +public class ResubmitComputationEvent extends + GwtEvent { + + public static Type TYPE = new Type(); + private ComputationItem jobItem; + + public interface ResubmitComputationHandler extends EventHandler { + void onResubmitComputation(ResubmitComputationEvent event); + } + + public ResubmitComputationEvent(ComputationItem jobItem) { + this.jobItem = jobItem; + } + + public ComputationItem getJobItem() { + return jobItem; + } + + @Override + protected void dispatch(ResubmitComputationHandler handler) { + handler.onResubmitComputation(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, ComputationItem jobItem) { + source.fireEvent(new ResubmitComputationEvent(jobItem)); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/SessionExpiredEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/SessionExpiredEvent.java new file mode 100644 index 0000000..8e32ced --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/SessionExpiredEvent.java @@ -0,0 +1,70 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import org.gcube.portlets.user.dataminermanager.client.type.SessionExpiredEventType; + +import com.google.gwt.event.shared.EventHandler; +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.event.shared.HasHandlers; + +/** + * Session Expired Event + * + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class SessionExpiredEvent extends GwtEvent { + + public static Type TYPE = new Type(); + private SessionExpiredEventType sessionExpiredEventType; + + public interface SessionExpiredEventHandler extends EventHandler { + void onChange(SessionExpiredEvent event); + } + + public interface HasSessionExpiredEventHandler extends HasHandlers { + public HandlerRegistration addSessionExpiredEventHandler( + SessionExpiredEventHandler handler); + } + + public SessionExpiredEvent() { + this.sessionExpiredEventType = SessionExpiredEventType.EXPIREDONSERVER; + } + + public SessionExpiredEvent(SessionExpiredEventType sessionExpiredEventType) { + this.sessionExpiredEventType = sessionExpiredEventType; + } + + @Override + protected void dispatch(SessionExpiredEventHandler handler) { + handler.onChange(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, SessionExpiredEvent sessionExpieredEvent) { + source.fireEvent(sessionExpieredEvent); + } + + public SessionExpiredEventType getSessionExpiredEventType() { + return sessionExpiredEventType; + } + + @Override + public String toString() { + return "SessionExpiredEvent [sessionExpiredEventType=" + + sessionExpiredEventType + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/TablesGridGotDirtyEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/TablesGridGotDirtyEvent.java new file mode 100644 index 0000000..2a791ea --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/TablesGridGotDirtyEvent.java @@ -0,0 +1,43 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.EventHandler; +import java.lang.String; +import com.google.gwt.event.shared.HasHandlers; + +public class TablesGridGotDirtyEvent extends + GwtEvent { + + public static Type TYPE = new Type(); + private String tableId; + + public interface TablesGridGotDirtyHandler extends EventHandler { + void onTablesGridGotDirty(TablesGridGotDirtyEvent event); + } + + public TablesGridGotDirtyEvent(String tableId) { + this.tableId = tableId; + } + + public String getTableId() { + return tableId; + } + + @Override + protected void dispatch(TablesGridGotDirtyHandler handler) { + handler.onTablesGridGotDirty(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, String tableId) { + source.fireEvent(new TablesGridGotDirtyEvent(tableId)); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/UIStateEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/UIStateEvent.java new file mode 100644 index 0000000..5fa7d42 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/UIStateEvent.java @@ -0,0 +1,67 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +import org.gcube.portlets.user.dataminermanager.client.type.UIStateEventType; + +import com.google.gwt.event.shared.EventHandler; +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.event.shared.HasHandlers; + +/** + * User Interface State Event + * + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class UIStateEvent extends GwtEvent { + + public static Type TYPE = new Type(); + private UIStateEventType uiStateType; + + public interface UIStateEventHandler extends EventHandler { + void onChange(UIStateEvent event); + } + + public interface HasUIStateEventHandler extends HasHandlers { + public HandlerRegistration addUIStateEventHandler( + UIStateEventHandler handler); + } + + public UIStateEvent() { + this.uiStateType = UIStateEventType.START; + } + + public UIStateEvent(UIStateEventType uiStateType) { + this.uiStateType = uiStateType; + } + + @Override + protected void dispatch(UIStateEventHandler handler) { + handler.onChange(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, UIStateEvent uiStateEvent) { + source.fireEvent(uiStateEvent); + } + + public UIStateEventType getUiStateType() { + return uiStateType; + } + + @Override + public String toString() { + return "UIStatusEvent [uiStateType=" + uiStateType + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/WPSMenuEvent.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/WPSMenuEvent.java new file mode 100644 index 0000000..1d9cb4c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/WPSMenuEvent.java @@ -0,0 +1,66 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + + +import com.google.gwt.event.shared.EventHandler; +import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.event.shared.HasHandlers; + +/** + * WPS Menu Event + * + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class WPSMenuEvent extends + GwtEvent { + + public static Type TYPE = new Type(); + private WPSMenuType menuType; + + public interface WPSMenuEventHandler extends EventHandler { + void onMenu(WPSMenuEvent event); + } + + public interface HasWPSMenuEventHandler extends HasHandlers { + public HandlerRegistration addWPSMenuEventHandler( + WPSMenuEventHandler handler); + } + + public WPSMenuEvent(WPSMenuType menuType) { + this.menuType = menuType; + } + + @Override + protected void dispatch(WPSMenuEventHandler handler) { + handler.onMenu(this); + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + public static Type getType() { + return TYPE; + } + + public static void fire(HasHandlers source, WPSMenuEvent wpsMenuEvent) { + source.fireEvent(wpsMenuEvent); + } + + public WPSMenuType getMenuType() { + return menuType; + } + + @Override + public String toString() { + return "WPSMenuEvent [menuType=" + menuType + "]"; + } + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/WPSMenuType.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/WPSMenuType.java new file mode 100644 index 0000000..7488a2a --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/events/WPSMenuType.java @@ -0,0 +1,11 @@ +package org.gcube.portlets.user.dataminermanager.client.events; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public enum WPSMenuType { + MENU, INPUT_SPACE, EXPERIMENT, COMPUTATIONS +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ComputationPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ComputationPanel.java new file mode 100644 index 0000000..47a0cea --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ComputationPanel.java @@ -0,0 +1,200 @@ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationItem; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; +import org.gcube.portlets.user.dataminermanager.client.events.JobsGridGotDirtyEvent; +import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.form.FieldLabel; +import com.sencha.gxt.widget.core.client.toolbar.ToolBar; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ComputationPanel extends ContentPanel { + + private List computationStatusPanels = new ArrayList(); + + private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove Computations Log"; + private TextButton removeAllButton; + + private VerticalLayoutContainer vert; + + /** + * + */ + public ComputationPanel() { + super(); + + bind(); + + // this.setHeading(".: Computation Execution"); + this.setHeaderVisible(false); + this.addStyleName("computationExcecutionPanel"); + + setToolsPanel(); + vert = new VerticalLayoutContainer(); + add(vert, new MarginData(0)); + } + + public void startNewComputation(final Operator operator, + String computationTitle, String computationDescription) { + Log.debug("Computation Panel: start new computation "); + final ComputationStatusPanel statusPanel = new ComputationStatusPanel( + operator); + computationStatusPanels.add(statusPanel); + Log.debug("Added status bar "); + vert.insert(statusPanel, 0, new VerticalLayoutData(1, -1, + new Margins(0))); + removeAllButton.setEnabled(true); + + DataMinerManager.getService().startComputation(operator, + computationTitle, computationDescription, + new AsyncCallback() { + @Override + public void onSuccess(ComputationId computationId) { + if (computationId == null) + UtilsGXT3 + .alert("ERROR", + "Failed to start computation " + + operator.getName() + + ", the computation id is null (1)"); + else { + statusPanel.computationStarted(computationId); + EventBusProvider.INSTANCE + .fireEvent(new JobsGridGotDirtyEvent()); + } + } + + @Override + public void onFailure(Throwable caught) { + UtilsGXT3.alert( + "ERROR", + "Failed to start computation " + + operator.getName() + + " (2)
Cause:" + caught.getCause() + + "
Message:" + caught.getMessage()); + } + }); + + forceLayout(); + + } + + private void bind() { + EventBusProvider.INSTANCE.addHandler( + ResubmitComputationEvent.getType(), + new ResubmitComputationEvent.ResubmitComputationHandler() { + @Override + public void onResubmitComputation( + ResubmitComputationEvent event) { + resubmitComputation(event.getJobItem()); + } + }); + } + + public void resubmitComputation(final ComputationItem computationItem) { + final ComputationStatusPanel statusPanel = new ComputationStatusPanel( + computationItem.getOperator()); + computationStatusPanels.add(statusPanel); + vert.insert(statusPanel, 0, new VerticalLayoutData(1, -1, + new Margins(0))); + removeAllButton.setEnabled(true); + + DataMinerManager.getService().resubmit( + computationItem.getComputationId(), + new AsyncCallback() { + @Override + public void onSuccess(ComputationId id) { + if (id == null) + UtilsGXT3 + .alert("ERROR", + "Failed to resubmit computation " + + computationItem.getName() + + ", the computation id is null (1)"); + else { + statusPanel.computationStarted(id); + EventBusProvider.INSTANCE + .fireEvent(new JobsGridGotDirtyEvent()); + } + } + + @Override + public void onFailure(Throwable caught) { + UtilsGXT3.alert("ERROR", + "Failed to start computation " + + computationItem.getName() + + " (2)
Cause:" + caught.getCause() + + "
Message:" + caught.getMessage()); + } + }); + + forceLayout(); + + } + + /** + * + */ + private void emptyPanel() { + // stop timers + for (ComputationStatusPanel statusPanel : computationStatusPanels) + statusPanel.stopTimer(); + + removeAllButton.setEnabled(false); + + computationStatusPanels.clear(); + + vert.clear(); + forceLayout(); + } + + private void setToolsPanel() { + ToolBar toolBar = new ToolBar(); + + removeAllButton = new TextButton("Remove All"); + + removeAllButton.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + emptyPanel(); + + } + }); + + removeAllButton.setIcon(DataMinerManager.resources.removeAll()); + + removeAllButton.setToolTip(DELETE_ALL_BUTTON_TOOLTIP); + removeAllButton.setScale(ButtonScale.MEDIUM); + removeAllButton.setEnabled(false); + + FieldLabel toolsLabel = new FieldLabel(removeAllButton, "Tools"); + + toolBar.add(toolsLabel); + + addTool(toolBar); + + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ComputationStatusPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ComputationStatusPanel.java new file mode 100644 index 0000000..ce23c0b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ComputationStatusPanel.java @@ -0,0 +1,246 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import java.util.Date; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; +import org.gcube.portlets.user.dataminermanager.client.events.SessionExpiredEvent; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.client.widgets.ComputationOutputPanel; +import org.gcube.portlets.user.dataminermanager.shared.Constants; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; +import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.i18n.client.NumberFormat; +import com.google.gwt.user.client.Timer; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.widget.core.client.ProgressBar; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.info.Info; + +/** + * @author ceras + * + */ +public class ComputationStatusPanel extends SimpleContainer { + + + + private ProgressBar progressBar = new ProgressBar(); + private ComputationId computationId; + private Operator operator; + private boolean terminated=false; + private ComputationTimer timer = new ComputationTimer(); + private TextButton cancelComputationButton; + private VerticalLayoutContainer vert; + + /** + * + */ + public ComputationStatusPanel(Operator operator) { + super(); + this.operator=operator; + init(); + + } + + + private void init(){ + vert=new VerticalLayoutContainer(); + HTML title = new HTML("
Computation of " + operator.getName() + "
"); + HTML date = new HTML("
" + new Date().toString() + "
"); + vert.add(title); + vert.add(date); + add(vert); + forceLayout(); + } + + /* (non-Javadoc) + * @see com.extjs.gxt.ui.client.widget.Container#onAttach() + */ + @Override + protected void onAttach() { + super.onAttach(); + progressBar.redraw(); + } + + /** + * @param computationId the computationId to set + */ + public void computationStarted(ComputationId computationId) { + this.computationId = computationId; + vert.add(new HTML("Created, the id is "+computationId.getId()+" [link]")); + progressBar.getElement().getStyle().setMargin(20, Unit.PX); + progressBar.updateProgress(0, "Starting..."); + vert.add(progressBar); + + cancelComputationButton = new TextButton("Cancel"); + + cancelComputationButton.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + cancelComputationButton.disable(); + cancelComputation(); + + } + }); + vert.add(cancelComputationButton); + forceLayout(); + timer.scheduleRepeating(Constants.TIME_UPDATE_COMPUTATION_STATUS_PANEL); + } + + + private void cancelComputation(){ + DataMinerManager.getService().cancelComputation(computationId, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + if (caught instanceof ExpiredSessionServiceException) { + UtilsGXT3.alert("Error", "Expired Session"); + EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent()); + } else { + UtilsGXT3.alert( + "Error", + "Error in cancel computation: ComputationId="+computationId.getId()+", Error=" + + caught.getLocalizedMessage()); + } + + } + + @Override + public void onSuccess(String result) { + Log.debug(result); + + } + }); + } + + /** + * @param computationId + * @param operator + * + */ + protected void computationTerminated(ComputationId computationId, Operator operator, ComputationStatus computationStatus) { + Log.debug("Computation Terminated"); + Log.debug("Computation Status:"+computationStatus); + if (terminated == false) { + terminated = true; + cancelComputationButton.setVisible(false); + if (computationStatus.isComplete()) { + Log.debug("Computation is Complete"); + Info.display("Terminated", "The computation "+computationId.getId()+" of "+operator.getName()+" is terminated correctly."); + progressBar.updateProgress(1, "Computation Complete"); + progressBar.addStyleName("progressBar-complete"); + + showOutput(); + + } else if (computationStatus.isFailed()) { + Log.debug("Computation is Failed"); +// Info.display("Failed", "The computation of "+operator.getName()+" has failed."); +// MessageBox.alert("Failed", "The computation "+computationId+" of "+operator.getName()+" has failed.
" +// +"Message: "+computationStatus.getMessage(), null); + String errorMessage; + if(computationStatus.getErrResource()==null||computationStatus.getErrResource().getDescription()==null ){ + errorMessage=new String("Computation Failed!"); + } else { + errorMessage=computationStatus.getErrResource().getDescription(); + } + + UtilsGXT3.alert("Failed", "The computation "+computationId.getId()+" of "+operator.getName()+" has failed.
" + +"Message: "+errorMessage, null); + progressBar.updateProgress(1, "Computation Fail"); + progressBar.addStyleName("progressBar-failed"); + +// + } + + } + forceLayout(); + } + + + /** + * + */ + private void showOutput() { + vert.add(new HTML(" The computation "+operator.getName()+" finished.")); + ComputationOutputPanel computationOutputPanel = new ComputationOutputPanel(computationId); + vert.add(computationOutputPanel); + + } + + /** + * @param computationStatus + */ + protected void updateStatus(ComputationStatus computationStatus) { + Log.debug("Conputation Status Panel ::Update Status "); + if (computationStatus.getStatus() == Status.PENDING) + progressBar.updateText("Pending..."); + else { + double percentage = computationStatus.getPercentage(); + progressBar.updateProgress(percentage/100, + "Running, " + NumberFormat.getFormat("0.00").format(percentage) + "% Complete"); + } + } + + + private class ComputationTimer extends Timer { + + /* (non-Javadoc) + * @see com.google.gwt.user.client.Timer#run() + */ + @Override + public void run() { + Log.debug("Timer run ....."); +// final ComputationStatusPanel cp = ComputationStatusPanel.this; + DataMinerManager.getService().getComputationStatus(computationId, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + progressBar.updateProgress(1, "Failed to get the status"); + progressBar.addStyleName("progressBar-failed"); +// MessageBox.alert("Error", ""+caught.getLocalizedMessage()+"\nCause: "+caught.getCause()+"\nStackTrace: "+caught.getStackTrace().toString(), null); +// computationTerminated(computationId, operator, TerminationMode.FAILED2); +// ComputationTimer.this.cancel(); + } + + @Override + public void onSuccess(ComputationStatus computationStatus) { + if (computationStatus.isTerminated()) { + ComputationTimer.this.cancel(); + computationTerminated(computationId, operator, computationStatus); + } else + updateStatus(computationStatus); + } + }); + } + + } + + + /** + * + */ + public void stopTimer() { + try { + timer.cancel(); + } catch (Exception e) { + } + vert.clear(); + + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ExperimentPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ExperimentPanel.java new file mode 100644 index 0000000..63638fc --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/ExperimentPanel.java @@ -0,0 +1,75 @@ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; + +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer; +import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ExperimentPanel extends SimpleContainer implements + OperatorsPanelHandler { + + private WorkflowPanel workflowPanel; + private OperatorsPanel operatorsPanel; + private OperatorPanel lastOperatorSelected = null; + + /** + * + */ + public ExperimentPanel() { + super(); + + operatorsPanel = new OperatorsPanel(this); + workflowPanel = new WorkflowPanel(); + + // + BorderLayoutContainer experimentPanelLayout = new BorderLayoutContainer(); + experimentPanelLayout.setId("experimentPanelLayout"); + experimentPanelLayout.setBorders(false); + experimentPanelLayout.setResize(true); + experimentPanelLayout.getElement().getStyle() + .setBackgroundColor("#FFFFFF"); + + // Center + MarginData mainData = new MarginData(new Margins(2)); + experimentPanelLayout.setCenterWidget(workflowPanel, mainData); + + // West + + BorderLayoutData westData = new BorderLayoutData(300); + westData.setCollapsible(true); + westData.setSplit(true); + westData.setFloatable(true); + westData.setCollapseMini(false); + westData.setMargins(new Margins(0, 5, 0, 0)); + westData.setCollapseHidden(true); + experimentPanelLayout.setWestWidget(operatorsPanel, westData); + // filtersPanel.expand(); + // filtersPanel.enable(); + + add(experimentPanelLayout, new MarginData(0)); + + } + + /** + * + */ + @Override + public void addOperator(OperatorPanel operatorPanel, Operator operator) { + if (lastOperatorSelected != null + && lastOperatorSelected != operatorPanel) + lastOperatorSelected.toggleSelected(false); + if (lastOperatorSelected != operatorPanel) + operatorPanel.toggleSelected(true); + lastOperatorSelected = operatorPanel; + workflowPanel.addOperator(operator); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorCategoryPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorCategoryPanel.java new file mode 100644 index 0000000..f6d813e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorCategoryPanel.java @@ -0,0 +1,139 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorCategory; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.core.client.Style.Side; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.tips.ToolTipConfig; + + +public class OperatorCategoryPanel extends SimpleContainer { + + private List operatorPanelsList = null; + private OperatorsPanelHandler handler; + private static final int TOOLTIP_WIDTH = 300; + private boolean isCollapsed = true; + private OperatorCategory category; + private HTML categoryHtml; +// private LayoutContainer collapsedPanel = new LayoutContainer(); + + + /** + * @param cat + */ + public OperatorCategoryPanel(OperatorsPanelHandler handler, OperatorCategory cat) { + super(); + this.handler = handler; + this.category = cat; + init(); + } + + private void init(){ + // set category info + categoryHtml = new HTML(category.getName() + " ("+category.getOperators().size()+")"); + categoryHtml.addStyleName("categoryItem"); + categoryHtml.addStyleName("categoryItem-Collapsed"); + ToolTipConfig tooltipConfig = createToolTip(category); + setToolTipConfig(tooltipConfig); + + addDomHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + switchOpenClose(); + + } + + }, ClickEvent.getType()); + + + add(categoryHtml); + } + + /** + * @return + */ + private ToolTipConfig createToolTip(OperatorCategory cat) { + ToolTipConfig tooltipConfig = new ToolTipConfig(); + tooltipConfig.setTitleHtml("
  "+cat.getName()); + tooltipConfig.setMouseOffsetX(0); + tooltipConfig.setMouseOffsetY(0); + tooltipConfig.setAnchor(Side.LEFT); + tooltipConfig.setDismissDelay(5000); + tooltipConfig.setBodyHtml( + getTooltipTemplate(GWT.getModuleBaseURL(), cat.getId(), cat.hasImage(), cat.getDescription()) + ); + // config.setCloseable(true); + tooltipConfig.setMaxWidth(TOOLTIP_WIDTH); + return tooltipConfig; + } + + private String getTooltipTemplate(String base, String id, boolean hasImage, String description){ + String html = + "
"+ + ""+ + description+ + "
"; + // '
    ', + // '
  • 5 bedrooms
  • ', + // '
  • 2 baths
  • ', + // '
  • Large backyard
  • ', + // '
  • Close to metro
  • ', + // '
', + // '
' + + return html; + }; + + public void switchOpenClose() { + if (isCollapsed) + expand(); + else + collapse(); + } + + /** + * + */ + private void collapse() { + categoryHtml.removeStyleName("categoryItem-Expanded"); + categoryHtml.addStyleName("categoryItem-Collapsed"); + + for (OperatorPanel op: this.operatorPanelsList) + this.remove(op); + this.isCollapsed = true; + forceLayout(); + } + + /** + * + */ + private void expand() { + if (operatorPanelsList==null) { + // init operator panels + operatorPanelsList = new ArrayList(); + for (Operator op : category.getOperators()) { + OperatorPanel operatorPanel = new OperatorPanel(op, handler); + operatorPanelsList.add(operatorPanel); + } + } + + categoryHtml.removeStyleName("categoryItem-Collapsed"); + categoryHtml.addStyleName("categoryItem-Expanded"); + for (OperatorPanel op: this.operatorPanelsList) + this.add(op); + this.isCollapsed = false; + forceLayout(); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorPanel.java new file mode 100644 index 0000000..27fd214 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorPanel.java @@ -0,0 +1,121 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.core.client.Style.Side; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.tips.ToolTipConfig; + +public class OperatorPanel extends SimpleContainer { + + private static final int TOOLTIP_WIDTH = 500; + private VerticalLayoutContainer vert; + + private Operator operator; + private OperatorsPanelHandler handler; + private HTML titleHtml; + + /** + * @param handler + * @param op + */ + public OperatorPanel(Operator operator, OperatorsPanelHandler handler) { + super(); + this.operator = operator; + this.handler = handler; + init(); + + } + + private void init() { + addStyleName("operatorPanel"); + addStyleName("opePanel"); + + addDomHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + handler.addOperator(OperatorPanel.this, operator); + + } + + }, ClickEvent.getType()); + + titleHtml = new HTML(operator.getName()); + titleHtml.addStyleName("operatorPanel-title"); + + HTML descriptionHtml = new HTML(operator.getBriefDescription()); + descriptionHtml.addStyleName("operatorPanel-briefDescription"); + + vert=new VerticalLayoutContainer(); + + vert.add(titleHtml, new VerticalLayoutData(1, -1, new Margins(0))); + vert.add(descriptionHtml, new VerticalLayoutData(1, -1, new Margins(0))); + add(vert); + + ToolTipConfig tooltipConfig = createToolTip(operator); + setToolTipConfig(tooltipConfig); + + } + + /** + * @return the operator + */ + public Operator getOperator() { + return operator; + } + + /** + * @return + */ + private ToolTipConfig createToolTip(Operator op) { + ToolTipConfig tooltipConfig = new ToolTipConfig(); + tooltipConfig.setTitleHtml("
  " + op.getName()); + tooltipConfig.setMouseOffsetX(0); + tooltipConfig.setMouseOffsetY(0); + tooltipConfig.setAnchor(Side.LEFT); + tooltipConfig.setDismissDelay(5000); + tooltipConfig.setBodyHtml(getTooltipTemplate(GWT.getModuleBaseURL(), + op.getId(), op.hasImage(), op.getDescription())); + // config.setCloseable(true); + tooltipConfig.setMaxWidth(TOOLTIP_WIDTH); + return tooltipConfig; + } + + /** + * + * @param base + * @param id + * @param hasImage + * @param description + * @return + */ + private String getTooltipTemplate(String base, String id, boolean hasImage, + String description) { + String template = "
" + "" + description + + "
"; + + return template; + }; + + public void toggleSelected(boolean isSelect) { + if (isSelect) + this.addStyleName("operatorPanel-selected"); + // titleHtml.addStyleName("operatorPanel-title-selected"); + else + this.removeStyleName("operatorPanel-selected"); + // titleHtml.removeStyleName("operatorPanel-title-selected"); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorsPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorsPanel.java new file mode 100644 index 0000000..7e06dce --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorsPanel.java @@ -0,0 +1,321 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorCategory; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.Constants; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.form.TextField; +import com.sencha.gxt.widget.core.client.menu.Item; +import com.sencha.gxt.widget.core.client.menu.Menu; +import com.sencha.gxt.widget.core.client.menu.MenuItem; +import com.sencha.gxt.widget.core.client.toolbar.ToolBar; + +/** + * @author ceras + * + */ +public class OperatorsPanel extends ContentPanel { + + private static final String LOADING_MESSAGE = "Loading Operators..."; + private static final String ERROR_GET_OPERATORS = "Operators not loaded."; + private static final String SHOW_ALL_OPERATORS_TOOLTIP = "Show all Operators without category classification."; + private static final String SHOW_CATEGORIES_TOOLTIP = "Show Operators by Categories"; + private OperatorsPanelHandler handler; + private ToolBar toolbar; + private VerticalLayoutContainer v; + + // private ArrayList categoryPanels; + private Map> mapCategoriesPanels = new HashMap>(); + + private enum View { + CATEGORIES, FILTER, ALL + }; + + private View view = null; + private String currentClassificationName = Constants.UserClassificationName; + + /** + * + */ + public OperatorsPanel(OperatorsPanelHandler handler) { + super(); + this.handler = handler; + + setHeadingText(".: Operators"); + // this.setScrollMode(Scroll.AUTO); + setToolbar(); + init(); + + } + + private void init() { + v = new VerticalLayoutContainer(); + add(v); + + + // if the operators classification is not loaded, let's load by an rpc + if (DataMinerManager.getOperatorsClassifications() == null) { + waitMessage(true); + DataMinerManager.getService().getOperatorsClassifications( + new AsyncCallback>() { + + @Override + public void onSuccess( + List result) { + waitMessage(false); + + DataMinerManager + .setOperatorsClassifications(result); + showCategoriesList(false); + } + + @Override + public void onFailure(Throwable caught) { + waitMessage(false); + UtilsGXT3.alert("Error", ERROR_GET_OPERATORS); + } + }); + } else + showCategoriesList(false); + } + + /** + * + */ + private void setToolbar() { + toolbar = new ToolBar(); + + TextButton showAllOperatorsButton = new TextButton(""); + showAllOperatorsButton.setIcon(DataMinerManager.resources + .sortAscending()); + showAllOperatorsButton + .addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + showAllOperatorsList(); + + } + }); + showAllOperatorsButton.setToolTip(SHOW_ALL_OPERATORS_TOOLTIP); + + TextButton showCategoriesButton = new TextButton(""); + showCategoriesButton.setIcon(DataMinerManager.resources.tree()); + showCategoriesButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + showCategoriesList(false); + + } + }); + + showCategoriesButton.setToolTip(SHOW_CATEGORIES_TOOLTIP); + + final TextField filterField = new TextField(); + filterField.setWidth(100); + filterField.addKeyUpHandler(new KeyUpHandler() { + + @Override + public void onKeyUp(KeyUpEvent event) { + String searchText = filterField.getCurrentValue(); + if (searchText == null || searchText.isEmpty()) + showCategoriesList(false); + if (searchText.length() >= 2) + showFilteredList(searchText); + + } + }); + + final TextButton btnClear = new TextButton(); + btnClear.addStyleName("x-form-clear-trigger"); + btnClear.setToolTip("Clear"); + + + final TextButton btnMenuPerspective = new TextButton( + currentClassificationName); + btnMenuPerspective + .setIcon(DataMinerManager.resources.userPerspective()); + + Menu menuPerspective = new Menu(); + for (final String perspectiveName : Constants.ClassificationNames) { + final ImageResource img = perspectiveName + .equals(Constants.UserClassificationName) ? DataMinerManager.resources + .userPerspective() : DataMinerManager.resources + .computationPerspective(); + MenuItem perspectiveItem = new MenuItem(perspectiveName); + perspectiveItem.addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + currentClassificationName = perspectiveName; + btnMenuPerspective.setText(perspectiveName); + btnMenuPerspective.setIcon(img); + showCategoriesList(true); + + } + }); + perspectiveItem.setIcon(img); + menuPerspective.add(perspectiveItem); + } + btnMenuPerspective.setMenu(menuPerspective); + + toolbar.add(showCategoriesButton); + toolbar.add(showAllOperatorsButton); + toolbar.add(filterField); + toolbar.add(btnMenuPerspective); + + addTool(toolbar); + } + + /** + + private ToolTipConfig createToolTip(OperatorCategory cat) { + ToolTipConfig tooltipConfig = new ToolTipConfig(); + tooltipConfig.setTitleHtml("
  " + cat.getName()); + tooltipConfig.setMouseOffsetX(0); + toolTipConfig.setMouseOffsetY(0); + tooltipConfig.setAnchor(Side.LEFT); + tooltipConfig.setDismissDelay(0); + tooltipConfig.setBodyHtml(getTooltipTemplate( + GWT.getModuleBaseURL(), cat.getId(), cat.hasImage(), + cat.getDescription())); + // config.setCloseable(true); + tooltipConfig.setMaxWidth(300); + return tooltipConfig; + } + + private String getTooltipTemplate(String base, String id, + boolean hasImage, String description) { + String html= + "
"+ + ""+ + description+"
"; + // '
    ', + // '
  • 5 bedrooms
  • ', + // '
  • 2 baths
  • ', + // '
  • Large backyard
  • ', + // '
  • Close to metro
  • ', + // '
', + // '
' + + return html; + }; + */ + private void waitMessage(boolean show) { + if (show) + this.mask(LOADING_MESSAGE); + else + this.unmask(); + } + + private void showFilteredList(String searchText) { + List operators = DataMinerManager + .getOperatorsClassificationByName(currentClassificationName) + .getOperators(); + List filteredOperators = new ArrayList(); + List ids = new ArrayList(); + for (Operator op : operators) + // check for filtering and prevent duplicates + if (op.getName().toLowerCase().contains(searchText.toLowerCase()) + && !ids.contains(op.getId())) { + filteredOperators.add(op); + ids.add(op.getId()); + } + + v.clear(); + + HTML html = new HTML("Filtered results (" + + filteredOperators.size() + " item" + + (filteredOperators.size() == 1 ? "" : "s") + " found)"); + html.addStyleName("filterResultText"); + this.add(html); + + for (Operator op : filteredOperators) + this.add(new OperatorPanel(op, handler)); + view = View.FILTER; + forceLayout(); + + } + + private void showCategoriesList(boolean force) { + + try { + if (force || view != View.CATEGORIES) { + Log.debug("ShowCategoriesList"); + List categoryPanels = mapCategoriesPanels + .get(currentClassificationName); + if (categoryPanels == null) { + // get category panels from classification + categoryPanels = new ArrayList(); + for (OperatorCategory cat : DataMinerManager + .getOperatorsClassificationByName( + currentClassificationName) + .getOperatorCategories()) { + // Log.debug("OperatorCategoryPanel"); + categoryPanels.add(new OperatorCategoryPanel(handler, + cat)); + } + mapCategoriesPanels.put(currentClassificationName, + categoryPanels); + } + + v.clear(); + for (OperatorCategoryPanel panel : categoryPanels) + v.add(panel); + view = View.CATEGORIES; + forceLayout(); + } + } catch (Throwable e) { + Log.error(e.getLocalizedMessage()); + e.printStackTrace(); + } + } + + private void showAllOperatorsList() { + if (view != View.ALL) { + List operators = DataMinerManager + .getOperatorsClassificationByName(currentClassificationName) + .getOperators(); + + v.clear(); + + HTML html = new HTML("All Operators (" + + operators.size() + " item" + + (operators.size() == 1 ? "" : "s") + " found)"); + html.addStyleName("filterResultText"); + v.add(html); + + for (Operator op : operators) + v.add(new OperatorPanel(op, handler)); + view = View.ALL; + forceLayout(); + + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorsPanelHandler.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorsPanelHandler.java new file mode 100644 index 0000000..6b89ae5 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/OperatorsPanelHandler.java @@ -0,0 +1,20 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; + +/** + * @author ceras + * + */ +public interface OperatorsPanelHandler { + + /** + * @param operatorPanel + * @param operator + */ + void addOperator(OperatorPanel operatorPanel, Operator operator); + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/WorkflowOperatorPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/WorkflowOperatorPanel.java new file mode 100644 index 0000000..e0b4268 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/WorkflowOperatorPanel.java @@ -0,0 +1,252 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.form.AbstractFld; +import org.gcube.portlets.user.dataminermanager.client.form.OperatorFieldWidget; +import org.gcube.portlets.user.dataminermanager.client.form.TabularFld; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.i18n.client.DateTimeFormat; +import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Image; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.form.FieldLabel; +import com.sencha.gxt.widget.core.client.form.FieldSet; +import com.sencha.gxt.widget.core.client.form.FormPanel; +import com.sencha.gxt.widget.core.client.form.TextField; + +/** + * @author ceras + * + */ +public class WorkflowOperatorPanel extends SimpleContainer { + + /** + * @author ceras + * + */ + public interface WorkflowOperatorPanelHandler { + public void startComputation(String computationTitle, String computationDescription); + } + + private static final String START_BUTTON_TOOLTIP = "Start Computation"; + + private static final ImageResource PRELOAD_IMAGE = DataMinerManager.resources.loaderBig(); + + private VerticalLayoutContainer v; + private Operator operator; + private FormPanel parametersPanel; + private FieldSet parametersFieldSet; + private Map fieldWidgetsMap = new HashMap(); + //private Map parameterValues = new HashMap(); + private WorkflowOperatorPanelHandler handler=null; + private TextField titleField; + + private String defaultComputationTitle; + + + public WorkflowOperatorPanel(DataMinerPortletServiceAsync service, Operator operator, WorkflowOperatorPanelHandler handler) { + this(operator); + this.setHandler(handler); + } + /** + * + */ + public WorkflowOperatorPanel(Operator operator) { + super(); + v=new VerticalLayoutContainer(); + add(v); + + this.operator = operator; + + this.defaultComputationTitle = getDefaultComputationTitle(); + //lc.setLayout(new FitLayout()); + + addStyleName("workflow"); + + Image img = new Image(GWT.getModuleBaseURL()+"../images/operators/"+(operator.hasImage() ? operator.getId() : "DEFAULT_IMAGE")+".png"); + img.addStyleName("workflow-icon"); + v.add(img); + + HTML title = new HTML(operator.getName()); + title.addStyleName("workflow-title"); + v.add(title); + + String descr = operator.getDescription(); + descr = (descr==null || descr.contentEquals("")) ? "no-description" : operator.getDescription(); + HTML description = new HTML(descr); + description.addStyleName("workflow-description"); + v.add(description); + + addTitleField(); + + parametersPanel = new FormPanel(){ + @Override + public boolean isValid(boolean preventMark) { + boolean flag = super.isValid(preventMark); + + if (flag) { + for (Map.Entry entry : fieldWidgetsMap.entrySet()) { + OperatorFieldWidget fieldWidget = entry.getValue(); + flag = flag && fieldWidget.isValid(); + } + } + return flag; + } + + + }; + parametersPanel.setBorders(false); + + //parametersPanel.getElement().getStyle().setMargin(20, px); + parametersFieldSet = new FieldSet(); + parametersFieldSet.setHeadingText("Parameters"); + parametersPanel.add(parametersFieldSet); + + v.add(parametersPanel); + + loadOperatorParameters(); + + } + + /** + * + */ + private void addTitleField() { + HorizontalLayoutContainer hp = new HorizontalLayoutContainer(); + hp.add(new HTML("
Computation Title:
")); + titleField = new TextField(); + titleField.setWidth(250); + titleField.setValue(this.defaultComputationTitle); + FieldLabel titleLabel=new FieldLabel(titleField,"Computation Title"); + hp.add(titleLabel); + v.add(hp); + } + + /** + * @param parametersPanel + */ + private void loadOperatorParameters() { + DataMinerManager.getService().getParameters(operator, new AsyncCallback>() { + @Override + public void onSuccess(List result) { + operator.setOperatorParameters(result); + parametersFieldSet.clear(); + showForm(); + } + + @Override + public void onFailure(Throwable caught) { + UtilsGXT3.alert("Error ", "Impossible to retrieve parameters."); + } + }); + Image img = new Image(PRELOAD_IMAGE); + img.setStyleName("workflow-parameters-preload"); + parametersFieldSet.add(img); + } + + /** + * + */ + protected void showForm() { + // field widgets creation + for (Parameter p : operator.getOperatorParameters()) { + OperatorFieldWidget fieldWidget = new OperatorFieldWidget(p); + fieldWidgetsMap.put(p.getName(), fieldWidget); + parametersFieldSet.add(fieldWidget); + } + + for (Parameter p: operator.getOperatorParameters()) { + if (p.isColumn() || p.isColumnList()) { + // search for the table parameter which it depends + String tabParamName = (p.isColumn() + ? ((ColumnParameter)p).getReferredTabularParameterName() + : ((ColumnListParameter)p).getReferredTabularParameterName()); + + try { + // get the column field and the tabular field referred + TabularFld tabularField = (TabularFld)fieldWidgetsMap.get(tabParamName).getField(); + AbstractFld field = fieldWidgetsMap.get(p.getName()).getField(); + tabularField.addChangeListener(field); + } catch (Exception e) { + e.printStackTrace(); + UtilsGXT3.alert("Error", "Column parameter \""+p.getName()+" refers to a tabular parameter that doesn't exists ("+tabParamName+")\"", null); + } + } + } + + + final TextButton submit = new TextButton("Start Computation"); + submit.setToolTip(START_BUTTON_TOOLTIP); + submit.setIcon(DataMinerManager.resources.startComputation()); + submit.getElement().getStyle().setMarginLeft(20,Unit.PX); + submit.getElement().getStyle().setMarginBottom(20, Unit.PX); + + submit.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + if (handler!=null && parametersPanel.isValid()) { + String value = titleField.getValue(); + String title = (value==null || value.contentEquals("")) ? defaultComputationTitle : value; + handler.startComputation(title, title); // TODO insert description + } + + } + }); + + v.add(submit); + forceLayout(); + + parametersPanel.forceLayout(); + } + + public void updateOperatorParametersValues() { + for (Map.Entry entry : fieldWidgetsMap.entrySet()) { + OperatorFieldWidget fieldWidget = entry.getValue(); + fieldWidget.updateOperatorParameterValue(); + } + } + + /** + * @return the operator + */ + public Operator getOperator() { + return operator; + } + + public void setHandler(WorkflowOperatorPanelHandler handler) { + this.handler = handler; + } + + public String getDefaultComputationTitle() { + String name = this.operator.getName(); + //String date = DateTimeFormat.getShortDateTimeFormat().format(new Date()); + String date = DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_SHORT).format(new Date()); + + return name+"-"+date; + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/WorkflowPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/WorkflowPanel.java new file mode 100644 index 0000000..4d69234 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/experimentArea/WorkflowPanel.java @@ -0,0 +1,175 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.experimentArea; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; +import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationEvent; +import org.gcube.portlets.user.dataminermanager.client.experimentArea.WorkflowOperatorPanel.WorkflowOperatorPanelHandler; + +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Image; +import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale; +import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.TabItemConfig; +import com.sencha.gxt.widget.core.client.TabPanel; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem; +import com.sencha.gxt.widget.core.client.toolbar.ToolBar; + +/** + * @author ceras + * + */ +public class WorkflowPanel extends TabPanel { + + public static final String DEFAULT_OPERATOR = "AQUAMAPS_SUITABLE"; + private static final String DELETE_ALL_BUTTON_TOOLTIP = "Remove All Operators"; + private static final boolean WORKFLOW_MODE = false; + private WorkflowOperatorPanel workflowOperatorPanel; + private TextButton removeAllButton = new TextButton(DELETE_ALL_BUTTON_TOOLTIP); + private ComputationPanel computationPanel; + private ContentPanel workflowLc; + + + /** + * + */ + public WorkflowPanel() { + super(); + + bind(); + setBodyBorder(false); + + TabItemConfig tabWorkFlowLcItemConf = new TabItemConfig( + ".: Computation", false); + tabWorkFlowLcItemConf.setIcon(DataMinerManager.resources.folderExplore()); + workflowLc = new ContentPanel(); + workflowLc.setHeaderVisible(false); + add(workflowLc, tabWorkFlowLcItemConf); + + + + TabItemConfig tabComputationPanelItemConf = new TabItemConfig( + ".: Computations Execution", false); + tabComputationPanelItemConf.setIcon(DataMinerManager.resources.folderExplore()); + computationPanel = new ComputationPanel(); + add(computationPanel, tabComputationPanelItemConf); + + setToolsPanel(); + emptyPanel(); + setActiveWidget(computationPanel); + } + + /** + * + */ + private void bind() { + EventBusProvider.INSTANCE.addHandler(ResubmitComputationEvent.getType(), new ResubmitComputationEvent.ResubmitComputationHandler() { + @Override + public void onResubmitComputation(ResubmitComputationEvent event) { + setActiveWidget(computationPanel); + } + }); + } + + /** + * + */ + private void emptyPanel() { + workflowOperatorPanel = null; + removeAllButton.setEnabled(false); + workflowLc.clear(); + workflowLc.add(new HTML("










Select an operator.

")); + workflowLc.forceLayout();; + + } + + private void setToolsPanel() { + ToolBar toolBar = new ToolBar(); + toolBar.add(new LabelToolItem("Tools")); + + removeAllButton.setToolTip(DELETE_ALL_BUTTON_TOOLTIP); + removeAllButton.setIcon(DataMinerManager.resources.removeAll()); + removeAllButton.setScale(ButtonScale.MEDIUM); + removeAllButton.setEnabled(false); + removeAllButton.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + emptyPanel(); + + } + }); + + + toolBar.add(removeAllButton); + workflowLc.addTool(toolBar); + } + + /** + * @param computationTitle + * @param operator + * + */ + private void startComputation(String computationTitle, String computationDescription) { + + + if (workflowOperatorPanel!=null) { + forceLayout(); + workflowOperatorPanel.updateOperatorParametersValues(); + Operator op = workflowOperatorPanel.getOperator(); + + computationPanel.startNewComputation(op, computationTitle, computationDescription); + } + } + + public void addOperator(Operator op) { + + if (!WORKFLOW_MODE) + workflowOperatorPanel = null; + + setActiveWidget(workflowLc); + + if (workflowOperatorPanel==null) { + workflowLc.clear(); + workflowLc.add(new HTML(" ")); + workflowLc.forceLayout(); + } + + workflowOperatorPanel = new WorkflowOperatorPanel(op); + workflowOperatorPanel.setHandler(new WorkflowOperatorPanelHandler() { + @Override + public void startComputation(String computationTitle, String computationDescription) { + WorkflowPanel.this.startComputation(computationTitle, computationDescription); + setActiveWidget(computationPanel); + } + }); + + addConnector(true); + + workflowLc.add(workflowOperatorPanel); // operator + workflowLc.forceLayout(); + + removeAllButton.setEnabled(true); + } + + + /** + * + * @param first + */ + private void addConnector(boolean first) { + SimpleContainer lc = new SimpleContainer(); + lc.setHeight(first ? 26 : 22); + lc.add(new Image( + first ? DataMinerManager.resources.workflowConnector1() : DataMinerManager.resources.workflowConnector2() + )); + workflowLc.add(lc); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/AbstractFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/AbstractFld.java new file mode 100644 index 0000000..baaab3a --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/AbstractFld.java @@ -0,0 +1,54 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; + +/** + * @author ceras + * + */ +public abstract class AbstractFld { + + protected Parameter parameter; + public abstract String getValue(); + public abstract Widget getWidget(); + + /** + * + */ + public AbstractFld(Parameter parameter) { + this.parameter = parameter; + } + + /** + * @return the operator + */ + public Parameter getParameter() { + return parameter; + } + + /** + * @param operator the operator to set + */ + public void setParameter(Parameter parameter) { + this.parameter = parameter; + } + + /** + * @return + */ + public boolean isValid() { + // is valid by dafault + // (for string, int, float, double and boolean) the built-in validation is enough + return true; + } + /** + * @param tableItem + */ + public void fireEvent(Object message) { + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/BooleanFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/BooleanFld.java new file mode 100644 index 0000000..4737614 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/BooleanFld.java @@ -0,0 +1,44 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.form.CheckBox; + +/** + * @author ceras + * + */ +public class BooleanFld extends AbstractFld { + + private CheckBox checkBox = new CheckBox(); + + /** + * @param parameter + */ + public BooleanFld(Parameter parameter) { + super(parameter); + + ObjectParameter p = (ObjectParameter)parameter; + checkBox.setValue(!p.getDefaultValue().toUpperCase().equals("FALSE")); + if (p.getDescription()!=null) + checkBox.setTitle(p.getDescription()); + checkBox.setBoxLabel(p.getName()); + } + + + @Override + public String getValue() { + return (checkBox.getValue() ? "true" : "false"); + } + + @Override + public Widget getWidget() { + return checkBox; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ColumnFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ColumnFld.java new file mode 100644 index 0000000..4ff2c7e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ColumnFld.java @@ -0,0 +1,137 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import java.util.ArrayList; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemPropertiesCombo; +import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction; +import com.sencha.gxt.data.shared.ListStore; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.form.ComboBox; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ColumnFld extends AbstractFld { + + private VerticalLayoutContainer vp; + + private String defaultColumn; + + private ComboBox comboBox; + private ListStore store; + private String referredTabularParameterName; + + /** + * @param parameter + */ + public ColumnFld(Parameter parameter) { + super(parameter); + vp = new VerticalLayoutContainer(); + + ColumnParameter p = (ColumnParameter) parameter; + this.referredTabularParameterName = p.getReferredTabularParameterName(); + this.defaultColumn = p.getDefaultColumn(); + + ColumnItemPropertiesCombo props = GWT + .create(ColumnItemPropertiesCombo.class); + + store = new ListStore(props.id()); + + comboBox = new ComboBox(store, props.label()); + comboBox.setAllowBlank(false); + comboBox.setForceSelection(true); + comboBox.setEditable(false); + comboBox.setTriggerAction(TriggerAction.ALL); + if (p.getDescription() != null) + comboBox.setTitle(p.getDescription()); + comboBox.setEnabled(false); + showNoSelectionField(); + } + + /** + * + */ + private void showNoSelectionField() { + vp.clear(); + ; + vp.add(comboBox); + vp.add(new HTML( + "
Select table from parameter " + + referredTabularParameterName + "
")); + vp.forceLayout(); + } + + /** + * + */ + private void showFieldWithSelection(TableItemSimple tableItem) { + vp.clear(); + vp.add(comboBox); + vp.add(new HTML( + "
Columns of Table " + + tableItem.getName() + "
")); + vp.forceLayout(); + } + + /** + * + */ + @Override + public String getValue() { + ColumnItem columnItem = comboBox.getCurrentValue(); + return columnItem != null ? columnItem.getName() : null; + } + + /** + * + */ + @Override + public Widget getWidget() { + return vp; + } + + + @Override + public void fireEvent(Object message) { + if (message == null) { + store.clear(); + store.commitChanges(); + comboBox.clear(); + comboBox.setEnabled(false); + showNoSelectionField(); + } else { + TableItemSimple tableItem = (TableItemSimple) message; + store.clear(); + store.commitChanges(); + ArrayList columns = tableItem.getColumns(); + if (columns != null) { + store.addAll(columns); + for (ColumnItem columnItem : columns) { + if (columnItem.getName().compareTo(defaultColumn) == 0) { + comboBox.setValue(columnItem); + break; + } + } + store.commitChanges(); + } + comboBox.clear(); + comboBox.setEnabled(true); + showFieldWithSelection(tableItem); + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ColumnListFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ColumnListFld.java new file mode 100644 index 0000000..da4c938 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ColumnListFld.java @@ -0,0 +1,168 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemProperties; +import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.core.client.IdentityValueProvider; +import com.sencha.gxt.core.client.Style.SelectionMode; +import com.sencha.gxt.data.shared.ListStore; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel; +import com.sencha.gxt.widget.core.client.grid.ColumnConfig; +import com.sencha.gxt.widget.core.client.grid.ColumnModel; +import com.sencha.gxt.widget.core.client.grid.Grid; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ColumnListFld extends AbstractFld { + + + private VerticalLayoutContainer vp; + private ColumnListParameter columnListParameter; + private ListStore store; + private Grid grid; + private CheckBoxSelectionModel sm; + + /** + * + * @param parameter + */ + public ColumnListFld(Parameter parameter) { + super(parameter); + + this.columnListParameter = (ColumnListParameter) parameter; + vp = new VerticalLayoutContainer(); + init(); + showNoSelectionField(); + } + + private void init() { + ColumnItemProperties props = GWT.create(ColumnItemProperties.class); + + ColumnConfig labelCol = new ColumnConfig( + props.label()); + + IdentityValueProvider identity = new IdentityValueProvider(); + sm = new CheckBoxSelectionModel(identity); + + List> l = new ArrayList>(); + l.add(sm.getColumn()); + l.add(labelCol); + ColumnModel cm = new ColumnModel(l); + + store = new ListStore(props.id()); + + grid = new Grid(store, cm); + + sm.setSelectionMode(SelectionMode.MULTI); + grid.setSelectionModel(sm); + // grid.getView().setAutoExpandColumn(labelCol); + grid.setSize("150px", "150px"); + grid.getView().setStripeRows(true); + grid.getView().setColumnLines(true); + grid.getView().setAutoFill(true); + grid.setBorders(false); + grid.setLoadMask(true); + grid.setColumnReordering(true); + grid.setColumnResize(false); + grid.disable(); + + } + + /** + * + */ + private void showNoSelectionField() { + vp.clear(); + vp.add(grid); + vp.add(new HTML( + "
Select table from parameter " + + this.columnListParameter + .getReferredTabularParameterName() + "
")); + vp.forceLayout(); + } + + /** + * + */ + private void showFieldWithSelection(TableItemSimple tableItem) { + vp.clear(); + vp.add(grid); + vp.add(new HTML( + "
Columns of Data Set " + + tableItem.getName() + "
")); + vp.forceLayout(); + } + + + /** + * + */ + @Override + public String getValue() { + String separator = columnListParameter.getSeparator(); + String value = ""; + boolean first = true; + + for (ColumnItem columnItem : sm.getSelection()) { + String columnName = columnItem.getName(); + value += (first ? "" : separator) + columnName; + first = false; + } + return value; + } + + /** + * + */ + @Override + public Widget getWidget() { + return vp; + } + + /** + * + */ + @Override + public void fireEvent(Object message) { + if (message == null) { + store.clear(); + store.commitChanges(); + grid.disable(); + showNoSelectionField(); + } else { + TableItemSimple tableItem = (TableItemSimple) message; + store.clear(); + store.commitChanges(); + store.addAll(tableItem.getColumns()); + store.commitChanges(); + grid.enable(); + showFieldWithSelection(tableItem); + } + } + + /** + * + */ + @Override + public boolean isValid() { + return store.size() > 0; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/DoubleFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/DoubleFld.java new file mode 100644 index 0000000..bd2e27e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/DoubleFld.java @@ -0,0 +1,53 @@ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.form.DoubleField; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class DoubleFld extends AbstractFld { + + private DoubleField numberField; + + /** + * @param operator + */ + public DoubleFld(Parameter parameter) { + super(parameter); + + ObjectParameter p = (ObjectParameter) parameter; + + numberField = new DoubleField(); + + if (p.getDefaultValue() != null) + numberField.setValue(Double.parseDouble(p.getDefaultValue())); + + if (p.getDescription() != null) + numberField.setTitle(p.getDescription()); + + } + + /** + * + */ + @Override + public String getValue() { + return numberField.getCurrentValue().toString(); + } + + /** + * + */ + @Override + public Widget getWidget() { + return numberField; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/EnumFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/EnumFld.java new file mode 100644 index 0000000..d254549 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/EnumFld.java @@ -0,0 +1,61 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.EnumParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction; +import com.sencha.gxt.data.shared.StringLabelProvider; +import com.sencha.gxt.widget.core.client.form.SimpleComboBox; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class EnumFld extends AbstractFld { + + private SimpleComboBox listBox; + + /** + * @param parameter + */ + public EnumFld(Parameter parameter) { + super(parameter); + + EnumParameter p = (EnumParameter) parameter; + + listBox = new SimpleComboBox(new StringLabelProvider<>()); + listBox.add(p.getValues()); + listBox.setAllowBlank(false); + listBox.setForceSelection(true); + listBox.setEditable(false); + listBox.setTriggerAction(TriggerAction.ALL); + if (p.getDescription() != null) + listBox.setTitle(p.getDescription()); + if (p.getDefaultValue() != null) + listBox.setValue(p.getDefaultValue()); + + } + + /** + * + */ + @Override + public String getValue() { + return listBox.getCurrentValue(); + } + + /** + * + */ + @Override + public Widget getWidget() { + return listBox; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/FileFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/FileFld.java new file mode 100644 index 0000000..a83fbd8 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/FileFld.java @@ -0,0 +1,223 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription; +import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener; +import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; +import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.core.client.dom.XDOM; +import com.sencha.gxt.core.client.util.Format; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class FileFld extends AbstractFld { + + private VerticalLayoutContainer vp; + + // FileSelector fileSelector; + private WorkspaceExplorerSelectDialog wselectDialog; + private TextButton selectButton, selectButton2, cancelButton; + private ItemDescription selectedFileItem = null; + + /** + * @param parameter + */ + public FileFld(Parameter parameter) { + super(parameter); + vp=new VerticalLayoutContainer(); + /* + * fileSelector = new FileSelector() { + * + * @Override public void fireSelection(TableItemSimple fileItem) { + * super.fireSelection(fileItem); selectedFileItem = fileItem; + * showFieldWithSelection(); } }; + */ + + List selectableTypes = new ArrayList(); + selectableTypes.add(ItemType.EXTERNAL_FILE); + List showableTypes = new ArrayList(); + showableTypes.addAll(Arrays.asList(ItemType.values())); + + wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false); + // filterCriteria, selectableTypes); + + WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() { + + @Override + public void onSelectedItem(Item item) { + + if (item.isFolder() || item.isRoot()) { + UtilsGXT3.info("Attention", "Select a valid csv!"); + + } else { + retrieveFileInformation(item); + + } + + } + + @Override + public void onFailed(Throwable throwable) { + Log.error("Error in create project: " + + throwable.getLocalizedMessage()); + UtilsGXT3.alert("Error", throwable.getLocalizedMessage()); + throwable.printStackTrace(); + } + + @Override + public void onAborted() { + + } + + @Override + public void onNotValidSelection() { + UtilsGXT3.info("Attention", "Select a valid csv!"); + } + }; + + wselectDialog.addWorkspaceExplorerSelectNotificationListener(handler); + wselectDialog.setZIndex(XDOM.getTopZIndex()); + + selectButton = new TextButton("Select File"); + selectButton.setIcon(DataMinerManager.resources.folderExplore()); + selectButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + wselectDialog.show(); + + } + }); + selectButton.setToolTip("Select File"); + + + + selectButton2 = new TextButton(""); + selectButton2.setIcon(DataMinerManager.resources.folderExplore()); + selectButton2.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + wselectDialog.show(); + } + }); + selectButton2.setToolTip("Select Another File"); + + cancelButton = new TextButton(""); + cancelButton.setIcon(DataMinerManager.resources.cancel()); + cancelButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + selectedFileItem = null; + showNoSelectionField(); + } + }); + + showNoSelectionField(); + } + + private void retrieveFileInformation(final Item item) { + Log.debug("Retrieved: " + item); + final ItemDescription itemDescription = new ItemDescription(item.getId(), + item.getName(), item.getOwner(), item.getPath(), item.getType() + .name()); + + DataMinerPortletServiceAsync.INSTANCE.getPublicLink(itemDescription, + new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Log.error("Error in retrieveFileInformation: " + + caught.getMessage()); + if (caught instanceof ExpiredSessionServiceException) { + UtilsGXT3.alert("Error", "Expired Session"); + // sessionExpiredShowDelayed(); + + } else { + UtilsGXT3.alert( + "Error", + "Error retrieving file informations: " + + caught.getLocalizedMessage()); + } + + } + + @Override + public void onSuccess(String result) { + itemDescription.setPublicLink(result); + selectedFileItem = itemDescription; + Log.debug("SelectedFileItem: " + selectedFileItem); + showFieldWithSelection(); + + } + }); + + + + } + + private void showNoSelectionField() { + vp.clear(); + vp.add(selectButton); + vp.forceLayout(); + } + + private void showFieldWithSelection() { + // final String fileId = selectedFileItem.getId(); + final String fileName = selectedFileItem.getName(); + + vp.clear(); + HorizontalLayoutContainer hp = new HorizontalLayoutContainer(); + hp.add(new HTML("
" + + Format.ellipse(fileName, 30) + "
")); + hp.add(selectButton2); + hp.add(cancelButton); + vp.add(hp); + vp.forceLayout(); + } + + /** + * + */ + @Override + public boolean isValid() { + return (selectedFileItem != null); + } + + @Override + public Widget getWidget() { + return vp; + } + + @Override + public String getValue() { + return (selectedFileItem == null) ? null : selectedFileItem.getPublicLink(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/FloatFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/FloatFld.java new file mode 100644 index 0000000..d984f28 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/FloatFld.java @@ -0,0 +1,53 @@ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.form.FloatField; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class FloatFld extends AbstractFld { + + private FloatField numberField; + + /** + * @param operator + */ + public FloatFld(Parameter parameter) { + super(parameter); + + ObjectParameter p = (ObjectParameter) parameter; + + numberField = new FloatField(); + + if (p.getDefaultValue() != null) + numberField.setValue(Float.parseFloat(p.getDefaultValue())); + + if (p.getDescription() != null) + numberField.setTitle(p.getDescription()); + + } + + /** + * + */ + @Override + public String getValue() { + Float f = numberField.getCurrentValue(); + return f.toString(); + } + + /** + * + */ + @Override + public Widget getWidget() { + return numberField; + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/IntFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/IntFld.java new file mode 100644 index 0000000..12784c2 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/IntFld.java @@ -0,0 +1,59 @@ + +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.form.IntegerField; + + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class IntFld extends AbstractFld { + + + private IntegerField numberField; + + /** + * @param operator + */ + public IntFld(Parameter parameter) { + super(parameter); + + ObjectParameter p = (ObjectParameter) parameter; + + + numberField = new IntegerField(); + + if (p.getDefaultValue() != null) + numberField.setValue(Integer.parseInt(p.getDefaultValue())); + + if (p.getDescription() != null) + numberField.setTitle(p.getDescription()); + numberField.setAllowBlank(false); + + } + + /** + * + */ + @Override + public String getValue() { + Integer i = numberField.getCurrentValue(); + return i.toString(); + } + + /** + * + */ + @Override + public Widget getWidget() { + return numberField; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ListIntFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ListIntFld.java new file mode 100644 index 0000000..20594f7 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ListIntFld.java @@ -0,0 +1,191 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * @author ceras + * + */ +public class ListIntFld extends AbstractFld { + + private List items; + private SimpleContainer simpleContainer; + private VerticalLayoutContainer vp; + private ListParameter listParameter; + + /** + * @param parameter + */ + public ListIntFld(Parameter parameter) { + super(parameter); + this.listParameter = (ListParameter) parameter; + simpleContainer=new SimpleContainer(); + vp = new VerticalLayoutContainer(); + simpleContainer.add(vp); + items = new ArrayList(); + addField(null); + } + + private void addField(Item upperItem) { + + ObjectParameter objPar = new ObjectParameter(listParameter.getName(), + listParameter.getDescription(), listParameter.getType(), null); + + if (upperItem == null) { + Item item = new Item(objPar, true); + items.add(item); + vp.add(item); + } else { + // search the position of the upper item + int pos = 0; + for (int i = 0; i < items.size(); i++) + if (items.get(i) == upperItem) { + pos = i; + break; + } + + upperItem.showCancelButton(); + Item item = new Item(objPar, false); + items.add(pos + 1, item); + vp.insert(item, pos + 1); + } + + simpleContainer.forceLayout(); + } + + /** + * @param item + */ + private void removeField(Item item) { + items.remove(item); + + vp.remove(item); + + if (items.size() == 1) { + items.get(0).hideCancelButton(); + } + + simpleContainer.forceLayout(); + + } + + /** + * + */ + @Override + public String getValue() { + String separator = listParameter.getSeparator(); + String value = ""; + boolean first = true; + for (Item item : items) { + String itemValue = item.getValue(); + if (itemValue != null && !itemValue.contentEquals("")) { + value += (first ? "" : separator) + itemValue; + first = false; + } + } + return value; + } + + /** + * + */ + @Override + public Widget getWidget() { + return simpleContainer; + } + + /** + * + */ + @Override + public boolean isValid() { + boolean valid = false; + for (Item item : items) + if (item.getField().getValue() != null) { + valid = true; + break; + } + return valid; + } + + private class Item extends HorizontalLayoutContainer { + + private IntFld field; + private TextButton addButton; + private TextButton removeButton; + + /** + * @param objPar + */ + public Item(ObjectParameter objectParameter, boolean first) { + super(); + this.field = new IntFld(objectParameter); + this.add(field.getWidget()); + + addButton = new TextButton(""); + + addButton.setIcon(DataMinerManager.resources.add()); + + addButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + addField(Item.this); + + } + }); + + removeButton = new TextButton(""); + + removeButton.setIcon(DataMinerManager.resources.cancel()); + + removeButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + removeField(Item.this); + + } + }); + + removeButton.setVisible(!first); + + this.add(addButton); + this.add(removeButton); + } + + public void showCancelButton() { + removeButton.setVisible(true); + } + + public void hideCancelButton() { + removeButton.setVisible(false); + } + + public String getValue() { + return field.getValue(); + } + + public IntFld getField() { + return field; + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ListStringFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ListStringFld.java new file mode 100644 index 0000000..8d95c35 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/ListStringFld.java @@ -0,0 +1,191 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * @author ceras + * + */ +public class ListStringFld extends AbstractFld { + + private List items; + private SimpleContainer simpleContainer; + private VerticalLayoutContainer vp; + private ListParameter listParameter; + + /** + * @param parameter + */ + public ListStringFld(Parameter parameter) { + super(parameter); + this.listParameter = (ListParameter) parameter; + simpleContainer = new SimpleContainer(); + vp = new VerticalLayoutContainer(); + simpleContainer.add(vp); + items = new ArrayList(); + addField(null); + } + + private void addField(Item upperItem) { + + ObjectParameter objPar = new ObjectParameter(listParameter.getName(), + listParameter.getDescription(), listParameter.getType(), null); + + if (upperItem == null) { + Item item = new Item(objPar, true); + items.add(item); + vp.add(item); + } else { + // search the position of the upper item + int pos = 0; + for (int i = 0; i < items.size(); i++) + if (items.get(i) == upperItem) { + pos = i; + break; + } + + upperItem.showCancelButton(); + Item item = new Item(objPar, false); + items.add(pos + 1, item); + vp.insert(item, pos + 1); + } + + simpleContainer.forceLayout(); + } + + /** + * @param item + */ + protected void removeField(Item item) { + items.remove(item); + + vp.remove(item); + + if (items.size() == 1) { + items.get(0).hideCancelButton(); + } + + simpleContainer.forceLayout(); + + } + + /** + * + */ + @Override + public String getValue() { + String separator = listParameter.getSeparator(); + String value = ""; + boolean first = true; + for (Item item : items) { + String itemValue = item.getValue(); + if (itemValue != null && !itemValue.contentEquals("")) { + value += (first ? "" : separator) + itemValue; + first = false; + } + } + return value; + } + + /** + * + */ + @Override + public Widget getWidget() { + return simpleContainer; + } + + /** + * + */ + @Override + public boolean isValid() { + boolean valid = false; + for (Item item : items) + if (item.getField().getValue() != null) { + valid = true; + break; + } + return valid; + } + + private class Item extends HorizontalLayoutContainer { + + private StringFld field; + private TextButton addButton; + private TextButton removeButton; + + /** + * @param objPar + */ + public Item(ObjectParameter objectParameter, boolean first) { + super(); + this.field = new StringFld(objectParameter); + this.add(field.getWidget()); + + addButton = new TextButton(""); + + addButton.setIcon(DataMinerManager.resources.add()); + + addButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + addField(Item.this); + + } + }); + + removeButton = new TextButton(""); + + removeButton.setIcon(DataMinerManager.resources.cancel()); + + removeButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + removeField(Item.this); + + } + }); + + removeButton.setVisible(!first); + + this.add(addButton); + this.add(removeButton); + } + + public void showCancelButton() { + removeButton.setVisible(true); + } + + public void hideCancelButton() { + removeButton.setVisible(false); + } + + public String getValue() { + return field.getValue(); + } + + public StringFld getField() { + return field; + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/OpenTableButton.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/OpenTableButton.java new file mode 100644 index 0000000..846bcdc --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/OpenTableButton.java @@ -0,0 +1,84 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; + +import com.sencha.gxt.widget.core.client.Dialog; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.event.HideEvent; +import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * @author ceras + * + */ +public abstract class OpenTableButton extends TextButton { + + protected TableItemSimple tableItem=null; + protected boolean added = false; + + public abstract void onOpenTable(); + + public abstract void onHideTable(); + + public OpenTableButton() { + super("Open Data Set", DataMinerManager.resources.table()); + this.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + //TabularData tabularData = DataMinerManager.getTabularData(); + //TabularDataGridPanel gridPanel = tabularData.getGridPanel(); + + Dialog dialog = new Dialog(); + dialog.setMaximizable(true); + dialog.setBodyBorder(false); + dialog.setExpanded(true); + dialog.setHeadingText("Data Set "+tableItem.getName()); + dialog.setWidth(700); + dialog.setHeight(500); + dialog.setHideOnButtonClick(true); + dialog.setModal(true); + //dialog.add(gridPanel); + dialog.show(); + + dialog.addHideHandler(new HideHandler() { + @Override + public void onHide(HideEvent event) { + onHideTable(); + } + }); + + onOpenTable(); + + //tabularData.openTable(tableItem.getId()); + //gridPanel.setHeaderVisible(false); + } + }); + + } + + public void setTable(TableItemSimple tableItem) { + this.tableItem = tableItem; + } + + + /** + * @return the added + */ + public boolean isAdded() { + return added; + } + + /** + * @param added the added to set + */ + public void setAdded(boolean added) { + this.added = added; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/OperatorFieldWidget.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/OperatorFieldWidget.java new file mode 100644 index 0000000..bac6d6f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/OperatorFieldWidget.java @@ -0,0 +1,155 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.form.FieldLabel; + +/** + * @author ceras + * + */ +public class OperatorFieldWidget extends SimpleContainer { + + private Parameter parameter; + + private AbstractFld field; + private HorizontalLayoutContainer horiz; + + // private Field generalParameterField; + // private SimpleComboBox inputDataParameterField; + // private TextField outputDataParameterField; + + /** + * + */ + public OperatorFieldWidget(Parameter p) { + super(); + this.parameter = p; + horiz = new HorizontalLayoutContainer(); + + try { + // this.setStyleAttribute("margin", "10px"); + if (p.isObject()) + field = createObjectField((ObjectParameter) p); + else if (p.isEnum()) + field = new EnumFld(p); + else if (p.isTabular()) + field = new TabularFld(p); + else if (p.isTabularList()) + field = new TabularListFld(p); + else if (p.isColumn()) + field = new ColumnFld(p); + else if (p.isColumnList()) + field = new ColumnListFld(p); + else if (p.isList()) + field = createListField((ListParameter) p); + else if (p.isFile()) + field = new FileFld(p); + + FieldLabel label = new FieldLabel(field.getWidget(), p.getName()); + horiz.add(label, new HorizontalLayoutData(-1, 1, new Margins(0))); + + if (p.getDescription() != null) { + HTML descr = new HTML(p.getDescription()); + descr.addStyleName("workflow-fieldDescription"); + horiz.add(descr); + } + + } catch (Throwable e) { + Log.error("Error: " + e.getLocalizedMessage()); + e.printStackTrace(); + horiz.add(new FieldLabel(new HTML("Error in field retrieving!"),p.getName())); + } + + add(horiz, new MarginData(0)); + } + + /** + * @return the parameter + */ + public Parameter getParameter() { + return parameter; + } + + public String getFieldValue() { + return field.getValue(); + } + + public String getValue() { + return getFieldValue(); + } + + /** + * @param p + * @return + */ + private AbstractFld createObjectField(ObjectParameter p) { + String type = p.getType(); + if (type.contentEquals(Integer.class.getName())) { + return new IntFld(p); + } else if (type.contentEquals(String.class.getName())) { + return new StringFld(p); + } else if (type.contentEquals(Boolean.class.getName())) { + return new BooleanFld(p); + } else if (type.contentEquals(Double.class.getName())) { + return new DoubleFld(p); + } else if (type.contentEquals(Float.class.getName())) { + return new FloatFld(p); + } else + return null; + } + + /** + * + */ + private AbstractFld createListField(ListParameter p) { + String type = p.getType(); + + if (type.contentEquals(String.class.getName()) + || type.contentEquals("STRING")) { // TODO REMOVE "STRING" + return new ListStringFld(p); + } else if (type.contentEquals(Integer.class.getName()) + || type.contentEquals("NUMBER")) { + return new ListIntFld(p); + } + // } else if (type.contentEquals(Boolean.class.getName())) { + // return new ListBooleanField(p); + // } else if (type.contentEquals(Double.class.getName())) { + // return new ListDoubleField(p); + // } else if (type.contentEquals(Float.class.getName())) { + // return new ListFloatField(p); + // } + else + return null; + } + + /** + * + */ + public void updateOperatorParameterValue() { + this.parameter.setValue(this.getFieldValue()); + } + + public AbstractFld getField() { + return field; + } + + public boolean isValid() { + if (field != null) + return field.isValid(); + else + return false; + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/StringFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/StringFld.java new file mode 100644 index 0000000..1949c6e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/StringFld.java @@ -0,0 +1,55 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; + +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.form.TextField; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class StringFld extends AbstractFld { + + private TextField textField; + + /** + * @param parameter + */ + public StringFld(Parameter parameter) { + super(parameter); + + textField = new TextField(); + ObjectParameter p = (ObjectParameter) parameter; + textField.setValue(p.getDefaultValue()); + + if (p.getDefaultValue() == null) + textField.setAllowBlank(false); + if (p.getDescription() != null) + textField.setToolTip(p.getDescription()); + + } + + /** + * + */ + @Override + public String getValue() { + return textField.getValue(); + } + + /** + * + */ + @Override + public Widget getWidget() { + return textField; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/TabularFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/TabularFld.java new file mode 100644 index 0000000..7975ef4 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/TabularFld.java @@ -0,0 +1,355 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; +import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException; +import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener; +import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; +import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.core.client.dom.XDOM; +import com.sencha.gxt.core.client.util.Format; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class TabularFld extends AbstractFld { + + private SimpleContainer sc; + private VerticalLayoutContainer vp; + + // TableSelector tableSelector; + private WorkspaceExplorerSelectDialog wselectDialog; + private TextButton selectButton, selectButton2, cancelButton; + private HTML templatesList; + private TableItemSimple selectedTableItem = null; + private List listeners = new ArrayList(); + + /** + * @param parameter + */ + public TabularFld(Parameter parameter) { + super(parameter); + Log.debug("TabularField"); + vp=new VerticalLayoutContainer(); + init(); + sc=new SimpleContainer(); + sc.add(vp, new MarginData(0)); + showNoSelectionField(); + } + + + private void init() { + TabularParameter p = (TabularParameter) parameter; + List templates = p.getTemplates(); + + /* + * tableSelector = new TableSelector(templates) { + * + * @Override public void fireSelection(TableItemSimple tableItem) { + * super.fireSelection(tableItem); selectedTableItem = tableItem; + * showFieldWithSelection(); + * + * loadTableMetadata(tableItem); // send change message to all listeners + * // it will be managed by all columnFields and columnListField that + * depends by tabular field } }; + */ + List selectableTypes = new ArrayList(); + selectableTypes.add(ItemType.EXTERNAL_FILE); + List showableTypes = new ArrayList(); + showableTypes.addAll(Arrays.asList(ItemType.values())); + + /* + "application/zip", "application/x-zip", + "application/x-zip-compressed", "application/octet-stream", + "application/x-compress", "application/x-compressed", + "multipart/x-zip" + */ + //List allowedMimeTypes = Arrays.asList("text/csv","text/plain","text/plain; charset=ISO-8859-1"); + + /** + * "zip" + */ + + /*List allowedFileExtensions = Arrays.asList("csv"); + + FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes, + allowedFileExtensions, new HashMap()); + */ + wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV",false); + // filterCriteria, selectableTypes); + + WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() { + + @Override + public void onSelectedItem(Item item) { + + if (item.isFolder() || item.isRoot()) { + UtilsGXT3.info("Attention", "Select a valid csv!"); + + } else { + retrieveTableInformation(item); + + } + + } + + @Override + public void onFailed(Throwable throwable) { + Log.error("Error in create project: " + + throwable.getLocalizedMessage()); + UtilsGXT3.alert("Error", throwable.getLocalizedMessage()); + throwable.printStackTrace(); + } + + @Override + public void onAborted() { + + } + + @Override + public void onNotValidSelection() { + UtilsGXT3.info("Attention", "Select a valid csv!"); + } + }; + + wselectDialog.addWorkspaceExplorerSelectNotificationListener(handler); + wselectDialog.setZIndex(XDOM.getTopZIndex()); + + selectButton = new TextButton("Select Data Set"); + selectButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + wselectDialog.show(); + } + }); + + selectButton.setIcon(DataMinerManager.resources.folderExplore()); + selectButton.setToolTip("Select Data Set"); + + + selectButton2 = new TextButton(""); + selectButton2.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + wselectDialog.show(); + } + }); + + selectButton2.setIcon(DataMinerManager.resources.folderExplore()); + selectButton2.setToolTip("Select Another Data Set"); + + cancelButton = new TextButton(""); + cancelButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + selectedTableItem = null; + showNoSelectionField(); + updateListeners(null); + } + }); + + cancelButton.setIcon(DataMinerManager.resources.cancel()); + + + String list = ""; + boolean first = true; + for (String template : templates) { + list += (first ? "" : ", ") + template; + first = false; + } + templatesList = new HTML("Suitable Data Set Templates:
" + list); + templatesList.addStyleName("workflow-templatesList"); + + + } + + private void retrieveTableInformation(Item item) { + DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(item, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Log.error("Error in retrieveTableInformation " + caught.getMessage()); + if (caught instanceof ExpiredSessionServiceException) { + UtilsGXT3.alert("Error", "Expired Session"); + //sessionExpiredShowDelayed(); + + } else { + UtilsGXT3.alert( + "Error", + "Error retrieving table information: " + + caught.getLocalizedMessage()); + } + + } + + @Override + public void onSuccess(TableItemSimple result) { + Log.debug("Retrieved: "+result); + selectedTableItem=result; + showFieldWithSelection(); + //loadTableMetadata(selectedTableItem); + updateListeners(selectedTableItem); + } + }); + } + + /** + * @param tableItem + + protected void loadTableMetadata(final TableItemSimple tableItem) { + //TabularData tabularData = DataMinerManager.getTabularData(); + String tableId = tableItem.getId(); + + tabularData.getTableDefinition(tableId, + new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + vp.unmask(); + Info.display("ERROR", ""); + } + + @Override + public void onSuccess(TableDefinition tableDefinition) { + vp.unmask(); + List columns = tableDefinition + .getColumnsAsList(); + Collections.sort(columns, new ColumnPositionComparator( + false)); + for (ColumnDefinition column : columns) + tableItem.addColumnName(column.getLabel()); + updateListeners(tableItem); + } + + }); + + vp.mask("Load Data Set Metadata...", Constants.maskLoadingStyle); + }*/ + + /** + * @param id + */ + protected void updateListeners(TableItemSimple tableItem) { + for (AbstractFld abstractField : listeners) { + abstractField.fireEvent(tableItem); + } + } + + /** + * + */ + private void showNoSelectionField() { + vp.clear(); + vp.add(selectButton); + vp.add(templatesList); + sc.forceLayout(); + } + + /** + * + */ + private void showFieldWithSelection() { + //final String tableId = selectedTableItem.getId(); + final String tableName = selectedTableItem.getName(); + + vp.clear(); + HorizontalLayoutContainer hp = new HorizontalLayoutContainer(); + hp.add(new HTML("
" + + Format.ellipse(tableName, 30) + "
")); + hp.add(selectButton2); + hp.add(cancelButton); + + TextButton openTableButton = new TextButton("Open Data Set"); + openTableButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + /*TabularData tabularData = DataMinerManager + .getTabularData(); + TabularDataGridPanel gridPanel = tabularData + .getGridPanel(); + gridPanel.setExpanded(true); + gridPanel.setBorders(true); + + Dialog dialog = new Dialog(); + dialog.setMaximizable(true); + dialog.setBodyBorder(false); + dialog.setExpanded(true); + + dialog.setHeadingText("Data Set " + tableName); + dialog.setWidth(640); + dialog.setHeight(480); + dialog.setHideOnButtonClick(true); + dialog.setModal(true); + dialog.add(gridPanel); + dialog.show(); + + tabularData.openTable(tableId); + gridPanel.setHeaderVisible(false);*/ + + } + }); + + hp.add(openTableButton); + vp.add(hp); + vp.add(templatesList); + sc.forceLayout(); + } + + /** + * + */ + @Override + public String getValue() { + return (selectedTableItem == null) ? null : selectedTableItem.getId(); + } + + /** + * + */ + @Override + public Widget getWidget() { + return sc; + } + + /** + * + */ + @Override + public boolean isValid() { + return (selectedTableItem != null); + } + + public void addChangeListener(AbstractFld abstractField) { + this.listeners.add(abstractField); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/TabularListFld.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/TabularListFld.java new file mode 100644 index 0000000..c8cc0f0 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/form/TabularListFld.java @@ -0,0 +1,191 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.form; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class TabularListFld extends AbstractFld { + + private List items = new ArrayList(); + private VerticalLayoutContainer vp; + private TabularListParameter tabularListParameter; + + /** + * @param parameter + */ + public TabularListFld(Parameter parameter) { + super(parameter); + Log.debug("TabularListField"); + this.tabularListParameter = (TabularListParameter) parameter; + vp = new VerticalLayoutContainer(); + addField(null); + } + + private void addField(Item upperItem) { + + TabularParameter tabPar = new TabularParameter( + tabularListParameter.getName(), + tabularListParameter.getDescription(),null, + tabularListParameter.getTemplates()); + + if (upperItem == null) { + Item item = new Item(tabPar, true); + items.add(item); + vp.add(item); + } else { + // search the position of the upper item + int pos = 0; + for (int i = 0; i < items.size(); i++) + if (items.get(i) == upperItem) { + pos = i; + break; + } + + upperItem.showCancelButton(); + Item item = new Item(tabPar, false); + items.add(pos + 1, item); + vp.insert(item, pos + 1); + } + + vp.forceLayout(); + } + + /** + * @param item + */ + protected void removeField(Item item) { + items.remove(item); + + vp.remove(item); + vp.forceLayout(); + + if (items.size() == 1) { + items.get(0).hideCancelButton(); + } + + } + + /** + * + */ + @Override + public String getValue() { + String separator = tabularListParameter.getSeparator(); + String value = ""; + boolean first = true; + for (Item item : items) { + String itemValue = item.getValue(); + if (itemValue != null && !itemValue.contentEquals("")) { + value += (first ? "" : separator) + itemValue; + first = false; + } + } + return value; + } + + /** + * + */ + @Override + public Widget getWidget() { + return vp; + } + + /** + * + */ + @Override + public boolean isValid() { + boolean valid = false; + for (Item item : items) + if (item.getField().getValue() != null) { + valid = true; + break; + } + return valid; + } + + private class Item extends HorizontalLayoutContainer { + + private TabularFld field; + private TextButton addButton; + + private TextButton removeButton; + + + /** + * + * @param tabularParameter + * @param first + */ + public Item(TabularParameter tabularParameter, boolean first) { + super(); + this.field = new TabularFld(tabularParameter); + this.add(field.getWidget()); + + addButton= new TextButton(""); + addButton.setIcon(DataMinerManager.resources.add()); + addButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + addField(Item.this); + } + }); + + + removeButton= new TextButton(""); + removeButton.setIcon(DataMinerManager.resources.cancel()); + + removeButton.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + removeField(Item.this); + } + }); + + removeButton.setVisible(!first); + + this.add(addButton); + this.add(removeButton); + } + + public void showCancelButton() { + removeButton.setVisible(true); + } + + public void hideCancelButton() { + removeButton.setVisible(false); + } + + public String getValue() { + return field.getValue(); + } + + public TabularFld getField() { + return field; + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/properties/ColumnItemProperties.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/properties/ColumnItemProperties.java new file mode 100644 index 0000000..2064087 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/properties/ColumnItemProperties.java @@ -0,0 +1,24 @@ +package org.gcube.portlets.user.dataminermanager.client.properties; + + +import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem; + +import com.google.gwt.editor.client.Editor.Path; +import com.sencha.gxt.core.client.ValueProvider; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.PropertyAccess; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public interface ColumnItemProperties extends PropertyAccess { + + @Path("id") + ModelKeyProvider id(); + + ValueProvider label(); + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/properties/ColumnItemPropertiesCombo.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/properties/ColumnItemPropertiesCombo.java new file mode 100644 index 0000000..397ec08 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/properties/ColumnItemPropertiesCombo.java @@ -0,0 +1,23 @@ +package org.gcube.portlets.user.dataminermanager.client.properties; + +import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem; + +import com.google.gwt.editor.client.Editor.Path; +import com.sencha.gxt.data.shared.LabelProvider; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.PropertyAccess; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public interface ColumnItemPropertiesCombo extends PropertyAccess { + + @Path("id") + ModelKeyProvider id(); + + LabelProvider label(); + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/Images.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/Images.java new file mode 100644 index 0000000..f57b096 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/Images.java @@ -0,0 +1,101 @@ +package org.gcube.portlets.user.dataminermanager.client.resources; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; + +import com.google.gwt.user.client.ui.AbstractImagePrototype; + +public class Images { + + public static AbstractImagePrototype logo() { + return AbstractImagePrototype.create(DataMinerManager.resources.logo()); + } + + public static AbstractImagePrototype logoLittle() { + return AbstractImagePrototype.create(DataMinerManager.resources.logoLittle()); + } + + public static AbstractImagePrototype computationIcon() { + return AbstractImagePrototype.create(DataMinerManager.resources.computationIcon()); + } + + public static AbstractImagePrototype inputSpaceIcon() { + return AbstractImagePrototype.create(DataMinerManager.resources.inputSpaceIcon()); + } + + public static AbstractImagePrototype addOperator() { + return AbstractImagePrototype.create(DataMinerManager.resources.addOperator()); + } + + public static AbstractImagePrototype startComputation() { + return AbstractImagePrototype.create(DataMinerManager.resources.startComputation()); + } + + public static AbstractImagePrototype removeAll() { + return AbstractImagePrototype.create(DataMinerManager.resources.removeAll()); + } + + public static AbstractImagePrototype showAllOperators() { + return AbstractImagePrototype.create(DataMinerManager.resources.sortAscending()); + } + + public static AbstractImagePrototype showCategories() { + return AbstractImagePrototype.create(DataMinerManager.resources.tree()); + } + + public static AbstractImagePrototype folderExplore() { + return AbstractImagePrototype.create(DataMinerManager.resources.folderExplore()); + } + + public static AbstractImagePrototype cancel() { + return AbstractImagePrototype.create(DataMinerManager.resources.cancel()); + } + + public static AbstractImagePrototype addl() { + return AbstractImagePrototype.create(DataMinerManager.resources.add()); + } + + public static AbstractImagePrototype table() { + return AbstractImagePrototype.create(DataMinerManager.resources.table()); + } + + public static AbstractImagePrototype refresh() { + return AbstractImagePrototype.create(DataMinerManager.resources.refresh()); + } + + public static AbstractImagePrototype fileDownload() { + return AbstractImagePrototype.create(DataMinerManager.resources.fileDownload()); + } + + public static AbstractImagePrototype loader() { + return AbstractImagePrototype.create(DataMinerManager.resources.loader()); + } + + public static AbstractImagePrototype save() { + return AbstractImagePrototype.create(DataMinerManager.resources.save()); + } + + public static AbstractImagePrototype expand() { + return AbstractImagePrototype.create(DataMinerManager.resources.expand()); + } + + public static AbstractImagePrototype collapse() { + return AbstractImagePrototype.create(DataMinerManager.resources.collapse()); + } + + public static AbstractImagePrototype groupBy() { + return AbstractImagePrototype.create(DataMinerManager.resources.groupBy()); + } + + public static AbstractImagePrototype map() { + return AbstractImagePrototype.create(DataMinerManager.resources.map()); + } + + public static AbstractImagePrototype userPerspective() { + return AbstractImagePrototype.create(DataMinerManager.resources.userPerspective()); + } + + public static AbstractImagePrototype computationPerspective() { + return AbstractImagePrototype.create(DataMinerManager.resources.computationPerspective()); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/Resources.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/Resources.java new file mode 100644 index 0000000..89ad626 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/Resources.java @@ -0,0 +1,123 @@ +package org.gcube.portlets.user.dataminermanager.client.resources; + + +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.ImageResource; + +public interface Resources extends ClientBundle { + + @Source("logo.png") + ImageResource logo(); + + @Source("logoLittle.png") + ImageResource logoLittle(); + + @Source("goBack.png") + ImageResource goBack(); + + @Source("computation.png") + ImageResource computationIcon(); + + @Source("computations.png") + ImageResource jobsIcon(); + + @Source("inputSpace.png") + ImageResource inputSpaceIcon(); + + @Source("application_side_expand.png") + ImageResource addOperator(); + + @Source("connector1.png") + ImageResource workflowConnector1(); + + @Source("connector2.png") + ImageResource workflowConnector2(); + + @Source("triangle.png") + ImageResource startComputation(); + + @Source("delete.png") + ImageResource removeAll(); + + @Source("sort_asc.gif") + ImageResource sortAscending(); + + @Source("tree.gif") + ImageResource tree(); + + @Source("folder_explore.png") + ImageResource folderExplore(); + + @Source("cancel_icon.png") + ImageResource cancel(); + + @Source("add.png") + ImageResource add(); + + @Source("table.png") + ImageResource table(); + + @Source("refresh.png") + ImageResource refresh(); + + @Source("details.png") + ImageResource details(); + + @Source("tableResult.png") + ImageResource tableResult(); + + @Source("menuItemComputations.png") + ImageResource menuItemComputations(); + + @Source("menuItemExperiment.png") + ImageResource menuItemExperiment(); + + @Source("menuItemDataspace.png") + ImageResource menuItemInputspace(); + + @Source("table.png") + ImageResource fileDownload(); // TODO change + + @Source("ajax-loader.gif") + ImageResource loader(); + + @Source("ajax-loader-big.gif") + ImageResource loaderBig(); + + @Source("ajax-complete.gif") + ImageResource loadingComplete(); + + @Source("inputSpaceImporter.png") + ImageResource inputSpaceImporter(); + + @Source("inputSpaceMonitor.png") + ImageResource inputSpaceMonitor(); + + @Source("save.png") + ImageResource save(); + + @Source("alert.png") + ImageResource error(); + + @Source("arrow_out.png") + ImageResource expand(); + + @Source("arrow_in.png") + ImageResource collapse(); + + @Source("application_view_list.png") + ImageResource groupBy(); + + @Source("map.png") + ImageResource map(); + + @Source("user_green.png") + ImageResource userPerspective(); + + @Source("monitor.png") + ImageResource computationPerspective(); + + @Source("arrow_redo.png") + ImageResource resubmit(); + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/add.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/add.png new file mode 100644 index 0000000..6332fef Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/add.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-complete.gif b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-complete.gif new file mode 100644 index 0000000..ca17bcd Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-complete.gif differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-error.gif b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-error.gif new file mode 100644 index 0000000..8dadfb9 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-error.gif differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-loader-big.gif b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-loader-big.gif new file mode 100644 index 0000000..b3d6d3f Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-loader-big.gif differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-loader.gif b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-loader.gif new file mode 100644 index 0000000..6bdc3b5 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/ajax-loader.gif differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/alert.gif b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/alert.gif new file mode 100644 index 0000000..024e2a9 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/alert.gif differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/alert.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/alert.png new file mode 100644 index 0000000..5177258 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/alert.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/application_side_expand.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/application_side_expand.png new file mode 100644 index 0000000..030cf7c Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/application_side_expand.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/application_view_list.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/application_view_list.png new file mode 100644 index 0000000..acc30b8 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/application_view_list.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_in.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_in.png new file mode 100644 index 0000000..745c651 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_in.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_out.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_out.png new file mode 100644 index 0000000..2e9bc42 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_out.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_redo.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_redo.png new file mode 100644 index 0000000..fdc394c Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_redo.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_right.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_right.png new file mode 100644 index 0000000..b1a1819 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/arrow_right.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/cancel.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/cancel.png new file mode 100644 index 0000000..c149c2b Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/cancel.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/cancel_icon.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/cancel_icon.png new file mode 100644 index 0000000..158b8b1 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/cancel_icon.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/computation.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/computation.png new file mode 100644 index 0000000..97ed5ee Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/computation.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/computations.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/computations.png new file mode 100644 index 0000000..5236b20 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/computations.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/connector1.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/connector1.png new file mode 100644 index 0000000..fb70243 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/connector1.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/connector2.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/connector2.png new file mode 100644 index 0000000..2f77b2f Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/connector2.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/delete.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/delete.png new file mode 100644 index 0000000..70c8035 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/delete.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/detach.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/detach.png new file mode 100644 index 0000000..f4db43e Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/detach.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/details.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/details.png new file mode 100644 index 0000000..8200ce8 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/details.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/folder_explore.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/folder_explore.png new file mode 100644 index 0000000..0ba9391 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/folder_explore.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/goBack.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/goBack.png new file mode 100644 index 0000000..57dd7e0 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/goBack.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpace.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpace.png new file mode 100644 index 0000000..5084c44 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpace.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpaceImporter.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpaceImporter.png new file mode 100644 index 0000000..281d218 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpaceImporter.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpaceMonitor.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpaceMonitor.png new file mode 100644 index 0000000..9b394e7 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/inputSpaceMonitor.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/logo.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/logo.png new file mode 100644 index 0000000..d2313dc Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/logo.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/logoLittle.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/logoLittle.png new file mode 100644 index 0000000..982965f Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/logoLittle.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/map.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/map.png new file mode 100644 index 0000000..f90ef25 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/map.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemComputations.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemComputations.png new file mode 100644 index 0000000..10618b3 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemComputations.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemDataspace.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemDataspace.png new file mode 100644 index 0000000..bbb33ee Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemDataspace.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemExperiment.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemExperiment.png new file mode 100644 index 0000000..a5333d5 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemExperiment.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemInputspace.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemInputspace.png new file mode 100644 index 0000000..071293e Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/menuItemInputspace.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/monitor.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/monitor.png new file mode 100644 index 0000000..d040bd0 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/monitor.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/refresh.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/refresh.png new file mode 100644 index 0000000..1f23890 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/refresh.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/save.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/save.png new file mode 100644 index 0000000..99d532e Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/save.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/sort_asc.gif b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/sort_asc.gif new file mode 100644 index 0000000..986c1c9 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/sort_asc.gif differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/table.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/table.png new file mode 100644 index 0000000..abcd936 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/table.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/tableResult.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/tableResult.png new file mode 100644 index 0000000..8b195b6 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/tableResult.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/tree.gif b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/tree.gif new file mode 100644 index 0000000..e9dd8e0 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/tree.gif differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/triangle.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/triangle.png new file mode 100644 index 0000000..7937431 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/triangle.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/user_green.png b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/user_green.png new file mode 100644 index 0000000..30383c2 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/dataminermanager/client/resources/user_green.png differ diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/rpc/DataMinerPortletService.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/rpc/DataMinerPortletService.java new file mode 100644 index 0000000..52209f6 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/rpc/DataMinerPortletService.java @@ -0,0 +1,105 @@ +package org.gcube.portlets.user.dataminermanager.client.rpc; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.CsvMetadata; +import org.gcube.portlets.user.dataminermanager.client.bean.FileMetadata; +import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification; +import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; +import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo; +import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; + +import com.google.gwt.user.client.rpc.RemoteService; +import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; + +/** + * The client side stub for the RPC service. + */ +@RemoteServiceRelativePath("dataminerman") +public interface DataMinerPortletService extends RemoteService { + + public UserInfo hello() throws ServiceException; + + // get all operators and categories + public List getOperatorsClassifications() + throws Exception; + + // get parameters for a given operator + public List getParameters(Operator operator) throws Exception; + + public ComputationId startComputation(Operator op, String computationTitle, + String computationDescription) throws Exception; + + // get a status for a computation + public ComputationStatus getComputationStatus(ComputationId computationId) + throws Exception; + + // get tables info belongs to a given templates set (for relative user) + public List getTableItems(List templates) + throws Exception; + + public List getFileItems(List templates) + throws Exception; + + public Resource getResourceByComputationId(ComputationId computationId); + + public Map getParametersMapByComputationId(ComputationId computationId) throws ServiceException; + + public String importTable(CsvMetadata csvMetadata) throws Exception; + + public CsvMetadata getCsvMetadataFromCsvImporterWizard() throws Exception; + + public List getImportsStatus(Date todayDate) + throws ServiceException; + + // get a status for an import + public ImportStatus getImportStatusById(String id) throws ServiceException; + + + public Map getMapFromMapResource(MapResource mapResource) + throws Exception; + + // Map getImagesInfoFromImagesResource(ImagesResource + // imgsRes) throws Exception; + + public String saveImage(ComputationId computationId, ImagesResource imageResource) + throws Exception; + + public void removeResource(String id) throws Exception; + + public void removeImport(String id) throws Exception; + + public String exportResource(String folderId, String fileName, + ResourceItem resourceItem) throws Exception; + + public ComputationId resubmit(ComputationId computationId) throws ServiceException; + + public FileMetadata getFilePathFromImporterWizard() throws Exception; + + public String importFile(FileMetadata fileMetadata) throws Exception; + + public TableItemSimple retrieveTableInformation(Item item) + throws ServiceException; + + public DataMinerWorkArea getDataMinerWorkArea() throws ServiceException; + + public String getPublicLink(ItemDescription itemDescription) + throws ServiceException; + + public String cancelComputation(ComputationId computationId) throws ServiceException; + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/rpc/DataMinerPortletServiceAsync.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/rpc/DataMinerPortletServiceAsync.java new file mode 100644 index 0000000..3a65c0e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/rpc/DataMinerPortletServiceAsync.java @@ -0,0 +1,107 @@ +package org.gcube.portlets.user.dataminermanager.client.rpc; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.CsvMetadata; +import org.gcube.portlets.user.dataminermanager.client.bean.FileMetadata; +import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification; +import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; +import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo; +import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.rpc.AsyncCallback; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public interface DataMinerPortletServiceAsync { + + public static DataMinerPortletServiceAsync INSTANCE = (DataMinerPortletServiceAsync) GWT + .create(DataMinerPortletService.class); + + + void hello(AsyncCallback callback); + + void getOperatorsClassifications( + AsyncCallback> callback); + + void getParameters(Operator operator, + AsyncCallback> callback); + + void startComputation(Operator op, String computationTitle, + String computationDescription, + AsyncCallback asyncCallback); + + void getComputationStatus(ComputationId computationId, + AsyncCallback asyncCallback); + + void getTableItems(List templates, + AsyncCallback> callback); + + void getFileItems(List templates, + AsyncCallback> callback); + + + void getResourceByComputationId(ComputationId computationId, + AsyncCallback callback); + + void importTable(CsvMetadata csvMetadata, AsyncCallback callback); + + void getImportsStatus(Date todayDate, + AsyncCallback> callback); + + void getImportStatusById(String id, AsyncCallback callback); + + void getMapFromMapResource(MapResource mapResource, + AsyncCallback> callback); + + void getParametersMapByComputationId(ComputationId computationId, + AsyncCallback> callback); + + void saveImage(ComputationId computationId, ImagesResource imageResource, + AsyncCallback callback); + + void removeResource(String id, AsyncCallback callback); + + void removeImport(String id, AsyncCallback callback); + + void getCsvMetadataFromCsvImporterWizard(AsyncCallback callback); + + void exportResource(String folderId, String fileName, + ResourceItem resourceItem, AsyncCallback callback); + + void resubmit(ComputationId computationId, AsyncCallback callback); + + void getFilePathFromImporterWizard(AsyncCallback callback); + + void importFile(FileMetadata fileMetadata, AsyncCallback callback); + + void retrieveTableInformation(Item item, AsyncCallback callback); + + void getDataMinerWorkArea(AsyncCallback asyncCallback); + + void getPublicLink(ItemDescription itemDescription, + AsyncCallback callback); + + void cancelComputation(ComputationId computationId, + AsyncCallback asyncCallback); + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/DataMinerWorkAreaEventType.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/DataMinerWorkAreaEventType.java new file mode 100644 index 0000000..0f12f48 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/DataMinerWorkAreaEventType.java @@ -0,0 +1,11 @@ +package org.gcube.portlets.user.dataminermanager.client.type; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public enum DataMinerWorkAreaEventType { + OPEN, UPDATE; +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/SessionExpiredEventType.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/SessionExpiredEventType.java new file mode 100644 index 0000000..2a7b88b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/SessionExpiredEventType.java @@ -0,0 +1,11 @@ +package org.gcube.portlets.user.dataminermanager.client.type; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public enum SessionExpiredEventType { + EXPIREDONSERVER; +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/UIStateEventType.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/UIStateEventType.java new file mode 100644 index 0000000..23e85a8 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/type/UIStateEventType.java @@ -0,0 +1,13 @@ +package org.gcube.portlets.user.dataminermanager.client.type; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public enum UIStateEventType { + START, + UPDATE, + WAITING; +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/util/InfoMessageBox.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/util/InfoMessageBox.java new file mode 100644 index 0000000..fb1a93a --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/util/InfoMessageBox.java @@ -0,0 +1,28 @@ +package org.gcube.portlets.user.dataminermanager.client.util; + +import com.sencha.gxt.widget.core.client.box.MessageBox; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class InfoMessageBox extends MessageBox { + + /** + * Creates a message box with an info icon and the specified title and + * message. + * + * @param title + * the message box title + * @param message + * the message displayed in the message box + */ + public InfoMessageBox(String title, String message) { + super(title, message); + + setIcon(ICONS.info()); + } + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/util/UtilsGXT3.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/util/UtilsGXT3.java new file mode 100644 index 0000000..82d23eb --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/util/UtilsGXT3.java @@ -0,0 +1,79 @@ +package org.gcube.portlets.user.dataminermanager.client.util; + + +import com.google.gwt.core.client.Callback; +import com.google.gwt.dom.client.Element; +import com.sencha.gxt.core.client.dom.XElement; +import com.sencha.gxt.widget.core.client.Component; +import com.sencha.gxt.widget.core.client.box.AlertMessageBox; +import com.sencha.gxt.widget.core.client.event.HideEvent; +import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class UtilsGXT3 { + public static void mask(Element element) { + XElement el = element. cast(); + el.mask("Loading..."); + } + + public static void umask(Element element) { + element. cast().unmask(); + } + + + public static void alert(String title, String message) { + final AlertMessageBox d = new AlertMessageBox(title, message); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + + } + }); + d.show(); + + } + + public static void alert(String title, String message, final Callback callback) { + final AlertMessageBox d = new AlertMessageBox(title, message); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + Component comp=event.getSource(); + callback.onSuccess(comp); + } + }); + d.show(); + } + + + public static void info(String title, String message) { + final InfoMessageBox d = new InfoMessageBox(title, message); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + + } + }); + d.show(); + + } + + public static void info(String title, String message, final Callback callback) { + final InfoMessageBox d = new InfoMessageBox(title, message); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + Component comp=event.getSource(); + callback.onSuccess(comp); + } + }); + d.show(); + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ComputationOutputPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ComputationOutputPanel.java new file mode 100644 index 0000000..1c87a8b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ComputationOutputPanel.java @@ -0,0 +1,284 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.widgets; + +import java.util.LinkedHashMap; +import java.util.Map; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.output.FileResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource.ResourceType; +import org.gcube.portlets.user.dataminermanager.client.bean.output.TableResource; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * @author ceras + * + */ +public class ComputationOutputPanel extends SimpleContainer { + + private ComputationId computationId; + private final DataMinerPortletServiceAsync service = DataMinerManager + .getService(); + private VerticalLayoutContainer v; + + public ComputationOutputPanel(ComputationId computationId) { + super(); + this.computationId = computationId; + init(); + } + + private void init() { + v = new VerticalLayoutContainer(); + add(v); + + // request for a jobItem linked with the computationId (or jobId) + service.getResourceByComputationId(computationId, + new AsyncCallback() { + @Override + public void onSuccess(Resource result) { + unmask(); + showOutputInfo(result); + } + + @Override + public void onFailure(Throwable caught) { + unmask(); + UtilsGXT3.alert("Error", + "Impossible to retrieve output info.", null); + } + }); + + this.mask("Loading Result Info..."); + } + + /** + * @param jobOutput + */ + protected void showOutputInfo(Resource resource) { + if (resource == null) + return; + + ResourceType resourceType = resource.getResourceType(); + + switch (resourceType) { + + case FILE: + FileResource fileResource = (FileResource) resource; + v.add(getHtmlTitle("The algorithm produced a File.")); + v.add(getFileResourceOutput(fileResource)); + break; + + case TABULAR: + TableResource tabResource = (TableResource) resource; + v.add(getHtmlTitle("The algorithm produced a Table.")); + // v.add(getTabResourceOutput(tabResource)); + break; + + case IMAGES: + v.add(getHtmlTitle("The algorithm produced an Set of Images.")); + final ImagesResource imagesResource = (ImagesResource) resource; + v.add(getImagesResourceOutput(imagesResource)); + break; + + case MAP: + v.add(getHtmlTitle("The algorithm produced Multiple Results.")); + + final MapResource mapResource = (MapResource) resource; + + v.add(getMultipleOutput(mapResource)); + break; + case ERROR: + break; + case OBJECT: + break; + default: + break; + + } + + this.add(new HTML("
")); + forceLayout(); + } + + /** + * @param string + * @return + */ + private HTML getHtmlTitle(String title) { + HTML html = new HTML(title); + html.setStyleName("jobViewer-output-outputType"); + return html; + } + + /** + * @param imagesResource + * @return + */ + private SimpleContainer getImagesResourceOutput( + ImagesResource imagesResource) { + SimpleContainer container = new SimpleContainer(); + container.add(new ImagesViewer(computationId, imagesResource)); + return container; + } + + /** + * @param tabResource + * + * private LayoutContainer getTabResourceOutput(TableResource + * tabResource) { final String tableName = tabResource.getName(); + * final String tableId = tabResource.getResourceId(); + * LayoutContainer lc = new LayoutContainer(); lc.add(new + * Html("Data Set Created: " + tableName + "
+ *
+ * ")); + * + * lc.add(new Button("Show Data Set", Images.table(), new + * SelectionListener() { + * @Override public void componentSelected(ButtonEvent ce) { final + * TabularData tabularData = DataMinerManager .getTabularData(); + * TabularDataGridPanel grid = tabularData.getGridPanel(); + * grid.setHeaderVisible(false); Window window = new Window(); + * window.setMaximizable(true); window.setHeadingText("Data Set " + * + tableName); window.setModal(true); window.add(grid); + * window.setWidth(900); window.setHeight(500); + * tabularData.openTable(tableId); window.show(); } })); return + * lc; } + */ + + /** + * @param fileResource + * @return + */ + private SimpleContainer getFileResourceOutput(FileResource fileResource) { + VerticalLayoutContainer lc = new VerticalLayoutContainer(); + SimpleContainer container = new SimpleContainer(); + final String fileName = fileResource.getName(); + final String fileUrl = fileResource.getUrl(); + lc.add(new HTML(fileName)); + TextButton downloadBtn = new TextButton("Download File"); + downloadBtn.setIcon(DataMinerManager.resources.fileDownload()); + downloadBtn.addSelectHandler(new SelectEvent.SelectHandler() { + @Override + public void onSelect(SelectEvent event) { + com.google.gwt.user.client.Window.open(fileUrl, fileName, ""); + + } + }); + + lc.add(downloadBtn); + container.add(lc); + return container; + } + + /** + * @param map + * @return + */ + private SimpleContainer getMultipleOutput(MapResource mapResource) { + Map map = mapResource.getMap(); + VerticalLayoutContainer vp = new VerticalLayoutContainer(); + SimpleContainer container = new SimpleContainer(); + + Map mapValues = new LinkedHashMap<>(); + Map mapFiles = new LinkedHashMap<>(); + Map mapTabs = new LinkedHashMap<>(); + Map mapImages = new LinkedHashMap<>(); + + for (String key : map.keySet()) { + Resource resource = map.get(key); + ResourceType resourceType = resource.getResourceType(); + + switch (resourceType) { + case OBJECT: + mapValues.put(key, (ObjectResource) resource); + break; + case FILE: + mapFiles.put(key, (FileResource) resource); + break; + case TABULAR: + mapTabs.put(key, (TableResource) resource); + break; + case IMAGES: + mapImages.put(key, (ImagesResource) resource); + break; + case MAP: + break; + case ERROR: + break; + default: + break; + } + } + + if (mapValues.size() > 0) { + HTML html = new HTML("Output Values"); + html.setStyleName("jobViewer-output-groupTitle"); + vp.add(html); + + vp.add((new ResourceViewer(mapValues)).getHtml()); + + html = new HTML("
"); + vp.add(html); + } + + if (mapFiles.size() > 0) { + HTML html = new HTML("Files"); + html.setStyleName("jobViewer-output-groupTitle"); + vp.add(html); + + for (String fileKey : mapFiles.keySet()) { + // vp.add(new Html(""+fileKey+"")); + vp.add(getFileResourceOutput(mapFiles.get(fileKey))); + } + + html = new HTML("
"); + vp.add(html); + } + + if (mapTabs.size() > 0) { + HTML html = new HTML("Tables"); + html.setStyleName("jobViewer-output-groupTitle"); + vp.add(html); + + for (String tabKey : mapTabs.keySet()) { + // vp.add(new Html(""+tabKey+"")); + // vp.add(getTabResourceOutput(mapTabs.get(tabKey))); + } + + html = new HTML("
"); + vp.add(html); + } + + if (mapImages.size() > 0) { + HTML html = new HTML("Images"); + html.setStyleName("jobViewer-output-groupTitle"); + vp.add(html); + + for (String imagesKey : mapImages.keySet()) { + // vp.add(new Html(""+imagesKey+"")); + vp.add(getImagesResourceOutput(mapImages.get(imagesKey))); + } + + html = new HTML("
"); + vp.add(html); + } + + container.add(vp); + return container; + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/HashMapViewer.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/HashMapViewer.java new file mode 100644 index 0000000..158a844 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/HashMapViewer.java @@ -0,0 +1,60 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.widgets; + +import java.util.Map; +import java.util.Map.Entry; + +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; + + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class HashMapViewer extends SimpleContainer { + + private Map map; + + /** + * + * @param map + */ + public HashMapViewer(Map map) { + super(); + this.map=map; + init(); + + } + + /** + * + */ + private void init() { + String html =""; + html += "" + + " " + + " " + + " " + + " "+ + " "; + + for (Entry entry: map.entrySet()) + if (entry.getKey()!=null) { + html += " " + + " " + + " " + + " "; + } + + html += " " + + "
"+entry.getKey()+""+entry.getValue()+"
"; + add(new HTML(html)); + forceLayout(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ImagesViewer.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ImagesViewer.java new file mode 100644 index 0000000..fb864de --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ImagesViewer.java @@ -0,0 +1,100 @@ +package org.gcube.portlets.user.dataminermanager.client.widgets; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource; +import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; +import org.gcube.portlets.user.dataminermanager.client.events.MaskEvent; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Image; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.event.SelectEvent; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class ImagesViewer extends SimpleContainer { + + protected static final String SAVE_OK_MESSAGE = "The images have been saved on the Workspace in the folder "; + protected static final String SAVE_OK_TITLE = "Saving operation was successful"; + protected static final String SAVE_FAIL_TITLE = "Error"; + protected static final String SAVE_FAIL_MESSAGE = "Error in saving images."; + private ImagesResource imagesResource; + private ComputationId computationId; + + + /** + * @param mapImages + */ + public ImagesViewer(ComputationId computationId, + ImagesResource imagesResource) { + super(); + this.imagesResource = imagesResource; + this.computationId = computationId; + init(); + } + + private void init() { + VerticalLayoutContainer v = new VerticalLayoutContainer(); + add(v); + if (imagesResource == null || imagesResource.getLink() == null + || imagesResource.getLink().isEmpty()) + v.add(new HTML("No image found.")); + else { + v.add(new HTML(imagesResource.getName())); + TextButton saveImageBtn = new TextButton( + "Save image on the Workspace"); + saveImageBtn.setIcon(DataMinerManager.resources.save()); + saveImageBtn.addSelectHandler(new SelectEvent.SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + saveImages(); + + } + }); + + v.add(saveImageBtn); + final Image img = new Image(imagesResource.getLink()); + v.add(img); + } + + forceLayout(); + + } + + + private void saveImages() { + EventBusProvider.INSTANCE.fireEvent(new MaskEvent( + "Saving on the workspace...")); + // handler.maskAll("Saving on the workspace..."); + DataMinerManager.getService().saveImage(computationId, imagesResource, + new AsyncCallback() { + @Override + public void onSuccess(String result) { + EventBusProvider.INSTANCE + .fireEvent(new MaskEvent(null)); + // handler.unmaskAll(); + UtilsGXT3.info(SAVE_OK_TITLE, SAVE_OK_MESSAGE + "\"" + + result + "\""); + } + + @Override + public void onFailure(Throwable caught) { + EventBusProvider.INSTANCE + .fireEvent(new MaskEvent(null)); + // handler.unmaskAll(); + UtilsGXT3.alert(SAVE_FAIL_TITLE, SAVE_FAIL_MESSAGE, + null); + } + }); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ResourceViewer.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ResourceViewer.java new file mode 100644 index 0000000..61e61c6 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ResourceViewer.java @@ -0,0 +1,56 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.widgets; + +import java.util.Map; +import java.util.Map.Entry; + +import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; + +import com.google.gwt.user.client.ui.HTML; + +/** + * @author ceras + * + */ +public class ResourceViewer { + + private Map map; + + /** + * @param map + */ + public ResourceViewer(Map map) { + this.map = map; + + } + + /** + * @param map + * @return + */ + public HTML getHtml() { + String html = ""; + html += "" + " " + + " " + " " + + " " + + " " + " "; + + for (Entry entry : map.entrySet()) + if (entry.getKey() != null) { + if (entry.getValue() instanceof ObjectResource) { + ObjectResource or = (ObjectResource) entry.getValue(); + html += " " + " " + + " " + " "; + } else { + + } + } + + html += " " + "
" + or.getName() + "" + or.getValue() + "
"; + return new HTML(html); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ResourcesExporter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ResourcesExporter.java new file mode 100644 index 0000000..c14aa59 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/ResourcesExporter.java @@ -0,0 +1,129 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.widgets; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.DataMinerManager; +import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem; +import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; +import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSaveNotification.WorskpaceExplorerSaveNotificationListener; +import org.gcube.portlets.widgets.wsexplorer.client.save.WorkspaceExplorerSaveDialog; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; +import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; + +import com.google.gwt.user.client.Timer; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.sencha.gxt.core.client.dom.XDOM; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class ResourcesExporter { + + + public static void exportResource(final ResourceItem resourceItem) { + final String fName = resourceItem.getName() + + (resourceItem.isTable() ? ".csv" : ""); + // + List selectableTypes = new ArrayList(); + selectableTypes.add(ItemType.FOLDER); + List showableTypes = new ArrayList(); + showableTypes.addAll(Arrays.asList(ItemType.values())); + + final WorkspaceExplorerSaveDialog wsaveDialog = new WorkspaceExplorerSaveDialog( + "Select the location to save the resource", fName, + showableTypes); + + WorskpaceExplorerSaveNotificationListener handler = new WorskpaceExplorerSaveNotificationListener() { + + @Override + public void onSaving(Item destinationFolder, String fileName) { + Timer timer = new Timer() { + + @Override + public void run() { + if (wsaveDialog != null) { + wsaveDialog.hide(); + } + + } + }; + timer.schedule(500); + + DataMinerManager.getService().exportResource( + destinationFolder.getId(), fileName, resourceItem, + new AsyncCallback() { + @Override + public void onSuccess(String result) { + // EventBusProvider.getInstance().fireEvent( + // new MaskEvent(null)); + UtilsGXT3 + .info("File saved", + "The file \"" + + result + + "\" has been exported in the workspace."); + } + + @Override + public void onFailure(Throwable caught) { + + // EventBusProvider.getInstance().fireEvent( + // new MaskEvent(null)); + UtilsGXT3.alert( + "Error", + "Impossible to export the file into the Workspace
Cause: " + + caught.getCause() + + "
Message: " + + caught.getMessage()); + } + }); + + } + + @Override + public void onFailed(Throwable throwable) { + throwable.printStackTrace(); + Timer timer = new Timer() { + @Override + public void run() { + if (wsaveDialog != null) { + wsaveDialog.hide(); + } + } + }; + timer.schedule(500); + UtilsGXT3.alert("Error", + "Impossible select destination into the Workspace
Cause: " + + throwable.getCause() + "
Message: " + + throwable.getMessage()); + + } + + @Override + public void onAborted() { + Timer timer = new Timer() { + @Override + public void run() { + if (wsaveDialog != null) { + wsaveDialog.hide(); + } + } + }; + timer.schedule(500); + } + }; + + wsaveDialog.addWorkspaceExplorerSaveNotificationListener(handler); + wsaveDialog.setZIndex(XDOM.getTopZIndex()); + wsaveDialog.show(); + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/Section.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/Section.java new file mode 100644 index 0000000..8ae2de1 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/widgets/Section.java @@ -0,0 +1,78 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.client.widgets; + +import java.util.Map; + +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Image; +import com.google.gwt.user.client.ui.Widget; +import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class Section extends SimpleContainer { + + private VerticalLayoutContainer v; + + + public Section(String title, ImageResource img) { + super(); + v = new VerticalLayoutContainer(); + v.addStyleName("jobViewer-section"); + createHeader(title, img); + add(v); + } + + public Section(String title, ImageResource img, Map map) { + super(); + v = new VerticalLayoutContainer(); + v.addStyleName("jobViewer-section"); + createHeader(title, img); + addMap(map); + + add(v); + } + + /** + * + */ + private void createHeader(String title, ImageResource img) { + HorizontalLayoutContainer hp = new HorizontalLayoutContainer(); + hp.addStyleName("jobViewer-section-header"); + + if (img!=null) { + Image image = new Image(img); + image.addStyleName("jobViewer-section-header-image"); + hp.add(image); + } + + if (title!=null) { + HTML htmlTitle = new HTML(title); + htmlTitle.addStyleName("jobViewer-section-header-title"); + hp.add(htmlTitle); + } + + v.add(hp); + } + + + public void add(Widget widget) { + v.add(widget); + } + + public void addMap(Map map) { + v.add(new HashMapViewer(map)); + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/dataminermanager.gwt.xml b/src/main/java/org/gcube/portlets/user/dataminermanager/dataminermanager.gwt.xml new file mode 100644 index 0000000..8b09859 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/dataminermanager.gwt.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/portlet/DataMinerManager.java b/src/main/java/org/gcube/portlets/user/dataminermanager/portlet/DataMinerManager.java new file mode 100644 index 0000000..cd820b8 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/portlet/DataMinerManager.java @@ -0,0 +1,49 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.portlet; + +import java.io.IOException; + +import javax.portlet.GenericPortlet; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; + +import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DataMinerManager extends GenericPortlet { + + private final Logger logger= LoggerFactory.getLogger(GenericPortlet.class); + + + /** + * JSP folder name + */ + public static final String JSP_FOLDER = "/WEB-INF/jsp/"; + + /** + * + */ + public static final String VIEW_JSP = JSP_FOLDER + "DataMinerManager_view.jsp"; + + /** + * @param request . + * @param response . + * @throws IOException . + * @throws PortletException . + */ + public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { + + logger.trace("DataMinerManager loading from JSP: "+VIEW_JSP); + logger.trace("setting context using ScopeHelper"); + ScopeHelper.setContext(request); + + logger.trace("passing to the render"); + PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(VIEW_JSP); + rd.include(request,response); + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/DataMinerManagerServiceImpl.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/DataMinerManagerServiceImpl.java new file mode 100644 index 0000000..8ff760b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/DataMinerManagerServiceImpl.java @@ -0,0 +1,639 @@ +package org.gcube.portlets.user.dataminermanager.server; + +import java.io.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpSession; + +import org.gcube.application.framework.accesslogger.library.impl.AccessLogger; +import org.gcube.application.framework.core.session.ASLSession; +import org.gcube.common.homelibrary.home.HomeLibrary; +import org.gcube.common.homelibrary.home.workspace.Workspace; +import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder; +import org.gcube.common.homelibrary.home.workspace.WorkspaceItem; +import org.gcube.common.homelibrary.home.workspace.exceptions.ItemAlreadyExistException; +import org.gcube.common.homelibrary.util.WorkspaceUtil; +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status; +import org.gcube.portlets.user.dataminermanager.client.bean.CsvMetadata; +import org.gcube.portlets.user.dataminermanager.client.bean.FileMetadata; +import org.gcube.portlets.user.dataminermanager.client.bean.ImportStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification; +import org.gcube.portlets.user.dataminermanager.client.bean.ResourceItem; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletService; +import org.gcube.portlets.user.dataminermanager.server.smservice.SClient; +import org.gcube.portlets.user.dataminermanager.server.util.DataMinerWorkAreaManager; +import org.gcube.portlets.user.dataminermanager.server.util.SessionUtil; +import org.gcube.portlets.user.dataminermanager.server.util.StorageUtil; +import org.gcube.portlets.user.dataminermanager.server.util.TableReader; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; +import org.gcube.portlets.user.dataminermanager.shared.session.UserInfo; +import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription; +//import org.gcube.portlets.user.tdw.server.datasource.DataSourceFactoryRegistry; +//import org.gcube.portlets.widgets.file_dw_import_wizard.server.file.TargetRegistry; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gwt.user.server.rpc.RemoteServiceServlet; + +/** + * The server side implementation of the RPC service. + */ +@SuppressWarnings("serial") +public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements + DataMinerPortletService { + public static AccessLogger accountinglog = AccessLogger.getAccessLogger(); + + // private static final long CACHE_REFRESH_TIME = 30 * 60 * 1000; // 30 + // minutes + + + // private final static String SEPARATOR = AlgorithmConfiguration + // .getListSeparator(); + private static Logger logger = LoggerFactory + .getLogger(DataMinerManagerServiceImpl.class); + + /** + * {@inheritDoc} + */ + @Override + public void init() throws ServletException { + super.init(); + + try { + Class.forName("org.postgresql.Driver"); + } catch (ClassNotFoundException e) { + // e.printStackTrace(); + throw new ServletException("Error initializing the db", e); + } + + //CSVTargetRegistry.getInstance().add(new DataMinerCSVTarget()); + //TargetRegistry.getInstance().add(new DataMinerFileTarget()); + //DataSourceFactoryRegistry.getInstance().add( + // new DataMinerDataSourceFactory()); + + /* + * try { // T(); + * + * // feeds.schedule(); } catch (Exception e) { e.printStackTrace(); } + */ + + logger.info("DataMinerManager started!"); + + } + + /** + * + * {@inheritDoc} + * + */ + @Override + public UserInfo hello() throws ServiceException { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + UserInfo userInfo = new UserInfo(aslSession.getUsername(), + aslSession.getGroupId(), aslSession.getGroupName(), + aslSession.getScope(), aslSession.getScopeName(), + aslSession.getUserEmailAddress(), + aslSession.getUserFullName()); + logger.debug("UserInfo: " + userInfo); + return userInfo; + } catch (ServiceException e) { + e.printStackTrace(); + throw e; + } catch (Throwable e) { + e.printStackTrace(); + logger.error("Hello(): " + e.getLocalizedMessage(), e); + throw new ServiceException(e.getLocalizedMessage()); + } + + } + + @Override + public List getOperatorsClassifications() + throws Exception { + + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + SClient smClient = SessionUtil.getSClient(session, aslSession); + return smClient.getOperatorsClassifications(); + + } catch (Throwable e) { + logger.error( + "An error occurred getting the OperatorsClassifications list", + e); + System.out + .println("An error occurred getting the OperatorsClassifications list"); + e.printStackTrace(); + // return null; + throw new Exception(e.getLocalizedMessage()); + } + } + + @Override + public List getParameters(Operator operator) throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + SClient smClient = SessionUtil.getSClient(session, aslSession); + return smClient.getInputParameters(operator); + + } catch (Throwable e) { + logger.error("Error retrieving parameters: " + + e.getLocalizedMessage()); + e.printStackTrace(); + throw new Exception(e.getLocalizedMessage()); + } + } + + @Override + public ComputationId startComputation(Operator operator, String computationTitle, + String computationDescription) throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + SClient smClient = SessionUtil.getSClient(session, aslSession); + return smClient.startComputation(operator, computationTitle, + computationDescription); + + } catch (Throwable e) { + logger.error("Error in computation: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw new Exception(e.getLocalizedMessage()); + } + } + + @Override + public ComputationId resubmit(ComputationId computationId) throws ServiceException { + try { + logger.info("RESUBMIT COMPUTATION: " + computationId); + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + SClient smClient = SessionUtil.getSClient(session, aslSession); + + // String computationId = + // factory.resubmitComputation(jobItem.getId()); + // return computationId; + return computationId; + } catch (Throwable e) { + logger.error("Error in resubmit: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + @Override + public ComputationStatus getComputationStatus(ComputationId computationId) + throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + SClient smClient = SessionUtil.getSClient(session, aslSession); + return smClient.getComputationStatus(computationId); + + } catch (Throwable e) { + // logger.error("Error in getComputationStatus: " + // + e.getLocalizedMessage()); + // e.printStackTrace(); + throw new Exception(e.getLocalizedMessage()); + } + } + + @Override + public List getTableItems(List templates) + throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + List list = new ArrayList(); + + return list; + } catch (Throwable e) { + logger.error("Error in getTableItems:" + e.getLocalizedMessage()); + e.printStackTrace(); + throw new Exception(e.getLocalizedMessage()); + } + + } + + @Override + public List getFileItems(List templates) + throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + List list = new ArrayList(); + + return list; + } catch (Throwable e) { + logger.error("Error in getFileItems:" + e.getLocalizedMessage()); + e.printStackTrace(); + throw new Exception(e.getLocalizedMessage()); + } + } + + + + @Override + public Resource getResourceByComputationId(ComputationId computationId) { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + SClient smClient = SessionUtil.getSClient(session, aslSession); + return smClient.getResourceByComputationId(computationId); + + // SMComputation computation = factory.getComputation(jobId); + // JobItem jobItem = convertSMComputationToJobItem(computation, + // true); + // + // // try to add map data (if resource is an object) + // + // Resource res = jobItem.getResource(); + // if (res.isMap()) { + // MapResource mapResource = (MapResource) res; + // Map map = getMapFromMapResource(mapResource); + // mapResource.setMap(map); + // // jobItem.setMapData(map); + // logger.info("getResourceByJobId: " + mapResource); + // + // } else if (res.isImages()) { + // ImagesResource imgsRes = (ImagesResource) res; + // Map map = + // getImagesInfoFromImagesResource(imgsRes); + // imgsRes.setMapImages(map); + // logger.info("getResourceByJobId: " + imgsRes); + // } else { + // logger.info("getResourceByJobId: " + res); + // } + // return res; + + } catch (Exception e) { + logger.error("Error in getResourceByComputationId: " + + e.getLocalizedMessage());// in this case the resource + // doesn't exist, nothing to do + return null; + } + + } + + @Override + public Map getParametersMapByComputationId(ComputationId jobId) + throws ServiceException { + + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + SClient smClient = SessionUtil.getSClient(session, aslSession); + + // SMComputation computation = wpsClient.getComputation(jobId); + + Map parametersMap = new LinkedHashMap(); + + // for (SMEntry entry : computation.parameters()) { + // String value = entry.value(); + // if (value != null) + // value = value.replaceAll("#", ", "); + // parametersMap.put(entry.key(), value); + // } + + return parametersMap; + + } catch (Throwable e) { + logger.error(e.getLocalizedMessage(), e); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage(),e); + } + + } + + @Override + public Map getMapFromMapResource(MapResource mapRes) + throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + return mapRes.getMap(); + } catch (Exception e) { + logger.error(e.getLocalizedMessage(), e); + // e.printStackTrace(); + throw e; + } + } + + @Override + public String importTable(CsvMetadata csvMetadata) throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + return "1"; + } catch (Exception e) { + logger.error(e.getLocalizedMessage(), e); + // e.printStackTrace(); + throw (e); + } + } + + @Override + public String importFile(FileMetadata fileMetadata) throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + String id = ""; + + return id; + } catch (Exception e) { + logger.error(e.getLocalizedMessage(), e); + throw (e); + } + } + + @Override + public CsvMetadata getCsvMetadataFromCsvImporterWizard() throws Exception { + HttpSession httpSession = this.getThreadLocalRequest().getSession(); + //CSVParserConfiguration csvParserConfiguration = (CSVParserConfiguration) httpSession + // .getAttribute("csvParserConfiguration"); + //String csvImportFilePath = (String) httpSession + // .getAttribute("csvImportFilePath"); + //boolean hasHeader = csvParserConfiguration.isHasHeader(); + //String delimiter = "" + csvParserConfiguration.getDelimiter(); + //String comment = "" + csvParserConfiguration.getComment(); + + //return new CsvMetadata(hasHeader, csvImportFilePath, delimiter, comment); + return null; + } + + @Override + public FileMetadata getFilePathFromImporterWizard() throws Exception { + FileMetadata result; + // logger.info("getFilePathFromImporterWizard"); + HttpSession httpSession = this.getThreadLocalRequest().getSession(); + String fileImportFilePath = (String) httpSession + .getAttribute("fileImportPath"); + // logger.info("filePaht: " + fileImportFilePath); + String type = (String) httpSession.getAttribute("typeFile"); + // logger.info("type: " + type); + + if (type == "DARWINCORE") { + String fileTaxaImportFilePath = (String) httpSession + .getAttribute("generatedTaxaFilePath"); + // logger.info("fileTaxaImportFilePath: " + fileTaxaImportFilePath); + String fileVernacularImportFilePath = (String) httpSession + .getAttribute("generatedVernacular"); + // logger.info("fileVernacularImportFilePath: " + // + fileVernacularImportFilePath); + + result = new FileMetadata(fileImportFilePath, + fileTaxaImportFilePath, fileVernacularImportFilePath, type); + } else + result = new FileMetadata(fileImportFilePath, type); + + // logger.info("result.filePath: " + result.getFileAbsolutePath()); + // logger.info("result.type: " + result.getType()); + + return result; + } + + @Override + public List getImportsStatus(Date todayDate) + throws ServiceException { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + List listStatus = new ArrayList(); + + return listStatus; + } + + @Override + public ImportStatus getImportStatusById(String importId) + throws ServiceException { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + Status status = Status.COMPLETE; + + ImportStatus importStatus = new ImportStatus(); + + importStatus.setStatus(status); + + return importStatus; + } + + + + @Override + public String saveImage(ComputationId computationId, ImagesResource imagesResource) + throws Exception { + + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + SClient smClient = SessionUtil.getSClient(session, aslSession); + // SMComputation computation = + // factory.gegetComputation(computationId); + // String computationName = computation.title() == null ? + // computationId + // : computation.title(); + // computationName = + // FileSystemNameUtil.cleanFileName(computationName); + + Workspace workspace = HomeLibrary.getUserWorkspace(aslSession + .getUsername()); + WorkspaceFolder rootFolder = workspace.getRoot(); + // computationName = WorkspaceUtil.getUniqueName(computationName, + // rootFolder); + + // create the folder + + WorkspaceFolder folder; + try { + folder = rootFolder + .createFolder(computationId.getId(), + "This folder contains images obtained from Data Miner Manager"); + + } catch (ItemAlreadyExistException e) { + folder = (WorkspaceFolder) rootFolder.find(computationId.getId()); + } + InputStream inputStream = new URL(imagesResource.getLink()) + .openStream(); + + WorkspaceItem wi = WorkspaceUtil.createExternalFile(folder, + imagesResource.getResourceId(), + imagesResource.getDescription(), + imagesResource.getMimeType(), inputStream); + + return wi.getId(); + } catch (Throwable e) { + logger.error("Error in save images: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw (e); + } + } + + @Override + public void removeResource(String id) throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + } catch (Exception e) { + logger.error(e.getLocalizedMessage(), e); + + throw (e); + } + } + + @Override + public void removeImport(String id) throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + } catch (Exception e) { + logger.error(e.getLocalizedMessage(), e); + e.printStackTrace(); + + throw (e); + } + } + + @Override + public String exportResource(String folderId, String fileName, + ResourceItem resourceItem) throws Exception { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + + String id = resourceItem.getId(); + InputStream inputStream; + if (resourceItem.isTable()) { + + } else + inputStream = StorageUtil + .getStorageClientInputStream(resourceItem.getUrl()); + + Workspace workspace = HomeLibrary.getUserWorkspace(aslSession + .getUsername()); + + WorkspaceFolder wsFolder = (WorkspaceFolder) workspace + .getItem(folderId); + String realFileName = WorkspaceUtil.getUniqueName(fileName, + wsFolder); + + return realFileName; + + } catch (Exception e) { + logger.error(e.getLocalizedMessage(), e); + throw (e); + } + } + + @Override + public TableItemSimple retrieveTableInformation(Item item) + throws ServiceException { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + logger.debug("retrieveTableInformation(): " + item); + TableReader tableReader = new TableReader(aslSession, item); + TableItemSimple tableItemSimple = tableReader.getTableItemSimple(); + return tableItemSimple; + } catch (ServiceException e) { + throw e; + } catch (Throwable e) { + logger.error(e.getLocalizedMessage(), e); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + @Override + public DataMinerWorkArea getDataMinerWorkArea() throws ServiceException { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + logger.debug("getDataMinerWorkArea()"); + DataMinerWorkAreaManager dataMinerWorkAreaManager=new DataMinerWorkAreaManager(aslSession); + return dataMinerWorkAreaManager.getDataMinerWorkArea(); + + } catch (ServiceException e) { + throw e; + } catch (Throwable e) { + logger.error(e.getLocalizedMessage(), e); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + + @Override + public String getPublicLink(ItemDescription itemDescription) + throws ServiceException { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + logger.debug("GetPublicLink(): " + itemDescription); + String link = StorageUtil.getPublicLink(aslSession.getUsername(), + itemDescription.getId()); + + return link; + } catch (ServiceException e) { + throw e; + } catch (Throwable e) { + logger.error(e.getLocalizedMessage(), e); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + @Override + public String cancelComputation(ComputationId computationId) + throws ServiceException { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + ASLSession aslSession = SessionUtil.getASLSession(session); + logger.debug("CancelComputation(): " + computationId); + SClient smClient = SessionUtil.getSClient(session, aslSession); + String result=smClient.cancelComputation(computationId); + + return result; + } catch (ServiceException e) { + throw e; + } catch (Throwable e) { + logger.error(e.getLocalizedMessage(), e); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/DescriptionRepository.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/DescriptionRepository.java new file mode 100644 index 0000000..f6a204b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/DescriptionRepository.java @@ -0,0 +1,121 @@ +package org.gcube.portlets.user.dataminermanager.server; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorCategory; + +public class DescriptionRepository { + + static List categories; + static List operators; + + private static void initCategories() { + if (categories==null) { + categories = new ArrayList(); + categories.add(new OperatorCategory( + "DISTRIBUTIONS", + "Distributions description", + "This category includes probability distributions, classifications, matching or distance measurements etc.", + true)); + categories.add(new OperatorCategory( + "MODELS", + "Models description", + "This category includes models to be trained, e.g. neural networks, species envelopes, support vector machines etc.. The result will be typically a binary file.", + false)); + categories.add(new OperatorCategory( + "EVALUATORS", + "A set of procedures for measuring the quality of a model", + "This category represent a set of procedures for measuring the quality of a model.", + false)); + } + } + + private static void initOperators() { + if (operators==null) { + operators = new ArrayList(); + operators.add(new Operator( + "AQUAMAPS_NATIVE_2050", + "Aquamaps Native for 2050 scenario", + "Aquamaps Native for 2050 scenario.", null, true)); + operators.add(new Operator( + "REMOTE_AQUAMAPS_SUITABLE_2050", + "Aquamaps Suitable for 2050 scenario", + "Aquamaps Suitable for 2050 scenario.", null, true)); + operators.add(new Operator( + "AQUAMAPS_SUITABLE_NEURALNETWORK", + "Aquamaps Suitable Distribution using a feed-Forward Neural Network", + "Aquamaps Suitable Distribution using a feed-Forward Neural Network.", null, true)); + operators.add(new Operator( + "REMOTE_AQUAMAPS_NATIVE", + "Aquamaps Native habitat generated by invoking Rainy Cloud", + "Aquamaps Native habitat generated by invoking Rainy Cloud.", null, true)); + operators.add(new Operator( + "AQUAMAPS_NEURAL_NETWORK_NS", + "Aquamaps Suitable Distribution using a Feed-Forward Neural Network provided by Neurosolutions", + "Aquamaps Suitable Distribution using a Feed-Forward Neural Network provided by Neurosolutions (http://www.neurosolutions.com).", null, true)); + operators.add(new Operator( + "REMOTE_AQUAMAPS_NATIVE_2050", + "Aquamaps Native 2050 habitat generated by invoking Rainy Cloud", + "Aquamaps Native 2050 habitat generated by invoking Rainy Cloud.", null, true)); + operators.add(new Operator( + "REMOTE_AQUAMAPS_SUITABLE", + "Aquamaps Suitable habitat generated by invoking Rainy Cloud", + "Aquamaps Suitable habitat generated by invoking Rainy Cloud.", null, true)); + operators.add(new Operator( + "AQUAMAPS_SUITABLE", + "Aquamaps Suitable habitat production", + "Aquamaps Suitable habitat production.", null, true)); + operators.add(new Operator( + "AQUAMAPS_NATIVE_NEURALNETWORK", + "Aquamaps Native Distribution using a Feed-Forward Neural Network", + "Aquamaps Native Distribution using a Feed-Forward Neural Network.", null, true)); + operators.add(new Operator( + "AQUAMAPS_NATIVE", + "Aquamaps Native habitat production", + "Aquamaps Native habitat production.", null, true)); + operators.add(new Operator( + "AQUAMAPS_SUITABLE_2050", + "Aquamaps Suitable for 2050 scenario", + "Aquamaps Suitable for 2050 scenario.", null, true)); + operators.add(new Operator( + "AQUAMAPSNN", + "Feed-Forward Neural Network for usage in Aquamaps generations", + "Feed-Forward Neural Network for usage in Aquamaps generations.", null, true)); + operators.add(new Operator( + "AQUAMAPSNNNS", + "Feed-Forward Neural Network by Neurosolutions for usage in Aquamaps generations", + "Feed-Forward Neural Network by Neurosolutions (http://www.neurosolutions.com) for usage in Aquamaps generations.", null, true)); + operators.add(new Operator( + "HSPEN", + "Hspen model by Aquamaps", + "Hspen model by Aquamaps.", null, true)); + operators.add(new Operator( + "QUALITY_ANALYSIS", + "", + ".", null)); + operators.add(new Operator( + "DISCREPANCY_ANALYSIS", + "", + ".", null)); + } + } + + public static OperatorCategory getOperatorCategory(OperatorCategory operatorCategory) { + initCategories(); + for (OperatorCategory cat : categories) + if (operatorCategory.getId().contentEquals(cat.getId())) + return cat; + return null; + } + + public static Operator getOperator(Operator operator) { + initOperators(); + for (Operator op : operators) + if (operator.getId().contentEquals(op.getId())) + return op; + return null; + } +} + diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/DownloadServlet.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/DownloadServlet.java new file mode 100644 index 0000000..2cb9b42 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/DownloadServlet.java @@ -0,0 +1,56 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.server; + + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.gcube.portlets.user.dataminermanager.server.util.StorageUtil; + +/** + * @author Federico De Faveri defaveri@isti.cnr.it + * + */ +public class DownloadServlet extends HttpServlet{ + + private static final long serialVersionUID = -8423345575690165644L; + + public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + + String requestType = (String)req.getParameter("type"); + + String smpUrl = (String)req.getParameter("url"); + + String fileName = req.getParameter("name"); + + System.out.println("DOWNLOAD SERVLET"); + System.out.println("SMP URL: "+smpUrl); + System.out.println("File name: "+fileName); + + try{ + if (requestType==null || !requestType.toUpperCase().contentEquals("IMAGES")) + resp.setHeader( "Content-Disposition", "attachment; filename=\"" + fileName + "\"" ); + + InputStream inputStream = StorageUtil.getStorageClientInputStream(smpUrl); + + OutputStream out = resp.getOutputStream(); + IOUtils.copy(inputStream, resp.getOutputStream()); + out.close(); + } catch (Exception e) { + System.out.println("Error during external item sending "+smpUrl); +// e.printStackTrace(); + resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error during data retrieving: "+e.getMessage()); + return; + } + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/is/InformationSystemUtils.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/is/InformationSystemUtils.java new file mode 100644 index 0000000..4025fbb --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/is/InformationSystemUtils.java @@ -0,0 +1,55 @@ +package org.gcube.portlets.user.dataminermanager.server.is; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.common.resources.gcore.ServiceEndpoint; +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.resources.discovery.client.api.DiscoveryClient; +import org.gcube.resources.discovery.client.queries.api.SimpleQuery; +import org.gcube.resources.discovery.icclient.ICFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class InformationSystemUtils { + + private static Logger logger = LoggerFactory + .getLogger(InformationSystemUtils.class); + + public static List retrieveServiceAddress(String category, + String name, String scope) throws Exception { + try { + + if (scope == null || scope.length() == 0) + return new ArrayList(); + + ScopeProvider.instance.set(scope); + + SimpleQuery query = ICFactory.queryFor(ServiceEndpoint.class); + query.addCondition( + "$resource/Profile/Category/text() eq '" + category + "'") + .addCondition( + "$resource/Profile/Name/text() eq '" + name + "'") + .setResult( + "$resource/Profile/AccessPoint/Interface/Endpoint/text()"); + DiscoveryClient client = ICFactory.client(); + List addresses = client.submit(query); + + return addresses; + + } catch (Throwable e) { + logger.error("Error in discovery DataMiner Service Endpoint in scope: " + + scope); + logger.error("Error: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw e; + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/news/FeedScheduler.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/news/FeedScheduler.java new file mode 100644 index 0000000..8804d4f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/news/FeedScheduler.java @@ -0,0 +1,169 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.server.news; + +import static org.gcube.resources.discovery.icclient.ICFactory.clientFor; +import static org.gcube.resources.discovery.icclient.ICFactory.queryFor; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; + +import org.apache.log4j.Logger; +import org.gcube.common.resources.gcore.GCoreEndpoint; +import org.gcube.common.resources.gcore.ServiceEndpoint; +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.resources.discovery.client.api.DiscoveryClient; +import org.gcube.resources.discovery.client.queries.api.SimpleQuery; + +/** + * @author "Federico De Faveri defaveri@isti.cnr.it" + * + */ +public class FeedScheduler { + + protected Timer scheduler; + protected Map scheduledScopes; + protected Logger logger = Logger.getLogger(FeedScheduler.class); + + public FeedScheduler(long refreshTime) { + scheduledScopes = new HashMap(); + scheduler = new Timer(true); + scheduler.schedule(new TimerTask() { + @Override + public void run() { + checkScopes(); + } + }, 0, refreshTime); + } + + public void schedule() throws Exception { + List scopes = getAvailableScopes(); + for (String scope : scopes) { + logger.trace("checking scope: " + scope); + if (isServicePresentInScope(scope)) { + logger.trace("service present"); + schedule(scope); + } else + logger.trace("service not present"); + } + + checkScopes(); + } + + protected void schedule(String scope) { + if (!scheduledScopes.containsKey(scope)) { + System.out.println("inside create new operator newProduce"); + + OperatorsNewsProducer feeder = new OperatorsNewsProducer(scope); + scheduledScopes.put(scope, feeder); + } + else + { + System.out.println("non created operator"); + + } + } + + protected void checkScopes() { + System.out.println("inside checkScope"); + for (OperatorsNewsProducer feeder : scheduledScopes.values()) { + try { + feeder.checkOperatorsForFeed(); + } catch (Exception e) { + } + } + } + + protected boolean isServicePresentInScope(String scope) throws Exception { + + SimpleQuery query = queryFor(GCoreEndpoint.class); + + query.addCondition("$resource/Profile/ServiceName/text() eq 'data-miner-manager-gcubews'"); + query.addCondition("$resource/Profile/ServiceClass/text() eq 'DataAnalysis'"); + DiscoveryClient client = clientFor(ServiceEndpoint.class); + // + System.out.println("scope"+ScopeProvider.instance.get()); + List resources = client.submit(query); + + System.out.println("number of find service :"+resources.size()); + + return resources.size()> 0; + } + + protected static List getAvailableScopes() throws Exception { + + List scopes = new ArrayList(); + String []scopeNames= ScopeProvider.instance.get().split("/"); + int i=0; + String toltaPathScope=""; + while(i findAvailableScopes(String infrastructure) +// throws Exception { +// +// List scopes = new ArrayList(); +// +// // ************* PORTAL MODE, Checking organizations +// scopes.add(infrastructure); +// +// // /************* GET ROOT ORGANIZATION +// List organizations = OrganizationLocalServiceUtil +// .getOrganizations(0, +// OrganizationLocalServiceUtil.getOrganizationsCount()); +// Organization rootOrganization = null; +// for (Organization organization : organizations) { +// if (organization.getName().equals(infrastructure.getName())) { +// rootOrganization = organization; +// break; +// } +// } +// if (rootOrganization == null) +// throw new Exception("Unable to find infrastructure scope " +// + infrastructure.getName() + " among organizations"); +// // ************** GET VO +// for (Organization vOrg : rootOrganization.getSuborganizations()) { +// String VOScopeString = "/" + vOrg.getParentOrganization().getName() +// + "/" + vOrg.getName(); +// try { +// scopes.add(GCUBEScope.getScope(VOScopeString)); +// for (Organization vre : vOrg.getSuborganizations()) { +// String VREScopeString = VOScopeString + "/" + vre.getName(); +// try { +// scopes.add(GCUBEScope.getScope(VREScopeString)); +// } catch (Exception e) { +// } +// } +// } catch (Exception e) { +// } +// // ************* GET VRE +// } +// +// return scopes; +// } + + public static void main(String[] args) throws Exception { + ScopeProvider.instance.set("/gcube/devNext"); + FeedScheduler scheduler = new FeedScheduler(1000); + scheduler.schedule(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/news/OperatorsNewsProducer.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/news/OperatorsNewsProducer.java new file mode 100644 index 0000000..2433f06 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/news/OperatorsNewsProducer.java @@ -0,0 +1,239 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.server.news; + +import static org.gcube.resources.discovery.icclient.ICFactory.client; + +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.apache.log4j.Logger; +import org.gcube.application.framework.core.session.ASLSession; +import org.gcube.application.framework.core.session.SessionManager; +import org.gcube.applicationsupportlayer.social.ApplicationNewsManager; +import org.gcube.applicationsupportlayer.social.NewsManager; +import org.gcube.common.resources.gcore.GenericResource; +import org.gcube.common.resources.gcore.Resources; +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.informationsystem.publisher.RegistryPublisherFactory; +import org.gcube.informationsystem.publisher.ScopedPublisher; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorCategory; +import org.gcube.portlets.user.dataminermanager.server.DescriptionRepository; +import org.gcube.portlets.user.dataminermanager.server.util.SessionUtil; +import org.gcube.portlets.user.dataminermanager.shared.Constants; +import org.gcube.resources.discovery.client.api.DiscoveryClient; +import org.gcube.resources.discovery.client.queries.api.Query; +import org.gcube.resources.discovery.client.queries.impl.QueryBox; +import org.w3c.dom.CharacterData; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * @author "Federico De Faveri defaveri@isti.cnr.it" + * + */ +public class OperatorsNewsProducer { + + private static final String GR_SECONDARY_TYPE = "DataMinerManager"; + private static final String GR_NAME = "Operators"; + + protected Logger logger = Logger.getLogger(OperatorsNewsProducer.class); + protected String scope; + + /** + * @param scope + */ + public OperatorsNewsProducer(String scope) { + this.scope = scope; + } + + public void checkOperatorsForFeed() throws Exception + { + logger.trace("checkOperatorsForFeed scope: "+scope); + + Map currentOperators = getCurrentOperators(); + List previousNotifiedOperators = getGenericResource(); + List newOperators = calculateNewOperators(previousNotifiedOperators, currentOperators); + + logger.trace("curentOperators.size "+currentOperators.size()+" previousNotifiedOperators: "+previousNotifiedOperators.size()+" newOperators: "+newOperators.size()); + + boolean feedNews = newOperators.size()!=0; + if (feedNews) { + + //TODO NEWS! + logger.trace("Operators:"); + for (Operator operator:newOperators) logger.trace(operator.getName()); + + ASLSession fakeSession = SessionManager.getInstance().getASLSession("1", "fake.session"); + fakeSession.setScope(scope.toString()); + + NewsManager anm = new ApplicationNewsManager(fakeSession, Constants.APPLICATION_ID); + + for (Operator operator:newOperators) { + String news = getNewsText(operator); + anm.shareApplicationUpdate(news); + } + + saveNotifiedOperators(currentOperators); + } + } + + protected String getNewsText(Operator operator) + { + StringBuilder text = new StringBuilder("The operator "); + text.append(operator.getName()); + text.append(" has been added: "); + text.append(operator.getDescription()); + return text.toString(); + } + + protected List calculateNewOperators(List previousNotifiedOperators, Map currentOperators) + { + List newOperators = new ArrayList(); + + for (Operator op: currentOperators.values()) if (!previousNotifiedOperators.contains(op.getName())) newOperators.add(op); + + return newOperators; + } + + + + protected List getGenericResource() throws Exception + { + + String queryString = "for $resource in collection('/db/Profiles/GenericResource')" + + "//Resource where ($resource/Profile/SecondaryType eq '" + + GR_SECONDARY_TYPE + + "')" + + " and ($resource/Scopes/Scope eq '" + + ScopeProvider.instance.get() + + "') " + + " and ( $resource/Profile/Name eq '" + + GR_NAME + + "')" + + " return $resource/Profile/Body/operators/text()"; + logger.debug(queryString); + Query q = new QueryBox(queryString); + + DiscoveryClient client = client(); + List operators = new ArrayList(); + + operators.addAll(client.submit(q)); + + List result= new ArrayList(); + for(String s : operators) + { + result.addAll(extractOperatorsFromXml(s)); + } + return result; + } + + /** + * @param xml + * @return + * @throws IOException + * @throws SAXException + * @throws ParserConfigurationException + */ + protected List extractOperatorsFromXml(String xml) throws SAXException, IOException, ParserConfigurationException { + List operators = new ArrayList(); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(xml)); + + Document doc = db.parse(is); + NodeList nodes = doc.getElementsByTagName("operator"); + + // iterate the employees + for (int i = 0; i < nodes.getLength(); i++) { + Element operator = (Element) nodes.item(i); + String operatorId = getCharacterDataFromElement(operator); + operators.add(operatorId); + } + + return operators; + } + + + protected String getCharacterDataFromElement(Element e) { + Node child = e.getFirstChild(); + if (child instanceof CharacterData) { + CharacterData cd = (CharacterData) child; + return cd.getData(); + } + return "?"; + } + + public Map getCurrentOperators() { + Map operators = new HashMap(); + + + + return operators; + } + + + + public void saveNotifiedOperators(Map operators) throws Exception + { + StringBuilder xml = new StringBuilder(); + xml.append(""); + xml.append("GenericResource"); + xml.append(""); + xml.append(""); + xml.append(GR_SECONDARY_TYPE); + xml.append(""); + xml.append(""); + xml.append(GR_NAME); + xml.append(""); + xml.append(""); + xml.append(""); + for (Operator operator: operators.values()) xml.append(""+operator.getName()+""); + xml.append(""); + xml.append(""); + xml.append(""); + xml.append(""); + + StringReader reader = new StringReader(xml.toString()); + + GenericResource resource = (GenericResource) Resources.unmarshal( + GenericResource.class, reader); + ScopedPublisher sp = RegistryPublisherFactory + .scopedPublisher(); + Listscopes= new ArrayList(); + scopes.add(scope); + sp.create(resource, scopes); + + + } + + + + + + + public static void main(String[] args) throws Exception + { + /*GHNContext ctx = GHNContext.getContext(); + String rootScope = (String) ctx.getProperty(GHNContext.INFRASTRUCTURE_NAME, true);*/ + OperatorsNewsProducer feeder = new OperatorsNewsProducer("/gcube/devNext/NextNext"); + feeder.checkOperatorsForFeed(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient.java new file mode 100644 index 0000000..38ca523 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient.java @@ -0,0 +1,50 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice; + +import java.util.List; + +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; + +/** + * + * Client + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public abstract class SClient { + + public SClient() { + super(); + } + + public abstract List getOperatorsClassifications() + throws Exception; + + public abstract List getInputParameters(Operator operator) + throws Exception; + + public abstract ComputationId startComputation(Operator operator, + String computationTitle, String computationDescription) + throws Exception; + + public abstract ComputationStatus getComputationStatus(ComputationId computationId) + throws Exception; + + public abstract Resource getResourceByComputationId(ComputationId computationId) + throws Exception; + + public abstract String cancelComputation(ComputationId computationId) + throws Exception; + + @Override + public String toString() { + return "SClient []"; + } + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient4WPS.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient4WPS.java new file mode 100644 index 0000000..f5405cd --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient4WPS.java @@ -0,0 +1,1133 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice; + +import java.math.BigInteger; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import net.opengis.wps.x100.CapabilitiesDocument; +import net.opengis.wps.x100.ComplexDataType; +import net.opengis.wps.x100.ExecuteDocument; +import net.opengis.wps.x100.ExecuteResponseDocument; +import net.opengis.wps.x100.ExecuteResponseDocument.ExecuteResponse.ProcessOutputs; +import net.opengis.wps.x100.InputDescriptionType; +import net.opengis.wps.x100.InputType; +import net.opengis.wps.x100.OutputDataType; +import net.opengis.wps.x100.OutputDescriptionType; +import net.opengis.wps.x100.ProcessBriefType; +import net.opengis.wps.x100.ProcessDescriptionType; +import net.opengis.wps.x100.ResponseDocumentType; +import net.opengis.wps.x100.StatusType; +import net.opengis.wps.x100.SupportedComplexDataInputType; +import net.opengis.wps.x100.impl.ExecuteResponseDocumentImpl; + +import org.apache.xmlbeans.XmlString; +import org.gcube.common.resources.gcore.ServiceEndpoint; +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus; +import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status; +import org.gcube.portlets.user.dataminermanager.client.bean.Operator; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorCategory; +import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification; +import org.gcube.portlets.user.dataminermanager.client.bean.output.FileResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResource; +import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.server.is.InformationSystemUtils; +import org.gcube.portlets.user.dataminermanager.server.smservice.wps.ResponseWPS; +import org.gcube.portlets.user.dataminermanager.server.smservice.wps.StatWPSClientSession; +import org.gcube.portlets.user.dataminermanager.server.smservice.wps.WPS2SM; +import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredential; +import org.gcube.portlets.user.dataminermanager.shared.Constants; +import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; +import org.gcube.resources.discovery.client.api.DiscoveryClient; +import org.gcube.resources.discovery.client.queries.api.SimpleQuery; +import org.gcube.resources.discovery.icclient.ICFactory; +import org.n52.wps.client.ExecuteRequestBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * Client 4 WPS + * + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class SClient4WPS extends SClient { + + private static Logger logger = LoggerFactory.getLogger(SClient4WPS.class); + private static final int OPERATOR_BRIEF_DESCRIPTION_MAX_LENGHT = 170; + private static final String OTHERS = "OTHERS"; + + private String wpsToken; + private String wpsUser; + // private String wpsServiceURL; + private String wpsProcessingServlet; + private String wpsCancelComputationServlet; + + private ProcessDescriptionType[] processesDescriptionType; + private ProcessBriefType[] processBriefs; + + private ProcessDescriptionType currentProcessDescription; + private InputDescriptionType[] currentInputs; + private OutputDescriptionType[] currentOutputs; + + private StatWPSClientSession wpsClient; + + public SClient4WPS(ServiceCredential serviceCredential) throws Exception { + super(); + if (serviceCredential == null) { + logger.error("Error credetials are null!"); + throw new Exception("Error credetials are null!"); + } else { + String token = serviceCredential.getToken(); + if (token == null || token.isEmpty()) { + logger.error("Error authorization token invalid: " + token); + throw new Exception("Error authorization token invalid: " + + token); + } else { + wpsToken = token; + } + + String userName = serviceCredential.getUsername(); + if (userName == null || userName.isEmpty()) { + logger.error("Error invalid user name: " + userName); + throw new Exception("Error invalid user name: " + userName); + } else { + wpsUser = userName; + } + List serviceAddress = InformationSystemUtils.retrieveServiceAddress( + Constants.DATAMINER_SERVICE_CATEGORY, + Constants.DATA_MINER_SERVICE_NAME, + serviceCredential.getScope()); + logger.debug("Service Address retrieved:" + serviceAddress); + if (serviceAddress == null || serviceAddress.size() < 1) { + logger.error("No DataMiner service address available!"); + throw new Exception("No DataMiner service address available!"); + } else { + logger.info("DataMiner service address found: " + + serviceAddress.get(0)); + wpsProcessingServlet = serviceAddress.get(0); + + int wpsWebProcessingServiceIndex = wpsProcessingServlet + .indexOf(Constants.WPSWebProcessingService); + if (wpsWebProcessingServiceIndex > 0) { + String wpsServiceUrl = wpsProcessingServlet.substring(0, + wpsWebProcessingServiceIndex); + wpsCancelComputationServlet = wpsServiceUrl + + Constants.WPSCancelComputationServlet; + logger.debug("Cancel computation servlet: " + + wpsCancelComputationServlet); + + } else { + logger.error("Cancel computation servlet not available!"); + throw new Exception( + "Cancel computation servlet not available!"); + } + + } + + } + + } + + + private StatWPSClientSession createWPSClientSession() { + if (wpsClient == null) { + wpsClient = new StatWPSClientSession(wpsUser, wpsToken); + return wpsClient; + } else { + return wpsClient; + } + } + + @Override + public List getOperatorsClassifications() + throws Exception { + + LinkedHashMap operatorsToCategoriesMap = new LinkedHashMap<>(); + LinkedHashMap> categoriesToOperatorsMap = new LinkedHashMap<>(); + + connect(); + if (processBriefs == null || processesDescriptionType == null) { + throw new ServiceException("Algorithms WPS not available!"); + } + + for (ProcessBriefType processBrief : processBriefs) { + String categoryTitle = processBrief.getTitle().getStringValue(); + String categoryName; + if (categoryTitle == null || categoryTitle.isEmpty()) { + categoryName = OTHERS; + } else { + String[] categorySplitted = categoryTitle.split(":"); + if (categorySplitted.length < 1) { + categoryName = OTHERS; + } else { + categoryName = categorySplitted[0]; + } + } + operatorsToCategoriesMap.put(processBrief.getIdentifier() + .getStringValue(), categoryName); + } + + String briefDescription; + for (ProcessBriefType processDescriptionType : processesDescriptionType) { + if (processDescriptionType.getAbstract().getStringValue().length() > OPERATOR_BRIEF_DESCRIPTION_MAX_LENGHT) { + briefDescription = processDescriptionType + .getAbstract() + .getStringValue() + .substring(0, OPERATOR_BRIEF_DESCRIPTION_MAX_LENGHT - 2); + briefDescription += "..."; + } else { + briefDescription = processDescriptionType.getAbstract() + .getStringValue(); + } + + String categoryName = operatorsToCategoriesMap + .get(processDescriptionType.getIdentifier() + .getStringValue()); + if (categoryName == null || categoryName.isEmpty()) { + categoryName = OTHERS; + } + + List listOperators = categoriesToOperatorsMap + .get(categoryName); + if (listOperators == null) { + listOperators = new ArrayList<>(); + } + + listOperators + .add(new Operator(processDescriptionType.getIdentifier() + .getStringValue(), processDescriptionType + .getTitle().getStringValue(), briefDescription, + processDescriptionType.getAbstract() + .getStringValue(), null)); + + categoriesToOperatorsMap.put(categoryName, listOperators); + + } + + List categories = new ArrayList<>(); + List operators = new ArrayList<>(); + + Comparator categoriesComparator = new Comparator() { + public int compare(OperatorCategory c1, OperatorCategory c2) { + return c1.getName().compareTo(c2.getName()); // use your logic + } + }; + + Comparator operatorsComparator = new Comparator() { + public int compare(Operator c1, Operator c2) { + return c1.getName().compareTo(c2.getName()); // use your logic + } + }; + + for (String categoryName : categoriesToOperatorsMap.keySet()) { + OperatorCategory category = new OperatorCategory(categoryName, + categoryName, categoryName); + List listOperators = categoriesToOperatorsMap + .get(categoryName); + for (Operator operator : listOperators) { + operator.setCategory(category); + } + Collections.sort(listOperators, operatorsComparator); + category.setOperators(listOperators); + operators.addAll(listOperators); + categories.add(category); + } + + Collections.sort(operators, operatorsComparator); + Collections.sort(categories, categoriesComparator); + + List operatorsClass = new ArrayList<>(); + + OperatorsClassification op = new OperatorsClassification( + Constants.UserClassificationName, categories, operators); + + operatorsClass.add(op); + + logger.debug("OperatorClass: " + operatorsClass); + return operatorsClass; + } + + private void describeProcess(String processID) throws Exception { + describeProcess(processID, null); + } + + private void describeProcess(String processID, URL processDescriptionURL) + throws Exception { + StatWPSClientSession wpsClient = null; + try { + wpsClient = createWPSClientSession(); + + logger.debug("Describe Process WPS URL: " + wpsProcessingServlet); + ProcessDescriptionType processDescription = null; + for (int k = 0; k <= 3; k++) { + try { + processDescription = wpsClient.getProcessDescription( + wpsProcessingServlet, processID); + } catch (Exception e) { + logger.debug("Retrying with WPS URL: " + + wpsProcessingServlet); + if (k == 3) + throw e; + } + if (processDescription != null) + break; + } + this.currentProcessDescription = processDescription; + + if (processDescriptionURL != null) + processDescription.set(XmlString.Factory + .parse(processDescriptionURL)); + + logger.debug(processDescription.toString()); + + InputDescriptionType[] inputList = processDescription + .getDataInputs().getInputArray(); + logger.debug("WPSClient->Fetching Inputs"); + for (InputDescriptionType input : inputList) { + logger.debug("WPSClient->Input: " + input); + } + + OutputDescriptionType[] outputList = processDescription + .getProcessOutputs().getOutputArray(); + logger.debug("WPSClient->Fetching Outputs"); + for (OutputDescriptionType output : outputList) { + logger.debug("WPSClient->Output: " + output); + } + + currentInputs = inputList; + currentOutputs = outputList; + + } catch (Exception e) { + e.printStackTrace(); + throw e; + } finally { + wpsClient.disconnect(wpsProcessingServlet); + } + } + + private void connect() throws ServiceException { + StatWPSClientSession wpsClient = null; + processesDescriptionType = null; + processBriefs = null; + + try { + wpsClient = createWPSClientSession(); + + wpsClient.connect(wpsProcessingServlet); + + processesDescriptionType = wpsClient + .getAllProcessDescriptions(wpsProcessingServlet); + + CapabilitiesDocument capabilitiesDocument = wpsClient + .getWPSCaps(wpsProcessingServlet); + + processBriefs = capabilitiesDocument.getCapabilities() + .getProcessOfferings().getProcessArray(); + return; + + } catch (Throwable e) { + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } finally { + if (wpsClient != null) { + wpsClient.disconnect(wpsProcessingServlet); + } + } + + } + + private ProcessDescriptionType getProcessDescription() { + return currentProcessDescription; + } + + private void setProcessDescription(ProcessDescriptionType processDescription) { + this.currentProcessDescription = processDescription; + } + + private String executeProcessAsync(ExecuteRequestBuilder executeBuilder, + ProcessDescriptionType processDescription) throws Exception { + try { + try { + + OutputDescriptionType[] odts = processDescription + .getProcessOutputs().getOutputArray(); + for (OutputDescriptionType odt : odts) { + // executeBuilder.setMimeTypeForOutput("text/xml", + // "result"); + if (odt.isSetComplexOutput()) + executeBuilder.setMimeTypeForOutput("text/xml", odt + .getIdentifier().getStringValue()); + } + } catch (Exception e) { + logger.debug("Execute Process-> Warning, no xml structured objects will be provided: " + + e.getLocalizedMessage()); + e.printStackTrace(); + } + // executeBuilder.setSchemaForOutput("http://schemas.opengis.net/gml/3.1.1/base/feature.xsd", + // "result"); + + ExecuteDocument execute = executeBuilder.getExecute(); + execute.getExecute().setService("WPS"); + // System.out.println("RESPONSE FORM:"+execute.getExecute().getResponseForm()); + StatWPSClientSession wpsClient = null; + + wpsClient = createWPSClientSession(); + wpsClient.connect(wpsProcessingServlet); + logger.debug("Sending: " + execute); + if (execute.getExecute().getResponseForm() != null) { + ResponseDocumentType documentType = execute.getExecute() + .getResponseForm().getResponseDocument(); + documentType.setStoreExecuteResponse(true); + documentType.setStatus(true); + documentType.setLineage(false); + execute.getExecute().getResponseForm() + .setResponseDocument(documentType); + } + Object responseObject = wpsClient.execute(wpsProcessingServlet, + execute); + String processLocation = null; + if (responseObject != null) { + processLocation = ((ExecuteResponseDocumentImpl) responseObject) + .getExecuteResponse().getStatusLocation(); + } else + throw new Exception("Invalid Response from service: " + + responseObject); + logger.debug("Retrieved ProcessLocation: " + processLocation); + return processLocation; + + } catch (Exception e) { + logger.debug("ExecuteProcessAsync: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw e; + } finally { + try { + if (wpsClient != null) + wpsClient.disconnect(wpsProcessingServlet); + } catch (Exception e) { + + } + } + } + + private ProcessOutputs retrieveProcessResult(String processLocation) + throws Exception { + try { + logger.debug("RetrieveProcessResult: " + processLocation); + wpsClient = createWPSClientSession(); + // wpsClient.connectForMonitoring(webProcessingService); + // wpsClient.connect(url) + + Object responseObject = null; + if (processLocation != null && processLocation.length() > 0) + responseObject = wpsClient.executeViaGET(processLocation, ""); + else + throw new Exception("Process Location is null!"); + + logger.debug("Response:\n" + responseObject); + return ((ExecuteResponseDocument) responseObject) + .getExecuteResponse().getProcessOutputs(); + + } catch (Exception e) { + logger.debug("RetrieveProcessResult: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw e; + } finally { + wpsClient.disconnect(wpsProcessingServlet); + } + } + + private static int calculateBBDimensions(String bbstring) { + String[] bbinput = bbstring.split(","); + int dimcounter = 0; + try { + for (int i = 0; i < bbinput.length; i++) { + Double.parseDouble(bbinput[i]); + dimcounter++; + } + } catch (Exception e) { + logger.debug("Dimensions Count: " + dimcounter); + } + return dimcounter; + } + + private static void addBoundingBoxInput( + org.n52.wps.client.ExecuteRequestBuilder executeBuilder, + String identifier, String BBstring) { + + ExecuteDocument executor = executeBuilder.getExecute(); + InputType input1 = executor.getExecute().getDataInputs().addNewInput(); + input1.addNewIdentifier().setStringValue(identifier); + + net.opengis.ows.x11.BoundingBoxType bbtype = input1.addNewData() + .addNewBoundingBoxData(); + + // bboxInput=46,102,47,103,urn:ogc:def:crs:EPSG:6.6:4326,2 + String[] bbinput = BBstring.split(","); + int dimensions = calculateBBDimensions(BBstring); + List lc = new ArrayList(); + for (int i = 0; i < dimensions / 2; i++) { + lc.add(bbinput[i]); + } + List uc = new ArrayList(); + for (int i = dimensions / 2; i < dimensions; i++) { + uc.add(bbinput[i]); + } + + bbtype.setLowerCorner(lc); + bbtype.setUpperCorner(uc); + + // int crsidx = bbinput[dimensions].indexOf("crs:"); + String crs = bbinput[dimensions]; + /* + * if (crsidx>=0) crs = bbinput[dimensions].substring(crsidx+4); + */ + bbtype.setCrs(crs); + bbtype.setDimensions(new BigInteger("" + dimensions / 2)); + + } + + private static LinkedHashMap retrieveURLsFromWPSResponse( + ComplexDataType cdt) { + org.w3c.dom.Node node = cdt.getDomNode(); + LinkedHashMap urls = new LinkedHashMap<>(); + getURLFromXML(node, urls); + for (String key : urls.keySet()) { + logger.debug("ResponseWPS Map: " + key + "-->" + urls.get(key)); + } + return urls; + } + + private static String getExceptionText(String exceptionText) { + try { + String excText = "ExceptionText>"; + int idx = exceptionText.indexOf(excText); + if (idx >= 0) { + String exception = exceptionText.substring(idx + + excText.length()); + exception = exception.substring(0, exception.indexOf("", "") + .replace("/", " ") + .replace("\\", " ") + .replaceAll( + "[\\]\\[!\"#$%&'\\(\\)*+/:;<=>?@\\^_`{\\|}~-]", + "_").trim(); + exception = exception.replaceAll("[ ]+", " "); + if (exception.length() > 200) + exception = exception.substring(0, 200) + "..."; + return exception; + } else + return "Process error in WPS Execution"; + } catch (Exception e) { + e.printStackTrace(); + return "Backend error in WPS Execution"; + } + } + + private static void getURLFromXML(org.w3c.dom.Node node, + ResponseWPS responseWPS) { + if (node == null) + return; + + logger.debug("Node Name: " + node.getNodeName() + "- Value:" + + node.getFirstChild().getNodeValue()); + + if (node.getNodeName() == null) { + return; + } + + String text; + switch (node.getNodeName()) { + case "d4science:Data": + text = node.getFirstChild().getNodeValue(); + responseWPS.setData(text); + break; + case "d4science:Description": + text = node.getFirstChild().getNodeValue(); + responseWPS.setDescription(text); + break; + case "d4science:MimeType": + text = node.getFirstChild().getNodeValue(); + responseWPS.setMimeType(text); + break; + default: + break; + } + /* logger.debug("ResponseWPS:"+responseWPS); */ + + } + + private static void getURLFromXML(org.w3c.dom.Node node, + LinkedHashMap urls) { + if (node == null) + return; + + logger.debug("Node Name: " + node.getNodeName()); + + if (node.getNodeName() == null) { + return; + } + + ResponseWPS responseWPS = null; + NodeList listnodes = node.getChildNodes(); + int nChildren = listnodes.getLength(); + + switch (node.getNodeName()) { + case "ogr:Result": + NamedNodeMap attrs = node.getAttributes(); + Node n = attrs.getNamedItem("fid"); + String key = n.getNodeValue(); + responseWPS = new ResponseWPS(); + urls.put(key, responseWPS); + if (nChildren == 0) { + + } else { + for (int i = 0; i < nChildren; i++) { + getURLFromXML(listnodes.item(i), responseWPS); + + } + } + break; + default: + if (nChildren == 0) { + + } else { + for (int i = 0; i < nChildren; i++) { + getURLFromXML(listnodes.item(i), urls); + + } + } + break; + + } + + /* + * + * NodeList listnodes = node.getChildNodes(); int nChildren = + * listnodes.getLength(); + * + * if (nChildren == 0) { String text = node.getNodeValue(); if (text != + * null && (text.startsWith("https:") || text.startsWith("http:") || + * text.startsWith("ftp:") || text.startsWith("smp:") || text + * .startsWith("file:"))) urls.add(text.trim()); else if (text != null + * && text.trim().length() > 0) urls.add(text.trim()); } else { for (int + * i = 0; i < nChildren; i++) { List childrenurls = + * getURLFromXML(listnodes.item(i)); urls.addAll(childrenurls); + * + * } } return urls; + */ + } + + // TODO + @Override + public List getInputParameters(Operator operator) + throws Exception { + try { + logger.info("Parameters of algorithm " + operator.getId()); + + try { + describeProcess(operator.getId()); + } catch (Throwable e) { + logger.error("GetParameters: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + + List parameters = new ArrayList<>(); + + Parameter inputParameter; + for (InputDescriptionType inputDesc : currentInputs) { + inputParameter = WPS2SM.convert2SMType(inputDesc); + logger.debug("InputParameter: " + inputParameter); + parameters.add(inputParameter); + } + + logger.debug("Parameters: " + parameters); + return parameters; + + } catch (Throwable e) { + + logger.error(e.getLocalizedMessage()); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + + } + + @Override + public ComputationId startComputation(Operator operator, + String computationTitle, String computationDescription) + throws Exception { + // TODO Auto-generated method stub + + try { + describeProcess(operator.getId()); + } catch (Throwable e) { + logger.error("GetParameters: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + + LinkedHashMap inputParameters = new LinkedHashMap<>(); + + Parameter inputParameter; + for (InputDescriptionType inputDesc : currentInputs) { + inputParameter = WPS2SM.convert2SMType(inputDesc); + logger.debug("InputParameter: " + inputParameter); + inputParameters.put(inputParameter.getName(), inputParameter); + } + + List params = operator.getOperatorParameters(); + Map userInputs = new LinkedHashMap<>(); + for (Parameter parm : params) { + userInputs.put(parm.getName(), parm.getValue()); + logger.debug("UserInputs= key:" + parm.getName() + ", value=" + + parm.getValue()); + } + + String processUrl = compute(userInputs, inputParameters, + computationTitle, computationDescription); + logger.debug("Stated Computation ProcessLocation:" + processUrl); + + int idIndex = processUrl.lastIndexOf("?id="); + String id; + if (idIndex > -1) { + id = processUrl.substring(idIndex + 4, processUrl.length()); + } else { + logger.error("Invalid processLocation: " + processUrl); + throw new ServiceException("Invalid processLocation: " + processUrl); + } + ComputationId computationId = new ComputationId(id, processUrl); + logger.debug("ComputationId: " + computationId); + + return computationId; + } + + private String compute(Map userInputs, + Map inputParameters, String computationTitle, + String computationDescription) throws Exception { + try { + // setup the inputs + org.n52.wps.client.ExecuteRequestBuilder executeBuilder = new org.n52.wps.client.ExecuteRequestBuilder( + currentProcessDescription); + // for each input + for (InputDescriptionType input : currentInputs) { + // retrieve the input from the sm config + String value = userInputs.get(input.getIdentifier() + .getStringValue()); + + if (value != null && value.trim().length() > 0) { + /* + * String[] values = value.split("\\|"); if (values.length + * == 0) { values = new String[1]; values[0] = value; } + */ + // fulfill an input obj for the execution + if (input.isSetLiteralData()) { + logger.debug("Configuring Literal: " + + input.getIdentifier().getStringValue() + + " to: " + value); + /* for (String v : values) { */ + executeBuilder.addLiteralData(input.getIdentifier() + .getStringValue(), value); + /* } */ + } else if (input.isSetBoundingBoxData()) { + logger.debug("Configuring Bounding Box: " + + input.getIdentifier().getStringValue() + + " to: " + value); + + /* for (String v : values) { */ + addBoundingBoxInput(executeBuilder, input + .getIdentifier().getStringValue(), value); + /* } */ + } else { + logger.debug("Configuring Complex: " + + input.getIdentifier().getStringValue() + + " to: " + value); + SupportedComplexDataInputType complex = input + .getComplexData(); + /* for (String v : values) { */ + executeBuilder.addComplexDataReference(input + .getIdentifier().getStringValue(), value, + complex.getDefault().getFormat().getSchema(), + complex.getDefault().getFormat().getEncoding(), + complex.getDefault().getFormat().getMimeType()); + /* } */ + + } + } + } + + // Submit the execution + String statusLocation = executeProcessAsync(executeBuilder, + currentProcessDescription); + logger.debug("Starting Process: " + statusLocation); + return statusLocation; + + } catch (Exception e) { + e.printStackTrace(); + String exceptiontext = getExceptionText(e.getLocalizedMessage()); + logger.debug("WPSProcess->Returning Exception to the SM:" + + exceptiontext); + throw new Exception(exceptiontext); + } + } + + @Override + public ComputationStatus getComputationStatus(ComputationId computationId) + throws Exception { + try { + logger.debug("GetComputationStatus(): ComputationId=" + + computationId); + wpsClient = createWPSClientSession(); + wpsClient.connectForMonitoring(wpsProcessingServlet); + + Object responseObject = null; + if (computationId == null || computationId.getUrlId() == null + || computationId.getUrlId().isEmpty()) { + throw new Exception("Process Location is null!"); + } else { + ComputationStatus computationStatus = null; + try { + + responseObject = wpsClient.executeViaGET( + computationId.getUrlId(), ""); + + logger.debug("ComputationStatus ResponseObject:" + + responseObject); + + if (responseObject instanceof ExecuteResponseDocumentImpl) { + if (((ExecuteResponseDocumentImpl) responseObject) + .getExecuteResponse() == null) { + logger.debug("WPS FAILURE OR PAUSED: ExecuteResponse is null"); + computationStatus = new ComputationStatus( + Status.FAILED, 100f); + + } else { + StatusType statusType = ((ExecuteResponseDocumentImpl) responseObject) + .getExecuteResponse().getStatus(); + if (statusType == null) { + logger.debug("WPS FAILURE OR PAUSED: Status Type is null"); + computationStatus = new ComputationStatus( + Status.FAILED, 100f); + } else { + + int status = statusType.getProcessStarted() == null ? -1 + : statusType.getProcessStarted() + .getPercentCompleted(); + /* + * String processStarted = + * statusType.getProcessStarted() == null ? null + * : + * statusType.getProcessStarted().getStringValue + * (); + */ + String failure = statusType.getProcessFailed() == null ? null + : statusType.getProcessFailed() + .getExceptionReport() + .toString(); + String accepted = statusType + .getProcessAccepted() == null ? null + : statusType.getProcessAccepted(); + String success = statusType + .getProcessSucceeded() == null ? null + : statusType.getProcessSucceeded(); + String paused = statusType.getProcessPaused() == null ? null + : statusType.getProcessPaused() + .getStringValue(); + + if ((failure != null && failure.length() > 0) + || (paused != null && paused.length() > 0)) { + logger.debug("WPS FAILURE: " + failure + + " OR PAUSED: " + paused); + computationStatus = new ComputationStatus( + Status.FAILED, 100f); + } else { + if (accepted != null + && accepted.length() > 0) { + logger.debug("WPS ACCEPTED"); + computationStatus = new ComputationStatus( + Status.PENDING, 0f); + } else { + if (success != null + && success.length() > 0) { + logger.debug("WPS SUCCESS"); + computationStatus = new ComputationStatus( + Status.COMPLETE, 100f); + } else { + if (status >= 0) { + Float statusd = (float) status; + try { + statusd = Float + .parseFloat(statusType + .getProcessStarted() + .getStringValue()); + } catch (Exception e) { + + } + logger.debug("WPS STATUS:" + + statusd); + computationStatus = new ComputationStatus( + Status.RUNNING, statusd); + } else { + } + } + } + } + } + } + logger.debug("ComputationStatus: " + computationStatus); + return computationStatus; + } else { + logger.error("Error in ResponceObject: " + + responseObject); + logger.error("WPS FAILURE"); + computationStatus = new ComputationStatus( + Status.FAILED, 100f); + return computationStatus; + } + } catch (Throwable e) { + logger.error("WPS FAILURE: " + e.getLocalizedMessage()); + e.printStackTrace(); + computationStatus = new ComputationStatus(Status.FAILED, + 100f); + return computationStatus; + + } + } + + } catch (Exception e) { + logger.error("MonitorProcess: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw e; + } finally { + wpsClient.disconnect(wpsProcessingServlet); + } + + } + + @Override + public Resource getResourceByComputationId(ComputationId computationId) + throws Exception { + Map resources = retrieveOutput(computationId + .getUrlId()); + MapResource mapResource = new MapResource("mapResource", "Resources", + "Resources", resources); + + return mapResource; + } + + private Map retrieveOutput(String processLocation) + throws Exception { + Map outputResource = new LinkedHashMap<>(); + Map outputParameters = new LinkedHashMap<>(); + + Parameter outputParameter; + for (OutputDescriptionType outputDesc : currentOutputs) { + outputParameter = WPS2SM.convert2SMType(outputDesc); + logger.debug("OutputParameter: " + outputParameter); + outputParameters.put(outputParameter.getName(), outputParameter); + } + + retrieveProcessOutput(processLocation, outputParameters, outputResource); + + return outputResource; + + } + + private void retrieveProcessOutput(String processLocation, + Map outputParameters, + Map outputResource) throws Exception { + ProcessOutputs outs = retrieveProcessResult(processLocation); + logger.debug("Process Executed"); + // retrieve the output objs + if (outs == null) + throw new Exception( + "Error during the execution of the WPS process: returned an empty document"); + else { + OutputDataType[] outputData = outs.getOutputArray(); + + for (OutputDataType out : outputData) { + String outputID = out.getIdentifier().getStringValue(); + String value = ""; + if (out.getData().isSetLiteralData()) { + value = out.getData().getLiteralData().getStringValue(); + Parameter paramLiteral = outputParameters.get(outputID); + if (paramLiteral != null) { + paramLiteral.setValue(value); + logger.debug("Assigning value: " + value + + " to output named: " + outputID); + Resource resource = new ObjectResource(outputID, + paramLiteral.getName(), + paramLiteral.getDescription(), + paramLiteral.getValue()); + outputResource.put(outputID, resource); + } + } else { + if (out.getData().isSetComplexData()) { + if (out.getReference() != null) { + value = out.getReference().getHref(); + Parameter paramComplexData = outputParameters + .get(outputID); + if (paramComplexData != null) { + paramComplexData.setValue(value); + logger.debug("Assigning value: " + value + + " to output named: " + outputID); + Resource resource = new ObjectResource( + outputID, paramComplexData.getName(), + paramComplexData.getDescription(), + paramComplexData.getValue()); + outputResource.put(outputID, resource); + } + } else + // remove the element name, which is not useful + outputParameters.remove(outputID); + + ComplexDataType cdt = out.getData().getComplexData(); + LinkedHashMap urls = retrieveURLsFromWPSResponse(cdt); + + for (String key : urls.keySet()) { + logger.debug("Adding OBJ:" + key); + ResponseWPS responseWPS = urls.get(key); + ObjectParameter objP = new ObjectParameter(key, + responseWPS.getDescription(), + String.class.getName(), " "); + objP.setValue(responseWPS.getData()); + logger.debug("ObjectParameter: " + objP); + outputParameters.put(key, objP); + if (responseWPS != null + && responseWPS.getMimeType() != null) { + Resource resource; + switch (responseWPS.getMimeType()) { + case "image/bmp": + case "image/gif": + case "image/jpeg": + case "image/png": + resource = new ImagesResource(key, + responseWPS.getDescription(), + responseWPS.getDescription(), + responseWPS.getData(), + responseWPS.getMimeType()); + outputResource.put(key, resource); + break; + case "text/csv": + if (responseWPS.getData() != null + && !responseWPS.getData().isEmpty()) { + if (responseWPS.getData().startsWith( + "http:") + || responseWPS.getData() + .startsWith("https:") + || responseWPS.getData() + .startsWith("smp:")) { + resource = new FileResource(key, + responseWPS + .getDescription(), + responseWPS + .getDescription(), + responseWPS.getData(), + responseWPS.getMimeType()); + outputResource.put(key, resource); + } else { + resource = new ObjectResource(key, + responseWPS + .getDescription(), + responseWPS + .getDescription(), + responseWPS.getData()); + outputResource.put(key, resource); + } + } else { + resource = new ObjectResource(key, + responseWPS.getDescription(), + responseWPS.getDescription(), + responseWPS.getData()); + outputResource.put(key, resource); + } + + break; + default: + if (responseWPS.getData() != null + && !responseWPS.getData().isEmpty()) { + if (responseWPS.getData().startsWith( + "http:") + || responseWPS.getData() + .startsWith("https:") + || responseWPS.getData() + .startsWith("smp:")) { + resource = new FileResource(key, + responseWPS + .getDescription(), + responseWPS + .getDescription(), + responseWPS.getData(), + responseWPS.getMimeType()); + outputResource.put(key, resource); + } else { + resource = new ObjectResource(key, + responseWPS + .getDescription(), + responseWPS + .getDescription(), + responseWPS.getData()); + outputResource.put(key, resource); + } + } else { + resource = new ObjectResource(key, + responseWPS.getDescription(), + responseWPS.getDescription(), + responseWPS.getData()); + outputResource.put(key, resource); + } + break; + } + + } + } + } else { + value = out.getData().getLiteralData().getStringValue(); + + } + } + } + } + } + + @Override + public String cancelComputation(ComputationId computationId) + throws Exception { + try { + wpsClient = createWPSClientSession(); + + String result = wpsClient.cancelComputation( + wpsCancelComputationServlet, computationId.getId()); + + return result; + + } catch (Throwable e) { + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } finally { + if (wpsClient != null) { + wpsClient.disconnect(wpsProcessingServlet); + } + } + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient4WPSBuilder.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient4WPSBuilder.java new file mode 100644 index 0000000..fe0eab6 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClient4WPSBuilder.java @@ -0,0 +1,40 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice; + +import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredential; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Client 4 WPS + * + * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * + */ +public class SClient4WPSBuilder extends SClientBuilder { + private static Logger logger = LoggerFactory + .getLogger(SClient4WPSBuilder.class); + private ServiceCredential serviceCredendial; + + public SClient4WPSBuilder(ServiceCredential serviceCredential) { + this.serviceCredendial= serviceCredential; + + } + + @Override + public void buildSClient() throws ServiceException { + try { + logger.debug("Build SM4WPS"); + logger.debug("ServiceCredential: " + serviceCredendial); + SClient smClient = new SClient4WPS(serviceCredendial); + + sClientSpec.setSClient(smClient); + } catch (Throwable e) { + logger.error(e.getLocalizedMessage()); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientBuilder.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientBuilder.java new file mode 100644 index 0000000..33bbf6f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientBuilder.java @@ -0,0 +1,26 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice; + +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; + +/** + * Abstract class for build Service + * + * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * + */ +public abstract class SClientBuilder { + protected SClientSpec sClientSpec; + + public SClientSpec getSClientSpec() { + return sClientSpec; + } + + public void createSpec() { + sClientSpec = new SClientSpec(); + + } + + public abstract void buildSClient() throws ServiceException; + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientDirector.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientDirector.java new file mode 100644 index 0000000..51798f6 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientDirector.java @@ -0,0 +1,31 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice; + +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; + + +/** + * Director + * + * @author "Giancarlo Panichi" + * email: g.panichi@isti.cnr.it + * + */ +public class SClientDirector { + SClientBuilder sClientBuilder; + + public void setSClientBuilder( + SClientBuilder sClientBuilder) { + this.sClientBuilder = sClientBuilder; + } + + public SClient getSClient() { + return sClientBuilder.getSClientSpec().getSClient(); + + } + + public void constructSClient() throws ServiceException { + sClientBuilder.createSpec(); + sClientBuilder.buildSClient(); + + } +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientSpec.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientSpec.java new file mode 100644 index 0000000..cc51e05 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/SClientSpec.java @@ -0,0 +1,21 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice; + +/** + * Specification + * + * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * + */ +public class SClientSpec { + private SClient sClient; + + public SClient getSClient() { + return sClient; + } + + public void setSClient(SClient sClient) { + this.sClient = sClient; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/ResponseWPS.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/ResponseWPS.java new file mode 100644 index 0000000..eeb3f8a --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/ResponseWPS.java @@ -0,0 +1,58 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice.wps; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class ResponseWPS implements Serializable { + private static final long serialVersionUID = 3449817768583395068L; + private String data; + private String description; + private String mimeType; + + public ResponseWPS() { + super(); + } + + public ResponseWPS(String data, String description, String mimeType) { + super(); + this.data = data; + this.description = description; + this.mimeType = mimeType; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + @Override + public String toString() { + return "ResponseWPS [data=" + data + ", description=" + description + + ", mimeType=" + mimeType + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/StatClientDescribeProcessRequest.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/StatClientDescribeProcessRequest.java new file mode 100644 index 0000000..348549f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/StatClientDescribeProcessRequest.java @@ -0,0 +1,36 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice.wps; + +import org.n52.wps.client.AbstractClientGETRequest; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class StatClientDescribeProcessRequest extends AbstractClientGETRequest { + + private static String IDENTIFIER_REQ_PARAM_NAME = "identifier"; + private static String REQUEST_REQ_PARAM_VALUE = "DescribeProcess"; + + public StatClientDescribeProcessRequest() { + super(); + setRequestParamValue(REQUEST_REQ_PARAM_VALUE); + } + + public void setIdentifier(String[] ids) { + String idsString = ""; + for(int i = 0; i < ids.length; i++) { + idsString = idsString + ids[i]; + if(i != ids.length -1) { + idsString = idsString + ","; + } + } + requestParams.put(IDENTIFIER_REQ_PARAM_NAME, idsString); + } + + public boolean valid() { + return true; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/StatWPSClientSession.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/StatWPSClientSession.java new file mode 100644 index 0000000..ffbf741 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/StatWPSClientSession.java @@ -0,0 +1,639 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice.wps; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.GZIPInputStream; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import net.opengis.ows.x11.ExceptionReportDocument; +import net.opengis.ows.x11.OperationDocument.Operation; +import net.opengis.wps.x100.CapabilitiesDocument; +import net.opengis.wps.x100.ExecuteDocument; +import net.opengis.wps.x100.ExecuteResponseDocument; +import net.opengis.wps.x100.ProcessBriefType; +import net.opengis.wps.x100.ProcessDescriptionType; +import net.opengis.wps.x100.ProcessDescriptionsDocument; + +import org.apache.commons.codec.binary.Base64; +import org.apache.xmlbeans.XmlException; +import org.apache.xmlbeans.XmlObject; +import org.apache.xmlbeans.XmlOptions; +import org.n52.wps.client.ClientCapabiltiesRequest; +import org.n52.wps.client.WPSClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class StatWPSClientSession { + private static Logger logger = LoggerFactory + .getLogger(StatWPSClientSession.class); + private static final String OGC_OWS_URI = "http://www.opengeospatial.net/ows"; + private static String SUPPORTED_VERSION = "1.0.0"; + + // private static StatWPSClientSession session; + private Map loggedServices; + private XmlOptions options = null; + + // a Map of + public Map processDescriptions; + private String user; + private String password; + + /** + * Initializes a WPS client session. + * + */ + public StatWPSClientSession(String user, String password) { + this.user = user; + this.password = password; + options = new XmlOptions(); + options.setLoadStripWhitespace(); + options.setLoadTrimTextBuffer(); + loggedServices = new HashMap(); + processDescriptions = new HashMap(); + } + + /** + * Connects to a WPS and retrieves Capabilities plus puts all available + * Descriptions into cache. + * + * @param url + * the entry point for the service. This is used as id for + * further identification of the service. + * @return true, if connect succeeded, false else. + * @throws WPSClientException + */ + public boolean connect(String url) throws WPSClientException { + logger.info("CONNECT"); + if (loggedServices.containsKey(url)) { + logger.info("Service already registered: " + url); + return false; + } + CapabilitiesDocument capsDoc = retrieveCapsViaGET(url); + if (capsDoc != null) { + loggedServices.put(url, capsDoc); + } + ProcessDescriptionsDocument processDescs = describeAllProcesses(url); + if (processDescs != null && capsDoc != null) { + processDescriptions.put(url, processDescs); + return true; + } + + logger.warn("retrieving caps failed, caps are null"); + return false; + } + + /** + * Connects to a WPS and retrieves Capabilities plus puts all available + * Descriptions into cache. + * + * @param url + * the entry point for the service. This is used as id for + * further identification of the service. + * @return true, if connect succeeded, false else. + * @throws WPSClientException + */ + public boolean connectForMonitoring(String url) throws WPSClientException { + logger.info("CONNECT"); + if (loggedServices.containsKey(url)) { + logger.info("Service already registered: " + url); + return false; + } + + logger.warn("retrieving caps failed, caps are null"); + return false; + } + + /** + * removes a service from the session + * + * @param url + */ + public void disconnect(String url) { + if (loggedServices.containsKey(url)) { + loggedServices.remove(url); + processDescriptions.remove(url); + logger.info("service removed successfully: " + url); + } + } + + /** + * returns the serverIDs of all loggedServices + * + * @return + */ + public List getLoggedServices() { + return new ArrayList(loggedServices.keySet()); + } + + /** + * informs you if the descriptions for the specified service is already in + * the session. in normal case it should return true :) + * + * @param serverID + * @return success + */ + public boolean descriptionsAvailableInCache(String serverID) { + return processDescriptions.containsKey(serverID); + } + + /** + * returns the cached processdescriptions of a service. + * + * @param serverID + * @return success + * @throws IOException + */ + private ProcessDescriptionsDocument getProcessDescriptionsFromCache( + String wpsUrl) throws IOException { + if (!descriptionsAvailableInCache(wpsUrl)) { + try { + connect(wpsUrl); + } catch (WPSClientException e) { + throw new IOException("Could not initialize WPS " + wpsUrl); + } + } + return processDescriptions.get(wpsUrl); + } + + /** + * return the processDescription for a specific process from Cache. + * + * @param serverID + * @param processID + * @return a ProcessDescription for a specific process from Cache. + * @throws IOException + */ + public ProcessDescriptionType getProcessDescription(String serverID, + String processID) throws IOException { + ProcessDescriptionType[] processes = getProcessDescriptionsFromCache( + serverID).getProcessDescriptions().getProcessDescriptionArray(); + for (ProcessDescriptionType process : processes) { + if (process.getIdentifier().getStringValue().equals(processID)) { + return process; + } + } + return null; + } + + /** + * Delivers all ProcessDescriptions from a WPS + * + * @param wpsUrl + * the URL of the WPS + * @return An Array of ProcessDescriptions + * @throws IOException + */ + public ProcessDescriptionType[] getAllProcessDescriptions(String wpsUrl) + throws IOException { + return getProcessDescriptionsFromCache(wpsUrl).getProcessDescriptions() + .getProcessDescriptionArray(); + } + + /** + * looks up, if the service exists already in session. + */ + public boolean serviceAlreadyRegistered(String serverID) { + return loggedServices.containsKey(serverID); + } + + /** + * provides you the cached capabilities for a specified service. + * + * @param url + * @return + */ + public CapabilitiesDocument getWPSCaps(String url) { + return loggedServices.get(url); + } + + /** + * retrieves all current available ProcessDescriptions of a WPS. Mention: to + * get the current list of all processes, which will be requested, the + * cached capabilities will be used. Please keep that in mind. the retrieved + * descriptions will not be cached, so only transient information! + * + * @param url + * @return + * @throws WPSClientException + */ + public ProcessDescriptionsDocument describeAllProcesses(String url) + throws WPSClientException { + CapabilitiesDocument doc = loggedServices.get(url); + if (doc == null) { + logger.warn("serviceCaps are null, perhaps server does not exist"); + return null; + } + ProcessBriefType[] processes = doc.getCapabilities() + .getProcessOfferings().getProcessArray(); + String[] processIDs = new String[processes.length]; + for (int i = 0; i < processIDs.length; i++) { + processIDs[i] = processes[i].getIdentifier().getStringValue(); + } + return describeProcess(processIDs, url); + + } + + /** + * retrieves the desired description for a service. the retrieved + * information will not be held in cache! + * + * @param processIDs + * one or more processIDs + * @param serverID + * @throws WPSClientException + */ + public ProcessDescriptionsDocument describeProcess(String[] processIDs, + String serverID) throws WPSClientException { + + CapabilitiesDocument caps = this.loggedServices.get(serverID); + Operation[] operations = caps.getCapabilities().getOperationsMetadata() + .getOperationArray(); + String url = null; + for (Operation operation : operations) { + if (operation.getName().equals("DescribeProcess")) { + url = operation.getDCPArray()[0].getHTTP().getGetArray()[0] + .getHref(); + } + } + if (url == null) { + throw new WPSClientException( + "Missing DescribeOperation in Capabilities"); + } + return retrieveDescriptionViaGET(processIDs, url); + } + + /** + * Executes a process at a WPS + * + * @param url + * url of server not the entry additionally defined in the caps. + * @param execute + * Execute document + * @return either an ExecuteResponseDocument or an InputStream if asked for + * RawData or an Exception Report + */ + private Object execute(String serverID, ExecuteDocument execute, + boolean rawData) throws WPSClientException { + CapabilitiesDocument caps = loggedServices.get(serverID); + Operation[] operations = caps.getCapabilities().getOperationsMetadata() + .getOperationArray(); + String url = null; + for (Operation operation : operations) { + if (operation.getName().equals("Execute")) { + url = operation.getDCPArray()[0].getHTTP().getPostArray()[0] + .getHref(); + } + } + if (url == null) { + throw new WPSClientException( + "Caps does not contain any information about the entry point for process execution"); + } + execute.getExecute().setVersion(SUPPORTED_VERSION); + return retrieveExecuteResponseViaPOST(url, execute, rawData); + } + + /** + * Executes a process at a WPS + * + * @param url + * url of server not the entry additionally defined in the caps. + * @param execute + * Execute document + * @return either an ExecuteResponseDocument or an InputStream if asked for + * RawData or an Exception Report + */ + public Object execute(String serverID, ExecuteDocument execute) + throws WPSClientException { + if (execute.getExecute().isSetResponseForm() == true + && execute.getExecute().isSetResponseForm() == true + && execute.getExecute().getResponseForm().isSetRawDataOutput() == true) { + return execute(serverID, execute, true); + } else { + return execute(serverID, execute, false); + } + + } + + private CapabilitiesDocument retrieveCapsViaGET(String url) + throws WPSClientException { + ClientCapabiltiesRequest req = new ClientCapabiltiesRequest(); + url = req.getRequest(url); + try { + String authString = user + ":" + password; + System.out.println("auth string: " + authString); + byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); + String encoded = new String(authEncBytes); + System.out.println("Base64 encoded auth string: " + encoded); + + URL urlObj = new URL(url); + HttpURLConnection connection = (HttpURLConnection) urlObj + .openConnection(); + connection.setRequestMethod("GET"); + connection.setDoOutput(true); + connection.setRequestProperty("Authorization", "Basic " + encoded); + InputStream is = connection.getInputStream(); + Document doc = checkInputStream(is); + return CapabilitiesDocument.Factory.parse(doc, options); + } catch (MalformedURLException e) { + e.printStackTrace(); + throw new WPSClientException( + "Capabilities URL seems to be unvalid: " + url, e); + } catch (IOException e) { + e.printStackTrace(); + throw new WPSClientException( + "Error occured while retrieving capabilities from url: " + + url, e); + } catch (XmlException e) { + e.printStackTrace(); + throw new WPSClientException("Error occured while parsing XML", e); + } + } + + private ProcessDescriptionsDocument retrieveDescriptionViaGET( + String[] processIDs, String url) throws WPSClientException { + try { + System.out.println("RetrieveDescriptio: " + processIDs + " url:" + + url); + StatClientDescribeProcessRequest req = new StatClientDescribeProcessRequest(); + req.setIdentifier(processIDs); + String requestURL = req.getRequest(url); + + String authString = user + ":" + password; + System.out.println("auth string: " + authString); + byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); + String encoded = new String(authEncBytes); + System.out.println("Base64 encoded auth string: " + encoded); + + URL urlObj = new URL(requestURL); + HttpURLConnection connection = (HttpURLConnection) urlObj + .openConnection(); + connection.setRequestMethod("GET"); + connection.setDoOutput(true); + connection.setRequestProperty("Authorization", "Basic " + encoded); + InputStream is = connection.getInputStream(); + + Document doc = checkInputStream(is); + return ProcessDescriptionsDocument.Factory.parse(doc, options); + } catch (MalformedURLException e) { + logger.error("URL seems not to be valid"); + e.printStackTrace(); + throw new WPSClientException("URL seems not to be valid", e); + } catch (IOException e) { + logger.error("Error occured while receiving data"); + e.printStackTrace(); + throw new WPSClientException("Error occured while receiving data", + e); + } catch (XmlException e) { + logger.error("Error occured while parsing ProcessDescription document"); + e.printStackTrace(); + throw new WPSClientException( + "Error occured while parsing ProcessDescription document", + e); + } catch (Throwable e) { + logger.error(e.getLocalizedMessage()); + e.printStackTrace(); + throw new WPSClientException(e.getLocalizedMessage(), new Exception(e)); + } + } + + private InputStream retrieveDataViaPOST(XmlObject obj, String urlString) + throws WPSClientException { + try { + logger.debug("RetrieveDataViaPost(): " + urlString); + String authString = user + ":" + password; + System.out.println("auth string: " + authString); + byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); + String encoded = new String(authEncBytes); + System.out.println("Base64 encoded auth string: " + encoded); + + URL url = new URL(urlString); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("POST"); + conn.setRequestProperty("Authorization", "Basic " + encoded); + conn.setRequestProperty("Accept-Encoding", "gzip"); + conn.setRequestProperty("Content-Type", "text/xml"); + conn.setDoOutput(true); + obj.save(conn.getOutputStream()); + InputStream input = null; + String encoding = conn.getContentEncoding(); + if (encoding != null && encoding.equalsIgnoreCase("gzip")) { + input = new GZIPInputStream(conn.getInputStream()); + } else { + input = conn.getInputStream(); + } + return input; + } catch (MalformedURLException e) { + e.printStackTrace(); + throw new WPSClientException("URL seems to be unvalid", e); + } catch (IOException e) { + e.printStackTrace(); + throw new WPSClientException("Error while transmission", e); + } + } + + private Document checkInputStream(InputStream is) throws WPSClientException { + DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance(); + fac.setNamespaceAware(true); + try { + Document doc = fac.newDocumentBuilder().parse(is); + if (getFirstElementNode(doc.getFirstChild()).getLocalName().equals( + "ExceptionReport") + && getFirstElementNode(doc.getFirstChild()) + .getNamespaceURI().equals(OGC_OWS_URI)) { + try { + ExceptionReportDocument exceptionDoc = ExceptionReportDocument.Factory + .parse(doc); + logger.debug(exceptionDoc.xmlText(options)); + throw new WPSClientException( + "Error occured while executing query", exceptionDoc); + } catch (XmlException e) { + throw new WPSClientException( + "Error while parsing ExceptionReport retrieved from server", + e); + } + } + return doc; + } catch (SAXException e) { + e.printStackTrace(); + throw new WPSClientException("Error while parsing input.", e); + } catch (IOException e) { + e.printStackTrace(); + throw new WPSClientException("Error occured while transfer", e); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + throw new WPSClientException( + "Error occured, parser is not correctly configured", e); + } + } + + private Node getFirstElementNode(Node node) { + if (node == null) { + return null; + } + if (node.getNodeType() == Node.ELEMENT_NODE) { + return node; + } else { + return getFirstElementNode(node.getNextSibling()); + } + + } + + /** + * either an ExecuteResponseDocument or an InputStream if asked for RawData + * or an Exception Report + * + * @param url + * @param doc + * @param rawData + * @return + * @throws WPSClientException + */ + private Object retrieveExecuteResponseViaPOST(String url, + ExecuteDocument doc, boolean rawData) throws WPSClientException { + InputStream is = retrieveDataViaPOST(doc, url); + if (rawData) { + return is; + } + Document documentObj = checkInputStream(is); + ExceptionReportDocument erDoc = null; + try { + + return ExecuteResponseDocument.Factory.parse(documentObj); + } catch (XmlException e) { + try { + erDoc = ExceptionReportDocument.Factory.parse(documentObj); + } catch (XmlException e1) { + throw new WPSClientException( + "Error occured while parsing executeResponse", e); + } + return erDoc; + } + } + + public String[] getProcessNames(String url) throws IOException { + ProcessDescriptionType[] processes = getProcessDescriptionsFromCache( + url).getProcessDescriptions().getProcessDescriptionArray(); + String[] processNames = new String[processes.length]; + for (int i = 0; i < processNames.length; i++) { + processNames[i] = processes[i].getIdentifier().getStringValue(); + } + return processNames; + } + + /** + * Executes a process at a WPS + * + * @param url + * url of server not the entry additionally defined in the caps. + * @param executeAsGETString + * KVP Execute request + * @return either an ExecuteResponseDocument or an InputStream if asked for + * RawData or an Exception Report + */ + public Object executeViaGET(String urlString, String executeAsGETString) + throws WPSClientException { + urlString = urlString + executeAsGETString; + logger.debug("ExecuteViaGet() Url: " + urlString); + try { + // TODO + String authString = user + ":" + password; + logger.debug("auth string: " + authString); + byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); + String encoded = new String(authEncBytes); + logger.debug("Base64 encoded auth string: " + encoded); + + URL url = new URL(urlString); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + conn.setRequestProperty("Authorization", "Basic " + encoded); + conn.setDoOutput(true); + InputStream is = conn.getInputStream(); + + if (executeAsGETString.toUpperCase().contains("RAWDATA")) { + logger.debug("ExecuteAsGETString as RAWDATA"); + return is; + } + Document doc = checkInputStream(is); + ExceptionReportDocument erDoc = null; + logger.debug("ExecuteAsGETString as Document"); + + try { + return ExecuteResponseDocument.Factory.parse(doc); + } catch (XmlException e) { + e.printStackTrace(); + try { + erDoc = ExceptionReportDocument.Factory.parse(doc); + } catch (XmlException e1) { + e1.printStackTrace(); + throw new WPSClientException( + "Error occured while parsing executeResponse", e); + + } + throw new WPSClientException( + "Error occured while parsing executeResponse", erDoc); + } + } catch (MalformedURLException e) { + e.printStackTrace(); + throw new WPSClientException( + "Capabilities URL seems to be unvalid: " + urlString, e); + } catch (IOException e) { + e.printStackTrace(); + throw new WPSClientException( + "Error occured while retrieving capabilities from url: " + + urlString, e); + } + + } + + + public String cancelComputation(String url,String computationId) + throws WPSClientException { + + try { + String authString = user + ":" + password; + System.out.println("auth string: " + authString); + byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); + String encoded = new String(authEncBytes); + System.out.println("Base64 encoded auth string: " + encoded); + + url+="?id="+computationId; + URL urlObj = new URL(url); + HttpURLConnection connection = (HttpURLConnection) urlObj + .openConnection(); + connection.setRequestMethod("GET"); + connection.setDoOutput(true); + connection.setRequestProperty("Authorization", "Basic " + encoded); + String responseMessage= connection.getResponseMessage(); + return responseMessage; + } catch (MalformedURLException e) { + e.printStackTrace(); + throw new WPSClientException( + "Capabilities URL seems to be unvalid: " + url, e); + } catch (IOException e) { + e.printStackTrace(); + throw new WPSClientException( + "Error occured while retrieving capabilities from url: " + + url, e); + } + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/WPS2SM.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/WPS2SM.java new file mode 100644 index 0000000..1fec287 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/smservice/wps/WPS2SM.java @@ -0,0 +1,428 @@ +package org.gcube.portlets.user.dataminermanager.server.smservice.wps; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import net.opengis.ows.x11.AllowedValuesDocument.AllowedValues; +import net.opengis.ows.x11.DomainMetadataType; +import net.opengis.ows.x11.ValueType; +import net.opengis.wps.x100.ComplexDataDescriptionType; +import net.opengis.wps.x100.InputDescriptionType; +import net.opengis.wps.x100.LiteralInputType; +import net.opengis.wps.x100.LiteralOutputType; +import net.opengis.wps.x100.OutputDescriptionType; +import net.opengis.wps.x100.SupportedComplexDataInputType; +import net.opengis.wps.x100.SupportedComplexDataType; + +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.EnumParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.FileParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; +import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.itextpdf.text.pdf.PatternColor; + +public class WPS2SM { + private final static String SEPARATOR = "|"; + + /* + * public enum PrimitiveTypes { STRING, NUMBER, ENUMERATED, CONSTANT, + * RANDOM, FILE, MAP, BOOLEAN, IMAGES + * + * } + */ + + private static Logger logger = LoggerFactory.getLogger(WPS2SM.class); + + /** + * + * @param title + * @param minOcc + * @param maxOcc + * @param rangeOccs + * @param id + * @param crs + * @return + */ + public static Parameter manageBoundingBoxInformation(String title, + int minOcc, int maxOcc, int rangeOccs, String id, String crs) { + Parameter converted = null; + title = "Bounding Box Input in OGC 06-121r3 spec. E.g. 102,46,103,47,urn:ogc:def:crs:EPSG:4328 " + + title; + if (crs != null && crs.length() > 0) + title += " Supported CRS " + crs; + + title = buildParameterDescription(title, null, null, minOcc, maxOcc, + null); + if ((maxOcc == 1) || (maxOcc < 0) || (maxOcc == 0)) + converted = new ObjectParameter(id, title, String.class.getName(), + " "); + + else + converted = new ListParameter(id, title, String.class.getName(), + SEPARATOR); + + return converted; + } + + /** + * + * @param title + * @param minOcc + * @param maxOcc + * @param rangeOccs + * @param defaultValue + * @param id + * @param uoms + * @param type + * @return + */ + public static Parameter manageLiteral(String title, int minOcc, int maxOcc, + int rangeOccs, String defaultValue, String id, String uoms, + DomainMetadataType type) { + Parameter converted = null; + logger.debug("WPS type:" + type.getStringValue()); + String guessedType = guessWPSLiteralType(type); + logger.debug("Guessed type: " + guessedType); + + // rebuild title + if ((defaultValue == null || defaultValue.trim().length() == 0)) + defaultValue = guessDefaultValue(guessedType); + + logger.debug("Guessed default value: " + defaultValue); + + title = buildParameterDescription(title, null, uoms, minOcc, maxOcc, + defaultValue); + if ((maxOcc == 1) || (maxOcc < 0) || (maxOcc == 0)) { + if (title != null && !title.isEmpty()) { + if (title.contains("[a sequence of names of columns from ")) { + Pattern pattern = Pattern + .compile("a sequence of names of columns from (\\w+) separated by (\\p{ASCII})"); + Matcher matcher = pattern.matcher(title); + logger.debug("Machter title: " + title); + logger.debug("Machter find: " + matcher.find()); + logger.debug("Machter group: " + matcher.group()); + logger.debug("Machter start: " + matcher.start()); + logger.debug("Machter end: " + matcher.end()); + logger.debug("Machter Group Count: " + matcher.groupCount()); + String referredTabularParameterName = matcher.group(1); + logger.debug("Matcher referredTabularParameterName: " + + referredTabularParameterName); + String separator = matcher.group(2); + logger.debug("Matcher separator: " + separator); + + converted = new ColumnListParameter(id, title, + referredTabularParameterName, separator); + } else { + if (title.contains("[the name of a column from ")) { + Pattern pattern = Pattern + .compile("the name of a column from (\\w+)"); + Matcher matcher = pattern.matcher(title); + logger.debug("Machter title: " + title); + logger.debug("Machter find: " + matcher.find()); + logger.debug("Machter group: " + matcher.group()); + logger.debug("Machter start: " + matcher.start()); + logger.debug("Machter end: " + matcher.end()); + logger.debug("Machter Group Count: " + matcher.groupCount()); + String referredTabularParameterName = matcher.group(1); + logger.debug("Matcher referredTabularParameterName: " + + referredTabularParameterName); + + converted = new ColumnParameter(id, title, + referredTabularParameterName, defaultValue); + } else { + if (title.contains("[a sequence of values separated by ")) { + Pattern pattern = Pattern + .compile("a sequence of values separated by (\\p{ASCII})"); + Matcher matcher = pattern.matcher(title); + logger.debug("Machter title: " + title); + logger.debug("Machter find: " + matcher.find()); + logger.debug("Machter group: " + matcher.group()); + logger.debug("Machter start: " + matcher.start()); + logger.debug("Machter end: " + matcher.end()); + logger.debug("Machter Group Count: " + matcher.groupCount()); + + String separator = matcher.group(1); + logger.debug("Matcher separator: " + separator); + + converted = new ListParameter(id, title, + guessedType, separator); + } else { + converted = new ObjectParameter(id, title, + guessPrimitiveType(guessedType), defaultValue); + } + } + } + + } else { + converted = new ObjectParameter(id, title, + guessPrimitiveType(guessedType), defaultValue); + } + + } else + converted = new ListParameter(id, title, String.class.getName(), + SEPARATOR); + return converted; + } + + /** + * + * @param maxMegaBytes + * @param title + * @param minOcc + * @param maxOcc + * @param rangeOccs + * @param id + * @param type + * @return + */ + public static Parameter manageComplexData(String maxMegaBytes, + String title, int minOcc, int maxOcc, int rangeOccs, String id, + ComplexDataDescriptionType type) { + Parameter converted = null; + String mimeType = null; + String schema = null; + String encoding = null; + // GenericFileDataConstants.MIME_TYPE_TEXT_XML + mimeType = type.getMimeType(); + schema = type.getSchema(); + encoding = type.getEncoding(); + + logger.debug("MimeType: " + mimeType); + logger.debug("Schema: " + schema); + logger.debug("Encoding: " + encoding); + + // rebuild title + title = buildParameterDescription(title, maxMegaBytes, null, minOcc, + maxOcc, null); + if ((maxOcc == 1) || (maxOcc < 0) || (maxOcc == 0)) + + if(title.contains("[a http link to a table")){ + converted = new TabularParameter(id, title, " ", + new ArrayList()); + } else { + converted = new FileParameter(id, title, mimeType); + } + + else + converted = new ListParameter(id, title, String.class.getName(), + SEPARATOR); + + return converted; + } + + public static Parameter convert2SMType(InputDescriptionType wpsType) + throws ServiceException { + try { + + String id = wpsType.getIdentifier().getStringValue(); + + String title = wpsType.getTitle() != null ? wpsType.getTitle() + .getStringValue() : ""; + int minOcc = wpsType.getMinOccurs().intValue(); + int maxOcc = wpsType.getMaxOccurs().intValue(); + int rangeOccs = maxOcc - minOcc; + if (rangeOccs == 0) + rangeOccs = 1; + + // default + Parameter converted = new ObjectParameter(id, title, + String.class.getName(), " "); + if (rangeOccs > 1) + converted = new ListParameter(id, title, + String.class.getName(), SEPARATOR); + + // Bounding Boxes + if (wpsType.isSetBoundingBoxData()) { + logger.debug("Conversion to SM Type->" + id + + " is a Bounding Box Input"); + converted = manageBoundingBoxInformation(title, minOcc, maxOcc, + rangeOccs, id, wpsType.getBoundingBoxData() + .getDefault().getCRS()); + } + // Literals + else if (wpsType.isSetLiteralData()) { + logger.debug("Conversion to SM Type->" + id + + " is a Literal Input"); + LiteralInputType literal = wpsType.getLiteralData(); + String uoms = literal.getUOMs() == null ? "" : literal + .getUOMs().getDefault().getUOM().getStringValue(); + String defaultValue = literal.getDefaultValue(); + converted = manageLiteral(title, minOcc, maxOcc, rangeOccs, + defaultValue, id, uoms, literal.getDataType()); + AllowedValues allowedValues = literal.getAllowedValues(); + if (allowedValues != null) { + ValueType[] values = allowedValues.getValueArray(); + logger.debug("ValueType[]:" + Arrays.toString(values)); + List enumValues = new ArrayList<>(); + + for (ValueType v : values) { + enumValues.add(v.getStringValue()); + } + if (values.length > 1) { + ObjectParameter conv = (ObjectParameter) converted; + converted = new EnumParameter(conv.getName(), + conv.getDescription(), enumValues, + conv.getDefaultValue()); + } + } + } else if (wpsType.isSetComplexData()) { + logger.debug("Conversion to SM Type->" + id + + " is a Complex Input"); + SupportedComplexDataInputType complex = wpsType + .getComplexData(); + String maxMegaBytes = complex.getMaximumMegabytes() != null ? complex + .getMaximumMegabytes().toString() : "1"; + logger.debug("Max Megabytes: " + maxMegaBytes); + converted = manageComplexData(maxMegaBytes, title, minOcc, + maxOcc, rangeOccs, id, complex.getDefault().getFormat()); + } + + logger.debug("Conversion to SM Type->Title:" + title); + logger.debug("Conversion to SM Type->Name:" + id); + logger.debug("Conversion to SM Type->Number of Inputs to Manage:" + + rangeOccs); + + return converted; + + } catch (Throwable e) { + e.printStackTrace(); + logger.error(e.getLocalizedMessage()); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + public static Parameter convert2SMType(OutputDescriptionType wpsType) { + + String id = wpsType.getIdentifier().getStringValue(); + String title = wpsType.getTitle() != null ? wpsType.getTitle() + .getStringValue() : ""; + + // default + Parameter converted = new ObjectParameter(id, title, + String.class.getName(), " "); + + logger.debug("Conversion to SM Type->Output id:" + id); + logger.debug("Conversion to SM Type->Title:" + title); + + // Bounding Boxes + if (wpsType.isSetBoundingBoxOutput()) { + logger.debug("Bounding Box Output"); + converted = manageBoundingBoxInformation(title, -1, -1, -1, id, ""); + } + // Literals + else if (wpsType.isSetLiteralOutput()) { + logger.debug("Literal Output"); + LiteralOutputType literal = wpsType.getLiteralOutput(); + String uoms = literal.getUOMs() == null ? "" : literal.getUOMs() + .toString(); + converted = manageLiteral(title, -1, -1, -1, "", id, uoms, + literal.getDataType()); + } else if (wpsType.isSetComplexOutput()) { + logger.debug("Complex Output"); + SupportedComplexDataType complex = wpsType.getComplexOutput(); + converted = manageComplexData("", title, -1, -1, -1, id, complex + .getDefault().getFormat()); + } + + return converted; + } + + /** + * + * @param title + * @param maxMegabytes + * @param UoM + * @param minElements + * @param maxElements + * @param defaultValue + * @return + */ + public static String buildParameterDescription(String title, + String maxMegabytes, String UoM, int minElements, int maxElements, + String defaultValue) { + + String description = title; + + String innerDescription = ""; + + if (maxMegabytes != null && maxMegabytes.trim().length() > 0) { + innerDescription += "Max MB Size:" + maxMegabytes.trim() + "; "; + } + if (UoM != null && UoM.trim().length() > 0) { + innerDescription += "Unit of Measure:" + UoM.trim() + "; "; + } + if (minElements > 0) { + innerDescription += "Min N. of Entries:" + minElements + "; "; + } + if (maxElements > 0) { + innerDescription += "Max N. of Entries:" + maxElements + "; "; + } + if (defaultValue != null && defaultValue.trim().length() > 0) { + innerDescription += "default:" + defaultValue.trim() + "; "; + } + + if (innerDescription.length() > 0) + description += " [" + + innerDescription.substring(0, + innerDescription.lastIndexOf(";")).trim() + "]"; + + return description; + + } + + public static String guessWPSLiteralType(DomainMetadataType type) { + + if (type == null || type.getStringValue() == null) + return String.class.getName(); + else { + String typeS = type.getReference().trim(); + if (typeS.length() == 0) + return String.class.getName(); + else if (typeS.contains("float") || typeS.contains("double") + || typeS.contains("decimal")) + return Double.class.getName(); + else if (typeS.contains("int")) + return Integer.class.getName(); + else if (typeS.contains("long")) + return Long.class.getName(); + else if (typeS.contains("short")) + return Short.class.getName(); + } + + return String.class.getName(); + } + + public static String guessDefaultValue(String type) { + if (type.equals(String.class.getName())) + return " "; + else + return "0"; + } + + public static String guessPrimitiveType(String type) { + if (type.equals(Integer.class.getName())) { + return Integer.class.getName(); + } else if (type.equals(String.class.getName())) { + return String.class.getName(); + } else if (type.equals(Boolean.class.getName())) { + return Boolean.class.getName(); + } else if (type.equals(Double.class.getName())) { + return Double.class.getName(); + } else if (type.equals(Float.class.getName())) { + return Float.class.getName(); + } else + return null; + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/DataMinerWorkAreaManager.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/DataMinerWorkAreaManager.java new file mode 100644 index 0000000..844adc1 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/DataMinerWorkAreaManager.java @@ -0,0 +1,133 @@ +package org.gcube.portlets.user.dataminermanager.server.util; + +import org.gcube.application.framework.core.session.ASLSession; +import org.gcube.common.homelibrary.home.workspace.WorkspaceItem; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; +import org.gcube.portlets.user.dataminermanager.shared.workspace.Computations; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ComputedData; +import org.gcube.portlets.user.dataminermanager.shared.workspace.DataMinerWorkArea; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ImportedData; +import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class DataMinerWorkAreaManager { + private static final String DATA_MINER_FOLDER = "DataMiner"; + private static final String IMPORTED_DATA_FOLDER = "Imported Data"; + private static final String COMPUTED_DATA_FOLDER = "Computed Data"; + private static final String COMPUTATIONS_FOLDER = "Computations"; + + public static final Logger logger = LoggerFactory + .getLogger(DataMinerWorkAreaManager.class); + + private ASLSession aslSession; + + public DataMinerWorkAreaManager(ASLSession aslSession) { + this.aslSession = aslSession; + } + + public DataMinerWorkArea getDataMinerWorkArea() throws ServiceException { + DataMinerWorkArea dataMinerWorkArea = null; + try { + WorkspaceItem wiDataMinerFolder = StorageUtil + .getItemInRootFolderOnWorkspace(aslSession.getUsername(), + DATA_MINER_FOLDER); + + if (wiDataMinerFolder == null) { + dataMinerWorkArea = new DataMinerWorkArea(null); + return dataMinerWorkArea; + } else { + ItemDescription dataMinerWorkAreaFolder = null; + + dataMinerWorkAreaFolder = new ItemDescription( + wiDataMinerFolder.getId(), wiDataMinerFolder.getName(), + wiDataMinerFolder.getOwner().getPortalLogin(), + wiDataMinerFolder.getPath(), wiDataMinerFolder + .getType().name()); + dataMinerWorkArea = new DataMinerWorkArea( + dataMinerWorkAreaFolder); + + } + + } catch (Throwable e) { + logger.debug("DataMiner Folder is set to null"); + e.printStackTrace(); + dataMinerWorkArea = new DataMinerWorkArea(null); + return dataMinerWorkArea; + } + + ImportedData importedData = null; + try { + WorkspaceItem wiImportedDataFolder = StorageUtil + .getItemInFolderOnWorkspace(aslSession.getUsername(), + dataMinerWorkArea.getDataMinerWorkAreaFolder() + .getId(), IMPORTED_DATA_FOLDER); + ItemDescription importedDataFolder = null; + + importedDataFolder = new ItemDescription( + wiImportedDataFolder.getId(), + wiImportedDataFolder.getName(), wiImportedDataFolder + .getOwner().getPortalLogin(), + wiImportedDataFolder.getPath(), wiImportedDataFolder + .getType().name()); + + importedData = new ImportedData(importedDataFolder); + + } catch (Throwable e) { + logger.debug("ImportedData Folder is set to null"); + } + dataMinerWorkArea.setImportedData(importedData); + + ComputedData computedData = null; + try { + WorkspaceItem wiComputedDataFolder = StorageUtil + .getItemInFolderOnWorkspace(aslSession.getUsername(), + dataMinerWorkArea.getDataMinerWorkAreaFolder() + .getId(), COMPUTED_DATA_FOLDER); + ItemDescription computedDataFolder = null; + + computedDataFolder = new ItemDescription( + wiComputedDataFolder.getId(), + wiComputedDataFolder.getName(), wiComputedDataFolder + .getOwner().getPortalLogin(), + wiComputedDataFolder.getPath(), wiComputedDataFolder + .getType().name()); + computedData = new ComputedData(computedDataFolder); + + } catch (Throwable e) { + logger.debug("ComputedData Folder is set to null"); + } + dataMinerWorkArea.setComputedData(computedData); + + Computations computations = null; + try { + WorkspaceItem wiComputationsDataFolder = StorageUtil + .getItemInFolderOnWorkspace(aslSession.getUsername(), + dataMinerWorkArea.getDataMinerWorkAreaFolder() + .getId(), COMPUTATIONS_FOLDER); + ItemDescription computationsDataFolder = null; + + computationsDataFolder = new ItemDescription( + wiComputationsDataFolder.getId(), + wiComputationsDataFolder.getName(), + wiComputationsDataFolder.getOwner().getPortalLogin(), + wiComputationsDataFolder.getPath(), + wiComputationsDataFolder.getType().name()); + computations = new Computations(computationsDataFolder); + + } catch (Throwable e) { + logger.debug("Computations Folder is set to null"); + } + dataMinerWorkArea.setComputations(computations); + + return dataMinerWorkArea; + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/ServiceCredential.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/ServiceCredential.java new file mode 100644 index 0000000..6342d89 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/ServiceCredential.java @@ -0,0 +1,66 @@ +package org.gcube.portlets.user.dataminermanager.server.util; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ServiceCredential implements Serializable { + + private static final long serialVersionUID = 3560918948310315680L; + private String username; + private String scope; + private String token; + + public ServiceCredential() { + super(); + } + + /** + * + * @param user + * @param scope + * @param token + */ + public ServiceCredential(String username, String scope, String token) { + super(); + this.username = username; + this.scope = scope; + this.token = token; + } + + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + @Override + public String toString() { + return "ServiceCredential [username=" + username + ", scope=" + scope + + ", token=" + token + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/SessionUtil.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/SessionUtil.java new file mode 100644 index 0000000..16ed544 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/SessionUtil.java @@ -0,0 +1,126 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.server.util; + +import static org.gcube.common.authorization.client.Constants.authorizationService; + +import java.util.ArrayList; +import java.util.List; + +import javax.activation.DataSource; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +import org.gcube.application.framework.core.session.ASLSession; +import org.gcube.application.framework.core.session.SessionManager; +import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; +import org.gcube.portlets.user.dataminermanager.server.smservice.SClient; +import org.gcube.portlets.user.dataminermanager.server.smservice.SClient4WPSBuilder; +import org.gcube.portlets.user.dataminermanager.server.smservice.SClientBuilder; +import org.gcube.portlets.user.dataminermanager.server.smservice.SClientDirector; +import org.gcube.portlets.user.dataminermanager.shared.Constants; +import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class SessionUtil { + + private static final Logger logger = Logger.getLogger(SessionUtil.class); + // private final static String hostUrl = + // "http://pc-angela.isti.cnr.it:9090"; + // private static URI host = URI.create(hostUrl); + // private final static String SCOPE = "/gcube"; + + public static final String DATASOURCE_ATTRIBUTE_NAME = "TDW.DATASOURCE"; + + public static ASLSession getASLSession(HttpSession httpSession) + throws ServiceException { + String username = (String) httpSession + .getAttribute(ScopeHelper.USERNAME_ATTRIBUTE); + ASLSession aslSession; + if (username == null) { + if (Constants.DEBUG_MODE) { + logger.info("no user found in session, use test user"); + /* + * throw new ExpiredSessionServiceException("Session Expired!"); + */ + + // Remove comment for Test + username = Constants.DEFAULT_USER; + String scope = Constants.DEFAULT_SCOPE; + + httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, + username); + aslSession = SessionManager.getInstance().getASLSession( + httpSession.getId(), username); + aslSession.setScope(scope); + } else { + logger.info("no user found in session, use test user"); + throw new ExpiredSessionServiceException("Session Expired!"); + + } + } else { + aslSession = SessionManager.getInstance().getASLSession( + httpSession.getId(), username); + + } + + logger.info("SessionUtil: aslSession " + aslSession.getUsername() + " " + + aslSession.getScope()); + + return aslSession; + } + + public static String getToken(ASLSession aslSession) { + String token=null; + if (Constants.DEBUG_MODE) { + List userRoles = new ArrayList<>(); + userRoles.add(Constants.DEFAULT_ROLE); + /*if (aslSession.getUsername().compareTo("lucio.lelii") == 0) + userRoles.add("VRE-Manager");*/ + token = authorizationService().build().generate( + aslSession.getUsername(), userRoles); + + } else { + token = aslSession.getSecurityToken(); + } + logger.info("received token: " + token); + return token; + + + } + + public static DataSource getDataSource(HttpSession httpSession) + throws ServiceException { + ASLSession session = getASLSession(httpSession); + return (DataSource) session.getAttribute(DATASOURCE_ATTRIBUTE_NAME); + } + + public static SClient getSClient(HttpSession session, ASLSession aslSession) + throws Exception { + + SClient sClient = (SClient) session.getAttribute(Constants.SClient); + + if (sClient == null) { + ServiceCredential serviceCredential=new ServiceCredential(aslSession.getUsername(), aslSession.getScope(), + SessionUtil.getToken(aslSession)); + SClientBuilder sBuilder = new SClient4WPSBuilder(serviceCredential); + + SClientDirector director = new SClientDirector(); + director.setSClientBuilder(sBuilder); + director.constructSClient(); + sClient = director.getSClient(); + session.setAttribute(Constants.SClient, sClient); + } + + return sClient; + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/StorageUtil.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/StorageUtil.java new file mode 100644 index 0000000..1c1f991 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/StorageUtil.java @@ -0,0 +1,256 @@ +package org.gcube.portlets.user.dataminermanager.server.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.gcube.common.homelibrary.home.Home; +import org.gcube.common.homelibrary.home.HomeLibrary; +import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException; +import org.gcube.common.homelibrary.home.exceptions.InternalErrorException; +import org.gcube.common.homelibrary.home.workspace.Workspace; +import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder; +import org.gcube.common.homelibrary.home.workspace.WorkspaceItem; +import org.gcube.common.homelibrary.home.workspace.exceptions.InsufficientPrivilegesException; +import org.gcube.common.homelibrary.home.workspace.exceptions.ItemAlreadyExistException; +import org.gcube.common.homelibrary.home.workspace.exceptions.ItemNotFoundException; +import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException; +import org.gcube.common.homelibrary.home.workspace.exceptions.WrongDestinationException; +import org.gcube.common.homelibrary.home.workspace.exceptions.WrongItemTypeException; +import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalImage; +import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPURLConnection; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; + +public class StorageUtil { + + private static Logger logger = Logger.getLogger(StorageUtil.class); + + public static InputStream getStorageClientInputStream(String url) + throws Exception { + /* + * try { logger.debug("Get ImputStream from: "+url); SMPUrl smsHome = + * new SMPUrl(url); logger.debug("smsHome: [host:" + smsHome.getHost() + + * " path:" + smsHome.getPath() + " ref:" + smsHome.getRef() + + * " userinfo:" + smsHome.getUserInfo() + " ]"); URLConnection uc = + * (URLConnection) smsHome.openConnection(); InputStream is = + * uc.getInputStream(); return is; + * + * } catch (Exception e) { + * logger.error("Error retrieving imput stream from storage: ", e); + * e.printStackTrace(); throw new Exception( + * "Error retrieving imput stream from storage: " + + * e.getLocalizedMessage(), e); } + */ + + try { + + URL u = new URL(null, url, new URLStreamHandler() { + + @Override + protected URLConnection openConnection(URL u) + throws IOException { + + return new SMPURLConnection(u); + } + }); + + return u.openConnection().getInputStream(); + + } catch (Throwable e) { + logger.error("Error in StorageUtil: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw new Exception(e.getLocalizedMessage()); + + } + + } + + public static String extractLocation(String url) { + String[] loc = url.split("//"); + // logger.trace("url extracted: " + loc[1]); + return loc[1]; + } + + public static String getFileName(String url) { + String[] urlParam = url.split("\\?"); + String location = extractLocation(urlParam[0]); + + try { + return location.split("/")[1]; + } catch (Exception e) { + // e.printStackTrace(); + return location; + } + } + + /** + * @return + */ + public static Map getFilesUrlFromFolderUrl( + String serviceClass, String serviceName, String url, + String username, String scope) throws Exception { + + Home home = HomeLibrary.getHomeManagerFactory().getHomeManager() + .getHome(username); + Map map = new LinkedHashMap(); + Workspace ws = home.getWorkspace(); + WorkspaceItem folderItem = ws.getItemByPath(url); + // logger.trace("Type of workspace item is : " + // + folderItem.getType().toString()); + WorkspaceFolder folder = (WorkspaceFolder) folderItem; + List childrenList = folder.getChildren(); + for (WorkspaceItem item : childrenList) { + ExternalImage file = (ExternalImage) item; + String name = item.getName(); + String absoluteUrlFile = file.getPublicLink(); + + map.put(name, absoluteUrlFile); + } + + return map; + } + + /** + * + * @param user + * User + * @param itemId + * Item id + * @return Input stream + * @throws StatAlgoImporterServiceException + */ + public static InputStream getInputStreamForItemOnWorkspace(String user, + String itemId) throws ServiceException { + Workspace ws; + try { + ws = HomeLibrary.getUserWorkspace(user); + + WorkspaceItem workSpaceItem = ws.getItem(itemId); + if (workSpaceItem.isFolder()) { + throw new ServiceException("Folder is not valid!"); + } + + return getImputStream(user, workSpaceItem); + + } catch (WorkspaceFolderNotFoundException | InternalErrorException + | HomeNotFoundException | ItemNotFoundException e) { + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + /** + * + * @param user + * User + * @param wi + * WorkspaceItem + * @return InputStream + * @throws StatAlgoImporterServiceException + */ + public static InputStream getImputStream(String user, WorkspaceItem wi) + throws ServiceException { + InputStream is = null; + try { + + org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi); + is = gcubeItem.getData(); + return is; + + } catch (Throwable e) { + logger.error("Error retrieving file from storage", e); + e.printStackTrace(); + throw new ServiceException("Error retrieving file from storage: " + + e.getLocalizedMessage(), e); + } + + } + + /** + * + * @param user + * User + * @param itemId + * Item id + * @return Public link + * @throws StatAlgoImporterServiceException + */ + public static String getPublicLink(String user, String itemId) + throws ServiceException { + Workspace ws; + try { + ws = HomeLibrary.getUserWorkspace(user); + + WorkspaceItem workSpaceItem = ws.getItem(itemId); + if (workSpaceItem.isFolder()) { + throw new ServiceException("Attention this is a folder!"); + } + + return workSpaceItem.getPublicLink(true); + + } catch (WorkspaceFolderNotFoundException | InternalErrorException + | HomeNotFoundException | ItemNotFoundException e) { + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + + } + } + + /** + * + * @param user + * @param itemName + * @return + * @throws ServiceException + */ + public static WorkspaceItem getItemInRootFolderOnWorkspace(String user, + String itemName) throws ServiceException { + Workspace ws; + try { + ws = HomeLibrary.getUserWorkspace(user); + + WorkspaceItem item = ws.find(itemName, ws.getRoot().getId()); + + return item; + + } catch (WorkspaceFolderNotFoundException | InternalErrorException + | HomeNotFoundException | ItemNotFoundException + | WrongItemTypeException e) { + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + + /** + * + * @param user + * @param folderId + * @param itemName + * @return + * @throws ServiceException + */ + public static WorkspaceItem getItemInFolderOnWorkspace(String user, + String folderId, String itemName) throws ServiceException { + Workspace ws; + try { + ws = HomeLibrary.getUserWorkspace(user); + + WorkspaceItem item = ws.find(itemName, folderId); + + return item; + + } catch (WorkspaceFolderNotFoundException | InternalErrorException + | HomeNotFoundException | ItemNotFoundException + | WrongItemTypeException e) { + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/TableReader.java b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/TableReader.java new file mode 100644 index 0000000..efa3cab --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/server/util/TableReader.java @@ -0,0 +1,73 @@ +package org.gcube.portlets.user.dataminermanager.server.util; + +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.sf.csv4j.CSVReader; + +import org.apache.log4j.Logger; +import org.gcube.application.framework.core.session.ASLSession; +import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem; +import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple; +import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException; +import org.gcube.portlets.widgets.wsexplorer.shared.Item; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class TableReader { + private static Logger logger = Logger.getLogger(TableReader.class); + + private ASLSession aslSession; + private Item item; + + public TableReader(ASLSession aslSession, Item item) { + this.aslSession = aslSession; + this.item= item; + } + + public TableItemSimple getTableItemSimple() throws ServiceException { + + InputStream is = StorageUtil.getInputStreamForItemOnWorkspace( + aslSession.getUsername(), item.getId()); + Reader fileReader = new InputStreamReader(is); + CSVReader csvReader = new CSVReader(fileReader); + List firstLine = getFirstLine(csvReader, false); + ArrayList columns = new ArrayList(firstLine); + + String publicLink=StorageUtil.getPublicLink(aslSession.getUsername(), item.getId()); + + TableItemSimple tableItemSimple=new TableItemSimple(publicLink,item.getName(), item.getType().name()); + ArrayList columnItemList=new ArrayList(); + for(int i=0; i getFirstLine(CSVReader csvReader, boolean includeComment) + throws ServiceException { + try { + logger.trace("getFirstLine includeComment: " + includeComment); + + List header = csvReader.readLine(includeComment); + return header == null ? Collections. emptyList() : header; + + } catch (Throwable e) { + logger.error("Error reading csv file: " + e.getLocalizedMessage()); + e.printStackTrace(); + throw new ServiceException(e.getLocalizedMessage()); + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/Constants.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/Constants.java new file mode 100644 index 0000000..303a43c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/Constants.java @@ -0,0 +1,46 @@ +package org.gcube.portlets.user.dataminermanager.shared; + +public class Constants { + public static final boolean DEBUG_MODE = false; + + public static final String APPLICATION_ID = "org.gcube.portlets.user.dataminermanager.portlet.DataMinerManager"; + public static final String DATA_MINER_MANAGER_ID = "DataMinerManagerId"; + public static final String DATA_MINER_LANG_COOKIE = "DataMinerLangCookie"; + public static final String DATA_MINER_LANG = "DataMinerLang"; + + public static final String DEFAULT_USER = "giancarlo.panichi"; + public static final String DEFAULT_ROLE = "OrganizationMember"; + public final static String DEFAULT_SCOPE = "/gcube/devsec/devVRE"; + // public final static String DEFAULT_USER = "test.user"; + // public final static String DEFAULT_SCOPE = "/gcube/devNext"; + // public final static String DEFAULT_SCOPE = "/gcube/devNext/NextNext"; + + public static final String SClient = "DataMinerClient"; + public static final String DATA_MINER_SERVICE_NAME = "DataMiner"; + public static final String DATAMINER_SERVICE_CATEGORY = "DataAnalysis"; + + + public static final String TD_DATASOURCE_FACTORY_ID = "DataMinerManager"; + + public static final int TIME_UPDATE_MONITOR = 5 * 1000; + public static final int TIME_UPDATE_JOBS_GRID = 10 * 1000; + public static final int TIME_UPDATE_COMPUTATION_STATUS_PANEL = 10 * 1000;// 7*1000; + public static final String maskLoadingStyle = "x-mask-loading"; + + public final static String[] ClassificationNames = { "User Perspective" }; + // "Computation Perspective"}; + public final static String UserClassificationName = ClassificationNames[0]; + // public final static String computationClassificationName = + // classificationNames[1]; + public static final String RealFileTemplate = "ZZ-FILE"; + public static final String UserFileTemplate = "FILE"; + + // WPS Data Miner + public static final String WPSServiceURL = "http://dataminer-d-d4s.d4science.org:80/wps/"; + public static final String WPSWebProcessingService = "WebProcessingService"; + public static final String WPSCancelComputationServlet = "CancelComputationServlet"; + public static final String WPSToken = "4ccc2c35-60c9-4c9b-9800-616538d5d48b";// "d7a4076c-e8c1-42fe-81e0-bdecb1e8074a"; + public static final String WPSUser = "gianpaolo.coro"; + public static final String SESSION_TOKEN = "SESSION_TOKEN"; + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/StringUtil.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/StringUtil.java new file mode 100644 index 0000000..9432383 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/StringUtil.java @@ -0,0 +1,34 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared; + +/** + * @author ceras + * + */ +public class StringUtil { + + public static String getCapitalWords(String string) { + String ris = ""; + + boolean precUnderscore = true; + for (int i=0; ig.panichi@isti.cnr.it + * + */ +public class ColumnItem implements Serializable { + + private static final long serialVersionUID = -3451466410777498956L; + private Integer id; + private String name; + + public ColumnItem() { + super(); + } + + public ColumnItem(Integer id, String name) { + super(); + this.id = id; + this.name = name; + } + + public String getLabel() { + return name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @Override + public String toString() { + return "ColumnItem [id=" + id + ", name=" + name + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/data/ComputationId.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/data/ComputationId.java new file mode 100644 index 0000000..fd78e08 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/data/ComputationId.java @@ -0,0 +1,48 @@ +package org.gcube.portlets.user.dataminermanager.shared.data; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ComputationId implements Serializable { + + private static final long serialVersionUID = 7898676192287822723L; + private String id; + private String urlId; + + public ComputationId() { + super(); + } + + public ComputationId(String id, String urlId) { + super(); + this.id = id; + this.urlId = urlId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUrlId() { + return urlId; + } + + public void setUrlId(String urlId) { + this.urlId = urlId; + } + + @Override + public String toString() { + return "ComputationId [id=" + id + ", urlId=" + urlId + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/data/TableItemSimple.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/data/TableItemSimple.java new file mode 100644 index 0000000..a6cff4f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/data/TableItemSimple.java @@ -0,0 +1,136 @@ +package org.gcube.portlets.user.dataminermanager.shared.data; + +import java.io.Serializable; +import java.util.ArrayList; + + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class TableItemSimple implements Serializable { + + private static final long serialVersionUID = -1204016958353092014L; + private String id; + private String name; + private String description; + private String type; + private ArrayList columns; + + /** + * + */ + public TableItemSimple() { + super(); + columns = new ArrayList(); + } + + /** + * @param name + * @param description + * @param type + */ + public TableItemSimple(String id, String name, String description, + String type) { + super(); + columns = new ArrayList(); + this.id = id; + this.name = name; + this.description = description; + this.type = type; + } + + /** + * @param id2 + * @param name2 + * @param description2 + */ + public TableItemSimple(String id, String name, String description) { + super(); + columns = new ArrayList(); + this.id = id; + this.name = name; + this.description = description; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description + * the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type + * the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id + * the id to set + */ + public void setId(String id) { + this.id = id; + } + + + public ArrayList getColumns() { + return columns; + } + + public void setColumns(ArrayList columns) { + this.columns = columns; + } + + @Override + public String toString() { + return "TableItemSimple [id=" + id + ", name=" + name + + ", description=" + description + ", type=" + type + + ", columns=" + columns + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/exception/ExpiredSessionServiceException.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/exception/ExpiredSessionServiceException.java new file mode 100644 index 0000000..644e518 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/exception/ExpiredSessionServiceException.java @@ -0,0 +1,37 @@ +package org.gcube.portlets.user.dataminermanager.shared.exception; + +/** + * ASL Session Expired Exception + * + * @author "Giancarlo Panichi" + * + */ +public class ExpiredSessionServiceException extends + ServiceException { + + private static final long serialVersionUID = -4831171355042165166L; + + /** + * + */ + public ExpiredSessionServiceException() { + super(); + } + + /** + * @param message + */ + public ExpiredSessionServiceException(String message) { + super(message); + } + + /** + * + * @param message + * @param t + */ + public ExpiredSessionServiceException(String message, Throwable t) { + super(message, t); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/exception/ServiceException.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/exception/ServiceException.java new file mode 100644 index 0000000..2149ba9 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/exception/ServiceException.java @@ -0,0 +1,38 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.exception; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class ServiceException extends Exception { + + + private static final long serialVersionUID = -2255657546267656458L; + + + /** + * + */ + public ServiceException() { + super(); + } + + /** + * @param message + */ + public ServiceException(String message) { + super(message); + } + + + public ServiceException(String message,Throwable t) { + super(message,t); + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/session/UserInfo.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/session/UserInfo.java new file mode 100644 index 0000000..0f925ef --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/session/UserInfo.java @@ -0,0 +1,114 @@ +package org.gcube.portlets.user.dataminermanager.shared.session; + +import java.io.Serializable; + +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ +public class UserInfo implements Serializable { + + private static final long serialVersionUID = -2826549639677017234L; + + private String username; + private long groupId; + private String groupName; + private String scope; + private String scopeName; + private String userEmailAddress; + private String userFullName; + + public UserInfo() { + super(); + } + + /** + * + * @param username + * @param groupId + * @param groupName + * @param scope + * @param scopeName + * @param userEmailAddress + * @param userFullName + */ + public UserInfo(String username, long groupId, String groupName, + String scope, String scopeName, String userEmailAddress, + String userFullName) { + super(); + this.username = username; + this.groupId = groupId; + this.groupName = groupName; + this.scope = scope; + this.scopeName = scopeName; + this.userEmailAddress = userEmailAddress; + this.userFullName = userFullName; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public long getGroupId() { + return groupId; + } + + public void setGroupId(long groupId) { + this.groupId = groupId; + } + + public String getGroupName() { + return groupName; + } + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public String getScopeName() { + return scopeName; + } + + public void setScopeName(String scopeName) { + this.scopeName = scopeName; + } + + public String getUserEmailAddress() { + return userEmailAddress; + } + + public void setUserEmailAddress(String userEmailAddress) { + this.userEmailAddress = userEmailAddress; + } + + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + @Override + public String toString() { + return "UserInfo [username=" + username + ", groupId=" + groupId + + ", groupName=" + groupName + ", scope=" + scope + + ", scopeName=" + scopeName + ", userEmailAddress=" + + userEmailAddress + ", userFullName=" + userFullName + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/Computations.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/Computations.java new file mode 100644 index 0000000..b9aa4a0 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/Computations.java @@ -0,0 +1,38 @@ +package org.gcube.portlets.user.dataminermanager.shared.workspace; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class Computations implements Serializable { + + private static final long serialVersionUID = 7375248981531583668L; + private ItemDescription folder; + + public Computations() { + super(); + } + + public Computations(ItemDescription folder) { + super(); + this.folder = folder; + } + + public ItemDescription getFolder() { + return folder; + } + + public void setFolder(ItemDescription folder) { + this.folder = folder; + } + + @Override + public String toString() { + return "Computations [folder=" + folder + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ComputedData.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ComputedData.java new file mode 100644 index 0000000..0ce3f26 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ComputedData.java @@ -0,0 +1,38 @@ +package org.gcube.portlets.user.dataminermanager.shared.workspace; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ComputedData implements Serializable { + private static final long serialVersionUID = -8235652292513149983L; + + private ItemDescription folder; + + public ComputedData() { + super(); + } + + public ComputedData(ItemDescription folder) { + super(); + this.folder = folder; + } + + public ItemDescription getFolder() { + return folder; + } + + public void setFolder(ItemDescription folder) { + this.folder = folder; + } + + @Override + public String toString() { + return "ComputedData [folder=" + folder + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/DataMinerWorkArea.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/DataMinerWorkArea.java new file mode 100644 index 0000000..af5eb39 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/DataMinerWorkArea.java @@ -0,0 +1,91 @@ +package org.gcube.portlets.user.dataminermanager.shared.workspace; + +import java.io.Serializable; + +/** + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class DataMinerWorkArea implements Serializable { + + private static final long serialVersionUID = -7906477664944910362L; + private ItemDescription dataMinerWorkAreaFolder; + private ImportedData importedData; + private ComputedData computedData; + private Computations computations; + + public DataMinerWorkArea() { + super(); + } + + /** + * + * @param dataMinerWorkAreaFolder + */ + public DataMinerWorkArea(ItemDescription dataMinerWorkAreaFolder) { + super(); + this.dataMinerWorkAreaFolder = dataMinerWorkAreaFolder; + + } + + /** + * + * @param dataMinerWorkAreaFolder + * @param importedData + * @param computedData + * @param computations + */ + public DataMinerWorkArea(ItemDescription dataMinerWorkAreaFolder, + ImportedData importedData, ComputedData computedData, + Computations computations) { + super(); + this.dataMinerWorkAreaFolder = dataMinerWorkAreaFolder; + this.importedData = importedData; + this.computedData = computedData; + this.computations = computations; + } + + public ItemDescription getDataMinerWorkAreaFolder() { + return dataMinerWorkAreaFolder; + } + + public void setDataMinerWorkAreaFolder( + ItemDescription dataMinerWorkAreaFolder) { + this.dataMinerWorkAreaFolder = dataMinerWorkAreaFolder; + } + + public ImportedData getImportedData() { + return importedData; + } + + public void setImportedData(ImportedData importedData) { + this.importedData = importedData; + } + + public ComputedData getComputedData() { + return computedData; + } + + public void setComputedData(ComputedData computedData) { + this.computedData = computedData; + } + + public Computations getComputations() { + return computations; + } + + public void setComputations(Computations computations) { + this.computations = computations; + } + + @Override + public String toString() { + return "DataMinerWorkArea [dataMinerWorkAreaFolder=" + + dataMinerWorkAreaFolder + ", importedData=" + importedData + + ", computedData=" + computedData + ", computations=" + + computations + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ImportedData.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ImportedData.java new file mode 100644 index 0000000..a17971d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ImportedData.java @@ -0,0 +1,38 @@ +package org.gcube.portlets.user.dataminermanager.shared.workspace; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ImportedData implements Serializable { + private static final long serialVersionUID = -4408116083736005844L; + + private ItemDescription folder; + + public ImportedData() { + super(); + } + + public ImportedData(ItemDescription folder) { + super(); + this.folder = folder; + } + + public ItemDescription getFolder() { + return folder; + } + + public void setFolder(ItemDescription folder) { + this.folder = folder; + } + + @Override + public String toString() { + return "ImportedData [folder=" + folder + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ItemDescription.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ItemDescription.java new file mode 100644 index 0000000..631fc74 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/workspace/ItemDescription.java @@ -0,0 +1,112 @@ +package org.gcube.portlets.user.dataminermanager.shared.workspace; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public class ItemDescription implements Serializable { + + private static final long serialVersionUID = -6624452446980057923L; + + private String id; + private String name; + private String owner; + private String path; + private String type; + private String publicLink; + + public ItemDescription() { + super(); + } + + public ItemDescription(String id, String name, String owner, String path, + String type) { + super(); + this.id = id; + this.name = name; + this.owner = owner; + this.path = path; + this.type = type; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getPublicLink() { + return publicLink; + } + + public void setPublicLink(String publicLink) { + this.publicLink = publicLink; + } + + /** + * Compare basic information with another ItemDescription not null + * + * @param itemDescription + * @return boolean + * + */ + public boolean compareInfo(ItemDescription itemDescription){ + if(itemDescription!=null && id.compareTo(itemDescription.getId())==0 && + name.compareTo(itemDescription.getName())==0 && + owner.compareTo(itemDescription.getOwner())==0 && + path.compareTo(itemDescription.getPath())==0 && + type.compareTo(itemDescription.getType())==0 + ){ + return true; + } else { + return false; + } + + } + + @Override + public String toString() { + return "ItemDescription [id=" + id + ", name=" + name + ", owner=" + + owner + ", path=" + path + ", type=" + type + ", publicLink=" + + publicLink + "]"; + } + +} diff --git a/src/main/resources/org/gcube/portlets/user/dataminermanager/dataminermanager.gwt.xml b/src/main/resources/org/gcube/portlets/user/dataminermanager/dataminermanager.gwt.xml new file mode 100644 index 0000000..bf7f571 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/dataminermanager/dataminermanager.gwt.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/DataMinerManager.css b/src/main/webapp/DataMinerManager.css new file mode 100644 index 0000000..ecf014d --- /dev/null +++ b/src/main/webapp/DataMinerManager.css @@ -0,0 +1,618 @@ +.smLayoutContainer { + box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 0px 0 27px + rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 0px 0 27px + rgba(0, 0, 0, 0.15); + -webkit-box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 0px 0 27px + rgba(0, 0, 0, 0.15); + -o-box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 71px 0 27px + rgba(0, 0, 0, 0.15); + border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + -o-border-radius: 0; +} + +.smMenu { + width: 900px; + height: 220px; + padding-top: 50px; + margin: auto; + margin-bottom: 20px; + /*margin-left: 30px;*/ +} + +.layoutContainerArea { + margin-right: 20px; +} + +.smMenuItem { + box-shadow: inset 0 0 99px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 0px 0 27px + rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 0 99px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 0px 0 27px + rgba(0, 0, 0, 0.15); + -webkit-box-shadow: inset 0 0 99px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 0px 0 27px + rgba(0, 0, 0, 0.15); + -o-box-shadow: inset 0 0 99px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 5px rgba(196, 196, 196, 1), 71px 0 27px + rgba(0, 0, 0, 0.15); + border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + -o-border-radius: 0; + padding: 10px; + margin-bottom: 30px; + margin-left: 200px; + width: 480px; +} + +.smMenuItem:HOVER { + cursor: pointer; + opacity: 0.7; +} + +.smMenuItem img { + border: 1px solid #C0C0C0; + display: inline; +} + +.smMenuItemText b { + display: block; + color: #000077; + font-size: 20px; +} + +.smMenuItemText { + display: block; + color: #606060; + margin-right: 10px; +} + +/* OPERATORS PANEL */ +.opePanel +{ + +} +.opePanel:hover { + cursor: pointer; +} + + + + +.categoryItem { + margin-top: 10px; + margin-left: 5px; + font-size: 15px; + font-variant: small-caps; + font-weight: bolder; + border-bottom: 2px solid #505050; + margin-bottom: 5px; + background-image: url(images/triangle-right.png); + background-repeat: no-repeat; + background-position: right; +} + +.categoryItem-Collapsed { + background-image: url(images/triangle-right.png); +} + +.categoryItem-Expanded { + background-image: url(images/triangle-down.png); +} + +.categoryItem:hover { + color: blue; + cursor: pointer; +} + +.filterResultText { + margin-top: 10px; + margin-left: 5px; + font-size: 15px; + font-variant: small-caps; + font-weight: bolder; + border-bottom: 2px solid #505050; + margin-bottom: 5px; +} + +.categoryItem .counter, .filterResultText .counter { + font-size: 10px; + color: #555555; +} + +.operatorPanel { + box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -moz-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -webkit-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -o-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -o-border-radius: 5px; + margin: 0px 5px 5px 10px; /* top right bottom left*/ + padding: 5px; + overflow: hidden; + height: 64px; +} + +.operatorPanel-selected { + background-color: #e0e7f7; +} + +.operatorPanel-title { + font-size: 13px; + font-weight: bolder; + color: #000077; +} + +.operatorPanel-title-selected { + color: #770000; +} + +.operatorPanel-briefDescription { + font-size: 10px; + color: #505050; +} + +.operatorPanel img { + float: right; +} + +.operatorPanel img:hover { + cursor: pointer; + opacity: 0.6; +} + +/* WORKFLOW PANEL */ +.workflow, .tableImporter, .uploadMonitor { + box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -moz-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -webkit-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -o-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -o-border-radius: 5px; + padding: 5px; + border: 1px solid black; + margin-left: 5px; + margin-right: 5px; +} + +.workflow-icon { + border: 1px solid black; + float: left; + position: relative; + left: 10px; + top: -20px; +} + +.workflow-title { + text-align: center; + font-size: 16px; + font-weight: bold; + color: #000077; + margin: 5px; +} + +.workflow-description { + font-size: 13px; + color: #505050; + margin-left: 65px; + margin-bottom: 20px; +} + +.workflow-fieldDescription { + font-size: 12px; + color: #505050; + text-align: right; + margin-left: 20px; + margin-top: 4px; +} + +.workflow-templatesList { + font-size: 9px; + color: #505050; + margin-top: 4px; +} + +.workflow-parameters-description { + font-size: 10px; + color: #505050; + margin-top: 4px; +} + +.computationExcecutionPanel { +} + +.workflow-parameters-tableDescription { + font-size: 12px; +/* border: 1px solid gray;*/ + color: white; + margin-right: 5px; + padding-right: 4px; + padding-left: 4px; + background-color: gray; +} + +.workflow-parameters-preload { + display: block; + margin: auto; + margin-left: auto; + margin-right: auto; +} + +/* TOOLTIP */ +.x-tip-mc { + padding: 6px; +} + +.categoryItemTooltip { + height: 80px; +} + +.categoryItemTooltip img { + border: 1px solid black; + float: left; + margin-right: 5px; +} + +/* TABLE EXPLORER */ + +.tableSelector-details { + margin-top: 20px; + margin-left: 5px; + margin-right: 5px; +} + +.tableSelector-details img { + display: block; + margin-left: auto; + margin-right: auto; + margin-bottom: 10px; +} + +#computationGrid .x-grid3-cell{ + vertical-align: middle; +} + +/* PENDING */ +.progressBar-pending { + border: 1px solid #AAAAAA; +} +.progressBar-pending .x-progress-bar { + border: medium none; + background-image: url("images/progress-gray.gif"); +} + +/* FAILED */ +.progressBar-failed { + border: 1px solid #AA0000; +} +.progressBar-failed .x-progress-bar { + border: medium none; + background-image: url("images/progress-red.gif"); +} + +/* COMPLETE */ +.progressBar-complete { + border: 1px solid #00AA00; +} +.progressBar-complete .x-progress-bar { + border: medium none; + background-image: url("images/progress-green.gif"); +} + + +/* JOB VIEWER */ + +.jobViewer-title { + font-size: 16px; + color: #000077; + margin-bottom: 10px; + margin-top: 10px; +} + +.jobViewer-section { + box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -moz-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -webkit-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + -o-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0 + rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px + rgba(77, 77, 77, 1); + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -o-border-radius: 5px; + margin: 0px 5px 5px 10px; /* top right bottom left*/ + padding: 5px; +/* overflow: hidden;*/ +} + +.jobViewer-section-header { + border-bottom: 1px solid gray; + margin-bottom: 10px; + margin-left: 5px; + margin-top: 20px; +} + +.jobViewer-section-header-title { + color: #333333; + font-size: 14px; + font-weight: bold; + margin-bottom: 5px; +} + +.jobViewer-section-header-image { + margin-right: 5px; +} + +.jobViewer-table +{ + line-height: 1.6em; + font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; + font-size: 12px; + margin: 15px; + width: 480px; + text-align: left; + border-collapse: collapse; +} +.jobViewer-table th +{ + font-size: 14px; + font-weight: normal; + padding: 12px 15px; + color: #039; +} +.jobViewer-table td +{ + padding: 3px 5px; + border-top: 1px solid #e8edff; +} +.jobViewer-table-oce-first +{ + background: #d0dafd; + border-right: 10px solid transparent; + border-left: 10px solid transparent; +} +.jobViewer-table tr:hover td +{ + color: #339; + background: #eff2ff; +} + +.jobViewer-output-outputType { + background-color: #EEEEEE; + border: 1px solid #BDBDBD; + font-weight: bold; + margin-bottom: 20px; + margin-top: 10px; + padding: 5px; + text-align: center; +} + +.jobViewer-output-groupTitle { + font-style: italic; + font-weight: bold; + margin-bottom: 5px; +} + +.jobViewer-output-separator { + border-top: 2px solid #AAAAAA; + height: 30px; + margin: 8px auto auto; + width: 400px;} + +.menuImgLogo:HOVER { +/* cursor: pointer;*/ +} + +.menuItemImage { + opacity: 0.5; +} + +.menuItemImage:HOVER { + cursor: pointer; + opacity: 1; +} + +.menuItemImage-selected { + opacity: 1; +} +.menuItemImage-selected:HOVER { + cursor:auto; +} + + +/* TABLE IMPORTER AND UPLOAD MONITOR */ + +.tableImporter, .uploadMonitor { + margin:auto; + margin-top: 20px; + padding: 5px; +} + +.tableImporter-title, .uploadMonitor-title { + text-align: center; + font-size: 16px; + font-weight: bold; + color: #000077; + margin-top: 5px; +} + +.uploadMonitor-text { + margin-left: 5px; +} + +.uploadMonitor-description, .tableImporter-description { + font-size: 12px; + color: #505050; + margin-top: 2px; + padding-left: 2px; + padding-right: 2px; + width: 380px; +} + +.tableImporter-form { + border: none; +} + +.tableImporter-form .x-panel-body { + border: none; +} + +.tableImporter-templateDescriptionsButton { + font-size: 14px; + font-weight: bold; + border: 1px dotted #BBBBBB; + color: #555555; + text-align: center; + margin-top: 10px; +} + +.tableImporter-templateDescriptionsButton:HOVER { + cursor: pointer; + color: #000077; +} + +.tableImporter-templateDescriptions-textSelectTemplate { + font-size: 13px; + margin: 10px; +} + +.tableImporter-templateDescriptorPanel { + text-align: left; + margin:auto; + margin-top: 10px; + padding: 5px; +} + +.tableImporter-templateDescriptorPanel-img { + float: left; + position: relative; + left: 10px; + top: -20px; +} + +.imgCursor:hover { + cursor: pointer; + opacity:0.7; + margin: auto; +} + +.tableImporter-fileName { + font-size: 10px; + color: #505050; + margin: auto; +} + +.tableImporter-templateText { + font-size: 10px; + color: #505050; + height: 25px; + vertical-align: bottom; +} +.tableImporter-templateIcon { + margin: auto; + margin-bottom: -10px; + margin-top: -5px; +} +.tableImporter-templateIcon:hover { + cursor: pointer; + opacity:0.7; +} + + +.templateDescriptorPanel-description { + font-size: 13px; + color: #505050; + margin-top: 17px; + padding-left: 30px; + padding-right: 20px; + padding-top: 28px; +} + +.templateDescriptorPanel-tableTemplateItem { + border-bottom: 1px solid gray; + font-size: 13px; + font-weight:bold; + margin-left: 10px; + padding-top: 20px; +} + +.templateDescriptorPanel-table +{ + line-height: 1.6em; + font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; + font-size: 12px; + margin: 15px; + width: 480px; + text-align: left; + border-collapse: collapse; +} +.templateDescriptorPanel-table th +{ + font-size: 13px; + font-weight: normal; + padding: 12px 15px; + color: #039; +} +.templateDescriptorPanel-table td +{ + padding: 3px 5px; + color: #669; + border-top: 1px solid #e8edff; +} +.templateDescriptorPanel-table-oce-first +{ + background: #d0dafd; + border-right: 10px solid transparent; + border-left: 10px solid transparent; +} +.templateDescriptorPanel-table tr:hover td +{ + color: #339; + background: #eff2ff; +} + +.gcube_DialogBox .Caption { font-family: Arial Unicode !important; } + +.dataSpace-grid-templateImg { + display: inline; +} + +.dataSpace-grid-tableName { + font-weight: bold; +} + + diff --git a/src/main/webapp/DataMinerManager.html b/src/main/webapp/DataMinerManager.html new file mode 100644 index 0000000..484db92 --- /dev/null +++ b/src/main/webapp/DataMinerManager.html @@ -0,0 +1,29 @@ + + + + + + + + + +Data Miner Manager + + + + + + + + + +
+ + diff --git a/src/main/webapp/WEB-INF/jsp/DataMinerManager_view.jsp b/src/main/webapp/WEB-INF/jsp/DataMinerManager_view.jsp new file mode 100644 index 0000000..4799767 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/DataMinerManager_view.jsp @@ -0,0 +1,14 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/liferay-display.xml b/src/main/webapp/WEB-INF/liferay-display.xml new file mode 100644 index 0000000..0e1615b --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-display.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/liferay-plugin-package.properties b/src/main/webapp/WEB-INF/liferay-plugin-package.properties new file mode 100644 index 0000000..410019a --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-plugin-package.properties @@ -0,0 +1,9 @@ +name=DataMinerManager +module-group-id=liferay +module-incremental-version=1 +tags= +short-description= +change-log= +page-url=http://www.d4science.eu +author=D4Science EU +licenses= \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/liferay-portlet.xml b/src/main/webapp/WEB-INF/liferay-portlet.xml new file mode 100644 index 0000000..9180fce --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-portlet.xml @@ -0,0 +1,11 @@ + + + + + + DataMinerManager + false + false + false + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/portlet.xml b/src/main/webapp/WEB-INF/portlet.xml new file mode 100644 index 0000000..d14b64d --- /dev/null +++ b/src/main/webapp/WEB-INF/portlet.xml @@ -0,0 +1,18 @@ + + + + DataMinerManager + DataMinerManager + DataMinerManager + org.gcube.portlets.user.dataminermanager.portlet.DataMinerManager + 0 + + text/html + VIEW + + + DataMinerManager + DataMinerManager + + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..504060d --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,76 @@ + + + + + DataMinerManagerServlet + org.gcube.portlets.user.dataminermanager.server.DataMinerManagerServiceImpl + + + DataMinerManagerServlet + /dataminermanager/dataminerman + + + jUnitHostImpl + com.google.gwt.junit.server.JUnitHostImpl + + + jUnitHostImpl + /dataminermanager/junithost/* + + + DownloadService + org.gcube.portlets.user.dataminermanager.server.DownloadServlet + + + DownloadService + /dataminermanager/DownloadService + + + + + workspaceExplorer + org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl + + + workspaceExplorer + /dataminermanager/WorkspaceExplorerService + + + + + workspaceUploaderService + org.gcube.portlets.widgets.workspaceuploader.server.WorkspaceUploaderServiceImpl + + + workspaceUploaderService + /dataminermanager/workspaceUploaderService + + + + workspaceUploadServletStream + org.gcube.portlets.widgets.workspaceuploader.server.WorkspaceUploadServletStream + + + workspaceUploadServletStream + /dataminermanager/workspaceUploadServletStream + + + + checkServlet + org.gcube.portlets.widgets.sessionchecker.server.SessionCheckerServiceImpl + + + + checkServlet + /dataminermanager/checksession + + + + + DataMinerManager.html + + + + \ No newline at end of file diff --git a/src/main/webapp/gxt/css/gxt-all.css b/src/main/webapp/gxt/css/gxt-all.css new file mode 100644 index 0000000..47dc215 --- /dev/null +++ b/src/main/webapp/gxt/css/gxt-all.css @@ -0,0 +1,7451 @@ +html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';} +.x-contrast-test { + background: url(../images/default/s.gif); + visibility: hidden; + position: relative; + left: -1000px; + top: -1000px; +} +.ext-el-mask { + z-index: 100; + position: absolute; + top: 0; + left: 0; + -moz-opacity: 0.5; + opacity: .50; + filter: alpha(opacity = 50); + width: 100%; + height: 100%; + zoom: 1; +} + +.ext-el-mask-msg { + z-index: 101; + position: absolute; + top: 0; + left: 0; + border: 1px solid; + background: repeat-x 0 -16px; + padding: 2px; +} + +.ext-el-mask-msg div { + padding: 5px 10px 5px 10px; + border: 1px solid; + cursor: wait; +} + +.ext-webkit *:focus { + outline: none !important; +} + +.ext-webkit .x-form-check-wrap input:focus { + outline: auto !important; +} + +.ext-shim { + position: absolute; + visibility: hidden; + left: 0; + top: 0; + overflow: hidden; +} + +.ext-ie .ext-shim { + filter: alpha(opacity = 0); +} + +.ext-ie6 .ext-shim { + margin-left: 5px; + margin-top: 3px; +} + +.x-mask-loading div { + padding: 5px 10px 5px 25px; + background: no-repeat 5px 5px; + line-height: 16px; +} + +.x-hidden,.x-hide-offsets { + position: absolute !important; + left: -10000px !important; + top: -10000px !important; + visibility: hidden !important; +} + +.x-hide-display { + display: none !important; +} + +.x-hide-visibility { + visibility: hidden !important; +} + +.x-masked { + overflow: hidden !important; +} + +.x-masked-relative { + position: relative !important; +} + +.x-masked select,.x-masked object,.x-masked embed { + visibility: hidden; +} + +.x-layer { + visibility: hidden; +} + +.x-unselectable,.x-unselectable * { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore; +} + +.x-unselectable-single { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore; +} + +.x-selectable,.x-selectable * { + -moz-user-select: text !important; + -webkit-user-select: auto; +} + +.x-repaint { + zoom: 1; + background-color: transparent; + -moz-outline: none; + outline: 0 none; +} + +.x-item-disabled { + cursor: default; + opacity: .6; + -moz-opacity: .6; + filter: alpha(opacity = 60); +} + +.ext-ie .x-item-disabled { + filter: none !important; +} + +.x-item-disabled * { + cursor: default !important; +} + +.x-splitbar-proxy { + position: absolute; + visibility: hidden; + z-index: 20001; + zoom: 1; + line-height: 1px; + font-size: 1px; + overflow: hidden; +} + +.x-splitbar-h,.x-splitbar-proxy-h { + cursor: e-resize; + cursor: col-resize; +} + +.x-splitbar-v,.x-splitbar-proxy-v { + cursor: s-resize; + cursor: row-resize; +} + +.x-color-palette { + width: 150px; + height: 92px; + cursor: pointer; + -moz-outline: 0 none; + outline: 0 none; +} + +.x-color-palette a { + border: 1px solid; + float: left; + padding: 2px; + text-decoration: none; + -moz-outline: 0 none; + outline: 0 none; + cursor: pointer; +} + +.x-color-palette a.x-color-palette-hover,.x-color-palette a.x-color-palette-sel { + border: 1px solid; +} + +.x-color-palette em { + display: block; + border: 1px solid; +} + +.x-color-palette em span { + cursor: pointer; + display: block; + height: 10px; + line-height: 10px; + width: 10px; +} + +.x-ie-shadow { + display: none; + position: absolute; + overflow: hidden; + left: 0; + top: 0; + zoom: 1; +} + +.x-shadow { + display: none; + position: absolute; + overflow: hidden; + left: 0; + top: 0; +} + +.x-shadow * { + overflow: hidden; +} + +.x-shadow * { + padding: 0; + border: 0; + margin: 0; + clear: none; + zoom: 1; +} + +.x-shadow .xstc,.x-shadow .xsbc { + height: 6px; + float: left; +} + +.x-shadow .xstl,.x-shadow .xstr,.x-shadow .xsbl,.x-shadow .xsbr { + width: 6px; + height: 6px; + float: left; +} + +.x-shadow .xsc { + width: 100%; +} + +.x-shadow .xsml,.x-shadow .xsmr { + width: 6px; + float: left; + height: 100%; +} + +.x-shadow .xsmc { + float: left; + height: 100%; + background: transparent; +} + +.x-shadow .xst,.x-shadow .xsb { + height: 6px; + overflow: hidden; + width: 100%; +} + +.x-shadow .xsml { + background: transparent repeat-y 0 0; +} + +.x-shadow .xsmr { + background: transparent repeat-y -6px 0; +} + +.x-shadow .xstl { + background: transparent no-repeat 0 0; +} + +.x-shadow .xstc { + background: transparent repeat-x 0 -30px; +} + +.x-shadow .xstr { + background: transparent repeat-x 0 -18px; +} + +.x-shadow .xsbl { + background: transparent no-repeat 0 -12px; +} + +.x-shadow .xsbc { + background: transparent repeat-x 0 -36px; +} + +.x-shadow .xsbr { + background: transparent repeat-x 0 -6px; +} + +.loading-indicator { + background: no-repeat left; + padding-left: 20px; + line-height: 16px; + margin: 3px; +} + +.x-text-resize { + position: absolute; + left: -1000px; + top: -1000px; + visibility: hidden; + zoom: 1; +} + +.x-drag-overlay { + width: 100%; + height: 100%; + display: none; + position: absolute; + left: 0; + top: 0; + background-image: url(../images/default/s.gif); + z-index: 20000; +} + +.x-clear { + clear: both; + overflow: hidden; + line-height: 0; + font-size: 0; +} + +.x-spotlight { + z-index: 8999; + position: absolute; + top: 0; + left: 0; + -moz-opacity: 0.5; + opacity: .50; + filter: alpha(opacity = 50); + width: 0; + height: 0; + zoom: 1; +} + +#x-history-frame { + position: absolute; + top: -1px; + left: 0; + width: 1px; + height: 1px; + visibility: hidden; +} + +#x-history-field { + position: absolute; + top: 0; + left: -1px; + width: 1px; + height: 1px; + visibility: hidden; +} + +.x-portlet { + margin-bottom: 10px; +} + +.x-portlet .x-panel-body { + background-color: white !important; +} + +.ext-ie .x-btn-icon .x-btn-center .x-btn-text { + height: auto; +} + +.x-portal-insert div { + height: 4px; + font-size: 0px; + border: 2px dotted blue; +} + +.icon-wait { + background: url(../images/gxt/icons/wait.gif) no-repeat !important; +} + +.x-panel-icon { + padding-left: 20px !important; +} + +.x-icon-btn { + width: 16px; + height: 16px; + overflow: hidden; + background-repeat: no-repeat; + cursor: pointer; +} + +.x-panel-inline-icon { + margin-top: 0; +} + +.x-modal { + position: absolute; + z-index: 10; + background-color: #CEDFF5; + filter: alpha(opacity = 10); + opacity: .4; + left: 0px; + top: 0px; +} + +.x-progress { + font-family: tahoma, arial, helvetica, sans-serif; +} + +.x-float-right { + float: right; +} + +.x-toolbar .x-float-right { + margin-right: 4px; +} + +.x-border { + border: 1px solid #99BBE8; +} + +.x-border-top { + border-top: 1px solid #99BBE8; +} + +.x-layout-popup { + background-color: #DFE8F6; + border: 1px solid #7CA4D9; +} + +.x-panel-popup-body { + border-top: 1px solid #99BBE8; +} + +.x-layout-collapsed .x-panel-header { + border-left: none; + border-right: none; + border-top: none; +} + +.x-layout-collapsed .x-panel-header .x-tool { + margin: 0 0 0 -4px; + padding: 0px; +} + +.x-layout-collapsed { + position: absolute; + visibility: hidden; + background-color: #d2e0f2; + width: 20px; + height: 20px; + overflow: hidden; + border: 1px solid #98c0f4; + z-index: 20; +} + +.ext-border-box .x-layout-collapsed { + width: 22px; + height: 22px; +} + +.x-layout-collapsed-over { + cursor: pointer; + background-color: #d9e8fb; +} + +.x-layout-collapsed-west .x-layout-collapsed-tools,.x-layout-collapsed-east .x-layout-collapsed-tools { + position: absolute; + top: 0; + left: 0; + width: 20px; + height: 20px; +} + +.x-panel-toolbar { + float: right; +} + +.x-cursor-row-resize { + cursor: n-resize; + cursor: row-resize; +} + +.x-date-picker,.x-date-picker a { + font-size: 11px; +} + +.x-date-days { + table-layout: fixed; + width: 100%; +} + +.x-date-days td { + width: 25px; + border: none; +} + +.x-date-days td span { + display: block; + padding: 2px 7px 2px 2px; +} + +.x-date-days td { + background: #DFECFB url(../images/default/shared/glass-bg.gif) repeat-x scroll left top; + border-bottom: 1px solid #A3BAD9; + border-collapse: separate; + color: #233D6D; + cursor: default; + font-family: arial, helvetica, tahoma, sans-serif; + font-size: 10px; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: normal; + padding: 0pt; + text-align: right !important; +} + +.x-date-picker .x-date-header { + background: url(../images/default/shared/hd-sprite.gif) repeat-x 0 -83px; + height: 22px; + left: 10px; + top: 10px; + width: 157px; +} + +.x-date-header .x-btn .x-btn-text { + color: #fff; +} + +.x-date-picker-footer { + width: 100%; +} + +.x-date-picker-footer td { + text-align: center; +} + +.x-date-left { + background: transparent url(../images/default/shared/hd-sprite.gif) repeat-x scroll 0pt -83px; + color: #FFFFFF; + font-family: "sans serif", tahoma, verdana, helvetica; + font-size: 11px; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: bold; + line-height: normal; + overflow: hidden; +} + +.x-modal { + position: absolute; + z-index: 10; + background-color: black; + filter: alpha(opacity = 10); + opacity: .1; + left: 0px; + top: 0px; +} + +.x-progress { + font-family: tahoma, arial, helvetica, sans-serif; +} + +.x-float-right { + float: right; +} + +.x-layout-popup { + background-color: #DFE8F6; + border: 1px solid #7CA4D9; +} + +.x-layout-collapsed .x-panel-header .x-tool { + margin: 0 0 0 -4px; + padding: 0px; +} + +.ext-border-box .x-layout-collapsed { + width: 22px; + height: 22px; +} + +.x-layout-collapsed-over { + cursor: pointer; + background-color: #d9e8fb; +} + +.x-layout-collapsed-west .x-layout-collapsed-tools,.x-layout-collapsed-east .x-layout-collapsed-tools { + position: absolute; + top: 0; + left: 0; + width: 20px; + height: 20px; +} + +.x-panel-toolbar { + float: right; +} + +.x-cursor-col-resize { + cursor: e-resize; + cursor: col-resize; +} + +.x-cursor-row-resize { + cursor: n-resize; + cursor: row-resize; +} + +.x-drag-proxy { + border: 1px dashed #3b5a82; + background-color: #EDEDED; + filter: alpha(opacity = 50); + opacity: .5; + background-color: #c3daf9; + z-index: 20000; + overflow: hidden; + position: absolute; + left: 0;; + top: 0; + cursor: move; +}.x-tab-panel { + overflow: hidden; + -moz-outline: none; + outline: 0 none; +} + +.x-tab-panel-header,.x-tab-panel-footer { + border: 1px solid; + overflow: hidden; + zoom: 1; +} + +.x-tab-panel-header { + border: 1px solid; + padding-bottom: 2px; +} + +.x-tab-panel-footer { + border: 1px solid; + padding-top: 2px; +} + +.x-tab-strip-wrap { + width: 100%; + overflow: hidden; + position: relative; + zoom: 1; +} + +ul.x-tab-strip { + display: block; + width: 7000px; + zoom: 1; +} + +ul.x-tab-strip-top { + padding-top: 1px; + background: repeat-x bottom; + border-bottom: 1px solid; +} + +ul.x-tab-strip-bottom { + padding-bottom: 1px; + background: repeat-x top; + border-top: 1px solid; + border-bottom: 0 none; +} + +.x-tab-panel-header-plain .x-tab-strip-top { + background: transparent !important; + padding-top: 0 !important; +} + +.x-tab-panel-header-plain { + background: transparent !important; + border-width: 0 !important; + padding-bottom: 0 !important; +} + +.x-tab-panel-header-plain .x-tab-strip-spacer,.x-tab-panel-footer-plain .x-tab-strip-spacer + { + border: 1px solid; + height: 2px; + font-size: 1px; + line-height: 1px; +} + +.x-tab-panel-header-plain .x-tab-strip-spacer { + border-top: 0 none; +} + +.x-tab-panel-footer-plain .x-tab-strip-spacer { + border-bottom: 0 none; +} + +.x-tab-panel-footer-plain .x-tab-strip-bottom { + background: transparent !important; + padding-bottom: 0 !important; +} + +.x-tab-panel-footer-plain { + background: transparent !important; + border-width: 0 !important; + padding-top: 0 !important; +} + +.ext-border-box .x-tab-panel-header-plain .x-tab-strip-spacer,.ext-border-box .x-tab-panel-footer-plain .x-tab-strip-spacer + { + height: 3px; +} + +ul.x-tab-strip li { + float: left; + position: relative; + margin-left: 2px; +} + +ul.x-tab-strip li.x-tab-edge { + float: left; + margin: 0 !important; + padding: 0 !important; + border: 0 none !important; + font-size: 1px !important; + line-height: 1px !important; + overflow: hidden; + zoom: 1; + background: transparent !important; + width: 1px; +} + +.x-tab-strip a,.x-tab-strip span,.x-tab-strip em { + display: block; +} + +.x-tab-strip a { + text-decoration: none !important; + -moz-outline: none; + outline: none; + cursor: pointer; +} + +.x-tab-strip-inner { + overflow: hidden; + text-overflow: ellipsis; +} + +.x-tab-strip span.x-tab-strip-text { + white-space: nowrap; + cursor: pointer; + padding: 4px 0; +} + +.x-tab-strip-top .x-tab-with-icon .x-tab-right { + padding-left: 6px; +} + +.x-tab-strip .x-tab-with-icon span.x-tab-strip-text { + padding-left: 20px; + background-position: 0 3px; + background-repeat: no-repeat; +} + +.x-tab-strip-active,.x-tab-strip-active a.x-tab-right { + cursor: default; +} + +.x-tab-strip-active span.x-tab-strip-text { + cursor: default; +} + +.x-tab-strip-disabled .x-tabs-text { + cursor: default; +} + +.x-tab-panel-body { + overflow: hidden; +} + +.x-tab-panel-bwrap { + overflow: hidden; +} + +.ext-ie .x-tab-strip .x-tab-right { + position: relative; +} + +.x-tab-strip-top .x-tab-strip-active .x-tab-right { + margin-bottom: -1px; +} + +.x-tab-strip-top .x-tab-strip-active .x-tab-right span.x-tab-strip-text + { + padding-bottom: 5px; +} + +.x-tab-strip-bottom .x-tab-strip-active .x-tab-right { + margin-top: -1px; +} + +.x-tab-strip-bottom .x-tab-strip-active .x-tab-right span.x-tab-strip-text + { + padding-top: 5px; +} + +.x-tab-strip-top .x-tab-right { + background: transparent no-repeat 0 -51px; + padding-left: 10px; +} + +.x-tab-strip-top .x-tab-left { + background: transparent no-repeat right -351px; + padding-right: 10px; +} + +.x-tab-strip-top .x-tab-strip-inner { + background: transparent repeat-x 0 -201px; +} + +.x-tab-strip-top .x-tab-strip-over .x-tab-right { + background-position: 0 -101px; +} + +.x-tab-strip-top .x-tab-strip-over .x-tab-left { + background-position: right -401px; +} + +.x-tab-strip-top .x-tab-strip-over .x-tab-strip-inner { + background-position: 0 -251px; +} + +.x-tab-strip-top .x-tab-strip-active .x-tab-right { + background-position: 0 0; +} + +.x-tab-strip-top .x-tab-strip-active .x-tab-left { + background-position: right -301px; +} + +.x-tab-strip-top .x-tab-strip-active .x-tab-strip-inner { + background-position: 0 -151px; +} + +.x-tab-strip-bottom .x-tab-right { + background: no-repeat bottom right; +} + +.x-tab-strip-bottom .x-tab-left { + background: no-repeat bottom left; +} + +.x-tab-strip-bottom .x-tab-strip-active .x-tab-right { + background: no-repeat bottom left; +} + +.x-tab-strip-bottom .x-tab-strip-active .x-tab-left { + background: no-repeat bottom right; +} + +.x-tab-strip-bottom .x-tab-left { + padding: 0 10px; +} + +.x-tab-strip-bottom .x-tab-right { + padding: 0; +} + +.x-tab-strip .x-tab-strip-close { + display: none; +} + +.x-tab-strip-closable { + position: relative; +} + +.x-tab-strip-closable .x-tab-left { + padding-right: 19px; +} + +.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { + opacity: .6; + -moz-opacity: .6; + background-repeat: no-repeat; + display: block; + width: 11px; + height: 11px; + position: absolute; + top: 3px; + right: 3px; + cursor: pointer; + z-index: 2; +} + +.x-tab-strip .x-tab-strip-active a.x-tab-strip-close { + opacity: .8; + -moz-opacity: .8; +} + +.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover { + opacity: 1; + -moz-opacity: 1; +} + +.x-tab-panel-body { + border: 1px solid; +} + +.x-tab-panel-body-top { + border-top: 0 none; +} + +.x-tab-panel-body-bottom { + border-bottom: 0 none; +} + +.x-tab-scroller-left { + background: transparent no-repeat -18px 0; + border-bottom: 1px solid; + width: 18px; + position: absolute; + left: 0; + top: 0; + z-index: 10; + cursor: pointer; +} + +.x-tab-scroller-left-over { + background-position: 0 0; +} + +.x-tab-scroller-left-disabled { + background-position: -18px 0; + opacity: .5; + -moz-opacity: .5; + filter: alpha(opacity = 50); + cursor: default; +} + +.x-tab-scroller-right { + background: transparent no-repeat 0 0; + border-bottom: 1px solid; + width: 18px; + position: absolute; + right: 0; + top: 0; + z-index: 10; + cursor: pointer; +} + +.x-tab-scroller-right-over { + background-position: -18px 0; +} + +.x-tab-scroller-right-disabled { + background-position: 0 0; + opacity: .5; + -moz-opacity: .5; + filter: alpha(opacity = 50); + cursor: default; +} + +.x-tab-scrolling-bottom .x-tab-scroller-left,.x-tab-scrolling-bottom .x-tab-scroller-right + { + margin-top: 1px; +} + +.x-tab-scrolling .x-tab-strip-wrap { + margin-left: 18px; + margin-right: 18px; +} + +.x-tab-scrolling { + position: relative; +} + +.x-tab-panel-bbar .x-toolbar { + border: 1px solid; + border-top: 0 none; + overflow: hidden; + padding: 2px; +} + +.x-tab-panel-tbar .x-toolbar { + border: 1px solid; + border-top: 0 none; + overflow: hidden; + padding: 2px; +} + +.x-tab-strip li .x-tab-image { + position: absolute; + top: 3px; + left: 5px; +} + +.ext-ie8 .x-tab-strip li .x-tab-image,.ext-ie8-compatibility .x-tab-strip li .x-tab-image { + top: 4px; + left: 6px; +} + +.ext-ie8 .x-tab-strip-top .x-tab-right,.ext-ie8-compatibility .x-tab-strip-top .x-tab-right + { + top: 1px; +} + +.ext-strict .ext-ie8 .x-tab-strip-top .x-tab-right,.ext-ie8 .x-tab-panel-header-plain .x-tab-strip-top .x-tab-right,.ext-ie8-compatibility .x-tab-panel-header-plain .x-tab-strip-top .x-tab-right + { + top: 0; +} +.ext-strict .ext-ie7 .x-panel-body { + position: relative !important; +} + +.x-form-field { + margin: 0; +} + +.foo { + padding: 1px; +} + +.foo { + margin: 4px; +} + +.x-form-text,textarea.x-form-field { + padding: 1px 3px; + background: repeat-x 0 0; + border: 1px solid; +} + +.ext-gecko textarea.x-form-field { + padding: 0; +} + +.x-form-text,.ext-ie .x-form-file { + height: 22px; + line-height: 18px; + vertical-align: middle; +} + +.ext-ie6 .x-form-text,.ext-ie7 .x-form-text { + margin: -1px 0; + height: 22px; /* ie quirks */ + line-height: 18px; +} + +.ext-ie8-compatibility .x-form-text { + margin: 0; +} + +.ext-ie textarea.x-form-field { + margin: -1px 0; /* ie bogus margin bug */ +} + +.ext-strict .ext-ie8 textarea.x-form-field,.ext-strict .ext-ie8-compatibility textarea.x-form-field { + margin: 0; +} + +.x-form-field-wrap .x-form-text { + position: relative; +} + +.ext-strict .x-form-text { + height: 18px; +} + +.ext-safari.ext-mac textarea.x-form-field { + margin-bottom: -2px; +} + +.ext-gecko .x-form-text,.ext-ie8 .x-form-text { + padding-top: 2px; + padding-bottom: 0; +} + +textarea { + resize: none; +} + +.x-form-select-one { + height: 20px; + line-height: 18px; + vertical-align: middle; + border: 1px solid; +} + +.x-form-check-wrap { + line-height: 18px; + height: 22px; + white-space: nowrap; +} + +.x-editor .x-form-check-wrap { + border: 1px solid; + padding: 2px; + height: 14px; +} + +.x-editor .x-form-checkbox { + height: 13px; +} + +.x-form-check-group-label { + border-bottom: 1px solid; + margin-bottom: 5px; + padding-left: 3px !important; + float: none !important; +} + +.x-form-field-wrap .x-form-trigger { + width: 17px; + height: 21px; + border: 0; + background: transparent no-repeat 0 0; + cursor: pointer; + border-bottom: 1px solid; + position: absolute; + top: 0; +} + +.ext-safari .x-form-field-wrap .x-form-trigger { + height: 21px; +} + +.ext-strict .ext-safari .x-form-field-wrap .x-form-trigger { + height: 23px; +} + +.ext-strict .ext-safari .x-small-editor .x-form-field-wrap .x-form-trigger { + height: 19px; +} + +.ext-strict .ext-ie8 .x-small-editor .x-form-field-wrap .x-form-trigger { + height: 20px !important; +} + +.ext-strict .ext-gecko .x-small-editor .x-form-field-wrap .x-form-trigger { + height: 21px !important; +} + +.x-form-field-wrap .x-form-date-trigger,.x-form-field-wrap .x-form-clear-trigger,.x-form-field-wrap .x-form-search-trigger + { + cursor: pointer; +} + +.ext-safari .x-form-field-wrap .x-form-trigger,.ext-gecko .x-form-field-wrap .x-form-trigger { + right: 0; +} + +.x-form-field-wrap .x-form-twin-triggers .x-form-trigger { + position: static; + top: auto; + vertical-align: top; +} + +.x-form-field-wrap { + position: relative; + left: 0; + top: 0; + zoom: 1; + white-space: nowrap; + text-align: left; +} + +.x-form-field-wrap .x-form-trigger-over { + background-position: -17px 0; +} + +.x-form-field-wrap .x-form-trigger-click { + background-position: -34px 0; +} + +.x-trigger-wrap-focus .x-form-trigger { + background-position: -51px 0; +} + +.x-trigger-wrap-focus .x-form-trigger-over { + background-position: -68px 0; +} + +.x-trigger-wrap-focus .x-form-trigger-click { + background-position: -85px 0; +} + +.x-trigger-wrap-focus .x-form-trigger { + border-bottom: 1px solid; +} + +.x-item-disabled .x-form-trigger-over { + background-position: 0 0 !important; + border-bottom: 1px solid; +} + +.x-item-disabled .x-form-trigger-click { + background-position: 0 0 !important; + border-bottom: 1px solid; +} + +.x-form-focus,textarea.x-form-focus { + border: 1px solid; +} + +.x-form-invalid,textarea.x-form-invalid { + background: repeat-x bottom; + border: 1px solid; +} + +.ext-safari .x-form-invalid { + border: 1px solid; +} + +.x-form-inner-invalid,textarea.x-form-inner-invalid { + background: repeat-x bottom; +} + +.x-editor { + padding: 0; + margin: 0; +} + +.x-form-grow-sizer { + left: -10000px; + padding: 8px 3px; + position: absolute; + visibility: hidden; + top: -10000px; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; + zoom: 1; +} + +.x-form-grow-sizer p { + margin: 0 !important; + border: 0 none !important; + padding: 0 !important; +} + +.x-form-item { + display: block; + margin-bottom: 4px; +} + +.x-form-item .x-form-item-label { + display: block; + float: left; + width: 100px; + padding: 3px; + padding-left: 0; + clear: left; + z-index: 2; + position: relative; +} + +.x-form-element { + padding-left: 105px; + position: relative; +} + +.x-form-invalid-msg { + padding: 2px; + padding-left: 18px; + background: transparent no-repeat 0 2px; + line-height: 16px; + width: 200px; +} + +.x-form-label-left .x-form-item-label { + text-align: left; +} + +.x-form-label-right .x-form-item-label { + text-align: right; +} + +.x-form-label-top .x-form-item .x-form-item-label { + width: auto; + float: none; + clear: none; + display: inline; + margin-bottom: 4px; + position: static; +} + +.x-form-label-top .x-form-element { + padding-left: 0; + padding-top: 4px; +} + +.x-form-label-top .x-form-item { + padding-bottom: 4px; +} + +.x-small-editor .x-form-text { + height: 20px; + line-height: 16px; + vertical-align: middle; +} + +.ext-ie6 .x-small-editor .x-form-text,.ext-ie7 .x-small-editor .x-form-text { + height: 20px !important; + line-height: 16px !important; +} + +.ext-strict .x-small-editor .x-form-text { + height: 16px !important; +} + +.ext-strict .ext-ie8 .x-small-editor .x-form-text { + height: 17px !important; +} + +.ext-strict .ext-webkit .x-small-editor .x-form-text { + height: 18px !important; + padding: 0px 3px; +} + +.ext-strict .ext-gecko .x-small-editor .x-form-text { + height: 18px !important; +} + +.ext-strict .ext-gecko .x-edit-grid .x-small-editor .x-form-text { + height:17px !important; +} + +.ext-border-box .x-small-editor .x-form-text { + height: 20px; +} + +.x-small-editor .x-form-select-one { + height: 20px; + line-height: 16px; + vertical-align: middle; +} + +.x-small-editor .x-form-num-field { + text-align: right; +} + +.x-small-editor .x-form-field-wrap .x-form-trigger { + height: 19px; +} + +.x-form-clear { + clear: both; + overflow: hidden; + line-height: 0; + font-size: 0; + height: 0; +} + +.x-form-clear-left { + clear: left; + overflow: hidden; + line-height: 0; + font-size: 0; + height: 0; +} + +.x-form-cb-label { + width: auto !important; + float: none !important; + clear: none !important; + display: inline !important; + margin-left: 4px; +} + +.x-form-column { + float: left; + padding: 0; + margin: 0; + width: 48%; + overflow: hidden; + zoom: 1; +} + +.x-form .x-form-btns-ct .x-btn { + float: right; + clear: none; +} + +.x-form .x-form-btns-ct .x-form-btns td { + border: 0; + padding: 0; +} + +.x-form .x-form-btns-ct .x-form-btns-right table { + float: right; + clear: none; +} + +.x-form .x-form-btns-ct .x-form-btns-left table { + float: left; + clear: none; +} + +.x-form .x-form-btns-ct .x-form-btns-center { + text-align: center; +} + +.x-form .x-form-btns-ct .x-form-btns-center table { + margin: 0 auto; +} + +.x-form .x-form-btns-ct table td.x-form-btn-td { + padding: 3px; +} + +.x-form .x-form-btns-ct .x-btn-focus .x-btn-left { + background-position: 0 -147px; +} + +.x-form .x-form-btns-ct .x-btn-focus .x-btn-right { + background-position: 0 -168px; +} + +.x-form .x-form-btns-ct .x-btn-focus .x-btn-center { + background-position: 0 -189px; +} + +.x-form .x-form-btns-ct .x-btn-click .x-btn-center { + background-position: 0 -126px; +} + +.x-form .x-form-btns-ct .x-btn-click .x-btn-right { + background-position: 0 -84px; +} + +.x-form .x-form-btns-ct .x-btn-click .x-btn-left { + background-position: 0 -63px; +} + +.x-form-invalid-icon { + width: 16px; + height: 18px; + position: absolute; + left: 0; + top: 0; + display: block; + background: transparent no-repeat 0 2px; +} + +.x-fieldset { + border: 1px solid; + padding: 10px; + margin-bottom: 10px; + display: block; +} + +.ext-ie .x-fieldset legend { + margin-bottom: 10px; +} + +.ext-ie .x-fieldset { + padding-top: 0; + padding-bottom: 10px; +} + +.x-fieldset legend .x-tool-toggle { + margin-right: 3px; + margin-left: 0; + float: left !important; +} + +.x-fieldset legend input { + margin-right: 3px; + float: left !important; + height: 13px; + width: 13px; +} + +fieldset.x-panel-collapsed { + padding-bottom: 0 !important; + border-width: 1px 1px 0 1px !important; + border-left-color: transparent; + border-right-color: transparent; +} + +.ext-ie6 fieldset.x-panel-collapsed { + padding-bottom: 0 !important; + border-width: 1px 0 0 0 !important; + margin-left: 1px; + margin-right: 1px; +} + +fieldset.x-panel-collapsed .x-fieldset-bwrap { + visibility: hidden; + position: absolute; + left: -1000px; + top: -1000px; +} + +.ext-ie .x-fieldset-bwrap { + zoom: 1; +} + +.x-fieldset-noborder { + border: 0px none transparent; +} + +.x-fieldset-noborder legend { + margin-left: -3px; +} + +.ext-ie .x-fieldset-noborder legend { + position: relative; + margin-bottom: 23px; +} + +.ext-ie .x-fieldset-noborder legend span { + position: absolute; + left: 16px; +} + +.ext-gecko .x-form-item { + -moz-outline: none; + outline: 0 none; +} + +.x-hide-label label.x-form-item-label { + display: none !important; +} + +.x-hide-label .x-form-element { + padding-left: 0 !important; +} + +.x-fieldset { + overflow: hidden; +} + +/* make top of checkbox/tools visible in webkit */ +.ext-webkit .x-fieldset-header { + padding-top: 1px; +} + +.x-fieldset-bwrap { + overflow: hidden; + zoom: 1; +} + +.x-fieldset-body { + overflow: hidden; +} + +.x-combo-list .x-combo-selected { + border-color: #a3bae9 !important; +} + +.x-combo-list { + background-color: white !important; +} + +.ext-gecko .x-form-file { + height: inherit !important; +} + +.x-form-check { + background: none !important +} + +.x-form-radio { + background: none !important +} + +.x-form-label { + padding: 2px 3px 3px 0px; + font-size: 12px; +} + +.x-form-label-top .x-form-item { + padding-bottom: 0px; + margin-bottom: 2px; +} + +.ext-safari .x-form-text { + height: 22px; /* safari always same size */ + padding: 0 3px; + /* remove extra top/bottom padding */ +} + +.ext-safari .x-small-editor .x-form-text { + height: 20px; +} + +.x-form-group-label,.x-form-cb-label { + font: normal 12px tahoma, arial, helvetica, sans-serif; + padding-right: 10px; +} + +.x-form-list { + background: #FFFFFF url(../images/default/form/text-bg.gif) repeat-x scroll 0 0; + border: 1px solid #B5B8C8; +} + +/* + * FileUploadField component styles + */ +.x-form-file-wrap { + height: 22px; +} + +.x-form-file-wrap .x-form-file { + position: absolute; + right: 0; + -moz-opacity: 0; + filter: alpha(opacity : 0); + opacity: 0; + z-index: 2; + height: 22px; + top: 0; +} + +.x-form-file-wrap .x-form-file-btn { + position: absolute; + right: 0; + z-index: 1; + top: 0; +} + +.x-form-file-wrap .x-form-file-text { + z-index: 3; + color: #777; +} + +.x-form-invalid-icon { + background-position: 0 0 !important; +} + +.x-triggerfield-noedit { + cursor: pointer; +} + +.ext-webkit .x-form-checkbox:focus { + outline: auto !important; +} + +.x-spinner-field .x-form-twin-triggers .x-form-spinner-up, .x-spinner-field .x-form-twin-triggers .x-form-spinner-down { + height: 10px; + position: absolute; +} + +.ext-strict .ext-safari .x-form-field-wrap .x-form-spinner-up { + height: 10px; +} + +.ext-strict .ext-safari .x-form-field-wrap .x-form-spinner-down { + height: 12px; +} + +.x-spinner-field .x-form-twin-triggers .x-form-spinner-up { + top:0px; +} + +.x-spinner-field .x-form-twin-triggers .x-form-spinner-down { + top:11px; +} + +.x-spinner-field .x-form-twin-triggers { + width: 17px; +} + +.x-spinner-field .x-form-spinner-down { + background-position:0 -12px; +} + +.x-trigger-wrap-focus .x-form-spinner-up { + background-position:-85px 0; +} + +.x-trigger-wrap-focus .x-form-spinner-down { + background-position:-85px -12px; +} + +.x-form-field-wrap .x-form-spinner-overup{ + background-position:-17px 0; +} +.x-form-field-wrap .x-form-spinner-clickup{ + background-position:-34px 0; +} + +.x-trigger-wrap-focus .x-form-spinner-overup{ + background-position:-102px 0; +} + +.x-trigger-wrap-focus .x-form-spinner-clickup{ + background-position:-119px 0; +} + +.x-form-field-wrap .x-form-spinner-overdown{ + background-position:-51px -12px; +} +.x-form-field-wrap .x-form-spinner-clickdown{ + background-position:-68px -12px; +} +.x-trigger-wrap-focus .x-form-spinner-overdown{ + background-position:-136px -12px; +} +.x-trigger-wrap-focus .x-form-spinner-clickdown{ + background-position:-153px -12px; +}.x-btn{ + cursor:pointer; + white-space: nowrap; +} +.x-btn button{ + border:0 none; + background:transparent; + padding-left:3px; + padding-right:3px; + cursor:pointer; + margin:0; + overflow:hidden; + width:auto; + -moz-outline:0 none; + outline:0 none; +} +* html .ext-ie .x-btn button { + width:1px; +} +.ext-ie .x-item-disabled .x-btn-mc img { + filter: alpha(opacity=60); +} +.ext-gecko .x-btn button,.ext-webkit .x-btn button { + padding-left:0; + padding-right:0; +} +.ext-gecko .x-btn button::-moz-focus-inner { + padding:0; +} +.ext-ie .x-btn button { + padding-top:2px; +} +.x-btn td { + padding:0 !important; +} +.x-btn-text { + cursor:pointer; + white-space: nowrap; + padding:0; +} +.x-btn-noicon .x-btn-small .x-btn-text{ + height: 16px; +} +.x-btn-noicon .x-btn-medium .x-btn-text{ + height: 24px; +} +.x-btn-noicon .x-btn-large .x-btn-text{ + height: 32px; +} +.x-btn-icon .x-btn-text{ + background-position: center; + background-repeat: no-repeat; +} +.x-btn-icon .x-btn-small .x-btn-text{ + height: 16px; + width: 16px; +} +.x-btn-icon .x-btn-medium .x-btn-text{ + height: 24px; + width: 24px; +} +.x-btn-icon .x-btn-large .x-btn-text{ + height: 32px; + width: 32px; +} +.x-btn-text-icon .x-btn-icon-small-left .x-btn-text{ + background-position: 0 center; + background-repeat: no-repeat; + padding-left:18px; + height:16px; +} +.x-btn-text-icon .x-btn-icon-medium-left .x-btn-text{ + background-position: 0 center; + background-repeat: no-repeat; + padding-left:26px; + height:24px; +} +.x-btn-text-icon .x-btn-icon-large-left .x-btn-text{ + background-position: 0 center; + background-repeat: no-repeat; + padding-left:34px; + height:32px; +} +.x-btn-text-icon .x-btn-icon-small-top .x-btn-text{ + background-position: center 0; + background-repeat: no-repeat; + padding-top:18px; +} +.x-btn-text-icon .x-btn-icon-medium-top .x-btn-text{ + background-position: center 0; + background-repeat: no-repeat; + padding-top:26px; +} +.x-btn-text-icon .x-btn-icon-large-top .x-btn-text{ + background-position: center 0; + background-repeat: no-repeat; + padding-top:34px; +} +.x-btn-text-icon .x-btn-icon-small-right .x-btn-text{ + background-position: right center; + background-repeat: no-repeat; + padding-right:18px; + height:16px; +} +.x-btn-text-icon .x-btn-icon-medium-right .x-btn-text{ + background-position: right center; + background-repeat: no-repeat; + padding-right:26px; + height:24px; +} +.x-btn-text-icon .x-btn-icon-large-right .x-btn-text{ + background-position: right center; + background-repeat: no-repeat; + padding-right:34px; + height:32px; +} +.x-btn-text-icon .x-btn-icon-small-bottom .x-btn-text{ + background-position: center bottom; + background-repeat: no-repeat; + padding-bottom:18px; +} +.x-btn-text-icon .x-btn-icon-medium-bottom .x-btn-text{ + background-position: center bottom; + background-repeat: no-repeat; + padding-bottom:26px; +} +.x-btn-text-icon .x-btn-icon-large-bottom .x-btn-text{ + background-position: center bottom; + background-repeat: no-repeat; + padding-bottom:34px; +} +.x-btn-tr i, .x-btn-tl i, .x-btn-mr i, .x-btn-ml i, .x-btn-br i, .x-btn-bl i{ + font-size:1px; + line-height:1px; + width:3px; + display:block; + overflow:hidden; +} +.x-btn-tr i, .x-btn-tl i, .x-btn-br i, .x-btn-bl i{ + height:3px; +} +.x-btn-tl{ + width:3px; + height:3px; + background:no-repeat 0 0; +} +.x-btn-tr{ + width:3px; + height:3px; + background:no-repeat -3px 0; +} +.x-btn-tc{ + height:3px; + background:repeat-x 0 -6px; +} +.x-btn-ml{ + width:3px; + background:no-repeat 0 -24px; +} +.x-btn-mr{ + width:3px; + background:no-repeat -3px -24px; +} +.x-btn-mc{ + background:repeat-x 0 -1096px; + vertical-align: middle; + text-align:center; + padding:0 5px; + cursor:pointer; + white-space:nowrap; +} +.x-btn-bl{ + width:3px; + height:3px; + background:no-repeat 0 -3px; +} +.x-btn-br{ + width:3px; + height:3px; + background:no-repeat -3px -3px; +} +.x-btn-bc{ + height:3px; + background:repeat-x 0 -15px; +} +.x-btn-over .x-btn-tl{ + background-position: -6px 0; +} +.x-btn-over .x-btn-tr{ + background-position: -9px 0; +} +.x-btn-over .x-btn-tc{ + background-position: 0 -9px; +} +.x-btn-over .x-btn-ml{ + background-position: -6px -24px; +} +.x-btn-over .x-btn-mr{ + background-position: -9px -24px; +} +.x-btn-over .x-btn-mc{ + background-position: 0 -2168px; +} +.x-btn-over .x-btn-bl{ + background-position: -6px -3px; +} +.x-btn-over .x-btn-br{ + background-position: -9px -3px; +} +.x-btn-over .x-btn-bc{ + background-position: 0 -18px; +} +.ext-webkit .x-btn-focus .x-btn-tl{ + background-position: -6px 0; +} +.ext-webkit .x-btn-focus .x-btn-tr{ + background-position: -9px 0; +} +.ext-webkit .x-btn-focus .x-btn-tc{ + background-position: 0 -9px; +} +.ext-webkit .x-btn-focus .x-btn-ml{ + background-position: -6px -24px; +} +.ext-webkit .x-btn-focus .x-btn-mr{ + background-position: -9px -24px; +} +.ext-webkit .x-btn-focus .x-btn-mc{ + background-position: 0 -2168px; +} +.ext-webkit .x-btn-focus .x-btn-bl{ + background-position: -6px -3px; +} +.ext-webkit .x-btn-focus .x-btn-br{ + background-position: -9px -3px; +} +.ext-webkit .x-btn-focus .x-btn-bc{ + background-position: 0 -18px; +} +.x-btn-click .x-btn-tl, .x-btn-menu-active .x-btn-tl, .x-btn-pressed .x-btn-tl{ + background-position: -12px 0 !important; +} +.x-btn-click .x-btn-tr, .x-btn-menu-active .x-btn-tr, .x-btn-pressed .x-btn-tr{ + background-position: -15px 0 !important; +} +.x-btn-click .x-btn-tc, .x-btn-menu-active .x-btn-tc, .x-btn-pressed .x-btn-tc{ + background-position: 0 -12px !important; +} +.x-btn-click .x-btn-ml, .x-btn-menu-active .x-btn-ml, .x-btn-pressed .x-btn-ml{ + background-position: -12px -24px !important; +} +.x-btn-click .x-btn-mr, .x-btn-menu-active .x-btn-mr, .x-btn-pressed .x-btn-mr{ + background-position: -15px -24px !important; +} +.x-btn-click .x-btn-mc, .x-btn-menu-active .x-btn-mc, .x-btn-pressed .x-btn-mc{ + background-position: 0 -3240px !important; +} +.x-btn-click .x-btn-bl, .x-btn-menu-active .x-btn-bl, .x-btn-pressed .x-btn-bl{ + background-position: -12px -3px !important; +} +.x-btn-click .x-btn-br, .x-btn-menu-active .x-btn-br, .x-btn-pressed .x-btn-br{ + background-position: -15px -3px !important; +} +.x-btn-click .x-btn-bc, .x-btn-menu-active .x-btn-bc, .x-btn-pressed .x-btn-bc{ + background-position: 0 -21px !important; +} +.x-btn-disabled *{ + cursor:default !important; +} +.x-btn-mc em.x-btn-arrow { + display:block; + background:transparent no-repeat right center; + padding-right:10px; +} +.x-btn-mc em.x-btn-split { + display:block; + background:transparent no-repeat right center; + padding-right:14px; +} +.x-btn-mc em.x-btn-arrow-bottom { + display:block; + background:transparent no-repeat center bottom; + padding-bottom:14px; +} +.x-btn-mc em.x-btn-split-bottom { + display:block; + background:transparent no-repeat center bottom; + padding-bottom:14px; +} +.x-btn-as-arrow .x-btn-mc em { + display:block; + background:transparent; + padding-bottom:14px; +} +.x-btn-group { + padding:1px; +} +.x-btn-group-header { + padding:2px; + text-align:center; +} +.x-btn-group-tc { + background: transparent repeat-x 0 0; + overflow:hidden; +} +.x-btn-group-tl { + background: transparent no-repeat 0 0; + padding-left:3px; + zoom:1; +} +.x-btn-group-tr { + background: transparent no-repeat right 0; + zoom:1; + padding-right:3px; +} +.x-btn-group-bc { + background: transparent repeat-x 0 bottom; + zoom:1; +} +.x-btn-group-bc .x-panel-footer { + zoom:1; +} +.x-btn-group-bl { + background: transparent no-repeat 0 bottom; + padding-left:3px; + zoom:1; +} +.x-btn-group-br { + background: transparent no-repeat right bottom; + padding-right:3px; + zoom:1; +} +.x-btn-group-mc { + border:0 none; + padding:1px 0 0 0; + margin:0; +} +.x-btn-group-mc .x-btn-group-body { + background:transparent; + border: 0 none; +} +.x-btn-group-ml { + background: transparent repeat-y 0 0; + padding-left:3px; + zoom:1; +} +.x-btn-group-mr { + background: transparent repeat-y right 0; + padding-right:3px; + zoom:1; +} +.x-btn-group-bc .x-btn-group-footer { + padding-bottom:6px; +} +.x-panel-nofooter .x-btn-group-bc { + height:3px; + font-size:0; + line-height:0; +} +.x-btn-group-bwrap { + overflow:hidden; + zoom:1; +} +.x-btn-group-body { + overflow:hidden; + zoom:1; +} +.x-btn-group-notitle .x-btn-group-tc { + background: transparent repeat-x 0 0; + overflow:hidden; + height:2px; +} +.x-toolbar{ + border-style:solid; + border-width:0 0 1px 0; + display: block; + padding:2px; + background:repeat-x top left; + position:relative; + left:0; + top:0; + zoom:1; + overflow:hidden; +} +.x-toolbar .x-item-disabled .x-btn-icon { + opacity: .35; + -moz-opacity: .35; + filter: alpha(opacity=35); +} +.x-toolbar td { + vertical-align:middle; +} +.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ + white-space: nowrap; +} +.x-toolbar .x-item-disabled { + cursor:default; + opacity:.6; + -moz-opacity:.6; + filter:alpha(opacity=60); +} + +.x-toolbar .x-item-disabled *{ + cursor:default; +} + +.x-toolbar .x-toolbar-cell { + vertical-align:middle; +} +.x-toolbar .x-btn-tl, .x-toolbar .x-btn-tr, .x-toolbar .x-btn-tc, .x-toolbar .x-btn-ml, .x-toolbar .x-btn-mr, +.x-toolbar .x-btn-mc, .x-toolbar .x-btn-bl, .x-toolbar .x-btn-br, .x-toolbar .x-btn-bc +{ + background-position: 500px 500px; +} +.x-toolbar .x-btn-over .x-btn-tl{ + background-position: -6px 0; +} +.x-toolbar .x-btn-over .x-btn-tr{ + background-position: -9px 0; +} +.x-toolbar .x-btn-over .x-btn-tc{ + background-position: 0 -9px; +} +.x-toolbar .x-btn-over .x-btn-ml{ + background-position: -6px -24px; +} +.x-toolbar .x-btn-over .x-btn-mr{ + background-position: -9px -24px; +} +.x-toolbar .x-btn-over .x-btn-mc{ + background-position: 0 -2168px; +} +.x-toolbar .x-btn-over .x-btn-bl{ + background-position: -6px -3px; +} +.x-toolbar .x-btn-over .x-btn-br{ + background-position: -9px -3px; +} +.x-toolbar .x-btn-over .x-btn-bc{ + background-position: 0 -18px; +} +.x-toolbar .x-btn-click .x-btn-tl, .x-toolbar .x-btn-menu-active .x-btn-tl, .x-toolbar .x-btn-pressed .x-btn-tl{ + background-position: -12px 0; +} +.x-toolbar .x-btn-click .x-btn-tr, .x-toolbar .x-btn-menu-active .x-btn-tr, .x-toolbar .x-btn-pressed .x-btn-tr{ + background-position: -15px 0; +} +.x-toolbar .x-btn-click .x-btn-tc, .x-toolbar .x-btn-menu-active .x-btn-tc, .x-toolbar .x-btn-pressed .x-btn-tc{ + background-position: 0 -12px; +} +.x-toolbar .x-btn-click .x-btn-ml, .x-toolbar .x-btn-menu-active .x-btn-ml, .x-toolbar .x-btn-pressed .x-btn-ml{ + background-position: -12px -24px; +} +.x-toolbar .x-btn-click .x-btn-mr, .x-toolbar .x-btn-menu-active .x-btn-mr, .x-toolbar .x-btn-pressed .x-btn-mr{ + background-position: -15px -24px; +} +.x-toolbar .x-btn-click .x-btn-mc, .x-toolbar .x-btn-menu-active .x-btn-mc, .x-toolbar .x-btn-pressed .x-btn-mc{ + background-position: 0 -3240px; +} +.x-toolbar .x-btn-click .x-btn-bl, .x-toolbar .x-btn-menu-active .x-btn-bl, .x-toolbar .x-btn-pressed .x-btn-bl{ + background-position: -12px -3px; +} +.x-toolbar .x-btn-click .x-btn-br, .x-toolbar .x-btn-menu-active .x-btn-br, .x-toolbar .x-btn-pressed .x-btn-br{ + background-position: -15px -3px; +} +.x-toolbar .x-btn-click .x-btn-bc, .x-toolbar .x-btn-menu-active .x-btn-bc, .x-toolbar .x-btn-pressed .x-btn-bc{ + background-position: 0 -21px; +} +.x-toolbar div.xtb-text{ + padding:2px 2px 0; + line-height:16px; + display:block; +} +.x-toolbar .xtb-sep { + background-position: center; + background-repeat: no-repeat; + display: block; + font-size: 1px; + height: 16px; + width:4px; + overflow: hidden; + cursor:default; + margin: 0 2px 0; + border:0; +} +.x-toolbar .xtb-spacer { + width:2px; +} +.x-tbar-page-number{ + width:24px; + height:14px; +} +.x-paging-info { + position:absolute; + top:5px; + right: 8px; +} +.x-toolbar-ct { + width:100%; +} +.x-panel-tbar, .x-panel-bbar, .x-window-tbar, .x-window-bbar, .x-tab-panel-tbar, .x-tab-panel-bbar, .x-plain-tbar, .x-plain-bbar { + overflow:hidden; + zoom:1; +} +.x-toolbar-more .x-btn-small .x-btn-text{ + height: 16px; + width: 12px; +} +.x-toolbar-more em.x-btn-arrow { + display:inline; + background:transparent; + padding-right:0; +} +.x-toolbar-more .x-btn-mc em.x-btn-arrow { + background-image: none; +} +div.x-toolbar-no-items { + color:gray !important; + padding:5px 10px !important; +}.x-resizable-handle { + position:absolute; + z-index:100; + font-size:1px; + line-height:6px; + overflow:hidden; + filter:alpha(opacity=0); + opacity:0; + zoom:1; +} +.x-resizable-handle-east{ + width:6px; + cursor:e-resize; + right:0; + top:0; + height:100%; +} +.ext-ie .x-resizable-handle-east { + margin-right:-1px; +} +.x-resizable-handle-south{ + width:100%; + cursor:s-resize; + left:0; + bottom:0; + height:6px; +} +.ext-ie .x-resizable-handle-south { + margin-bottom:-1px; +} +.x-resizable-handle-west{ + width:6px; + cursor:w-resize; + left:0; + top:0; + height:100%; +} +.x-resizable-handle-north{ + width:100%; + cursor:n-resize; + left:0; + top:0; + height:6px; +} +.x-resizable-handle-southeast{ + width:6px; + cursor:se-resize; + right:0; + bottom:0; + height:6px; + z-index:101; +} +.x-resizable-handle-northwest{ + width:6px; + cursor:nw-resize; + left:0; + top:0; + height:6px; + z-index:101; +} +.x-resizable-handle-northeast{ + width:6px; + cursor:ne-resize; + right:0; + top:0; + height:6px; + z-index:101; +} +.x-resizable-handle-southwest{ + width:6px; + cursor:sw-resize; + left:0; + bottom:0; + height:6px; + z-index:101; +} +.x-resizable-over .x-resizable-handle, .x-resizable-pinned .x-resizable-handle{ + filter:alpha(opacity=100); + opacity:1; +} +.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, +.x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west +{ + background-position: left; +} +.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, +.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north +{ + background-position: top; +} +.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ + background-position: top left; +} +.x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ + background-position:bottom right; +} +.x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ + background-position: bottom left; +} +.x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ + background-position: top right; +} +.x-resizable-proxy{ + border: 1px dashed; + position:absolute; + overflow:hidden; + display:none; + left:0; + top:0; + z-index:50000; +} +.x-resizable-overlay{ + width:100%; + height:100%; + display:none; + position:absolute; + left:0; + top:0; + z-index:200000; + -moz-opacity: 0; + opacity:0; + filter: alpha(opacity=0); +} +.x-grid3 { + position: relative; + overflow: hidden; +} + +.x-grid-panel { + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.x-grid-panel .x-panel-body { + overflow: hidden !important; +} + +.x-grid-panel .x-panel-mc .x-panel-body { + border: 1px solid; +} + +.x-grid3 .x-grid3-row-table, .x-grid3 .x-grid3-summary-table { + table-layout: fixed; +} + +.x-grid3-viewport { + overflow: hidden; +} + +.x-grid3-hd-row .x-grid3-hd,.x-grid3-row .x-grid3-hd,.x-grid3-summary-row .x-grid3-hd { + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.x-grid3-summary-row { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore; + outline: 0 none; +} + +.x-grid3-row td.x-grid3-cell,.x-grid3-summary-row td.x-grid3-cell { + line-height: 14px; + vertical-align: top; + padding-left: 1px; + padding-right: 1px; + -moz-outline: none; + outline: 0 none; +} + +.x-grid3-hd-row .x-grid3-hd { + line-height: 15px; + vertical-align: middle; + border-left: 1px solid; + border-right: 1px solid; +} + +.x-grid3-hd-row .x-grid3-marker-hd { + padding: 3px; +} + +.x-grid3-row .x-grid3-marker { + padding: 3px; +} + +.x-grid3-cell-inner,.x-grid3-hd-inner { + overflow: hidden; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + padding: 3px 3px 3px 5px; + white-space: nowrap; +} + +.x-grid3-hd-inner { + position: relative; + cursor: inherit; + padding: 4px 3px 4px 5px; + vertical-align: middle; +} + +.x-grid3-row-body { + white-space: normal; + font-size: 11px; +} + +.x-grid3-body-cell { + -moz-outline: 0 none; + outline: 0 none; +} + +.ext-ie .x-grid3-cell-inner,.ext-ie .x-grid3-hd-inner { + width: 100%; +} + +.ext-strict .x-grid3-cell-inner,.ext-strict .x-grid3-hd-inner { + width: auto; +} + +.x-grid-row-loading { + background: no-repeat center center; +} + +.x-grid-page { + overflow: hidden; +} + +.x-grid3-row { + cursor: default; + border: 1px solid; + width: 100%; +} + +.x-grid3-row-over { + border: 1px solid; + background: repeat-x left top; +} + +.x-grid3-resize-proxy { + width: 1px; + left: 0; + cursor: e-resize; + cursor: col-resize; + position: absolute; + top: 0; + height: 100px; + overflow: hidden; + visibility: hidden; + border: 0 none; + z-index: 7; +} + +.x-grid3-resize-marker { + width: 1px; + left: 0; + position: absolute; + top: 0; + height: 100px; + overflow: hidden; + visibility: hidden; + border: 0 none; + z-index: 7; +} + +.x-grid3-focus { + position: absolute; + left: 0; + top: 0; + width: 1px; + height: 1px; + line-height: 1px; + font-size: 1px; + -moz-outline: 0 none; + outline: 0 none; + -moz-user-select: text; + -khtml-user-select: text; + -webkit-user-select: ignore; +} + +.x-grid3-header { + background: repeat-x 0 bottom; + cursor: default; + zoom: 1; + padding: 0px 0 0 0; +} + +.x-grid3-header-pop { + border-left: 1px solid; + float: right; + clear: none; +} + +.x-grid3-header-pop-inner { + border-left: 1px solid; + width: 14px; + height: 19px; + background: transparent no-repeat center center; +} + +.ext-ie .x-grid3-header-pop-inner { + width: 15px; +} + +.ext-strict .x-grid3-header-pop-inner { + width: 14px; +} + +.x-grid3-header-inner { + overflow: hidden; + zoom: 1; + float: left; +} + +.x-grid3-header-offset { + padding-left: 1px; +} + +td.x-grid3-hd-over,td.sort-desc,td.sort-asc,td.x-grid3-hd-menu-open { + border-left: 1px solid; + border-right: 1px solid; +} + +td.x-grid3-hd-over .x-grid3-hd-inner,td.sort-desc .x-grid3-hd-inner,td.sort-asc .x-grid3-hd-inner,td.x-grid3-hd-menu-open .x-grid3-hd-inner + { + background: repeat-x left bottom; +} + +.x-grid3-sort-icon { + background-repeat: no-repeat; + display: none; + height: 4px; + width: 13px; + margin-left: 3px; + vertical-align: middle; +} + +.sort-asc .x-grid3-sort-icon,.sort-desc .x-grid3-sort-icon { + display: inline; +} + +.ext-strict .ext-ie .x-grid3-header-inner,.ext-strict .ext-ie6 .x-grid3-hd { + position: relative; +} + +.ext-strict .ext-ie6 .x-grid3-hd-inner { + position: static; +} + +.x-grid3-body { + zoom: 1; +} + +.x-grid3-scroller { + overflow: auto; + zoom: 1; + position: relative; +} + +.x-grid3-cell-text,.x-grid3-hd-text { + display: block; + padding: 3px 5px 3px 5px; +} + +.x-grid3-split { + background-position: center; + background-repeat: no-repeat; + cursor: e-resize; + cursor: col-resize; + display: block; + font-size: 1px; + height: 16px; + overflow: hidden; + position: absolute; + top: 2px; + width: 6px; + z-index: 3; +} + +.x-dd-drag-proxy .x-grid3-hd-inner { + background: repeat-x left bottom; + width: 120px; + padding: 3px; + border: 1px solid; + overflow: hidden; +} + +.col-move-top,.col-move-bottom { + width: 9px; + height: 9px; + position: absolute; + top: 0; + line-height: 1px; + font-size: 1px; + overflow: hidden; + visibility: hidden; + z-index: 20000; + background: transparent no-repeat left top; +} + +.x-grid3-row-selected { + border: 1px dotted; +} + +.x-grid3-locked td.x-grid3-row-marker,.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker { + background: repeat-x 0 bottom !important; + vertical-align: middle !important; + padding: 0; + border-top: 1px solid; + border-bottom: none !important; + border-right: 1px solid !important; + text-align: center; +} + +.x-grid3-locked td.x-grid3-row-marker div,.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div { + padding: 0 4px; + text-align: center; +} + +.x-grid3-dirty-cell { + background: transparent no-repeat 0 0; +} + +.x-grid3-invalid-cell { + background: repeat-x bottom; +} + +.x-grid3-topbar,.x-grid3-bottombar { + overflow: hidden; + display: none; + zoom: 1; + position: relative; +} + +.x-grid3-topbar .x-toolbar { + border-right: 0 none; +} + +.x-grid3-bottombar .x-toolbar { + border-right: 0 none; + border-bottom: 0 none; + border-top: 1px solid; +} + +.x-props-grid .x-grid3-cell { + padding: 1px; +} + +.x-props-grid .x-grid3-td-name .x-grid3-cell-inner { + background: transparent repeat-y -16px !important; + padding-left: 12px; +} + +.x-props-grid .x-grid3-body .x-grid3-td-name { + padding: 1px; + padding-right: 0; + border: 0 none; + border-right: 1px solid; +} + +.x-grid3-col-dd { + border: 0 none; + padding: 0; + background: transparent; +} + +.x-dd-drag-ghost .x-grid3-dd-wrap { + padding: 1px 3px 3px 1px; +} + +.x-grid3-hd { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore; +} + +.x-grid3-hd-btn { + display: none; + position: absolute; + width: 14px; + background: no-repeat left center; + right: 0; + top: 0; + z-index: 2; + cursor: pointer; + outline: none; +} + +.x-grid3-hd-over .x-grid3-hd-btn,.x-grid3-hd-menu-open .x-grid3-hd-btn { + display: block; +} + +a.x-grid3-hd-btn:hover { + background-position: -14px center; +} + +.x-grid3-body .x-grid3-td-expander { + background: transparent repeat-y right; +} + +.x-grid3-body .x-grid3-td-expander .x-grid3-cell-inner { + padding: 0 !important; + height: 100%; +} + +.x-grid3-row-expander { + width: 100%; + height: 18px; + background-position: 4px 2px; + background-repeat: no-repeat; + background-color: transparent; +} + +.x-grid3-row-collapsed .x-grid3-row-expander { + background-position: 4px 2px; +} + +.x-grid3-row-expanded .x-grid3-row-expander { + background-position: -21px 2px; +} + +.x-grid3-row-collapsed .x-grid3-row-body { + display: none !important; +} + +.x-grid3-row-expanded .x-grid3-row-body { + display: block !important; +} + +.x-grid3-body .x-grid3-td-checker { + background: transparent repeat-y right; +} + +.x-grid3-body .x-grid3-td-checker .x-grid3-cell-inner,.x-grid3-header .x-grid3-td-checker .x-grid3-hd-inner { + padding: 0 !important; + height: 100%; +} + +.x-grid3-group-checker { + float: left; +} + +.x-grid3-row-checker,.x-grid3-hd-checker { + width: 100%; + height: 18px; + background-position: 2px 2px; + background-repeat: no-repeat; + background-color: transparent; +} + +.x-grid3-hd-checker { + padding-bottom: 0px !important; +} + +.x-grid3-row .x-grid3-row-checker { + background-position: 2px 2px; +} + +.x-grid3-row-selected .x-grid3-row-checker,.x-grid3-hd-checker-on .x-grid3-hd-checker,.x-grid3-row-checked .x-grid3-row-checker + { + background-position: -23px 2px; +} + +.x-grid3-hd-checker { + background-position: 2px 3px; +} + +.x-grid3-hd-checker-on .x-grid3-hd-checker { + background-position: -23px 3px; +} + +.x-grid3-body .x-grid3-td-numberer { + background: transparent repeat-y right; +} + +.x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { + padding: 3px 5px 0 0 !important; + text-align: right; +} + +.x-grid3-body .x-grid3-td-row-icon { + background: transparent repeat-y right; + vertical-align: top; + text-align: center; +} + +.x-grid3-body .x-grid3-td-row-icon .x-grid3-cell-inner { + padding: 0 !important; + background-position: center center; + background-repeat: no-repeat; + width: 16px; + height: 16px; + margin-left: 2px; + margin-top: 3px; +} + +.x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer,.x-grid3-body .x-grid3-row-selected .x-grid3-td-checker,.x-grid3-body .x-grid3-row-selected .x-grid3-td-expander + { + background: transparent repeat-y right; +} + +.x-grid3-body .x-grid3-check-col-td .x-grid3-cell-inner { + padding: 1px 0 0 0 !important; +} + +.x-grid3-check-col { + width: 100%; + height: 16px; + background-position: center center; + background-repeat: no-repeat; + background-color: transparent; +} + +.x-grid3-check-col-on { + width: 100%; + height: 16px; + background-position: center center; + background-repeat: no-repeat; + background-color: transparent; +} + +.x-grid-group,.x-grid-group-body,.x-grid-group-hd { + zoom: 1; +} + +.x-grid-group-hd { + border-bottom: 2px solid; + cursor: pointer; + padding-top: 6px; +} + +.x-grid-group-hd .x-grid-group-div { + background: transparent no-repeat 3px -47px; + padding: 4px 4px 4px 17px; +} + +.x-grid-group-collapsed .x-grid-group-hd .x-grid-group-div { + background-position: 3px 3px; +} + +.x-grid-group-collapsed .x-grid-group-body { + display: none; +} + +.x-grid-empty { + padding: 10px; +} + +.ext-ie7 .x-grid-panel .x-panel-bbar { + position: relative; +} + +.x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { + padding-right: 0; + border-right: 1px solid; +} + +.ext-ie6 .x-grid3-header { + position: relative; +} + +.x-grid3-check-col-disabled { + width: 100%; + height: 16px; + background-position: center center; + background-repeat: no-repeat; +} + +.x-row-editor-header { + height: 2px; + overflow: hidden; +} + +.x-row-editor-footer { + height: 2px; + overflow: hidden; +} + +.ext-ie .x-row-editor-footer { + margin-top: -1px; +} + +.x-row-editor-body { + overflow: hidden; + zoom: 1; + padding-top: 2px; +} + +.x-row-editor .x-btns { + position: absolute; + top: 28px; + left: 20px; + padding-left: 5px; +} + +.x-row-editor .x-btns .x-plain-bwrap { + padding-right: 5px; +} + +.x-row-editor .x-btns .x-plain-body { + height: 31px; +} + +.x-row-editor .x-btns .x-table-layout-cell { + padding: 3px; +} + +.x-grid3-footer { + background: #f7f7f7 none repeat scroll 0 0; + border-top: 1px solid #DDDDDD; + border-bottom: 1px solid #DDDDDD; + display: block; + overflow: hidden; + position: relative; +} + +.x-grid3-footer-row { + border: 1px solid #EEEEEE; + background-color: #f7f7f7; + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore; + cursor: default; +} + +.x-grid3-footer-row td { + line-height: 13px; + vertical-align: top; + padding-left: 1px; + padding-right: 1px; + font: normal 11px arial, tahoma, helvetica, sans-serif; +} + +.ext-ie6 .x-grid3 .x-editor .x-form-text,.ext-ie7 .x-grid3 .x-editor .x-form-text { + top: -1px; +} + +.ext-ie8-compatibility .x-grid3 .x-editor .x-form-text { + top: 0; +} + +.x-grid-panel .x-livegrid-scroller { + z-index: 1; + position: absolute; + right: 0px; + width: 18px; + overflow-y: scroll; + overflow-x: hidden; +} + +.x-grid3-group-checker div { + width: 14px; + height: 18px; + background-position: -1 -2px; + background-repeat: no-repeat; + background-color: transparent; +} + +.x-grid-group-hd .x-grid3-group-check { + background-image: url(../images/default/menu/checked.gif); +} + +.x-grid-group-hd .x-grid3-group-uncheck { + background-image: url(../images/default/menu/unchecked.gif); +} + +.x-grid3-hd-row .x-filtered-column { + font-style: italic !important; + font-weight: bold !important; +} + +.ext-strict .ext-gecko .x-inline-editor .x-small-editor .x-form-text { + height: 18px !important; +} +.x-dd-drag-proxy{ + position:absolute; + left:0; + top:0; + visibility:hidden; + z-index:15000; +} +.x-dd-drag-ghost{ + -moz-opacity: 0.85; + opacity:.85; + filter: alpha(opacity=85); + border: 1px solid; + padding:3px; + padding-left:20px; + white-space:nowrap; +} +.x-dd-drag-repair .x-dd-drag-ghost{ + -moz-opacity: 0.4; + opacity:.4; + filter: alpha(opacity=40); + border:0 none; + padding:0; + background-color:transparent; +} +.x-dd-drag-repair .x-dd-drop-icon{ + visibility:hidden; +} +.x-dd-drop-icon{ + position:absolute; + top:3px; + left:3px; + display:block; + width:16px; + height:16px; + background-color:transparent; + background-position: center; + background-repeat: no-repeat; + z-index:1; +} +.x-view-selector { + position:absolute; + left:0; + top:0; + width:0; + border:1px dotted; + opacity: .5; + -moz-opacity: .5; + filter:alpha(opacity=50); + zoom:1; +} + +.x-dd-cursor { + cursor: default !important; +} + +.x-insert-bar { + position: absolute; + + z-index: 99999; +} + +.x-insert-bar td { + line-height: 1px; + font-size: 1px; +} + +.x-insert-left { + background: url(../images/gxt/dd/insert-bg.gif) no-repeat; +} + +.x-insert-mid { + background: url(../images/gxt/dd/insert-bg.gif) repeat-x 0 -12px; +} + +.x-insert-right { + background: url(../images/gxt/dd/insert-bg.gif) no-repeat 0px -6px; +} +.tree-folder { + background: url(../images/gxt/icons/folder-closed.gif) no-repeat center + left !important; +} + +.tree-folder-open { + background: url(../images/gxt/icons/folder.gif) no-repeat center left + !important; +} + +.my-tree { + cursor: default; + font-size: 11px; + -moz-outline: none; + -moz-user-focus: none; +} + +.my-root-item { + padding: 4px; +} + +.my-tree-item,.my-tree-item table,.my-tree-item table td { + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; + font-size: 11px; +} + +.my-tree-item td { + height: 19px; +} + +.my-tree-indent { + line-height: 1px; + font-size: 1px; +} + +.my-tree-joint div { + width: 15px; + height: 19px; + line-height: 1px; + font-size: 1px; +} + +.my-tree-left,.my-tree-left div,.my-tree-right { + line-height: 1px; + font-size: 1px; + width: 3px; +} + +.my-tree-left div,.my-tree-right div { + width: 3px; +} + +.my-tree-item,.my-treeitem-wrap { + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-tree-check div { + width: 17px; + height: 17px; + line-height: 1px; + font-size: 1px; +} + +.my-tree-icon div { + width: 16px; + height: 17px; + cursor: pointer; + background-repeat: no-repeat; + background-position: center; +} + +.my-tree-item-text span { + font-family: arial, tahoma, helvetica, sans-serif; + font-size: 12px; + white-space: nowrap; + padding-left: 3px; + padding-right: 3px; + display: block; + height: 15px; + cursor: pointer; +} + +.my-tree-over .my-tree-left { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat left + -57px; +} + +.my-tree-over .my-tree-right { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat right + -76px; +} + +.my-tree-over .my-tree-check,.my-tree-over .my-tree-icon,.my-tree-over .my-tree-item-text + { + background: url(../images/gxt/shared/select-19-bg.gif) left -95px; +} + +.my-tree-sel .my-tree-left { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat left + 0px; +} + +.my-tree-sel .my-tree-right { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat right + -19px; +} + +.my-tree-sel .my-tree-check,.my-tree-sel .my-tree-icon,.my-tree-sel .my-tree-item-text + { + background: url(../images/gxt/shared/select-19-bg.gif) left -38px; +} + +.my-tree-drop .my-tree-left { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat left + -115px; +} + +.my-tree-drop .my-tree-right { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat right + -133px; +} + +.my-tree-drop .my-tree-check,.my-tree-drop .my-tree-icon,.my-tree-drop .my-tree-item-text + { + background: url(../images/gxt/shared/select-19-bg.gif) left -152px; +} + +.my-tree-close { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px + 1px; +} + +.my-tree-open { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px + -32px; +} + +.my-tree-joint-over .my-tree-open { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px + -48px; +} + +.my-tree-joint-over .my-tree-close { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px + -15px; +} + +.my-tree-notchecked { + background: url(../images/gxt/tree/notchecked.gif) no-repeat 0px 50%; +} + +.my-tree-checked { + background: url(../images/gxt/tree/checked.gif) no-repeat 0px 50%; +} + +.my-tree-loading .tree-folder { + background: url(../images/gxt/icons/wait.gif) no-repeat 0px -1px + !important; +} + +.my-tree-loading .my-tree-item-text span { + font-style: italic; +} + +.x-ftree-selected .x-ftree-text { + background-color: #d9e8fb; +} + +.x-ftree-node-over .x-ftree-text { + background-color: #eee; +} + +.x-ftree-item { + line-height: 18px; +} + +.x-ftree-joint,.x-ftree-icon { + border: 0 none; + height: 18px; + margin: 0; + padding: 0; + vertical-align: top; + width: 16px; + background-position: center; + background-repeat: no-repeat; +} + +.x-ftree-text { + color: black; + font: normal 11px arial, tahoma, helvetica, sans-serif; + white-space: nowrap; + text-decoration: none; + color: black; + padding-left: 4px; + vertical-align: middle; + line-height: 18px; + padding: 2px 4px 4px 4px; +} + +/* some default icons for leaf/folder */ +.x-ftree-expanded .x-ftree-icon { + background-image: url(../images/default/tree/folder-open.gif); +} + +.x-ftree-leaf .x-ftree-icon { + background-image: url(../images/default/tree/leaf.gif); +} + +.x-ftree-collapsed .x-ftree-icon { + background-image: url(../images/gxt/icons/folder-closed.gif); +} + +/* Arrows */ +.x-ftree-arrows .x-ftree-joint { + background: transparent; +} + +.x-ftree-arrows .x-ftree-joint-plus { + background: transparent url(../images/default/tree/arrows.gif) no-repeat + 0 0; +} + +.x-ftree-arrows .x-ftree-joint-minus { + background: transparent url(../images/default/tree/arrows.gif) no-repeat + -16px 0; +} + +.x-ftree-arrows .x-ftree-ec-over .x-ftree-joint-plus { + background-position: -32px 0; +} + +.x-ftree-arrows .x-ftree-ec-over .x-ftree-joint-minus { + background-position: -48px 0; +} + +.x-ftree2-highlightrow { + border: 1px dotted #545352; +} + +.x-ftree2-selected { + background-color: #d9e8fb !important; +} + +.x-ftree2-node-over { + background-color: #eee; +} + +.x-ftree2-node-drop { + background-color: #defadc; +} + +.x-ftree2-joint,.x-ftree2-icon { + border: 0 none; + height: 18px; + margin: 0; + padding: 0; + vertical-align: top; + width: 16px; + background-position: center; + background-repeat: no-repeat; +} + +.x-ftree2-joint div { + width: 16px; +} + +.x-ftree2-el-ct { + display: none; +} + +.x-ftree2-node { + padding-bottom: 1px; +} + +.x-ftree2-text { + vertical-align: middle !important; + white-space: nowrap !important; +} + +.x-ftree2-text span { + color: black; + font: normal 11px arial, tahoma, helvetica, sans-serif; + white-space: nowrap; + text-decoration: none; + color: black; + padding: 2px 4px 2px 1px; + display: block; +} + +.ext-ie .x-ftree2-text span { + padding-left: 3px; +} + +.x-ftree2-check { + width: 17px; +} + +.x-ftree2-check div { + width: 17px; + height: 17px; +} + +/* some default icons for leaf/folder */ +.x-ftree2-expanded .x-ftree2-icon { + background-image: url(../images/default/tree/folder-open.gif); +} + +.x-ftree2-leaf .x-ftree2-icon { + background-image: url(../images/default/tree/leaf.gif); +} + +.x-ftree2-collapsed .x-ftree2-icon { + background-image: url(../images/gxt/icons/folder-closed.gif); +} + +/* Arrows */ +.x-ftree2-arrows .x-ftree2-joint { + background: transparent; +} + +.x-ftree2-arrows .x-ftree2-joint-plus { + background: transparent url(../images/default/tree/arrows.gif) no-repeat + 0 0; +} + +.x-ftree2-arrows .x-ftree2-joint-minus { + background: transparent url(../images/default/tree/arrows.gif) no-repeat + -16px 0; +} + +.x-ftree2-arrows .x-ftree2-ec-over .x-ftree2-joint-plus { + background-position: -32px 0; +} + +.x-ftree2-arrows .x-ftree2-ec-over .x-ftree2-joint-minus { + background-position: -48px 0; +} + +.x-treegrid { + -moz-outline: none; + -moz-user-focus: none; + outline: 0 none; +} + +.x-treegrid .x-treegrid-column .x-grid3-cell-inner { + padding: 0px !important; +} + +.x-tree3 { + cursor: default; + -moz-outline: none; + -moz-user-focus: none; + outline: 0 none; +} + +.ext-strict .ext-gecko .x-tree3, .ext-strict .ext-webkit .x-tree3 { + padding-bottom: 1px; +} + +.x-tree3-node { + cursor: default; +} + +.x-tree3-el { + white-space: nowrap; + height: 21px; + position: relative; +} + +.x-tree3-node-text { + white-space: nowrap; + line-height: 11px; + text-decoration: none; + padding: 0 0 0 3px; + position: relative; + top: -4px; +} + +.x-tree3-node-ct { + display: none; +} + +.x-tree3-node-text-widget { + position: static !important; + padding: 0px !important; +}.x-date-picker { + border: 1px solid; + border-top:0 none; + position:relative; + -moz-outline:0 none; + outline:0 none; +} +.x-date-picker a { + -moz-outline:0 none; + outline:0 none; +} +.x-date-inner, .x-date-inner td, .x-date-inner th{ + border-collapse:separate; +} +.x-date-middle,.x-date-left,.x-date-right { + background: repeat-x 0 -83px; + overflow:hidden; +} +.x-date-middle .x-btn-tc,.x-date-middle .x-btn-tl,.x-date-middle .x-btn-tr, +.x-date-middle .x-btn-mc,.x-date-middle .x-btn-ml,.x-date-middle .x-btn-mr, +.x-date-middle .x-btn-bc,.x-date-middle .x-btn-bl,.x-date-middle .x-btn-br{ + background:transparent !important; + vertical-align:middle; +} +.x-date-middle .x-btn-mc em.x-btn-arrow { + background:transparent no-repeat right 0; +} +.x-date-right, .x-date-left { + width:18px; +} +.x-date-right{ + text-align:right; +} +.x-date-middle { + padding-top:2px; + padding-bottom:2px; + width:130px; +} +.x-date-right a, .x-date-left a{ + display:block; + width:16px; + height:16px; + background-position: center; + background-repeat: no-repeat; + cursor:pointer; + -moz-opacity: 0.6; + opacity:.6; + filter: alpha(opacity=60); +} +.x-date-right a:hover, .x-date-left a:hover{ + -moz-opacity: 1; + opacity:1; + filter: alpha(opacity=100); +} +.x-date-right a { + margin-right:2px; + text-decoration:none !important; +} +.x-date-left a{ + margin-left:2px; + text-decoration:none !important; +} +table.x-date-inner { + width:100%; + table-layout:fixed; +} +.x-date-inner th { + width:25px; +} +.x-date-inner th { + background: repeat-x left top; + text-align:right !important; + border-bottom: 1px solid; + cursor:default; + padding:0; + border-collapse:separate; +} +.x-date-inner th span { + display:block; + padding:2px; + padding-right:7px; +} +.x-date-inner td { + border: 1px solid; + text-align:right; + padding:0; +} +.x-date-inner a { + padding:2px 5px; + display:block; + text-decoration:none; + text-align:right; + zoom:1; +} +.x-date-inner .x-date-active{ + cursor:pointer; + color:black; +} +.x-date-inner .x-date-selected a{ + background: repeat-x left top; + border:1px solid; + padding:1px 4px; +} +.x-date-inner .x-date-today a{ + border: 1px solid; + padding:1px 4px; +} +.x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { + text-decoration:none !important; +} +.x-date-bottom { + padding:4px; + border-top: 1px solid; + background: repeat-x left top; +} +.x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ + text-decoration:none !important; +} +.x-date-inner .x-date-disabled a { + cursor:default; +} +.x-date-mmenu .x-menu-item { + padding:1px 24px 1px 4px; + white-space: nowrap; +} +.x-date-mmenu .x-menu-item .x-menu-item-icon { + width:10px; + height:10px; + margin-right:5px; + background-position:center -4px !important; +} +.x-date-mp { + position:absolute; + left:0; + top:0; + display:none; +} +.x-date-mp td { + padding:2px; + font:normal 11px arial, helvetica,tahoma,sans-serif; +} +td.x-date-mp-month,td.x-date-mp-year,td.x-date-mp-ybtn { + border: 0 none; + text-align:center; + vertical-align: middle; + width:25%; +} +.x-date-mp-ok { + margin-right:3px; +} +.x-date-mp-btns button { + text-decoration:none; + text-align:center; + text-decoration:none !important; + border:1px solid; + padding:1px 3px 1px; + cursor:pointer; +} +.x-date-mp-btns { + background: repeat-x left top; +} +.x-date-mp-btns td { + border-top: 1px solid; + text-align:center; +} +td.x-date-mp-month a,td.x-date-mp-year a { + display:block; + padding:2px 4px; + text-decoration:none; + text-align:center; +} +td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { + text-decoration:none; + cursor:pointer; +} +td.x-date-mp-sel a { + padding:1px 3px; + background: repeat-x left top; + border:1px solid; +} +.x-date-mp-ybtn a { + overflow:hidden; + width:15px; + height:15px; + cursor:pointer; + background:transparent no-repeat; + display:block; + margin:0 auto; +} +.x-date-mp-ybtn a.x-date-mp-next { + background-position:0 -120px; +} +.x-date-mp-ybtn a.x-date-mp-next:hover { + background-position:-15px -120px; +} +.x-date-mp-ybtn a.x-date-mp-prev { + background-position:0 -105px; +} +.x-date-mp-ybtn a.x-date-mp-prev:hover { + background-position:-15px -105px; +} +.x-date-mp-ybtn { + text-align:center; +} +td.x-date-mp-sep { + border-right:1px solid; +} + +.x-date-picker, .x-date-picker a { + font-size: 11px; +} + +.x-date-right-icon { + background-image: url(../images/default/shared/right-btn.gif); + margin-right: 2px; + text-decoration: none !important; +} + +.x-date-left-icon { + background-image: url(../images/default/shared/left-btn.gif); + margin-left: 4px; + text-decoration: none !important; +} + +.x-date-days { + table-layout: fixed; + width: 100%; +} + +.x-date-days td { + width: 25px; + border: none; +} + +.x-date-days td span { + display: block; + padding: 2px 7px 2px 2px; +} + +.x-date-days td { + background: #DFECFB url(../images/default/shared/glass-bg.gif) repeat-x scroll left top; + border-bottom: 1px solid #A3BAD9; + border-collapse: separate; + color: #233D6D; + cursor: default; + font-family: arial, helvetica, tahoma, sans-serif; + font-size: 10px; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: normal; + padding: 0pt; + text-align: right !important; +} + +.x-date-picker .x-date-header { + background: url(../images/default/shared/hd-sprite.gif) repeat-x 0 -83px; + height: 22px; + left: 10px; + top: 10px; + width: 157px; +} + +.x-date-header .x-btn .x-btn-text { + color: #fff; +} + +.x-date-picker-footer { + width: 100%; +} + +.x-date-picker-footer td { + text-align: center; +} + +.x-date-left { + background: transparent url(../images/default/shared/hd-sprite.gif) repeat-x scroll 0pt -83px; + color: #FFFFFF; + font-family: "sans serif", tahoma, verdana, helvetica; + font-size: 11px; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: bold; + line-height: normal; + overflow: hidden; +} + +.x-date-inner .x-date-active-hover { + background: #ddecfe !important; +}.x-tip{ + position: absolute; + top: 0; + left:0; + visibility: hidden; + z-index: 20000; + border:0 none; +} +.x-tip .x-tip-close{ + height: 15px; + float:right; + width: 15px; + margin:0 0 2px 2px; + cursor:pointer; + display:none; +} +.x-tip .x-tip-tc { + background: transparent no-repeat 0 -62px; + padding-top:3px; + overflow:hidden; + zoom:1; +} +.x-tip .x-tip-tl { + background: transparent no-repeat 0 0; + padding-left:6px; + overflow:hidden; + zoom:1; +} +.x-tip .x-tip-tr { + background: transparent no-repeat right 0; + padding-right:6px; + overflow:hidden; + zoom:1; +} +.x-tip .x-tip-bc { + background: transparent no-repeat 0 -121px; + height:3px; + overflow:hidden; +} +.x-tip .x-tip-bl { + background: transparent no-repeat 0 -59px; + padding-left:6px; + zoom:1; +} +.x-tip .x-tip-br { + background: transparent no-repeat right -59px; + padding-right:6px; + zoom:1; +} +.x-tip .x-tip-mc { + border:0 none; +} +.x-tip .x-tip-ml { + background: no-repeat 0 -124px; + padding-left:6px; + zoom:1; +} +.x-tip .x-tip-mr { + background: transparent no-repeat right -124px; + padding-right:6px; + zoom:1; +} +.ext-ie .x-tip .x-tip-header,.ext-ie .x-tip .x-tip-tc { + font-size:0; + line-height:0; +} +.ext-border-box .x-tip .x-tip-header,.ext-border-box .ext-ie .x-tip .x-tip-tc { + line-height:1px; +} +.x-tip .x-tip-header-text { + padding:0; + margin:0 0 2px 0; +} +.x-tip .x-tip-body { + margin:0 !important; + line-height:14px; + padding:0; +} +.x-tip .x-tip-body .loading-indicator { + margin:0; +} +.x-tip-draggable .x-tip-header,.x-tip-draggable .x-tip-header-text { + cursor:move; +} +.x-form-invalid-tip .x-tip-tc { + background: repeat-x 0 -12px; + padding-top:6px; +} +.x-form-invalid-tip .x-tip-bc { + background: repeat-x 0 -18px; + height:6px; +} +.x-form-invalid-tip .x-tip-bl { + background: no-repeat 0 -6px; +} +.x-form-invalid-tip .x-tip-br { + background: no-repeat right -6px; +} +.x-form-invalid-tip .x-tip-body { + padding:2px; +} +.x-form-invalid-tip .x-tip-body { + padding-left:24px; + background:transparent no-repeat 2px 2px; +} +.x-tip-anchor { + position: absolute; + width: 9px; + height: 10px; + overflow:hidden; + background: transparent no-repeat 0 0; + zoom:1; +} +.x-tip-anchor-bottom { + background-position: -9px 0; +} +.x-tip-anchor-right { + background-position: -18px 0; + width: 10px; +} +.x-tip-anchor-left { + background-position: -28px 0; + width: 10px; +} +.x-menu { + border: 1px solid; + z-index: 15000; + zoom: 1; + background: repeat-y; + -moz-outline: none; + outline: 0 none; +} + +.x-menu a { + text-decoration: none !important; +} + +.ext-ie .x-menu { + zoom: 1; + overflow: hidden; +} + +.x-menu-list { + padding: 2px; + background: transparent; + border: 0 none; + overflow: hidden; + overflow-y: hidden; +} + +.ext-strict .ext-ie .x-menu-list { + position: relative; +} + +.x-menu x-menu-sep-li { + font-size: 1px; + line-height: 1px; +} + +.x-menu-list-item { + white-space: nowrap; + display: block; + padding: 1px; +} + +.x-menu-item { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore +} + +.x-menu-item-arrow { + background: transparent no-repeat right; +} + +.x-menu-sep { + display: block; + font-size: 1px; + line-height: 1px; + margin: 2px 3px; + border-bottom: 1px solid; + overflow: hidden; +} + +.x-menu-focus { + position: absolute; + left: -1px; + top: -1px; + width: 1px; + height: 1px; + line-height: 1px; + font-size: 1px; + -moz-outline: 0 none; + outline: 0 none; + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore + overflow: hidden; + display: block; +} + +a.x-menu-item { + cursor: pointer; + display: block; + line-height: 16px; + outline-color: -moz-use-text-color; + outline-style: none; + outline-width: 0; + padding: 3px 21px 3px 27px; + position: relative; + text-decoration: none; + white-space: nowrap; +} + +.x-menu-item-active { + border-style: solid; + border-width: 1px; + padding: 0; +} + +.x-menu-item-icon { + border: 0 none; + height: 16px; + padding: 0; + vertical-align: top; + width: 16px; + position: absolute; + left: 3px; + top: 3px; + margin: 0; + background-position: center; +} + +.ext-ie .x-menu-item-icon { + left: -24px; +} + +.ext-strict .x-menu-item-icon { + left: 3px; +} + +.ext-ie6 .x-menu-item-icon { + left: -24px; +} + +.ext-ie .x-menu-item-icon { + vertical-align: middle; +} + +.x-date-menu .x-menu-list { + padding: 0; +} + +.x-menu-date-item { + padding: 0; +} + +.x-menu .x-color-palette,.x-menu .x-date-picker { + margin-left: 26px; + margin-right: 4px; +} + +.x-menu .x-date-picker { + border: 1px solid; + margin-top: 2px; + margin-bottom: 2px; +} + +.x-menu-plain .x-color-palette,.x-menu-plain .x-date-picker { + margin: 0; + border: 0 none; +} + +.x-date-menu { + padding: 0 !important; +} + +.x-cycle-menu .x-menu-item-checked { + border: 1px dotted !important; + padding: 0; +} + +.x-menu .x-menu-scroller { + width: 100%; + background-repeat: no-repeat; + background-position: center; + height: 8px; + line-height: 8px; + cursor: pointer; + margin: 0; + padding: 0; +} + +.x-menu .x-menu-scroller-active { + height: 6px; + line-height: 6px; +} + +.x-menu-list-item-indent { + padding-left: 27px !important; +} + +.x-menu-text { + + border-style: solid; + background: #D6E3F2; + border-color:#DAE6F4 #99bbe8 #99bbe8 #DAE6F4; + border-width: 1px; + margin:-2px -2px 0; + color:#15428b; + font:bold 10px tahoma,arial,verdana,sans-serif; + display:block; + padding:3px; +} + +.x-menubar { + padding: 3px; + border-style: solid; + border-width: 0 0 1px 0; + cursor: default; + border-color: #a9bfd3; + background-color: #d0def0; + padding: 3px; + background-image: url(../images/default/toolbar/bg.gif); +} + +.x-menubar-item { + padding: 1px 8px; + font: 12px arial, verdana, sans-serif; +} + +.x-menubar-item-over { + background-color: #98c5f5; +} + +.x-menubar-item-active { + background-color: #98c5f5; +}.x-box-tl { + background: transparent no-repeat 0 0; + zoom:1; +} +.x-box-tc { + height: 8px; + background: transparent repeat-x 0 0; + overflow: hidden; +} +.x-box-tr { + background: transparent no-repeat right -8px; +} +.x-box-ml { + background: transparent repeat-y 0; + padding-left: 4px; + overflow: hidden; + zoom:1; +} +.x-box-mc { + background: repeat-x 0 -16px; + padding: 4px 10px; +} +.x-box-mc h3 { + margin: 0 0 4px 0; + zoom:1; +} +.x-box-mr { + background: transparent repeat-y right; + padding-right: 4px; + overflow: hidden; +} +.x-box-bl { + background: transparent no-repeat 0 -16px; + zoom:1; +} +.x-box-bc { + background: transparent repeat-x 0 -8px; + height: 8px; + overflow: hidden; +} +.x-box-br { + background: transparent no-repeat right -24px; +} +.x-box-tl, .x-box-bl { + padding-left: 8px; + overflow: hidden; +} +.x-box-tr, .x-box-br { + padding-right: 8px; + overflow: hidden; +} +.x-combo-list { + border:1px solid; + zoom:1; + overflow:hidden; + position: absolute; +} +.x-combo-list-inner { + overflow:auto; + position:relative; + zoom:1; + overflow-x:hidden; +} +.x-combo-list-hd { + border-bottom:1px solid; + padding:3px; +} +.x-resizable-pinned .x-combo-list-inner { + border-bottom:1px solid; +} +.x-combo-list-item { + padding:2px; + border:1px solid; + white-space: nowrap; + overflow:hidden; + text-overflow: ellipsis; +} +.x-combo-list .x-combo-selected{ + border:1px dotted !important; + cursor:pointer; +} +.x-combo-list .x-toolbar { + border-top:1px solid; + border-bottom:0 none; +} +.x-panel { + border-style: solid; + border-width:0; + outline: 0 none; +} +.x-panel-header { + overflow:hidden; + zoom:1; + padding:5px 3px 4px 5px; + border:1px solid; + line-height: 15px; + background: transparent repeat-x 0 -1px; +} +.x-panel-body { + border:1px solid; + border-top:0 none; + overflow:hidden; + position: relative; +} +.x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { + border:1px solid; + border-top:0 none; + overflow:hidden; + padding:2px; +} +.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { + border-top:1px solid; + border-bottom: 0 none; +} +.x-panel-body-noheader, .x-panel-mc .x-panel-body { + border-top:1px solid; +} +.x-panel-header { + overflow:hidden; + zoom:1; +} +.x-panel-tl .x-panel-header { + padding:5px 0 4px 0; + border:0 none; + background:transparent; + line-height: 15px; +} +.x-panel-tl .x-panel-icon, .x-window-tl .x-panel-icon { + padding-left:20px !important; + background-repeat:no-repeat; + background-position:0 4px; + zoom:1; +} +.x-panel-inline-icon { + width:16px; + height:16px; + background-repeat:no-repeat; + background-position:0 0; + vertical-align:middle; + margin-right:4px; + margin-top:-1px; + margin-bottom:-1px; +} +.x-panel-tc { + background: transparent repeat-x 0 0; + overflow:hidden; +} +.ext-strict .ext-ie7 .x-panel-tc { + overflow: visible; +} +.x-panel-tl { + background: transparent no-repeat 0 0; + padding-left:6px; + zoom:1; + border-bottom:1px solid; +} +.x-panel-tr { + background: transparent no-repeat right 0; + zoom:1; + padding-right:6px; +} +.x-panel-bc { + background: transparent repeat-x 0 bottom; + zoom:1; +} +.x-panel-bc .x-panel-footer { + zoom:1; +} +.x-panel-bl { + background: transparent no-repeat 0 bottom; + padding-left:6px; + zoom:1; +} +.x-panel-br { + background: transparent no-repeat right bottom; + padding-right:6px; + zoom:1; +} +.x-panel-mc { + border:0 none; + padding:0; + margin:0; + padding-top:6px; +} +.x-panel-mc .x-panel-body { + background:transparent; + border: 0 none; +} +.x-panel-ml { + background: repeat-y 0 0; + padding-left:6px; + zoom:1; +} +.x-panel-mr { + background: transparent repeat-y right 0; + padding-right:6px; + zoom:1; +} +.x-panel-bc .x-panel-footer { + padding-bottom:6px; +} +.x-panel-nofooter .x-panel-bc, .x-panel-nofooter .x-window-bc { + height:6px; + font-size:0; + line-height:0; +} +.x-panel-bwrap { + overflow:hidden; + zoom:1; + left:0; + top:0; +} +.x-panel-body { + overflow:hidden; + zoom:1; +} +.x-panel-collapsed .x-resizable-handle{ + display:none; +} +.ext-gecko .x-panel-animated * { + overflow:hidden !important; +} +.x-plain-body { + overflow:hidden; +} +.x-plain-bbar .x-toolbar { + overflow:hidden; + padding:2px; +} +.x-plain-tbar .x-toolbar { + overflow:hidden; + padding:2px; +} +.x-plain-bwrap { + overflow:hidden; + zoom:1; +} +.x-plain { + overflow:hidden; +} +.x-tool { + overflow:hidden; + width:15px; + height:15px; + float:right; + cursor:pointer; + background:transparent no-repeat; + margin-left:2px; +} +.x-tool-toggle { + background-position:0 -60px; +} +.x-tool-toggle-over { + background-position:-15px -60px; +} +.x-panel-collapsed .x-tool-toggle { + background-position:0 -75px; +} +.x-panel-collapsed .x-tool-toggle-over { + background-position:-15px -75px; +} +.x-tool-close { + background-position:0 -0; +} +.x-tool-close-over { + background-position:-15px 0; +} +.x-tool-minimize { + background-position:0 -15px; +} +.x-tool-minimize-over { + background-position:-15px -15px; +} +.x-tool-maximize { + background-position:0 -30px; +} +.x-tool-maximize-over { + background-position:-15px -30px; +} +.x-tool-restore { + background-position:0 -45px; +} +.x-tool-restore-over { + background-position:-15px -45px; +} +.x-tool-gear { + background-position:0 -90px; +} +.x-tool-gear-over { + background-position:-15px -90px; +} +.x-tool-pin { + background-position:0 -135px; +} +.x-tool-pin-over { + background-position:-15px -135px; +} +.x-tool-unpin { + background-position:0 -150px; +} +.x-tool-unpin-over { + background-position:-15px -150px; +} +.x-tool-right { + background-position:0 -165px; +} +.x-tool-right-over { + background-position:-15px -165px; +} +.x-tool-left { + background-position:0 -180px; +} +.x-tool-left-over { + background-position:-15px -180px; +} +.x-tool-up { + background-position:0 -210px; +} +.x-tool-up-over { + background-position:-15px -210px; +} +.x-tool-down { + background-position:0 -195px; +} +.x-tool-down-over { + background-position:-15px -195px; +} +.x-tool-refresh { + background-position:0 -225px; +} +.x-tool-refresh-over { + background-position:-15px -225px; +} +.x-tool-minus { + background-position:0 -255px; +} +.x-tool-minus-over { + background-position:-15px -255px; +} +.x-tool-plus { + background-position:0 -240px; +} +.x-tool-plus-over { + background-position:-15px -240px; +} +.x-tool-search { + background-position:0 -270px; +} +.x-tool-search-over { + background-position:-15px -270px; +} +.x-tool-save { + background-position:0 -285px; +} +.x-tool-save-over { + background-position:-15px -285px; +} +.x-tool-help { + background-position:0 -300px; +} +.x-tool-help-over { + background-position:-15px -300px; +} +.x-tool-print { + background-position:0 -315px; +} +.x-tool-print-over { + background-position:-15px -315px; +} +.x-panel-ghost { + z-index:12000; + overflow:hidden; + position:absolute; + left:0;top:0; + opacity:.65; + -moz-opacity:.65; + filter:alpha(opacity=65); +} +.x-panel-ghost ul { + margin:0; + padding:0; + overflow:hidden; + font-size:0; + line-height:0; + border:1px solid; + border-top:0 none; + display:block; +} +.x-panel-ghost * { + cursor:move !important; +} +.x-panel-dd-spacer { + border:2px dashed; +} +.x-panel-btns { + padding:5px; + overflow:hidden; +} +.x-panel-btns-left .x-buttonbar { + clear:none; +} +.x-panel-btns-center{ + text-align:center; +} +.x-panel-btns-center .x-toolbar-ct { + margin:0 auto; + text-align:left; + width:auto; +} +.x-panel-fbar td.x-toolbar-cell{ + padding:0px; +} +.x-panel-fbar { + display: block; + padding:2px; + position:relative; + left:0; + top:0; + zoom:1; + overflow:hidden; +} + +.x-panel-fbar .x-toolbar-cell { + vertical-align:middle; +} + +.x-panel-fbar td { + vertical-align:middle; +} +.x-panel-btns .x-btn-focus .x-btn-left{ + background-position:0 -147px; +} +.x-panel-btns .x-btn-focus .x-btn-right{ + background-position:0 -168px; +} +.x-panel-btns .x-btn-focus .x-btn-center{ + background-position:0 -189px; +} +.x-panel-btns .x-btn-over .x-btn-left{ + background-position:0 -63px; +} +.x-panel-btns .x-btn-over .x-btn-right{ + background-position:0 -84px; +} +.x-panel-btns .x-btn-over .x-btn-center{ + background-position:0 -105px; +} +.x-panel-btns .x-btn-click .x-btn-center{ + background-position:0 -126px; +} +.x-panel-btns .x-btn-click .x-btn-right{ + background-position:0 -84px; +} +.x-panel-btns .x-btn-click .x-btn-left{ + background-position:0 -63px; +} +.x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ + white-space: nowrap; +} +.x-window { + zoom:1; + -moz-outline: none; + outline: 0 none; +} +.x-window .x-resizable-handle { + opacity:0; + -moz-opacity:0; + filter:alpha(opacity=0); +} +.x-window-proxy { + border:1px solid; + z-index:12000; + overflow:hidden; + position:absolute; + left:0;top:0; + display:none; + opacity:.5; + -moz-opacity:.5; + filter:alpha(opacity=50); +} +.x-window-header { + overflow:hidden; + zoom:1; +} +.x-window-bwrap { + z-index:1; + position:relative; + zoom:1; + left:0;top:0; +} +.x-window-tl .x-window-header { + padding:5px 0 4px 0; +} +.x-window-header-text { + cursor:pointer; +} +.x-window-tc { + background: transparent repeat-x 0 0; + overflow:hidden; + zoom:1; +} +.x-window-tl { + background: transparent no-repeat 0 0; + padding-left:6px; + zoom:1; + z-index:1; + position:relative; +} +.x-window-tr { + background: transparent no-repeat right 0; + padding-right:6px; +} +.x-window-bc { + background: transparent repeat-x 0 bottom; + zoom:1; +} +.x-window-bc .x-window-footer { + padding-bottom:6px; + zoom:1; + font-size:0; + line-height:0; +} +.x-window-bl { + background: transparent no-repeat 0 bottom; + padding-left:6px; + zoom:1; +} +.x-window-br { + background: transparent no-repeat right bottom; + padding-right:6px; + zoom:1; +} +.x-window-mc { + border:1px solid; + padding:0; + margin:0; +} +.x-window-ml { + background: transparent repeat-y 0 0; + padding-left:6px; + zoom:1; +} +.x-window-mr { + background: transparent repeat-y right 0; + padding-right:6px; + zoom:1; +} +.x-window-body { + overflow:hidden; +} +.x-window-bwrap { + overflow:hidden; +} +.x-window-maximized .x-window-bl, .x-window-maximized .x-window-br, + .x-window-maximized .x-window-ml, .x-window-maximized .x-window-mr, + .x-window-maximized .x-window-tl, .x-window-maximized .x-window-tr { + padding:0; +} +.x-window-maximized .x-window-footer { + padding-bottom:0; +} +.x-window-maximized .x-window-tc { + padding-left:3px; + padding-right:3px; +} +.x-window-maximized .x-window-mc { + border-left:0 none; + border-right:0 none; +} +.x-window-tbar .x-toolbar, .x-window-bbar .x-toolbar { + border-left:0 none; + border-right: 0 none; +} +.x-window-bbar .x-toolbar { + border-top:1px solid; + border-bottom:0 none; +} +.x-window-draggable, .x-window-draggable .x-window-header-text { + cursor:move; +} +.x-window-maximized .x-window-draggable, .x-window-maximized .x-window-draggable .x-window-header-text { + cursor:default; +} +.x-window-body { + background:transparent; +} +.x-panel-ghost .x-window-tl { + border-bottom:1px solid; +} +.x-panel-collapsed .x-window-tl { + border-bottom:1px solid; +} +.x-window-maximized-ct { + overflow:hidden; +} +.x-window-sizing-ghost ul { + border:0 none !important; +} +.x-dlg-focus{ + -moz-outline:0 none; + outline:0 none; + width:0; + height:0; + overflow:hidden; + position:absolute; + top:0; + left:0; +} +.x-dlg-mask{ + z-index:10000; + display:none; + position:absolute; + top:0; + left:0; + -moz-opacity: 0.5; + opacity:.50; + filter: alpha(opacity=50); +} +body.ext-ie6.x-body-masked select { + visibility:hidden; +} +body.ext-ie6.x-body-masked .x-window select { + visibility:visible; +} +.x-window-plain .x-window-mc { + border: 1px solid; +} +.x-window-plain .x-window-body { + border: 1px solid; + background:transparent !important; +} +.x-html-editor-wrap { + border:1px solid; +} + +.x-html-editor-tb .x-btn-text { + background:transparent no-repeat; +} + +.x-html-editor-tip .x-tip-bd .x-tip-bd-inner { + padding:5px; + padding-bottom:1px; +} + +.x-html-editor-tb .x-toolbar { + position:static !important; +}.x-panel-noborder .x-panel-body-noborder { + border-width:0; +} +.x-panel-noborder .x-panel-header-noborder { + border-width:0 0 1px; + border-style:solid; +} +.x-panel-noborder .x-panel-tbar-noborder .x-toolbar { + border-width:0 0 1px; + border-style:solid; +} +.x-panel-noborder .x-panel-bbar-noborder .x-toolbar { + border-width:1px 0 0 0; + border-style:solid; +} +.x-window-noborder .x-window-mc { + border-width:0; +} +.x-window-plain .x-window-body-noborder { + border-width:0; +} +.x-tab-panel-noborder .x-tab-panel-body-noborder { + border-width:0; +} +.x-tab-panel-noborder .x-tab-panel-header-noborder { + border-width: 0 0 1px 0; +} +.x-tab-panel-noborder .x-tab-panel-footer-noborder { + border-width: 1px 0 0 0; +} +.x-tab-panel-bbar-noborder .x-toolbar { + border-width: 1px 0 0 0; + border-style:solid; +} +.x-tab-panel-tbar-noborder .x-toolbar { + border-width:0 0 1px; + border-style:solid; +} +.x-border-panel { + position:absolute !important; + left:0; + top:0; +} +.x-tool-collapse-south { + background-position:0 -195px; +} +.x-tool-collapse-south-over { + background-position:-15px -195px; +} +.x-tool-collapse-north { + background-position:0 -210px; +} +.x-tool-collapse-north-over { + background-position:-15px -210px; +} +.x-tool-collapse-west { + background-position:0 -180px; +} +.x-tool-collapse-west-over { + background-position:-15px -180px; +} +.x-tool-collapse-east { + background-position:0 -165px; +} +.x-tool-collapse-east-over { + background-position:-15px -165px; +} +.x-tool-expand-south { + background-position:0 -210px; +} +.x-tool-expand-south-over { + background-position:-15px -210px; +} +.x-tool-expand-north { + background-position:0 -195px; +} +.x-tool-expand-north-over { + background-position:-15px -195px; +} +.x-tool-expand-west { + background-position:0 -165px; +} +.x-tool-expand-west-over { + background-position:-15px -165px; +} +.x-tool-expand-east { + background-position:0 -180px; +} +.x-tool-expand-east-over { + background-position:-15px -180px; +} +.x-tool-expand-north, .x-tool-expand-south { + float:right; + margin:3px; +} +.x-tool-expand-east, .x-tool-expand-west { + float:none; + margin:3px auto; +} +.x-accordion-hd .x-tool-toggle { + background-position:0 -255px; +} +.x-accordion-hd .x-tool-toggle-over { + background-position:-15px -255px; +} +.x-panel-collapsed .x-accordion-hd .x-tool-toggle { + background-position:0 -240px; +} +.x-panel-collapsed .x-accordion-hd .x-tool-toggle-over { + background-position:-15px -240px; +} +.x-accordion-hd { + padding-top:4px; + padding-bottom:3px; + border-top:0 none; + background: transparent repeat-x 0 -9px; +} +.x-layout-collapsed{ + position:absolute; + left:-10000px; + top:-10000px; + visibility:hidden; + width:20px; + height:20px; + overflow:hidden; + border:1px solid; + z-index:20; +} +.ext-border-box .x-layout-collapsed{ + width:22px; + height:22px; +} +.x-layout-collapsed-over{ + cursor:pointer; +} +.x-layout-collapsed-west .x-layout-collapsed-tools, .x-layout-collapsed-east .x-layout-collapsed-tools{ + position:absolute; + top:0; + left:0; + width:20px; + height:20px; +} +.x-layout-split{ + position:absolute; + height:5px; + width:5px; + line-height:1px; + font-size:1px; + z-index:3; + background-color:transparent; +} +.ext-strict .ext-ie6 .x-layout-split{ + background-color: #fff !important; + filter: alpha(opacity=1); +} +.x-layout-split-h{ + background-image:url(../images/default/s.gif); + background-position: left; +} +.x-layout-split-v{ + background-image:url(../images/default/s.gif); + background-position: top; +} +.x-column-layout-ct { + overflow:hidden; + zoom:1; +} +.x-column { + float:left; + padding:0; + margin:0; + overflow:hidden; + zoom:1; +} +.x-column-inner { + overflow:hidden; + zoom:1; +} +.x-layout-mini { + position:absolute; + top:0; + left:0; + display:block; + width:5px; + height:35px; + cursor:pointer; + opacity:.5; + -moz-opacity:.5; + filter:alpha(opacity=50); +} +.x-layout-mini-over, .x-layout-collapsed-over .x-layout-mini{ + opacity:1; + -moz-opacity:1; + filter:none; +} +.x-layout-split-west .x-layout-mini { + top:48%; +} +.x-layout-split-east .x-layout-mini { + top:48%; +} +.x-layout-split-north .x-layout-mini { + left:48%; + height:5px; + width:35px; +} +.x-layout-split-south .x-layout-mini { + left:48%; + height:5px; + width:35px; +} +.x-layout-cmini-west .x-layout-mini { + top:48%; +} +.x-layout-cmini-east .x-layout-mini { + top:48%; +} +.x-layout-cmini-north .x-layout-mini { + left:48%; + height:5px; + width:35px; +} +.x-layout-cmini-south .x-layout-mini { + left:48%; + height:5px; + width:35px; +} +.x-layout-cmini-west, .x-layout-cmini-east { + border:0 none; + width:5px !important; + padding:0; + background:transparent; +} +.x-layout-cmini-north, .x-layout-cmini-south { + border:0 none; + height:5px !important; + padding:0; + background:transparent; +} +.x-viewport, .x-viewport body { + margin: 0; + padding: 0; + border: 0 none; + overflow: hidden; + height: 100%; +} +.x-abs-layout-item { + position:absolute !important; + left:0; + top:0; +} +.x-abs-layout-container { + position:relative; +} +.ext-ie input.x-abs-layout-item, .ext-ie textarea.x-abs-layout-item { + margin:0; +} +.x-box-layout-ct { + overflow:hidden; + zoom:1; +} +.x-box-inner { + overflow:hidden; + zoom:1; + position:relative; + left:0; + top:0; +} +.x-box-item { + position:absolute !important; + left:0; + top:0; +} +.x-border-layout-ct { + position: relative; +} +.x-progress-wrap { + border:1px solid; + overflow:hidden; +} +.x-progress-inner { + height:18px; + background:repeat-x; + position:relative; +} +.x-progress-bar { + height:18px; + float:left; + width:0; + background: repeat-x left center; + border-top:1px solid; + border-bottom:1px solid; + border-right:1px solid; +} +.x-progress-text { + padding:1px 5px; + overflow:hidden; + position:absolute; + left:0; + text-align:center; +} +.x-progress-text-back { + line-height:16px; +} +.ext-ie .x-progress-text-back { + line-height:15px; +} +.x-slider { + zoom:1; + -moz-outline: none; + outline: 0 none; +} +.x-slider-thumb { + line-height: 0px; + font-size: 0px; + position: absolute; + background:transparent no-repeat 0 0; +} +.x-slider-inner { + position:relative; + left:0; + top:0; + overflow:visible; + zoom:1; +} +.x-slider-focus { + position:absolute; + left:0; + top:0; + width:1px; + height:1px; + line-height:1px; + font-size:1px; + -moz-outline:0 none; + outline:0 none; + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: ignore + display:block; + overflow:hidden; +} +.x-slider-horz { + padding-left:7px; + background:transparent no-repeat 0 -22px; +} +.x-slider-horz .x-slider-end { + padding-right:7px; + zoom:1; + background:transparent no-repeat right -44px; +} +.x-slider-horz .x-slider-inner { + background:transparent repeat-x 0 0; + height:22px; +} +.x-slider-horz .x-slider-thumb { + width:14px; + height:15px; + left:0; + top:3px; +} +.x-slider-horz .x-slider-thumb-over { + background-position: -14px -15px; +} +.x-slider-horz .x-slider-thumb-drag { + background-position: -28px -30px; +} +.x-slider-vert { + padding-top:7px; + background:transparent no-repeat -44px 0; + width:22px; +} +.x-slider-vert .x-slider-end { + padding-bottom:7px; + zoom:1; + background:transparent no-repeat -22px bottom; +} +.x-slider-vert .x-slider-inner { + background:transparent repeat-y 0 0; +} +.x-slider-vert .x-slider-thumb { + width:15px; + height:14px; + left:3px; + bottom:0; +} +.x-slider-vert .x-slider-thumb-over { + background-position: -15px -14px; +} +.x-slider-vert .x-slider-thumb-drag { + background-position: -30px -28px; +} +.x-window-dlg .x-window-body { + border:0 none !important; + padding:5px 10px; + overflow:hidden !important; +} +.x-window-dlg .x-window-mc { + border:0 none !important; +} +.x-window-dlg .ext-mb-input { + margin-top:4px; + width:95%; +} +.x-window-dlg .ext-mb-textarea { + margin-top:4px; +} +.x-window-dlg .x-progress-wrap { + margin-top:4px; +} +.ext-ie .x-window-dlg .x-progress-wrap { + margin-top:6px; +} +.x-window-dlg .x-msg-box-wait { + background:transparent no-repeat left; + display:block; + width:300px; + padding-left:18px; + line-height:18px; +} +.x-window-dlg .ext-mb-icon { + float:left; + width:47px; + height:32px; +} +.ext-ie .x-window-dlg .ext-mb-icon { + width:44px; +} +.x-window-dlg .x-dlg-icon .ext-mb-content{ + zoom: 1; margin-left: 47px; +} +.x-window-dlg .ext-mb-info, .x-window-dlg .ext-mb-warning, .x-window-dlg .ext-mb-question, .x-window-dlg .ext-mb-error { + background:transparent no-repeat top left; +} +.ext-gecko2 .ext-mb-fix-cursor { + overflow:auto; +} +.arrow-top { + background: url(../images/gxt/icons/top2.gif) no-repeat center left !important; +} +.arrow-bottom { + background: url(../images/gxt/icons/bottom2.gif) no-repeat center left !important; +} +.arrow-up { + background: url(../images/gxt/icons/up2.gif) no-repeat center left !important; +} +.arrow-down { + background: url(../images/gxt/icons/down2.gif) no-repeat center left !important; +} +.arrow-left { + background: url(../images/gxt/icons/left2.gif) no-repeat center left !important; +} +.arrow-double-left { + background: url(../images/gxt/icons/doubleleft2.gif) no-repeat center left !important; +} +.arrow-right { + background: url(../images/gxt/icons/right2.gif) no-repeat center left !important; +} +.arrow-double-right { + background: url(../images/gxt/icons/doubleright2.gif) no-repeat center left !important; +} +.x-info { + border-style: solid; + border-color: #99bbe8; + border-width: 0; + z-index: 99999999; +} + +.x-info-header { + overflow: hidden; + zoom: 1; + color: black; + font: bold 13px tahoma, arial, verdana, sans-serif; + padding: 5px 3px 4px 5px; + line-height: 15px; + background: transparent url(../images/default/panel/white-top-bottom.gif) repeat-x 0 -1px; +} + +.x-info-body { + border-top: 0 none; + overflow: hidden; + background: white; + position: relative; /* added for item scroll positioning */ +} + +.x-info-header { + overflow: hidden; + zoom: 1; +} + +.x-info-tl .x-info-header { + color: #555555; + font-family: tahoma, arial, sans-serif; + font-size: 13px; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: bold; + line-height: normal; + padding: 5px 0 4px 0; + border: 0 none; + background: transparent; +} + +.x-info-tl .x-info-icon,.x-window-tl .x-info-icon { + padding-left: 20px !important; + background-repeat: no-repeat; + background-position: 0 4px; + zoom: 1; +} + +.x-info-inline-icon { + width: 16px; + height: 16px; + background-repeat: no-repeat; + background-position: 0 0; + vertical-align: middle; + margin-right: 4px; + margin-top: -1px; + margin-bottom: -1px; +} + +.x-info-tc { + background: transparent url(../images/gxt/info/top-bottom.gif) repeat-x 0 0; + overflow: hidden; +} + +/* fix ie7 strict mode bug */ +.ext-ie7 .x-info-tc { + overflow: visible; +} + +.x-info-tl { + background: transparent url(../images/gxt/info/corners-sprite.gif) no-repeat 0 0; + padding-left: 6px; + zoom: 1; +} + +.x-info-tr { + background: transparent url(../images/gxt/info/corners-sprite.gif) no-repeat right 0; + zoom: 1; + padding-right: 6px; +} + +.x-info-bc { + background: transparent url(../images/default/panel/top-bottom.gif) repeat-x 0 bottom; + zoom: 1; + font-size: 0px; +} + +.x-info-bc .x-info-footer { + zoom: 1; +} + +.x-info-bl { + background: transparent url(../images/default/panel/corners-sprite.gif) no-repeat 0 bottom; + padding-left: 6px; + zoom: 1; +} + +.x-info-br { + background: transparent url(../images/default/panel/corners-sprite.gif) no-repeat right bottom; + padding-right: 6px; + zoom: 1; +} + +.x-info-mc { + border: 0 none; + padding: 0; + margin: 0; + font: normal 11px tahoma, arial, helvetica, sans-serif; + background: #dfe8f6; +} + +.x-info-mc .x-info-body { + background: transparent; + border: 0 none; +} + +.x-info-ml { + background: #fff url(../images/default/panel/left-right.gif) repeat-y 0 0; + padding-left: 6px; + zoom: 1; +} + +.x-info-mr { + background: transparent url(../images/default/panel/left-right.gif) repeat-y right 0; + padding-right: 6px; + zoom: 1; +} + +.x-info-bc .x-info-footer { + padding-bottom: 6px; +} + +.x-info-nofooter .x-info-bc,.x-panel-nofooter .x-info-bc { + height: 6px; + font-size: 0; + line-height: 0; +} + +.x-info-bwrap { + overflow: hidden; + zoom: 1; +} + +.x-info-body { + overflow: hidden; + zoom: 1; + color: #555555; + font-family: tahoma, arial, sans-serif; + font-size: 12px; + font-size-adjust: none; + font-style: normal; + font-variant: normal; + font-weight: normal; +}.x-combo-over { + border: 1px dotted #B5B4B4 !important; + background: #F1F1F1; + cursor: pointer; +} + +.my-list { + border: 1px solid #99BBE8; + -moz-outline: none; + outline: 0 none; + -moz-user-focus: normal; + background-color: white; + font-family: "Myriad Pro", "Myriad Web", "Tahoma", "Helvetica", "Arial", sans-serif; +} + +.my-list-notchecked { + background: url(../images/gxt/tree/notchecked.gif) no-repeat 0px 0px !important; + margin: 3px 0pt 0pt 0px; +} + +.my-list-checked { + background: url(../images/gxt/tree/checked.gif) no-repeat 0px 0px !important; + margin: 3px 0pt 0pt 0px; +} + +.ext-ie .my-list-notchecked { + margin: 2px 0pt 0pt 0px; +} + +.ext-ie .my-list-checked { + margin: 2px 0pt 0pt 0px; +} + +.my-list-flat { + border: 1px solid #6593cf; + -moz-outline: none; + outline: 0 none; + -moz-user-focus: normal; + background-color: white; + cursor: default; +} + +.my-list-item { + cursor: pointer; + -moz-outline: none; + outline: 0 none; + -moz-user-focus: normal; +} + +.my-list-flat .my-list-item { + height: 19px; + border: 1px solid white; +} + +.my-list-flat .my-list-item-over { + background-color: #F1F1F1; + border: 1px dotted #B5B4B4; +} + +.my-list-flat .my-list-item-sel { + background-color: #DFE8F6; + border: 1px dotted #9EB8ED; +} + +.my-list-flat .my-list-item-over .my-list-item-l { + background: none; +} + +.my-list-flat .my-list-item-over .my-list-item-icon,.my-list-flat .my-list-item-over .my-list-item-ml,.my-list-flat .my-list-item-over .my-list-item-c + { + background: none; +} + +.my-list-flat .my-list-item-over .my-list-item-r { + background: none; +} + +.my-list-flat .my-list-item-sel .my-list-item-l { + background: none; +} + +.my-list-flat .my-list-item-sel .my-list-item-icon,.my-list-flat .my-list-item-sel .my-list-item-ml,.my-list-flat .my-list-item-sel .my-list-item-c + { + background: none; +} + +.my-list-flat .my-list-item-sel .my-list-item-r { + background: none; +} + +.my-list-item-text { + font-size: 11px; + padding-top: 3px; + padding-left: 2px; + white-space: nowrap; + overflow: hidden; + line-height: 19px; +} + +.my-list-item-l div { + width: 5px; +} + +.my-list-item-ml { + width: 18px; +} + +.my-list-item-c { + width: 100%; +} + +.my-list-item-r div { + width: 3px; +} + +.my-list-item-over .my-list-item-l { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat left -57px; +} + +.my-list-item-over .my-list-item-icon,.my-list-item-over .my-list-item-check,.my-list-item-over .my-list-item-c + { + background: url(../images/gxt/shared/select-19-bg.gif) repeat-x left -95px; +} + +.my-list-item-over .my-list-item-r { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat right -76px; +} + +.my-list-item-sel .my-list-item-l { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat left 0px; +} + +.my-list-item-sel .my-list-item-icon,.my-list-item-sel .my-list-item-check,.my-list-item-sel .my-list-item-c + { + background: url(../images/gxt/shared/select-19-bg.gif) left -38px; +} + +.my-list-item-sel .my-list-item-r { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat right -19px; +}.x-view { + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; + background-color: white; + cursor: default; + border: 1px solid #98C0F4; + overflow: auto; + padding: 0px; + zoom: 1; +} + +.x-view-item { + border: 1px solid #FFFFFF; + font-family: tahoma, arial, helvetica, sans-serif; + font-size: 12px; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: normal; + overflow: hidden; + padding: 2px; + white-space: nowrap; +} + +.x-view-highlightrow { + border: 1px dotted #545352 !important; +} + +.x-view-item-over { + background: #efefef url(../images/default/grid/row-over.gif) repeat-x left top; + border: 1px dotted #dddddd !important; + cursor: pointer; +} + +.x-view-item-sel { + background: #DFE8F6 none repeat scroll 0%; + border: 1px dotted #A3BAE9 !important; + cursor: pointer; +} +.x-view-item-check { + padding: 0px; +} +.x-view-item-check td { + font-family: tahoma, arial, helvetica, sans-serif; + font-size: 12px; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: normal; + white-space: nowrap; + vertical-align: middle; + padding-left: 1px; +} + +.x-splitbar-shim { + filter: alpha(opacity = 1); + opacity: 0; + position: absolute; + width: 100%; + height: 100%; + z-index: 10; + background-color: white; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.x-vsplitbar { + background: url(../images/default/s.gif); + position: absolute; + z-index: 3; + cursor: e-resize; + cursor: col-resize; +} + +.x-hsplitbar { + background: url(../images/default/s.gif); + position: absolute; + font-size: 1px; + line-height: 1px; + z-index: 3; + cursor: s-resize; + cursor: row-resize; +} + +.x-splitbar-proxy { + position: absolute; + background-color: #929090; + font-size: 1px; + line-height: 1px; + z-index: 200; +} + +.my-splitbar-shim { + filter: alpha(opacity = 1); + opacity: 0; + position: absolute; + width: 100%; + height: 100%; + z-index: 10; + background-color: white; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-splitbar-transparent { + background: none; + font-size: 1px; + line-height: 1px; + z-index: 2000; +} + +.my-splitbar-proxy { + position: absolute; + background-color: #929090; + font-size: 1px; + line-height: 1px; + z-index: 200; +}.x-status { + padding: 0 4px; + height: 21px; + line-height: 21px !important; + cursor: default; +} +.x-status .x-status-text{ + padding: 2px; + line-height: 21px !important; +} +.x-status-icon { + padding-left: 25px !important; + background: transparent no-repeat left center; +} +.x-status-busy { + background-image: url(../images/default/grid/loading.gif); +} +.x-status-text-panel { + border: 1px solid; + border-color: #99bbe8 #fff #fff #99bbe8; +} +.my-tbl { + border: 1px solid #99BBE8; + cursor: default; + background-color: white; + overflow: hidden; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; + font-family: arial, tahoma, helvetica, sans-serif; + font-size: 11px; + table-layout: fixed; +} + +.my-tbl-col-overflow { + overflow: hidden; +} + +.ext-ie .my-tbl-col-overflow { + +} + +.my-tbl-col-text { + color: black; + padding: 5px 4px 0 4px; + display: block; + white-space: nowrap; + font-family: arial, tahoma, helvetica, sans-serif; + font-size: 11px; +} + +.my-tbl-col { + border-right: 1px solid #D5D5D5; + background: url(../images/gxt/table/vs-column-bg.gif) repeat-x; +} + +.my-tbl-col-splitter { + position: absolute; + top: 0; + width: 6px; + z-index: 100; + height: 100%; + right: 0px; +} + +.my-tbl-col-over { + background: url(../images/gxt/table/vs-column-bg.gif) repeat-x 0px -24px; +} + +.my-tbl-col-sort { + background-position: 0px -48px; +} + +.my-icon-asc { + background-image: url(../images/gxt/icons/hmenu-asc.gif) !important; +} + +.my-icon-desc { + background-image: url(../images/gxt/icons/hmenu-desc.gif) !important; +} + +.my-tbl-col-asc { + background: url(../images/gxt/table/vsort-asc.gif) no-repeat 50% top; +} + +.my-tbl-col-desc { + background: url(../images/gxt/table/vsort-desc.gif) no-repeat 50% top; +} + +.my-tbl-col-splitter { + background: none; +} + +.my-tbl-data { + background-color: white; + overflow: hidden; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-tbl-item { + border-top: 1px solid white; + border-bottom: 1px solid white; + border-bottom: 1px solid #EDEDED; + cursor: default; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-tbl-item table { + -moz-outline: none; + -moz-user-focus: normal; + table-layout: fixed; + outline: 0 none; +} + +.my-tbl-data .my-tbl-item-cell { + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-tbl-item td { + -moz-user-select: none; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-tbl-vlines .my-tbl-data .my-tbl-item-cell-overflow { + border-right: 1px solid #EDEDED; +} + +.my-tbl-data .my-tbl-item-cell-overflow { + white-space: nowrap; + overflow: hidden; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-tbl-data .my-tbl-item-cell-text { + padding: 3px 4px; + font-family: arial, tahoma, helvetica, sans-serif; + font-size: 11px; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-tbl-data .my-tbl-item-cell-widget { + padding: 1px 4px; +} + +.my-tbl-data tr { + overflow: hidden; +} + +.my-tbl-item-over { + border-top: 1px solid #dddddd; + border-bottom: 1px solid #dddddd; + background: #efefef url(../images/default/grid/row-over.gif) repeat-x left top; +} + +.my-tbl-item-sel { + background-image: none !important; + background-color: #D9E1ED !important; + border-top: 1px dotted #9EB8ED !important; + border-bottom: 1px dotted #9EB8ED !important; +} + +.ext-ie .my-tbl TD .x-form-text { + POSITION: static; + TOP: 0px; +}.tree-folder { + background: url(../images/gxt/icons/folder-closed.gif) no-repeat -1px -1px; +} + +.tree-folder-open { + background: url(../images/gxt/icons/folder.gif) no-repeat -1px -1px; +} + +.my-treetbl-tree { + cursor: default; +} + +.my-treetblitem,.my-treetblitem table,.my-treetblitem table td { + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-treetblitem td { + height: 19px; +} + +.my-treetbl-indent { + line-height: 1px; + font-size: 1px; +} + +.my-treetbl-joint div { + width: 15px; + height: 19px; + line-height: 1px; + font-size: 1px; +} + +.my-treetbl-left,.my-treetbl-left div,.my-treetbl-right { + line-height: 1px; + font-size: 1px; + width: 3px; +} + +.my-treetbl-left div,.my-treetbl-right div { + width: 3px; +} + +.my-treetbl-check div { + width: 17px; + height: 19px; + line-height: 1px; + font-size: 1px; + display: block; +} + +.my-treetbl-icon div { + width: 16px; + height: 16px; + margin-top: 1px; + cursor: pointer; + background-repeat: no-repeat; + background-position: center; +} + +.my-ie .my-treetbl-icon { + padding-top: 2px; +} + +.my-ie .my-treetbl-icon div { + position: static; +} + +.my-treetbl-item-text span { + font-family: arial, tahoma, helvetica, sans-serif; + font-size: 12px; + white-space: nowrap; + padding-left: 3px; + padding-right: 3px; + display: block; + height: 15px; + cursor: pointer; +} + +.my-treetbl-over .my-treetbl-left { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat left -57px; +} + +.my-treetbl-over .my-treetbl-right { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat right -76px; +} + +.my-treetbl-over .my-treetbl-check,.my-treetbl-over .my-treetbl-icon,.my-treetbl-over .my-treetbl-item-text + { + background: url(../images/gxt/shared/select-19-bg.gif) left -95px; +} + +.my-treetbl-sel .my-treetbl-left { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat left 0px; +} + +.my-treetbl-sel .my-treetbl-right { + background: url(../images/gxt/shared/select-19-bg.gif) no-repeat right -19px; +} + +.my-treetbl-sel .my-treetbl-check,.my-treetbl-sel .my-treetbl-icon,.my-treetbl-sel .my-treetbl-item-text + { + background: url(../images/gxt/shared/select-19-bg.gif) left -38px; +} + +.my-treetbl-close { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px 1px; +} + +.my-treetbl-open { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px -32px; +} + +.my-treetbl-joint-over .my-treetbl-open { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px -48px; +} + +.my-treetbl-joint-over .my-treetbl-close { + background: url(../images/gxt/tree/vnode_transparent.gif) no-repeat 0px -15px; +} + +.my-treetbl-notchecked { + background: url(../images/gxt/tree/notchecked.gif) no-repeat 0px 50%; +} + +.my-treetbl-checked { + background: url(../images/gxt/tree/checked.gif) no-repeat 0px 50%; +} + +.my-treetbl-loading .tree-folder { + background: url(../images/gxt/icons/wait.gif) no-repeat 0px -1px; +} + +.my-treetbl-loading .my-treetbl-item-text span { + font-style: italic; +} + +.my-treetbl { + border: 1px solid #99BBE8; + cursor: default; + background-color: white; + overflow: hidden; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-treetbl-col-overflow { + overflow: hidden; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-treetbl-col-text { + color: black; + padding: 5px 4px 0 4px; + display: block; + white-space: nowrap; + font-family: arial, tahoma, helvetica, sans-serif; + font-size: 12px; +} + +.my-treetbl-col { + border-right: 1px solid #D5D5D5; + background: url(../images/gxt/table/vs-column-bg.gif) repeat-x; +} + +.my-treetbl-col-splitter { + position: absolute; + top: 0; + width: 6px; + z-index: 100; + height: 100%; + right: 0px; +} + +.my-treetbl-col-over { + background: url(../images/gxt/table/vs-column-bg.gif) repeat-x 0px -24px; +} + +.my-treetbl-col-sort { + background-position: 0px -48px; +} + +.my-treetbl-col-asc { + background: url(../images/gxt/table/vsort-asc.gif) no-repeat 50% top; +} + +.my-treetbl-col-desc { + background: url(../images/gxt/table/vsort-desc.gif) no-repeat 50% top; +} + +.my-treetbl-col-splitter { + background: none; +} + +.my-treetbl-data { + background-color: white; + overflow: hidden; +} + +.my-treetbl-data .my-treetbl-cell { + height: 20px; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-treetbl-data .my-treetbl-cell-overflow { + white-space: nowrap; + overflow: hidden; +} + +.my-treetbl-data .my-treetbl-cell-text { + padding: 0px 0px; + font-family: arial, tahoma, helvetica, sans-serif; + font-size: 12px; +} + +.my-treetbl-data tr { + overflow: hidden; +} + +.my-treetbl-item { + border-top: 1px solid white; + border-bottom: 1px solid white; + border-bottom: 1px solid #EDEDED; + cursor: default; + -moz-outline: none; + -moz-user-focus: normal; + outline: 0 none; +} + +.my-treetbl-item-over { + border-top: 1px solid #dddddd; + border-bottom: 1px solid #dddddd; + background: #efefef url(../images/default/grid/row-over.gif) repeat-x left top; +} + +.my-treetbl-item-sel { + background-image: none; + background-color: #D9E1ED; + border-top: 1px dotted #9EB8ED; + border-bottom: 1px dotted #9EB8ED; +} + +.my-treetbl .x-grid3-td-numberer { + background: transparent url(../images/gxt/tree/tree-table-special-col.gif) repeat-y + scroll left center; + height: 19px; + line-height: normal; + padding-left: 0px; + margin-left: 0px; +} + +.x-grid3-td-numberer div { + font-size: 11px; + font-family: "segoe ui", tahoma, arial, sans-serif; + color: #444444; + padding: 3px 0px 0 5px !important; +} + +.ext-ie .my-treetbl .x-grid3-td-numberer { + height: 20px; +} + +.my-treetbl-item-sel .x-grid3-td-numberer { + background: transparent url(../images/gxt/tree/tree-table-special-col-sel.gif) repeat-y + scroll left center; +}.ext-el-mask { + background-color: #ccc; +} +.ext-el-mask-msg { + border-color:#6593cf; + background-color:#c3daf9; + background-image:url(../images/default/box/tb-blue.gif); +} +.ext-el-mask-msg div { + background-color: white; + border-color:#a3bad9; + color:#222; + font:normal 11px tahoma, arial, helvetica, sans-serif; +} +.x-mask-loading div { + background-color:#fbfbfb; + background-image:url(../images/default/grid/loading.gif); +} +.x-item-disabled { + color: gray; +} +.x-item-disabled * { + color: gray !important; +} +.x-splitbar-proxy { + background-color: #aaa; +} +.x-color-palette a { + border-color:#fff; +} +.x-color-palette a.x-color-palette-hover, .x-color-palette a.x-color-palette-sel { + border-color:#8bb8f3; + background-color: #deecfd; +} +.x-color-palette em { + border-color:#aca899; +} +.x-ie-shadow { + background-color:#777; +} +.x-shadow .xsmc { + background-image: url(../images/default/shadow-c.png); +} +.x-shadow .xsml, .x-shadow .xsmr { + background-image: url(../images/default/shadow-lr.png); +} +.x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ + background-image: url(../images/default/shadow.png); +} +.loading-indicator { + font-size: 11px; + background-image: url(../images/default/grid/loading.gif); +} +.x-spotlight { + background-color: #ccc; +} +.x-aria-focusframe-side { + background-color: #15428B; + line-height: 2px; + font-size: 2px; +} +.x-tab-panel-header, .x-tab-panel-footer { + background-color: #deecfd; + border-color:#8db2e3; + overflow:hidden; + zoom:1; +} +.x-tab-panel-header, .x-tab-panel-footer { + border-color:#8db2e3; +} +ul.x-tab-strip-top{ + background-color:#cedff5; + background-image: url(../images/default/tabs/tab-strip-bg.gif); + border-bottom-color:#8db2e3; +} +ul.x-tab-strip-bottom{ + background-color:#cedff5; + background-image: url(../images/default/tabs/tab-strip-btm-bg.gif); + border-top-color:#8db2e3; +} +.x-tab-panel-header-plain .x-tab-strip-spacer, +.x-tab-panel-footer-plain .x-tab-strip-spacer { + border-color:#8db2e3; + background-color: #deecfd; +} +.x-tab-strip span.x-tab-strip-text { + font:normal 11px tahoma,arial,helvetica; + color:#416aa3; +} +.x-tab-strip-over span.x-tab-strip-text { + color:#15428b; +} +.x-tab-strip-active span.x-tab-strip-text { + color:#15428b; + font-weight:bold; +} +.x-tab-strip-disabled .x-tabs-text { + color:#aaaaaa; +} +.x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ + background-image: url(../images/default/tabs/tabs-sprite.gif); +} +.x-tab-strip-bottom .x-tab-right { + background-image: url(../images/default/tabs/tab-btm-inactive-right-bg.gif); +} +.x-tab-strip-bottom .x-tab-left { + background-image: url(../images/default/tabs/tab-btm-inactive-left-bg.gif); +} +.x-tab-strip-bottom .x-tab-strip-active .x-tab-right { + background-image: url(../images/default/tabs/tab-btm-right-bg.gif); +} +.x-tab-strip-bottom .x-tab-strip-active .x-tab-left { + background-image: url(../images/default/tabs/tab-btm-left-bg.gif); +} +.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { + background-image:url(../images/default/tabs/tab-close.gif); +} +.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ + background-image:url(../images/default/tabs/tab-close.gif); +} +.x-tab-panel-body { + border-color:#8db2e3; + background-color:#fff; +} +.x-tab-panel-body-top { + border-top: 0 none; +} +.x-tab-panel-body-bottom { + border-bottom: 0 none; +} +.x-tab-scroller-left { + background-image:url(../images/default/tabs/scroll-left.gif); + border-bottom-color:#8db2e3; +} +.x-tab-scroller-left-over { + background-position: 0 0; +} +.x-tab-scroller-left-disabled { + background-position: -18px 0; + opacity:.5; + -moz-opacity:.5; + filter:alpha(opacity=50); + cursor:default; +} +.x-tab-scroller-right { + background-image:url(../images/default/tabs/scroll-right.gif); + border-bottom-color:#8db2e3; +} +.x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { + border-color:#99bbe8; +} +.x-form-field { + font: normal 12px tahoma, arial, helvetica, sans-serif; +} + +.x-form-text,textarea.x-form-field { + background-color: #fff; + background-image: url(../images/default/form/text-bg.gif); + border-color: #b5b8c8; +} + +.x-form-select-one { + background-color: #fff; + border-color: #b5b8c8; +} + +.x-form-check-group-label { + border-bottom: 1px solid #99bbe8; + color: #15428b; +} + +.x-editor .x-form-check-wrap { + background-color: #fff; +} + +.x-form-field-wrap .x-form-trigger { + background-image: url(../images/default/form/trigger.gif); + border-bottom-color: #b5b8c8; +} + +.x-form-field-wrap .x-form-date-trigger { + background-image: url(../images/default/form/date-trigger.gif); +} + +.x-form-field-wrap .x-form-clear-trigger { + background-image: url(../images/default/form/clear-trigger.gif); +} + +.x-form-field-wrap .x-form-search-trigger { + background-image: url(../images/default/form/search-trigger.gif); +} + +.x-trigger-wrap-focus .x-form-trigger { + border-bottom-color: #7eadd9; +} + +.x-item-disabled .x-form-trigger-over { + border-bottom-color: #b5b8c8; +} + +.x-item-disabled .x-form-trigger-click { + border-bottom-color: #b5b8c8; +} + +.x-form-focus,textarea.x-form-focus { + border-color: #7eadd9; +} + +.x-form-invalid,textarea.x-form-invalid { + background-color: #fff; + background-image: url(../images/default/grid/invalid_line.gif); + border-color: #c30; +} + +.ext-safari .x-form-invalid { + background-color: #fee; + border-color: #ff7870; +} + +.x-form-inner-invalid,textarea.x-form-inner-invalid { + background-color: #fff; + background-image: url(../images/default/grid/invalid_line.gif); +} + +.x-form-grow-sizer { + font: normal 12px tahoma, arial, helvetica, sans-serif; +} + +.x-form-item { + font: normal 12px tahoma, arial, helvetica, sans-serif; +} + +.x-form-invalid-msg { + color: #c0272b; + font: normal 11px tahoma, arial, helvetica, sans-serif; + background-image: url(../images/default/shared/warning.gif); +} + +.x-form-empty-field { + color: gray; +} + +.x-small-editor .x-form-field { + font: normal 11px arial, tahoma, helvetica, sans-serif; +} + +.ext-safari .x-small-editor .x-form-field { + font: normal 12px arial, tahoma, helvetica, sans-serif; +} + +.x-form-invalid-icon { + background-image: url(../images/default/form/exclamation.gif); +} + +.x-fieldset { + border-color: #b5b8c8; +} + +.x-fieldset legend { + font: bold 11px tahoma, arial, helvetica, sans-serif; + color: #15428b; +} + +.x-editor .x-form-check-wrap { + border-color: #7eadd9; +} + +.x-spinner-field .x-form-spinner-up { + background-image: url('../images/default/form/spinner.gif'); +} +.x-spinner-field .x-form-spinner-down { + background-image: url('../images/default/form/spinner.gif'); +}.x-btn{ + font:normal 11px tahoma, verdana, helvetica; +} +.x-btn button{ + font:normal 11px arial,tahoma,verdana,helvetica; + color:#333; +} +.x-btn em { + font-style:normal; + font-weight:normal; +} +.x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ + background-image:url(../images/default/button/btn.gif); +} +.x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ + color:#000; +} +.x-btn-disabled *{ + color:gray !important; +} +.x-btn-mc em.x-btn-arrow { + background-image:url(../images/default/button/arrow.gif); +} +.x-btn-mc em.x-btn-split { + background-image:url(../images/default/button/s-arrow.gif); +} +.x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { + background-image:url(../images/default/button/s-arrow-o.gif); +} +.x-btn-mc em.x-btn-arrow-bottom { + background-image:url(../images/default/button/s-arrow-b-noline.gif); +} +.x-btn-mc em.x-btn-split-bottom { + background-image:url(../images/default/button/s-arrow-b.gif); +} +.x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { + background-image:url(../images/default/button/s-arrow-bo.gif); +} +.x-btn-group-header { + color: #3e6aaa; +} +.x-btn-group-tc { + background-image: url(../images/default/button/group-tb.gif); +} +.x-btn-group-tl { + background-image: url(../images/default/button/group-cs.gif); +} +.x-btn-group-tr { + background-image: url(../images/default/button/group-cs.gif); +} +.x-btn-group-bc { + background-image: url(../images/default/button/group-tb.gif); +} +.x-btn-group-bl { + background-image: url(../images/default/button/group-cs.gif); +} +.x-btn-group-br { + background-image: url(../images/default/button/group-cs.gif); +} +.x-btn-group-ml { + background-image: url(../images/default/button/group-lr.gif); +} +.x-btn-group-mr { + background-image: url(../images/default/button/group-lr.gif); +} +.x-btn-group-notitle .x-btn-group-tc { + background-image: url(../images/default/button/group-tb.gif); +} +.x-toolbar { + border-color: #a9bfd3; + background-color: #d0def0; + background-image: url(../images/default/toolbar/bg.gif); +} + +.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label { + font: normal 11px arial, tahoma, helvetica, sans-serif; +} + +.x-toolbar .x-item-disabled { + color: gray; +} + +.x-toolbar .x-item-disabled * { + color: gray; +} + +.x-toolbar .x-btn-mc em.x-btn-split { + background-image: url(../images/default/button/s-arrow-noline.gif); +} + +.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split,.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split,.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split + { + background-image: url(../images/default/button/s-arrow-o.gif); +} + +.x-toolbar .x-btn-mc em.x-btn-split-bottom { + background-image: url(../images/default/button/s-arrow-b-noline.gif); +} + +.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom,.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom,.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom + { + background-image: url(../images/default/button/s-arrow-bo.gif); +} + +.x-toolbar .xtb-sep { + background-image: url(../images/default/grid/grid-blue-split.gif); +} + +.x-tbar-page-first { + background-image: url(../images/default/grid/page-first.gif) !important; +} + +.x-tbar-refresh { + background-image: url(../images/default/grid/refresh.gif) !important; +} + +.x-tbar-page-last { + background-image: url(../images/default/grid/page-last.gif) !important; +} + +.x-tbar-page-next { + background-image: url(../images/default/grid/page-next.gif) !important; +} + +.x-tbar-page-prev { + background-image: url(../images/default/grid/page-prev.gif) !important; +} + +.x-tbar-loading { + background-image: url(../images/default/grid/loading.gif) !important; +} + +.x-item-disabled .x-tbar-page-first { + background-image: url(../images/default/grid/page-first-disabled.gif) !important; +} + +.x-item-disabled .x-tbar-page-last { + background-image: url(../images/default/grid/page-last-disabled.gif) !important; +} + +.x-item-disabled .x-tbar-page-next { + background-image: url(../images/default/grid/page-next-disabled.gif) !important; +} + +.x-item-disabled .x-tbar-page-prev { + background-image: url(../images/default/grid/page-prev-disabled.gif) !important; +} + +.x-paging-info { + color: #444; +} + +.x-toolbar-more-icon { + background-image: url(../images/default/toolbar/more.gif) !important; +}.x-resizable-handle { + background-color:#fff; +} +.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, +.x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west +{ + background-image:url(../images/default/sizer/e-handle.gif); +} +.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, +.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north +{ + background-image:url(../images/default/sizer/s-handle.gif); +} +.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ + background-image:url(../images/default/sizer/s-handle.gif); +} +.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ + background-image:url(../images/default/sizer/se-handle.gif); +} +.x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ + background-image:url(../images/default/sizer/nw-handle.gif); +} +.x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ + background-image:url(../images/default/sizer/ne-handle.gif); +} +.x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ + background-image:url(../images/default/sizer/sw-handle.gif); +} +.x-resizable-proxy{ + border-color:#3b5a82; +} +.x-resizable-overlay{ + background-color:#fff; +} +.x-grid3 { + background-color: #fff; +} + +.x-grid-panel .x-panel-mc .x-panel-body { + border-color: #99bbe8; +} + +.x-grid3-hd-row .x-grid3-hd,.x-grid3-row .x-grid3-cell,.x-grid3-summary-row .x-grid3-cell { + font: normal 11px arial, tahoma, helvetica, sans-serif; +} + +.x-grid3-hd-row .x-grid3-hd { + border-left-color: #eee; + border-right-color: #d0d0d0; +} + +.x-grid-row-loading { + background-color: #fff; + background-image: url(../images/default/shared/loading-balls.gif); +} + +.x-grid3-row { + border-color: #ededed; + border-top-color: #fff; +} + +.x-grid3-row-alt { + background-color: #fafafa; +} + +.x-grid3-row-over { + border-color: #ddd; + background-color: #efefef; + background-image: url(../images/default/grid/row-over.gif); +} + +.x-grid3-resize-proxy { + background-color: #777; +} + +.x-grid3-resize-marker { + background-color: #777; +} + +.x-grid3-header { + background-color: #f9f9f9; + background-image: url(../images/default/grid/grid3-hrow.gif); +} + +.x-grid3-header-pop { + border-left-color: #d0d0d0; +} + +.x-grid3-header-pop-inner { + border-left-color: #eee; + background-image: url(../images/default/grid/hd-pop.gif); +} + +td.x-grid3-hd-over,td.sort-desc,td.sort-asc,td.x-grid3-hd-menu-open { + border-left-color: #aaccf6; + border-right-color: #aaccf6; +} + +td.x-grid3-hd-over .x-grid3-hd-inner,td.sort-desc .x-grid3-hd-inner,td.sort-asc .x-grid3-hd-inner,td.x-grid3-hd-menu-open .x-grid3-hd-inner + { + background-color: #ebf3fd; + background-image: url(../images/default/grid/grid3-hrow-over.gif); +} + +.sort-asc .x-grid3-sort-icon { + background-image: url(../images/default/grid/sort_asc.gif); +} + +.sort-desc .x-grid3-sort-icon { + background-image: url(../images/default/grid/sort_desc.gif); +} + +.x-grid3-cell-text,.x-grid3-hd-text { + color: #000; +} + +.x-grid3-split { + background-image: url(../images/default/grid/grid-split.gif); +} + +.x-grid3-hd-text { + color: #15428b; +} + +.x-dd-drag-proxy .x-grid3-hd-inner { + background-color: #ebf3fd; + background-image: url(../images/default/grid/grid3-hrow-over.gif); + border-color: #aaccf6; +} + +.col-move-top { + background-image: url(../images/default/grid/col-move-top.gif); +} + +.col-move-bottom { + background-image: url(../images/default/grid/col-move-bottom.gif); +} + +.x-grid3-highlightrow { + border: 1px dotted #545352; +} + +.x-grid3-row-selected { + background-image: none !important; + background-color: #dfe8f6 !important; + border-color: #a3bae9; +} + +.x-grid3-cell-selected { + background-color: #b8cfee !important; + color: #000; +} + +.x-grid3-group-selected { + background-color: #b8cfee !important; +} + +.x-grid3-cell-selected span { + color: #000 !important; +} + +.x-grid3-cell-selected .x-grid3-cell-text { + color: #000; +} + +.x-grid3-locked td.x-grid3-row-marker,.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker { + background-color: #ebeadb !important; + background-image: url(../images/default/grid/grid-hrow.gif) !important; + color: #000; + border-top-color: #fff; + border-right-color: #6fa0df !important; +} + +.x-grid3-locked td.x-grid3-row-marker div,.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div { + color: #15428b !important; +} + +.x-grid3-dirty-cell { + background-image: url(../images/default/grid/dirty.gif); +} + +.x-grid3-invalid-cell { + background-image: url(../images/default/grid/invalid_line.gif); +} + +.x-grid3-topbar,.x-grid3-bottombar { + font: normal 11px arial, tahoma, helvetica, sans-serif; +} + +.x-grid3-bottombar .x-toolbar { + border-top-color: #a9bfd3; +} + +.x-props-grid .x-grid3-td-name .x-grid3-cell-inner { + background-image: url(../images/default/grid/grid3-special-col-bg.gif) !important; + color: #000 !important; +} + +.x-props-grid .x-grid3-body .x-grid3-td-name { + background-color: #fff !important; + border-right-color: #eee; +} + +.xg-hmenu-sort-asc .x-menu-item-icon { + background-image: url(../images/default/grid/hmenu-asc.gif); +} + +.xg-hmenu-sort-desc .x-menu-item-icon { + background-image: url(../images/default/grid/hmenu-desc.gif); +} + +.xg-hmenu-lock .x-menu-item-icon { + background-image: url(../images/default/grid/hmenu-lock.gif); +} + +.xg-hmenu-unlock .x-menu-item-icon { + background-image: url(../images/default/grid/hmenu-unlock.gif); +} + +.x-grid3-hd-btn { + background-color: #c3daf9; + background-image: url(../images/default/grid/grid3-hd-btn.gif); +} + +.x-grid3-body .x-grid3-td-expander { + background-image: url(../images/default/grid/grid3-special-col-bg.gif); +} + +.x-grid3-row-expander { + background-image: url(../images/default/grid/row-expand-sprite.gif); +} + +.x-grid3-body .x-grid3-td-checker { + background-image: url(../images/default/grid/grid3-special-col-bg.gif); +} + +.x-grid3-row-checker,.x-grid3-hd-checker { + background-image: url(../images/default/grid/row-check-sprite.gif); +} + +.x-grid3-body .x-grid3-td-numberer { + background-image: url(../images/default/grid/grid3-special-col-bg.gif); +} + +.x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { + color: #444; +} + +.x-grid3-body .x-grid3-td-row-icon { + background-image: url(../images/default/grid/grid3-special-col-bg.gif); +} + +.x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer,.x-grid3-body .x-grid3-row-selected .x-grid3-td-checker,.x-grid3-body .x-grid3-row-selected .x-grid3-td-expander + { + background-image: url(../images/default/grid/grid3-special-col-sel-bg.gif); +} + +.x-grid3-check-col { + background-image: url(../images/default/menu/unchecked.gif); +} + +.x-grid3-check-col-on { + background-image: url(../images/default/menu/checked.gif); +} + +.x-grid-group,.x-grid-group-body,.x-grid-group-hd { + zoom: 1; +} + +.x-grid-group-hd { + border-bottom-color: #99bbe8; +} + +.x-grid-group-hd .x-grid-group-div { + background-image: url(../images/default/grid/group-expand-sprite.gif); + color: #3764a0; + font: bold 11px tahoma, arial, helvetica, sans-serif; +} + +.x-group-by-icon { + background-image: url(../images/default/grid/group-by.gif); +} + +.x-cols-icon { + background-image: url(../images/default/grid/columns.gif); +} + +.x-show-groups-icon { + background-image: url(../images/default/grid/group-by.gif); +} + +.x-grid-empty { + color: gray; + font: normal 11px tahoma, arial, helvetica, sans-serif; +} + +.x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { + border-right-color: #ededed; +} + +.x-grid-with-col-lines .x-grid3-row-selected { + border-top-color: #a3bae9; +} + +.x-grid3-check-col-disabled { + background-color: transparent; + background-image: url(../images/gxt/menu/disabledcheck.gif); +} + +.x-row-editor-header { + background: transparent url(../images/gxt/grid/row-editor-bg.gif) repeat-x 0 0; +} + +.x-row-editor-footer { + background: transparent url(../images/gxt/grid/row-editor-bg.gif) repeat-x 0 -2px; +} + +.x-row-editor-body { + background: #ebf2fb; +} + +.x-row-editor .x-btns { + background: transparent url(../images/gxt/grid/row-editor-btns.gif) no-repeat 0 0; +} + +.x-row-editor .x-btns .x-plain-bwrap { + background: transparent url(../images/gxt/grid/row-editor-btns.gif) no-repeat right -31px; +} + +.x-row-editor .x-btns .x-plain-body { + background: transparent url(../images/gxt/grid/row-editor-btns.gif) repeat-x 0 -62px; +} + +.x-inserted-row { + background-color: #f7f9cc +}.x-dd-drag-ghost{ + color:#000; + font: normal 11px arial, helvetica, sans-serif; + border-color: #ddd #bbb #bbb #ddd; + background-color:#fff; +} +.x-dd-drop-nodrop .x-dd-drop-icon{ + background-image: url(../images/default/dd/drop-no.gif); +} +.x-dd-drop-ok .x-dd-drop-icon{ + background-image: url(../images/default/dd/drop-yes.gif); +} +.x-dd-drop-ok-add .x-dd-drop-icon{ + background-image: url(../images/default/dd/drop-add.gif); +} +.x-view-selector { + background-color:#c3daf9; + border-color:#3399bb; +} +.x-tree-drop-ok-append .x-dd-drop-icon { + background-image: url(../images/default/tree/drop-add.gif); +} + +.x-tree-drop-ok-above .x-dd-drop-icon { + background-image: url(../images/default/tree/drop-over.gif); +} + +.x-tree-drop-ok-below .x-dd-drop-icon { + background-image: url(../images/default/tree/drop-under.gif); +} + +.x-tree-drop-ok-between .x-dd-drop-icon { + background-image: url(../images/default/tree/drop-between.gif); +} + +.x-tree3-loading { + background-image: url(../images/default/tree/loading.gif); +} + +.x-tree3-node-text { + font: normal 11px arial, tahoma, helvetica, sans-serif; + color: black; +}.x-date-picker { + border-color: #1b376c; + background-color:#fff; +} +.x-date-middle,.x-date-left,.x-date-right { + background-image: url(../images/default/shared/hd-sprite.gif); + color:#fff; + font:bold 11px "sans serif", tahoma, verdana, helvetica; +} +.x-date-middle .x-btn .x-btn-text { + color:#fff; +} +.x-date-middle .x-btn-mc em.x-btn-arrow { + background-image:url(../images/default/toolbar/btn-arrow-light.gif); +} +.x-date-right a { + background-image: url(../images/default/shared/right-btn.gif); +} +.x-date-left a{ + background-image: url(../images/default/shared/left-btn.gif); +} +.x-date-inner th { + background-color:#dfecfb; + background-image:url(../images/default/shared/glass-bg.gif); + border-bottom-color:#a3bad9; + font:normal 10px arial, helvetica,tahoma,sans-serif; + color:#233d6d; +} +.x-date-inner td { + border-color:#fff; +} +.x-date-inner a { + font:normal 11px arial, helvetica,tahoma,sans-serif; + color:#000; +} +.x-date-inner .x-date-active{ + color:#000; +} +.x-date-inner .x-date-selected a{ + background-color:#dfecfb; + background-image:url(../images/default/shared/glass-bg.gif); + border-color:#8db2e3; +} +.x-date-inner .x-date-today a{ + border-color:darkred; +} +.x-date-inner .x-date-selected span{ + font-weight:bold; +} +.x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { + color:#aaa; +} +.x-date-bottom { + border-top-color:#a3bad9; + background-color:#dfecfb; + background-image:url(../images/default/shared/glass-bg.gif); +} +.x-date-inner .x-date-disabled a { + background-color:#eee; + color:#bbb; +} +.x-date-mmenu{ + background-color:#eee !important; +} +.x-date-mmenu .x-menu-item { + font-size:10px; + color:#000; +} +.x-date-mp { + background-color:#fff; +} +.x-date-mp td { + font:normal 11px arial, helvetica,tahoma,sans-serif; +} +.x-date-mp-btns button { + background-color:#083772; + color:#fff; + border-color: #3366cc #000055 #000055 #3366cc; + font:normal 11px arial, helvetica,tahoma,sans-serif; +} +.x-date-mp-btns { + background-color: #dfecfb; + background-image: url(../images/default/shared/glass-bg.gif); +} +.x-date-mp-btns td { + border-top-color: #c5d2df; +} +td.x-date-mp-month a,td.x-date-mp-year a { + color:#15428b; +} +td.x-date-mp-sel a { + background-color: #dfecfb; + background-image: url(../images/default/shared/glass-bg.gif); + border-color:#8db2e3; +} +.x-date-mp-ybtn a { + background-image:url(../images/default/panel/tool-sprites.gif); +} +td.x-date-mp-sep { + border-right-color:#c5d2df; +} +.x-tip .x-tip-close{ + background-image: url(../images/default/qtip/close.gif); +} +.x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { + background-image: url(../images/default/qtip/tip-sprite.gif); +} +.x-tip .x-tip-mc { + font: normal 11px tahoma,arial,helvetica,sans-serif; +} +.x-tip .x-tip-ml { + background-color: #fff; +} +.x-tip .x-tip-header-text { + font: bold 11px tahoma,arial,helvetica,sans-serif; + color:#444; +} +.x-tip .x-tip-body { + font: normal 11px tahoma,arial,helvetica,sans-serif; + color:#444; +} +.x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, +.x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr +{ + background-image: url(../images/default/form/error-tip-corners.gif); +} +.x-form-invalid-tip .x-tip-body { + background-image:url(../images/default/form/exclamation.gif); +} +.x-tip-anchor { + background-image:url(../images/default/qtip/tip-anchor-sprite.gif); +} +.x-menu { + border-color:#718bb7; + background-color:#f0f0f0; + background-image:url(../images/default/menu/menu.gif); +} +.x-menu-nosep { + background-image:none; +} +.x-menu-list-item{ + font:normal 11px tahoma,arial, sans-serif; +} +.x-menu-item-arrow{ + background-image:url(../images/default/menu/menu-parent.gif); +} +.x-menu-sep { + background-color:#e0e0e0; + border-bottom-color:#fff; +} +a.x-menu-item { + color:#222; +} +.x-menu-item-active { + background:#ebf3fd url(../images/default/menu/item-over.gif) repeat-x left bottom; + border:1px solid #aaccf6; + padding:0; +} +.x-menu-item-active a.x-menu-item { + color:#233d6d; +} + +.x-menu-plain { + background-color:#fff !important; +} +.x-menu .x-date-picker{ + border-color:#a3bad9; +} +.x-cycle-menu .x-menu-item-checked { + border-color:#a3bae9 !important; + background-color:#def8f6; +} +.x-menu-scroller-top { + background-image:url(../images/default/layout/mini-top.gif); +} +.x-menu-scroller-bottom { + background-image:url(../images/default/layout/mini-bottom.gif); +} + +.x-menu-scroller{ + border-width: 1px 0; +} +.x-box-tl { + background-image: url(../images/default/box/corners.gif); +} +.x-box-tc { + background-image: url(../images/default/box/tb.gif); +} +.x-box-tr { + background-image: url(../images/default/box/corners.gif); +} +.x-box-ml { + background-image: url(../images/default/box/l.gif); +} +.x-box-mc { + background-color: #eee; + background-image: url(../images/default/box/tb.gif); + font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; + color: #393939; + font-size: 12px; +} +.x-box-mc h3 { + font-size: 14px; + font-weight: bold; +} +.x-box-mr { + background-image: url(../images/default/box/r.gif); +} +.x-box-bl { + background-image: url(../images/default/box/corners.gif); +} +.x-box-bc { + background-image: url(../images/default/box/tb.gif); +} +.x-box-br { + background-image: url(../images/default/box/corners.gif); +} +.x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { + background-image: url(../images/default/box/corners-blue.gif); +} +.x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { + background-image: url(../images/default/box/tb-blue.gif); +} +.x-box-blue .x-box-mc { + background-color: #c3daf9; +} +.x-box-blue .x-box-mc h3 { + color: #17385b; +} +.x-box-blue .x-box-ml { + background-image: url(../images/default/box/l-blue.gif); +} +.x-box-blue .x-box-mr { + background-image: url(../images/default/box/r-blue.gif); +} +.x-combo-list { + border-color:#98c0f4; + background-color:#ddecfe; + font:normal 12px tahoma, arial, helvetica, sans-serif; +} +.x-combo-list-inner { + background-color:#fff; +} +.x-combo-list-hd { + font:bold 11px tahoma, arial, helvetica, sans-serif; + color:#15428b; + background-image: url(../images/default/layout/panel-title-light-bg.gif); + border-bottom-color:#98c0f4; +} +.x-resizable-pinned .x-combo-list-inner { + border-bottom-color:#98c0f4; +} +.x-combo-list-item { + border-color:#fff; +} +.x-combo-list .x-combo-selected{ + border-color:#a3bae9 !important; + background-color:#dfe8f6; +} +.x-combo-list .x-toolbar { + border-top-color:#98c0f4; +} +.x-combo-list-small { + font:normal 11px tahoma, arial, helvetica, sans-serif; +} +.x-panel { + border-color: #99bbe8; +} +.x-panel-header { + color:#15428b; + font-weight:bold; + font-size: 11px; + font-family: tahoma,arial,verdana,sans-serif; + border-color:#99bbe8; + background-image: url(../images/default/panel/white-top-bottom.gif); +} +.x-panel-body { + border-color:#99bbe8; + background-color:#fff; +} +.x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { + border-color:#99bbe8; +} +.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { + border-top-color:#99bbe8; +} +.x-panel-body-noheader, .x-panel-mc .x-panel-body { + border-top-color:#99bbe8; +} +.x-panel-tl .x-panel-header { + color:#15428b; + font-weight:bold; + font-size: 11px; + font-family: tahoma,arial,verdana,sans-serif; +} +.x-panel-tc { + background-image: url(../images/default/panel/top-bottom.gif); +} +.x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ + background-image: url(../images/default/panel/corners-sprite.gif); + border-bottom-color:#99bbe8; +} +.x-panel-bc { + background-image: url(../images/default/panel/top-bottom.gif); +} +.x-panel-mc { + font: normal 11px tahoma,arial,helvetica,sans-serif; + background-color:#dfe8f6; +} +.x-panel-ml { + background-color: #fff; + background-image:url(../images/default/panel/left-right.gif); +} +.x-panel-mr { + background-image: url(../images/default/panel/left-right.gif); +} +.x-tool { + background-image:url(../images/default/panel/tool-sprites.gif); +} +.x-panel-ghost { + background-color:#cbddf3; +} +.x-panel-ghost ul { + border-color:#99bbe8; +} +.x-panel-dd-spacer { + border-color:#99bbe8; +} +.x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ + font:normal 11px arial,tahoma, helvetica, sans-serif; +} +.x-window-proxy { + background-color:#c7dffc; + border-color:#99bbe8; +} +.x-window-tl .x-window-header { + color:#15428b; + font:bold 11px tahoma,arial,verdana,sans-serif; +} +.x-window-tc { + background-image: url(../images/default/window/top-bottom.png); +} +.x-window-tl { + background-image: url(../images/default/window/left-corners.png); +} +.x-window-tr { + background-image: url(../images/default/window/right-corners.png); +} +.x-window-bc { + background-image: url(../images/default/window/top-bottom.png); +} +.x-window-bl { + background-image: url(../images/default/window/left-corners.png); +} +.x-window-br { + background-image: url(../images/default/window/right-corners.png); +} +.x-window-mc { + border-color:#99bbe8; + font: normal 11px tahoma,arial,helvetica,sans-serif; + background-color:#dfe8f6; +} +.x-window-ml { + background-image: url(../images/default/window/left-right.png); +} +.x-window-mr { + background-image: url(../images/default/window/left-right.png); +} +.x-window-maximized .x-window-tc { + background-color:#fff; +} +.x-window-bbar .x-toolbar { + border-top-color:#99bbe8; +} +.x-panel-ghost .x-window-tl { + border-bottom-color:#99bbe8; +} +.x-panel-collapsed .x-window-tl { + border-bottom-color:#84a0c4; +} +.x-dlg-mask{ + background-color:#ccc; +} +.x-window-plain .x-window-mc { + background-color: #ccd9e8; + border-color: #a3bae9 #dfe8f6 #dfe8f6 #a3bae9; +} +.ext-ie .x-window-plain .x-window-mc { + background-color: #c9d5e4; +} +.x-window-plain .x-window-body { + border-color: #dfe8f6 #a3bae9 #a3bae9 #dfe8f6; +} +body.x-body-masked .x-window-plain .x-window-mc { + background-color: #ccd9e8; +} +.x-html-editor-wrap { + border-color:#a9bfd3; + background-color:#fff; +} + +.x-html-editor-tb .x-edit-bold, .x-menu-item .x-edit-bold { + background-position:0 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-italic, .x-menu-item .x-edit-italic { + background-position:-16px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-underline, .x-menu-item .x-edit-underline { + background-position:-32px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-forecolor, .x-menu-item .x-edit-forecolor { + background-position:-160px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-backcolor, .x-menu-item .x-edit-backcolor { + background-position:-176px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-justifyleft, .x-menu-item .x-edit-justifyleft { + background-position:-112px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-justifycenter, .x-menu-item .x-edit-justifycenter { + background-position:-128px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-justifyright, .x-menu-item .x-edit-justifyright { + background-position:-144px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-insertorderedlist, .x-menu-item .x-edit-insertorderedlist { + background-position:-80px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-insertunorderedlist, .x-menu-item .x-edit-insertunorderedlist { + background-position:-96px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-increasefontsize, .x-menu-item .x-edit-increasefontsize { + background-position:-48px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-decreasefontsize, .x-menu-item .x-edit-decreasefontsize { + background-position:-64px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-sourceedit, .x-menu-item .x-edit-sourceedit { + background-position:-192px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +} + +.x-html-editor-tb .x-edit-createlink, .x-menu-item .x-edit-createlink { + background-position:-208px 0; + background-image:url(../images/default/editor/tb-sprite.gif); +}.x-panel-noborder .x-panel-header-noborder { + border-bottom-color:#99bbe8; +} +.x-panel-noborder .x-panel-tbar-noborder .x-toolbar { + border-bottom-color:#99bbe8; +} +.x-panel-noborder .x-panel-bbar-noborder .x-toolbar { + border-top-color:#99bbe8; +} +.x-tab-panel-bbar-noborder .x-toolbar { + border-top-color:#99bbe8; +} +.x-tab-panel-tbar-noborder .x-toolbar { + border-bottom-color:#99bbe8; +} +.x-border-layout-ct { + background-color:#dfe8f6; +} +.x-accordion-hd { + color:#222; + font-weight:normal; + background-image: url(../images/default/panel/light-hd.gif); +} +.x-layout-collapsed{ + background-color:#d2e0f2; + border-color:#98c0f4; +} +.x-layout-collapsed-over{ + background-color:#d9e8fb; +} +.x-layout-split-west .x-layout-mini { + background-image:url(../images/default/layout/mini-left.gif); +} +.x-layout-split-east .x-layout-mini { + background-image:url(../images/default/layout/mini-right.gif); +} +.x-layout-split-north .x-layout-mini { + background-image:url(../images/default/layout/mini-top.gif); +} +.x-layout-split-south .x-layout-mini { + background-image:url(../images/default/layout/mini-bottom.gif); +} +.x-layout-cmini-west .x-layout-mini { + background-image:url(../images/default/layout/mini-right.gif); +} +.x-layout-cmini-east .x-layout-mini { + background-image:url(../images/default/layout/mini-left.gif); +} +.x-layout-cmini-north .x-layout-mini { + background-image:url(../images/default/layout/mini-bottom.gif); +} +.x-layout-cmini-south .x-layout-mini { + background-image:url(../images/default/layout/mini-top.gif); +} +.x-progress-wrap { + border-color:#6593cf; +} +.x-progress-inner { + background-color:#e0e8f3; + background-image:url(../images/default/qtip/bg.gif); +} +.x-progress-bar { + background-color:#9cbfee; + background-image:url(../images/default/progress/progress-bg.gif); + border-top-color:#d1e4fd; + border-bottom-color:#7fa9e4; + border-right-color:#7fa9e4; +} +.x-progress-text { + font-size:11px; + font-weight:bold; + color:#fff; +} +.x-progress-text-back { + color:#396095; +} +.x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { + background-image:url(../images/default/slider/slider-bg.png); +} +.x-slider-horz .x-slider-thumb { + background-image:url(../images/default/slider/slider-thumb.png); +} +.x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { + background-image:url(../images/default/slider/slider-v-bg.png); +} +.x-slider-vert .x-slider-thumb { + background-image:url(../images/default/slider/slider-v-thumb.png); +} +.x-window-dlg .ext-mb-text, +.x-window-dlg .x-window-header-text { + font-size:12px; +} +.x-window-dlg .ext-mb-textarea { + font:normal 12px tahoma,arial,helvetica,sans-serif; +} +.x-window-dlg .x-msg-box-wait { + background-image:url(../images/default/grid/loading.gif); +} +.x-window-dlg .ext-mb-info { + background-image:url(../images/default/window/icon-info.gif); +} +.x-window-dlg .ext-mb-warning { + background-image:url(../images/default/window/icon-warning.gif); +} +.x-window-dlg .ext-mb-question { + background-image:url(../images/default/window/icon-question.gif); +} +.x-window-dlg .ext-mb-error { + background-image:url(../images/default/window/icon-error.gif); +} diff --git a/src/main/webapp/gxt/css/gxt-gray.css b/src/main/webapp/gxt/css/gxt-gray.css new file mode 100644 index 0000000..bc31336 --- /dev/null +++ b/src/main/webapp/gxt/css/gxt-gray.css @@ -0,0 +1,493 @@ +.x-panel { + border-style: solid; + border-color: #d0d0d0; +} +.x-panel-header { + color:#333; + border:1px solid #d0d0d0; + background-image:url(../images/gray/panel/white-top-bottom.gif); +} + +.x-panel-body { + border-color:#d0d0d0; +} + +.x-panel-bbar .x-toolbar { + border-color:#d0d0d0; +} + +.x-panel-tbar .x-toolbar { + border-color:#d0d0d0; +} + +.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { + border-color:#d0d0d0; +} +.x-panel-body-noheader, .x-panel-mc .x-panel-body { + border-color:#d0d0d0; +} +.x-panel-tl .x-panel-header { + color:#333; +} +.x-panel-tc { + background-image:url(../images/gray/panel/top-bottom.gif); +} +.x-panel-tl { + background-image:url(../images/gray/panel/corners-sprite.gif); + border-color:#d0d0d0; +} +.x-panel-tr { + background-image:url(../images/gray/panel/corners-sprite.gif); +} +.x-panel-bc { + background-image:url(../images/gray/panel/top-bottom.gif); +} +.x-panel-bl { + background-image:url(../images/gray/panel/corners-sprite.gif); +} +.x-panel-br { + background-image:url(../images/gray/panel/corners-sprite.gif); +} +.x-panel-mc { + background:#f1f1f1; +} +.x-panel-mc .x-panel-body { + background:transparent; + border: 0 none; +} +.x-panel-ml { + background-image:url(../images/gray/panel/left-right.gif); +} +.x-panel-mr { + background-image:url(../images/gray/panel/left-right.gif); +} + +/* Tools */ +.x-tool { + background-image:url(../images/gray/panel/tool-sprites.gif); +} + +/* Ghosting */ +.x-panel-ghost { + background:#e0e0e0; +} + +.x-panel-ghost ul { + border-color:#b0b0b0; +} + +.x-grid-panel .x-panel-mc .x-panel-body { + border:1px solid #d0d0d0; +} + +/* Buttons */ + +.x-btn-left{ + background-image:url(../images/gray/button/btn-sprite.gif); +} +.x-btn-right{ + background-image:url(../images/gray/button/btn-sprite.gif); +} +.x-btn-center{ + background-image:url(../images/gray/button/btn-sprite.gif); +} + +.x-btn-group-header { + color: #333333; +} +.x-btn-group-tc { + background-image: url(../images/gray/button/group-tb.gif); +} +.x-btn-group-tl { + background-image: url(../images/gray/button/group-cs.gif); +} +.x-btn-group-tr { + background-image: url(../images/gray/button/group-cs.gif); +} +.x-btn-group-bc { + background-image: url(../images/gray/button/group-tb.gif); +} +.x-btn-group-bl { + background-image: url(../images/gray/button/group-cs.gif); +} +.x-btn-group-br { + background-image: url(../images/gray/button/group-cs.gif); +} +.x-btn-group-ml { + background-image: url(../images/gray/button/group-lr.gif); +} +.x-btn-group-mr { + background-image: url(../images/gray/button/group-lr.gif); +} +.x-btn-group-notitle .x-btn-group-tc { + background-image: url(../images/gray/button/group-tb.gif); +} + +/* Layout classes */ + +.x-border-layout-ct { + background:#f0f0f0; +} + +.x-accordion-hd { + background-image:url(../images/gray/panel/light-hd.gif); +} + +.x-layout-collapsed{ + background-color:#eee; + border-color:#e0e0e0; +} +.x-layout-collapsed-over{ + background-color:#fbfbfb; +} + + +/* qtips */ +.x-tip .x-tip-top { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} +.x-tip .x-tip-top-left { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} +.x-tip .x-tip-top-right { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} +.x-tip .x-tip-ft { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} +.x-tip .x-tip-ft-left { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} +.x-tip .x-tip-ft-right { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} +.x-tip .x-tip-bd-left { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} +.x-tip .x-tip-bd-right { + background-image:url(../images/gray/qtip/tip-sprite.gif); +} + +/* Toolbars */ + +.x-toolbar{ + border-color:#d0d0d0; + background:#f0f4f5 url(../images/gray/toolbar/bg.gif) repeat-x top left; +} +.x-toolbar button { + color:#444; +} +.x-toolbar .x-btn-menu-arrow-wrap .x-btn-center button { + background-image:url(../images/gray/toolbar/btn-arrow.gif); +} +.x-toolbar .x-btn-text-icon .x-btn-menu-arrow-wrap .x-btn-center button { + background-image:url(../images/gray/toolbar/btn-arrow.gif); +} +.x-toolbar .x-btn-over .x-btn-left{ + background-image:url(../images/gray/toolbar/tb-btn-sprite.gif); +} +.x-toolbar .x-btn-over .x-btn-right{ + background-image:url(../images/gray/toolbar/tb-btn-sprite.gif); +} +.x-toolbar .x-btn-over .x-btn-center{ + background-image:url(../images/gray/toolbar/tb-btn-sprite.gif); +} +.x-toolbar .x-btn-over button { + color:#111; +} +.x-toolbar .x-btn-click .x-btn-left, .x-toolbar .x-btn-pressed .x-btn-left, .x-toolbar .x-btn-menu-active .x-btn-left{ + background-image:url(../images/gray/toolbar/tb-btn-sprite.gif); +} +.x-toolbar .x-btn-click .x-btn-right, .x-toolbar .x-btn-pressed .x-btn-right, .x-toolbar .x-btn-menu-active .x-btn-right{ + background-image:url(../images/gray/toolbar/tb-btn-sprite.gif); +} + +.x-toolbar .x-btn-click .x-btn-center, .x-toolbar .x-btn-pressed .x-btn-center, .x-toolbar .x-btn-menu-active .x-btn-center{ + background-image:url(../images/gray/toolbar/tb-btn-sprite.gif); +} +.x-toolbar .xtb-sep { + background-image: url(../images/gray/grid/grid-split.gif); +} + +/* Tabs */ + +.x-tab-panel-header, .x-tab-panel-footer { + background: #EAEAEA; + border-color:#d0d0d0; +} + + +.x-tab-panel-header { + border-color:#d0d0d0; +} + +.x-tab-panel-footer { + border-color:#d0d0d0; +} + +ul.x-tab-strip-top{ + background:#dbdbdb url(../images/gray/tabs/tab-strip-bg.gif) repeat-x left top; + border-color:#d0d0d0; + padding-top: 2px; +} + +ul.x-tab-strip-bottom{ + background-image:url(../images/gray/tabs/tab-strip-btm-bg.gif); + border-color:#d0d0d0; +} + +.x-tab-strip span.x-tab-strip-text { + color:#333; +} +.x-tab-strip-over span.x-tab-strip-text { + color:#111; +} + +.x-tab-strip-active span.x-tab-strip-text { + color:#333; +} + +.x-tab-strip-disabled .x-tabs-text { + color:#aaaaaa; +} + +.x-tab-strip-top .x-tab-right { + background-image:url(../images/gray/tabs/tabs-sprite.gif); +} + +.x-tab-strip-top .x-tab-left { + background-image:url(../images/gray/tabs/tabs-sprite.gif); +} +.x-tab-strip-top .x-tab-strip-inner { + background-image:url(../images/gray/tabs/tabs-sprite.gif); +} + +.x-tab-strip-bottom .x-tab-right { + background-image:url(../images/gray/tabs/tab-btm-inactive-right-bg.gif); +} + +.x-tab-strip-bottom .x-tab-left { + background-image:url(../images/gray/tabs/tab-btm-inactive-left-bg.gif); +} + +.x-tab-strip-bottom .x-tab-strip-active .x-tab-right { + background-image:url(../images/gray/tabs/tab-btm-right-bg.gif); +} + +.x-tab-strip-bottom .x-tab-strip-active .x-tab-left { + background-image:url(../images/gray/tabs/tab-btm-left-bg.gif); +} + +.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { + background-image:url(../images/gray/tabs/tab-close.gif); +} +.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ + background-image:url(../images/gray/tabs/tab-close.gif); +} + +.x-tab-panel-body { + border-color:#d0d0d0; + background:#fff; +} +.x-tab-panel-bbar .x-toolbar { + border-color: #d0d0d0; +} + +.x-tab-panel-tbar .x-toolbar { + border-color: #d0d0d0; +} + +.x-tab-panel-header-plain .x-tab-strip-spacer { + border-color:#d0d0d0; + background: #eaeaea; +} + +.x-tab-scroller-left { + background-image: url(../images/gray/tabs/scroll-left.gif); + border-color:#aeaeae; +} +.x-tab-scroller-right { + background-image: url(../images/gray/tabs/scroll-right.gif); + border-color:#aeaeae; +} + +/* Window */ + +.x-window-proxy { + background:#e0e0e0; + border-color:#b0b0b0; +} + +.x-window-tl .x-window-header { + color:#555; +} +.x-window-tc { + background-image:url(../images/gray/window/top-bottom.png); +} +.x-window-tl { + background-image:url(../images/gray/window/left-corners.png); +} +.x-window-tr { + background-image:url(../images/gray/window/right-corners.png); +} +.x-window-bc { + background-image:url(../images/gray/window/top-bottom.png); +} +.x-window-bl { + background-image:url(../images/gray/window/left-corners.png); +} +.x-window-br { + background-image:url(../images/gray/window/right-corners.png); +} +.x-window-mc { + border:1px solid #d0d0d0; + background:#e8e8e8; +} +.ext-ie .x-window-plain .x-window-mc { + background-color: #e3e3e3; +} + +.x-window-ml { + background-image:url(../images/gray/window/left-right.png); +} +.x-window-mr { + background-image:url(../images/gray/window/left-right.png); +} +.x-panel-ghost .x-window-tl { + border-color:#d0d0d0; +} +.x-panel-collapsed .x-window-tl { + border-color:#d0d0d0; +} + +.x-window-plain .x-window-mc { + background: #e8e8e8; + border-right:1px solid #eee; + border-bottom:1px solid #eee; + border-top:1px solid #d0d0d0; + border-left:1px solid #d0d0d0; +} + +.x-window-plain .x-window-body { + border-left:1px solid #eee; + border-top:1px solid #eee; + border-bottom:1px solid #d0d0d0; + border-right:1px solid #d0d0d0; + background:transparent !important; +} + +body.x-body-masked .x-window-mc, body.x-body-masked .x-window-plain .x-window-mc { + background-color: #e4e4e4; +} + + +/* misc */ +.x-html-editor-wrap { + border-color:#d0d0d0; +} + +/* Borders go last for specificity */ +.x-panel-noborder .x-panel-body-noborder { + border-width:0; +} + +.x-panel-noborder .x-panel-header-noborder { + border-width:0; + border-bottom:1px solid #d0d0d0; +} + +.x-panel-noborder .x-panel-tbar-noborder .x-toolbar { + border-width:0; + border-bottom:1px solid #d0d0d0; +} + +.x-panel-noborder .x-panel-bbar-noborder .x-toolbar { + border-width:0; + border-top:1px solid #d0d0d0; +} + +.x-window-noborder .x-window-mc { + border-width:0; +} +.x-window-plain .x-window-body-noborder { + border-width:0; +} + +.x-tab-panel-noborder .x-tab-panel-body-noborder { + border-width:0; +} + +.x-tab-panel-noborder .x-tab-panel-header-noborder { + border-top-width:0; + border-left-width:0; + border-right-width:0; +} + +.x-tab-panel-noborder .x-tab-panel-footer-noborder { + border-bottom-width:0; + border-left-width:0; + border-right-width:0; +} + + +.x-tab-panel-bbar-noborder .x-toolbar { + border-width:0; + border-top:1px solid #d0d0d0; +} + +.x-tab-panel-tbar-noborder .x-toolbar { + border-width:0; + border-bottom:1px solid #d0d0d0; +} + +.x-spinner-field .x-form-spinner-up { + background-image: url('../images/gray/form/spinner.gif'); +} +.x-spinner-field .x-form-spinner-down { + background-image: url('../images/gray/form/spinner.gif'); +}.x-accordion-hd { + background-color: #e5e5e5; +}.x-border { + border: 1px solid #D0D0D0; +} + +.x-layout-popup { + background-color: #F0F0F0; + border: 1px solid #D0D0D0; +} + +.my-list { + border: 1px solid #D0D0D0; +} + +.x-view { + border:1px solid #D0D0D0; +} + +.x-menubar { + border-color: #D0D0D0; + background-color: #F0F0F0; + background-image: url(../images/gray/toolbar/bg.gif); +} + +.x-menubar-item-active { + background-color: #D9E8FB; +} + +.x-menubar-item-active { + background-color: #D9E8FB; +}.x-date-right-icon { + background-image: url(../images/default/shared/right-btn.gif); + margin-right: 2px; + text-decoration: none !important; +} + +.x-date-left-icon { + background-image: url(../images/default/shared/left-btn.gif); + margin-right: 2px; + text-decoration: none !important; +}.my-tbl { + border: 1px solid #C6C5C5; +}.my-treetbl { + border: 1px solid #C6C5C5; +} \ No newline at end of file diff --git a/src/main/webapp/gxt/desktop/css/desktop.css b/src/main/webapp/gxt/desktop/css/desktop.css new file mode 100644 index 0000000..0013ed9 --- /dev/null +++ b/src/main/webapp/gxt/desktop/css/desktop.css @@ -0,0 +1,638 @@ +/* + * Ext JS Library 2.1 + * Copyright(c) 2006-2008, Ext JS, LLC. + * licensing@extjs.com + * + * http://extjs.com/license + */ +html,body { + background: #3d71b8 url(../wallpapers/desktop.jpg) no-repeat left top; + font: normal 12px tahoma, arial, verdana, sans-serif; + margin: 0; + padding: 0; + border: 0 none; + overflow: hidden; + height: 100%; +} + +.start { + background-image: url( ../images/taskbar/black/startbutton-icon.gif ) !important; +} + +.bogus { + background-image: url( ../images/bogus.png ) !important; +} + +.logout { + background-image: url( ../images/logout.gif ) !important; +} + +.settings { + background-image: url( ../images/gears.gif ) !important; +} + +#dpanels { + width: 250px; + float: right; +} + +#dpanels .x-panel { + margin: 15px; +} + +#dpanels .x-date-picker { + border: 0 none; + border-top: 0 none; + background: transparent; +} + +#dpanels .x-date-picker td.x-date-active { + background: #ffffff; +} + +#dpanels .x-date-picker { + width: 100% !important; +} + +#x-desktop { + width: 100%; + height: 100%; + border: 0 none; + position: relative; + overflow: hidden; + zoom: 1; +} + +#ux-taskbar .x-btn { + float: left; + margin: 1px 0 0 1px; + position: relative; +} + +#ux-taskbar-start .x-btn { + float: left; + margin: 0; + position: relative; +} + +#ux-taskbar button { /* width: 150px; + overflow: hidden; */ + text-align: left; + color: #ffffff; +} + +#title-bar-wrapper { + height: 35px; +} + +#title-bar { + color: #225599; + padding: 9px 7px; + font: bold 16px tahoma, arial, verdana, sans-serif; + float: left; +} + +#x-logout { + float: right; + padding: 6px 7px; +} + +.x-btn-text-icon .x-btn-center .logout { + background-position: 0pt 3px; + background-repeat: no-repeat; + padding: 3px 0pt 3px 18px; +} + +#ux-taskbar { + background: transparent none; + height: 30px; + margin: 0; + padding: 0; + position: relative; + z-index: 12001; +} + +.x-btn-icon .ux-taskbutton-center .x-btn-text { + background-position: center; + background-repeat: no-repeat; + height: 16px; + width: 16px; + cursor: pointer; + white-space: nowrap; + padding: 0; +} + +.x-btn-icon .ux-taskbutton-center { + padding: 1px; +} + +.ux-startbutton-center .x-btn-text { + color: #000000 !important; + font-weight: bold; +} + +.ux-taskbutton-left,.ux-taskbutton-right { + font-size: 1px; + line-height: 1px; +} + +.ux-taskbutton-left { + width: 4px; + height: 28px; + background: url( ../images/taskbar/black/taskbutton.gif ) no-repeat 0 0; +} + +.ux-taskbutton-right { + width: 4px; + height: 28px; + background: url( ../images/taskbar/black/taskbutton.gif ) no-repeat 0 -28px; +} + +.ux-taskbutton-left i,.ux-taskbutton-right i { + display: block; + width: 4px; + overflow: hidden; + font-size: 1px; + line-height: 1px; +} + +.ux-taskbutton-center { + background: url( ../images/taskbar/black/taskbutton.gif ) repeat-x 0 -56px; + vertical-align: middle; + text-align: center; + padding: 0 5px; + cursor: pointer; + white-space: nowrap; +} + +#ux-taskbar .ux-taskbutton-left { + background-position: 0 0; +} + +#ux-taskbar .ux-taskbutton-right { + background-position: 0 -28px; +} + +#ux-taskbar .ux-taskbutton-center { + background-position: 0 -56px; +} + +#ux-taskbar .x-btn-over .ux-taskbutton-left { + background-position: 0 -252px; +} + +#ux-taskbar .x-btn-over .ux-taskbutton-right { + background-position: 0 -280px; +} + +#ux-taskbar .x-btn-over .ux-taskbutton-center { + background-position: 0 -308px; +} + +#ux-taskbar .x-btn-click .ux-taskbutton-left { + background-position: 0 -168px; +} + +#ux-taskbar .x-btn-click .ux-taskbutton-right { + background-position: 0 -196px; +} + +#ux-taskbar .x-btn-click .ux-taskbutton-center { + background-position: 0 -224px; +} + +#ux-taskbar .active-win .ux-taskbutton-left { + background-position: 0 -84px; +} + +#ux-taskbar .active-win .ux-taskbutton-right { + background: url( ../images/taskbar/black/taskbutton.gif ) no-repeat 0 -112px; +} + +#ux-taskbar .active-win .ux-taskbutton-center { + background: url( ../images/taskbar/black/taskbutton.gif ) repeat-x 0 -140px; +} + +#ux-taskbar .active-win .ux-taskbutton-center button { + color: #fff; +} + +#spacer { + height: 25px; + float: left; + width: 0; + overflow: hidden; + margin-top: 2px; +} + +.x-window-body p,.x-panel-body p { + padding: 10px; + margin: 0; +} + +.x-window-maximized .x-window-bc { + height: 0; +} + +.add { + background-image: url(../../shared/icons/fam/add.gif) !important; +} + +.option { + background-image: url(../../shared/icons/fam/plugin.gif) !important; +} + +.remove { + background-image: url(../../shared/icons/fam/delete.gif) !important; +} + +.tabs { + background-image: url(../images/tabs.gif) !important; +} + +.ux-start-menu { + background: transparent none; + border: 0px none; + padding: 0; +} + +.ux-start-menu-tl .x-window-header { + color: #f1f1f1; + font: bold 11px tahoma, arial, verdana, sans-serif; + padding: 5px 0 4px 0; +} + +.x-panel-tl .x-panel-icon,.ux-start-menu-tl .x-panel-icon { + background-position: 0pt 4px; + background-repeat: no-repeat; + padding-left: 20px !important; +} + +.ux-start-menu-tl { + background: transparent url( ../images/taskbar/black/start-menu-left-corners.png ) no-repeat 0 0; + padding-left: 6px; + zoom: 1; + z-index: 1; + position: relative; +} + +.ux-start-menu-tr { + background: transparent url( ../images/taskbar/black/start-menu-right-corners.png ) no-repeat right + 0; + padding-right: 6px; +} + +.ux-start-menu-tc { + background: transparent url( ../images/taskbar/black/start-menu-top-bottom.png ) repeat-x 0 0; + overflow: hidden; + zoom: 1; +} + +.ux-start-menu-ml { + background: transparent url( ../images/taskbar/black/start-menu-left-right.png ) repeat-y 0 0; + padding-left: 6px; + zoom: 1; +} + +.ux-start-menu-bc { + background: transparent url( ../images/taskbar/black/start-menu-top-bottom.png ) repeat-x 0 bottom; + zoom: 1; +} + +.ux-start-menu-bc .x-window-footer { + padding-bottom: 6px; + zoom: 1; + font-size: 0; + line-height: 0; +} + +.ux-start-menu-bl { + background: transparent url( ../images/taskbar/black/start-menu-left-corners.png ) no-repeat 0 + bottom; + padding-left: 6px; + zoom: 1; +} + +.ux-start-menu-br { + background: transparent url( ../images/taskbar/black/start-menu-right-corners.png ) no-repeat right + bottom; + padding-right: 6px; + zoom: 1; +} + +.x-panel-nofooter .ux-start-menu-bc { + height: 6px; +} + +.ux-start-menu-splitbar-h { + background-color: #d0d0d0; +} + +.ux-start-menu-bwrap { + background: transparent none; + border: 0px none; +} + +.ux-start-menu-body { + background: transparent none; + border: 0px none; +} + +.ux-start-menu-apps-panel { + background: #ffffff none; + border: 1px solid #1e2124; +} + +.ux-start-menu-tools-panel { + border: 0px none; + background: transparent url( ../images/taskbar/black/start-menu-right.png ) repeat-y scroll right + 0pt; +} + +#ux-taskbar-start { + background: #000000 url( ../images/taskbar/black/taskbar-start-panel-bg.gif ) repeat-x left top; + left: 0px; + padding: 0; + position: absolute; +} + +#ux-taskbar-start .x-toolbar { + background: none; + padding: 0px; + border: 0px none; +} + +#ux-taskbuttons-panel { + background: #000000 url( ../images/taskbar/black/taskbuttons-panel-bg.gif ) repeat-x left top; + padding-top: 0; + position: relative; +} + +.ux-taskbuttons-strip-wrap { /* overflow:hidden; + position:relative; + width:100%; */ + width: 100%; + overflow: hidden; + position: relative; + zoom: 1; +} + +ul.ux-taskbuttons-strip { + display: block; + width: 5000px; + zoom: 1; +} + +ul.ux-taskbuttons-strip li { + float: left; + margin-left: 2px; +} + +ul.ux-taskbuttons-strip li.ux-taskbuttons-edge { + float: left; + margin: 0 !important; + padding: 0 !important; + border: 0 none !important; + font-size: 1px !important; + line-height: 1px !important; + overflow: hidden; + zoom: 1; + background: transparent !important; + width: 1px; +} + +.x-clear { + clear: both; + height: 0; + overflow: hidden; + line-height: 0; + font-size: 0; +} + +.x-taskbuttons-scrolling { + position: relative; +} + +.x-taskbuttons-scrolling .ux-taskbuttons-strip-wrap { + margin-left: 18px; + margin-right: 18px; +} + +td.ux-taskButtons-edge { /*float:left;*/ + margin: 0 !important; + padding: 0 !important; + border: 0 none !important; + font-size: 1px !important; + line-height: 1px !important; + overflow: hidden; + zoom: 1; + background: transparent !important; + width: 1px; +} + +.ux-taskbuttons-scroller-left { + background: transparent url( ../images/taskbar/black/scroll-left.gif ) no-repeat -18px 0; + width: 18px; + position: absolute; + left: 1px; + top: 0px; + z-index: 10; + cursor: pointer; +} + +.ux-taskbuttons-scroller-left-over { + background-position: 0 0; +} + +.ux-taskbuttons-scroller-left-disabled { + background-position: -18px 0; + opacity: .5; + -moz-opacity: .5; + filter: alpha(opacity = 50); + cursor: default; +} + +.ux-taskbuttons-scroller-right { + background: transparent url( ../images/taskbar/black/scroll-right.gif ) no-repeat 0 0; + width: 18px; + position: absolute; + right: 0; + top: 0px; + z-index: 10; + cursor: pointer; +} + +.ux-taskbuttons-scroller-right-over { + background-position: -18px 0; +} + +.ux-taskbuttons-scroller-right-disabled { + background-position: 0 0; + opacity: .5; + -moz-opacity: .5; + filter: alpha(opacity = 50); + cursor: default; +} + +.ux-toolmenu-sep { + background-color: #18191a; + border-bottom: 1px solid #858789; + display: block; + font-size: 1px; + line-height: 1px; + margin: 2px 3px; +} + +.ux-start-menu-tools-panel ul.x-menu-list li.x-menu-list-item a.x-menu-item { + color: #ffffff; +} + +.ux-start-menu-tools-panel ul.x-menu-list li.x-menu-list-item .x-menu-item-active a.x-menu-item { + color: #000000; +} + +.ux-start-menu-tools-panel .x-menu-item-active { + background: #525456 url( ../images/taskbar/black/item-over.gif ) repeat-x left bottom; + border: 1px solid #000000; + padding: 0; +} + +#ux-taskbar .x-splitbar-h { + background: #000000 url( ../images/taskbar/black/taskbar-split-h.gif ) no-repeat 0 0; + width: 8px; +} + +.x-window-header-text { + cursor: default; +} + +/* + * Begin Start button + */ +.ux-startbutton-left,.ux-startbutton-right { + font-size: 1px; + line-height: 1px; +} + +.ux-startbutton-left { + width: 10px; + height: 28px; + background: url( ../images/taskbar/black/startbutton.gif ) no-repeat 0 0; +} + +.ux-startbutton-right { + width: 10px; + height: 30px; + background: url( ../images/taskbar/black/startbutton.gif ) no-repeat 0 -28px; +} + +.ux-startbutton-left i,.ux-startbutton-right i { + display: block; + width: 10px; + overflow: hidden; + font-size: 1px; + line-height: 1px; +} + +.ux-startbutton-center { + background: url( ../images/taskbar/black/startbutton.gif ) repeat-x 0 -56px; + vertical-align: middle; + text-align: center; + padding: 0; + cursor: pointer; + white-space: nowrap; +} + +#ux-taskbar .ux-startbutton-left { + background-position: 0 0; +} + +#ux-taskbar .ux-startbutton-right { + background-position: 0 -30px; +} + +#ux-taskbar .ux-startbutton-center { + background-position: 0 -60px; +} + +#ux-taskbar .x-btn-over .ux-startbutton-left { + background-position: 0 -270px; +} + +#ux-taskbar .x-btn-over .ux-startbutton-right { + background-position: 0 -300px; +} + +#ux-taskbar .x-btn-over .ux-startbutton-center { + background-position: 0 -330px; +} + +#ux-taskbar .x-btn-click .ux-startbutton-left { + background-position: 0 -180px; +} + +#ux-taskbar .x-btn-click .ux-startbutton-right { + background-position: 0 -210px; +} + +#ux-taskbar .x-btn-click .ux-startbutton-center { + background-position: 0 -240px; +} + +#ux-taskbar .active-win .ux-startbutton-left { + background-position: 0 -90px; +} + +#ux-taskbar .active-win .ux-startbutton-right { + background: url( ../images/taskbar/black/startbutton.gif ) no-repeat 0 -120px; +} + +#ux-taskbar .active-win .ux-startbutton-center { + background: url( ../images/taskbar/black/startbutton.gif ) repeat-x 0 -150px; +} + +#ux-taskbar .active-win .ux-startbutton-center button { + color: #fff; +} + +/* + * End Start button + */ +.x-resizable-proxy { + background: #C7DFFC; + opacity: .5; + -moz-opacity: .5; + filter: alpha(opacity = 50); + border: 1px solid #3b5a82; +} + +/* Desktop Shortcuts */ +#x-shortcuts dt { + float: left; + margin: 15px 0 0 15px; + clear: left; + width: 64px; + font: normal 10px tahoma, arial, verdana, sans-serif; + text-align: center; + zoom: 1; + display: block; +} + +#x-shortcuts dt a { + width: 64px; + display: block; + color: white; + text-decoration: none; +} + +#x-shortcuts dt div { + width: 100%; + color: white; + overflow: hidden; + text-overflow: ellipsis; + cursor: pointer; +} + +#x-shortcuts dt a:hover { + text-decoration: underline; +} diff --git a/src/main/webapp/gxt/desktop/images/desktop.gif b/src/main/webapp/gxt/desktop/images/desktop.gif new file mode 100644 index 0000000..f305cb6 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/desktop.gif differ diff --git a/src/main/webapp/gxt/desktop/images/desktop3.jpg b/src/main/webapp/gxt/desktop/images/desktop3.jpg new file mode 100644 index 0000000..daca8bc Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/desktop3.jpg differ diff --git a/src/main/webapp/gxt/desktop/images/gears.gif b/src/main/webapp/gxt/desktop/images/gears.gif new file mode 100644 index 0000000..2bf6bd7 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/gears.gif differ diff --git a/src/main/webapp/gxt/desktop/images/gears.png b/src/main/webapp/gxt/desktop/images/gears.png new file mode 100644 index 0000000..6acdc98 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/gears.png differ diff --git a/src/main/webapp/gxt/desktop/images/grid.png b/src/main/webapp/gxt/desktop/images/grid.png new file mode 100644 index 0000000..c4da495 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/grid.png differ diff --git a/src/main/webapp/gxt/desktop/images/hatch.gif b/src/main/webapp/gxt/desktop/images/hatch.gif new file mode 100644 index 0000000..6a044a8 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/hatch.gif differ diff --git a/src/main/webapp/gxt/desktop/images/hd-bg.gif b/src/main/webapp/gxt/desktop/images/hd-bg.gif new file mode 100644 index 0000000..f35a53f Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/hd-bg.gif differ diff --git a/src/main/webapp/gxt/desktop/images/hd-tb-bg.gif b/src/main/webapp/gxt/desktop/images/hd-tb-bg.gif new file mode 100644 index 0000000..f800edb Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/hd-tb-bg.gif differ diff --git a/src/main/webapp/gxt/desktop/images/icon_padlock.png b/src/main/webapp/gxt/desktop/images/icon_padlock.png new file mode 100644 index 0000000..92625ff Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/icon_padlock.png differ diff --git a/src/main/webapp/gxt/desktop/images/icons-bg.png b/src/main/webapp/gxt/desktop/images/icons-bg.png new file mode 100644 index 0000000..6557cbb Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/icons-bg.png differ diff --git a/src/main/webapp/gxt/desktop/images/launcher-bg.gif b/src/main/webapp/gxt/desktop/images/launcher-bg.gif new file mode 100644 index 0000000..c7cfd83 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/launcher-bg.gif differ diff --git a/src/main/webapp/gxt/desktop/images/launcher-btn.gif b/src/main/webapp/gxt/desktop/images/launcher-btn.gif new file mode 100644 index 0000000..a9a72d7 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/launcher-btn.gif differ diff --git a/src/main/webapp/gxt/desktop/images/logout.gif b/src/main/webapp/gxt/desktop/images/logout.gif new file mode 100644 index 0000000..a4f3738 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/logout.gif differ diff --git a/src/main/webapp/gxt/desktop/images/logout.png b/src/main/webapp/gxt/desktop/images/logout.png new file mode 100644 index 0000000..1fcb386 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/logout.png differ diff --git a/src/main/webapp/gxt/desktop/images/member.gif b/src/main/webapp/gxt/desktop/images/member.gif new file mode 100644 index 0000000..216c839 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/member.gif differ diff --git a/src/main/webapp/gxt/desktop/images/member.png b/src/main/webapp/gxt/desktop/images/member.png new file mode 100644 index 0000000..0f3657f Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/member.png differ diff --git a/src/main/webapp/gxt/desktop/images/powered.gif b/src/main/webapp/gxt/desktop/images/powered.gif new file mode 100644 index 0000000..8ce74b8 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/powered.gif differ diff --git a/src/main/webapp/gxt/desktop/images/powered.png b/src/main/webapp/gxt/desktop/images/powered.png new file mode 100644 index 0000000..5b2a0b8 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/powered.png differ diff --git a/src/main/webapp/gxt/desktop/images/s.gif b/src/main/webapp/gxt/desktop/images/s.gif new file mode 100644 index 0000000..1d11fa9 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/s.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/item-over.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/item-over.gif new file mode 100644 index 0000000..26c1fc2 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/item-over.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/scroll-left.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/scroll-left.gif new file mode 100644 index 0000000..94fea48 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/scroll-left.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/scroll-right.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/scroll-right.gif new file mode 100644 index 0000000..94b5669 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/scroll-right.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-left-corners.png b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-left-corners.png new file mode 100644 index 0000000..d6e5196 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-left-corners.png differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-left-right.png b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-left-right.png new file mode 100644 index 0000000..a577d1b Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-left-right.png differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-right-corners.png b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-right-corners.png new file mode 100644 index 0000000..b683301 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-right-corners.png differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-right.png b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-right.png new file mode 100644 index 0000000..e5fa2b8 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-right.png differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-top-bottom.png b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-top-bottom.png new file mode 100644 index 0000000..fbea3cb Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/start-menu-top-bottom.png differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/startbutton-icon.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/startbutton-icon.gif new file mode 100644 index 0000000..8dcd2d1 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/startbutton-icon.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/startbutton.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/startbutton.gif new file mode 100644 index 0000000..683313e Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/startbutton.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/taskbar-split-h.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbar-split-h.gif new file mode 100644 index 0000000..13564ad Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbar-split-h.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/taskbar-start-panel-bg.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbar-start-panel-bg.gif new file mode 100644 index 0000000..9794880 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbar-start-panel-bg.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/taskbutton.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbutton.gif new file mode 100644 index 0000000..df13974 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbutton.gif differ diff --git a/src/main/webapp/gxt/desktop/images/taskbar/black/taskbuttons-panel-bg.gif b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbuttons-panel-bg.gif new file mode 100644 index 0000000..0865c45 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/taskbar/black/taskbuttons-panel-bg.gif differ diff --git a/src/main/webapp/gxt/desktop/images/winbar-bg.gif b/src/main/webapp/gxt/desktop/images/winbar-bg.gif new file mode 100644 index 0000000..45295a6 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/winbar-bg.gif differ diff --git a/src/main/webapp/gxt/desktop/images/winbar-btn.gif b/src/main/webapp/gxt/desktop/images/winbar-btn.gif new file mode 100644 index 0000000..2c8c024 Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/winbar-btn.gif differ diff --git a/src/main/webapp/gxt/desktop/images/windows-bg.gif b/src/main/webapp/gxt/desktop/images/windows-bg.gif new file mode 100644 index 0000000..396471e Binary files /dev/null and b/src/main/webapp/gxt/desktop/images/windows-bg.gif differ diff --git a/src/main/webapp/gxt/desktop/wallpapers/desktop.jpg b/src/main/webapp/gxt/desktop/wallpapers/desktop.jpg new file mode 100644 index 0000000..8e1fcb0 Binary files /dev/null and b/src/main/webapp/gxt/desktop/wallpapers/desktop.jpg differ diff --git a/src/main/webapp/gxt/flash/swfobject.js b/src/main/webapp/gxt/flash/swfobject.js new file mode 100644 index 0000000..4b704c5 --- /dev/null +++ b/src/main/webapp/gxt/flash/swfobject.js @@ -0,0 +1,5 @@ +/* SWFObject v2.1 + Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis + This software is released under the MIT License +*/ +var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("