diff --git a/rtd_phosphonetx/.classpath b/rtd_phosphonetx/.classpath index 605f3fd7c87f711e4ccce4d71bb026910ee1e47d..efc56346735878751c8c2a0b1a7f889b73e3c206 100644 --- a/rtd_phosphonetx/.classpath +++ b/rtd_phosphonetx/.classpath @@ -24,5 +24,7 @@ </classpathentry> <classpathentry kind="lib" path="/libraries/restrictionchecker/restrictions.jar"/> <classpathentry kind="lib" path="/libraries/spring/spring.jar" sourcepath="/libraries/spring/src.jar"/> + <classpathentry kind="lib" path="/libraries/spring/webmvc/spring-webmvc.jar" sourcepath="/libraries/spring/webmvc/src.jar"/> + <classpathentry kind="lib" path="/libraries/hibernate-search/jms.jar"/> <classpathentry kind="output" path="targets/classes"/> </classpath> diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/phosphonetx/IProtDAO.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/phosphonetx/IProtDAO.java index 174e75a036f2e8689f1bf551e81e5ef780731941..f2ecde6ff4c6531f7d1f509910b53a6320db5caf 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/phosphonetx/IProtDAO.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/etlserver/phosphonetx/IProtDAO.java @@ -42,7 +42,7 @@ public interface IProtDAO extends BaseQuery + "values (?{1.sequence}, ?{1.checksum}) returning id") public long createSequence(Sequence sequence); - @Select("insert into proteins (data_set_code) values (?{1}) returning id") + @Select("insert into proteins (data_set_perm_id) values (?{1}) returning id") public long createProtein(String dataSetCode); @Select("insert into peptides (prot_id, sequ_id) values (?{1}, ?{2}) returning id") diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/OpenBIS.gwt.xml b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/OpenBIS.gwt.xml index 11c365c365e0733939759e1f1f68cf130b8911fc..7fcaef8e692abf8a83915a497f848510aa3b8dca 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/OpenBIS.gwt.xml +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/OpenBIS.gwt.xml @@ -9,5 +9,6 @@ <script src="phosphonetx-dictionary.js"/> <public path="client/web/public"/> <source path="client/web/client"/> + <source path="shared/basic" /> </module> \ No newline at end of file diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java index cb66b9cf333f6922116b3b0c611ef8f85e20d503..8812bbc90e452dda3c55362b2d20b7c5842a0ffa 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientService.java @@ -17,6 +17,11 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client; import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; /** * @@ -25,5 +30,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService; */ public interface IPhosphoNetXClientService extends IClientService { + public ResultSet<Protein> listProteinsByExperiment(ListProteinByExperimentCriteria criteria) + throws UserFailureException; + + public String prepareExportProteins(TableExportCriteria<Protein> exportCriteria) + throws UserFailureException; } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java index 0127ad07f7b032f8c3bf47a9d48ff287b90898df..ce9dc0e0a575e38bd2210b9b76ff7d3a92ee2eae 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/IPhosphoNetXClientServiceAsync.java @@ -16,7 +16,13 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client; +import com.google.gwt.user.client.rpc.AsyncCallback; + import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; /** * @@ -25,5 +31,13 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync; */ public interface IPhosphoNetXClientServiceAsync extends IClientServiceAsync { + /** @see IPhosphoNetXClientService#listProteinsByExperiment(ListProteinByExperimentCriteria) */ + public void listProteinsByExperiment(ListProteinByExperimentCriteria criteria, + AsyncCallback<ResultSet<Protein>> callback); + + + /** @see IPhosphoNetXClientService#prepareExportProteins(TableExportCriteria) */ + public void prepareExportProteins(TableExportCriteria<Protein> exportCriteria, + AsyncCallback<String> callback); -} +} \ No newline at end of file diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ClientPluginFactory.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ClientPluginFactory.java index 7ceb5f04edd35ec0018dbaf0ae31852c5a29844d..b4872352c9dba8324ad6eec6298791f587da2eff 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ClientPluginFactory.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ClientPluginFactory.java @@ -30,6 +30,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IModule; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifiable; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; @@ -48,15 +49,19 @@ public class ClientPluginFactory extends AbstractClientPluginFactory<IPhosphoNet public ClientPluginFactory(IViewContext<ICommonClientServiceAsync> originalViewContext) { super(originalViewContext); - // TODO Auto-generated constructor stub } @Override protected IViewContext<IPhosphoNetXClientServiceAsync> createViewContext( IViewContext<ICommonClientServiceAsync> originalViewContext) { - // TODO Auto-generated method stub - return null; + return new ViewContext(originalViewContext); + } + + @Override + public IModule tryGetModule() + { + return new PhosphoNetXModule(getViewContext()); } public Set<String> getEntityTypeCodes(EntityKind entityKind) diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java new file mode 100644 index 0000000000000000000000000000000000000000..c198f91a739640e42886496db6f0242d60fc857a --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/Dict.java @@ -0,0 +1,31 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +/** + * + * + * @author Franz-Josef Elmer + */ +class Dict +{ + public static final String QUERY_MENU_TITLE = "query_menu_title"; + public static final String QUERY_ALL_PROTEINS_BY_EXPERIMENT = "query_all_proteins_by_experiment"; + public static final String SELECTED_EXPERIMENT_LABEL = "selected_experiment_label"; + public static final String PROTEIN_DESCRIPTION = "protein_name"; + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXDisplayTypeIDGenerator.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXDisplayTypeIDGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..435fa39e2a9c0e0f9f79b523a249af85dfbf3432 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXDisplayTypeIDGenerator.java @@ -0,0 +1,54 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDisplayTypeIDGenerator; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; + +/** + * + * + * @author Franz-Josef Elmer + */ +public enum PhosphoNetXDisplayTypeIDGenerator implements IDisplayTypeIDGenerator +{ + PROTEIN_BY_EXPERIMENT_BROWSER_GRID("protein-by-experiment-browser-grid"), + ; + + private final String genericNameOrPrefix; + + private PhosphoNetXDisplayTypeIDGenerator(String genericNameOrPrefix) + { + this.genericNameOrPrefix = genericNameOrPrefix; + } + + public String createID(EntityKind entityKindOrNull, EntityType entityTypeOrNull) + { + String id = genericNameOrPrefix; + if (entityKindOrNull != null) + { + id += "-" + entityKindOrNull.toString(); + } + if (entityTypeOrNull != null) + { + id += "-" + entityTypeOrNull.getCode(); + } + return id; + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXModule.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXModule.java new file mode 100644 index 0000000000000000000000000000000000000000..33a9f6bab5abaf823b2d5e79bda967443301ba60 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/PhosphoNetXModule.java @@ -0,0 +1,44 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import com.google.gwt.user.client.ui.Widget; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IModule; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class PhosphoNetXModule implements IModule +{ + private final IViewContext<IPhosphoNetXClientServiceAsync> viewContext; + + public PhosphoNetXModule(IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + this.viewContext = viewContext; + } + + public Widget getMenu() + { + return new QueryMenu(viewContext); + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowerToolBar.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowerToolBar.java new file mode 100644 index 0000000000000000000000000000000000000000..172faa9f79a7f7394b545b6ac670969074bec336 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowerToolBar.java @@ -0,0 +1,70 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import com.extjs.gxt.ui.client.Events; +import com.extjs.gxt.ui.client.event.BaseEvent; +import com.extjs.gxt.ui.client.event.Listener; +import com.extjs.gxt.ui.client.widget.form.TextField; +import com.extjs.gxt.ui.client.widget.toolbar.AdapterToolItem; +import com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem; +import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.ExperimentChooserField; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.ExperimentChooserField.ExperimentChooserFieldAdaptor; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentIdentifier; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; + +/** + * @author Franz-Josef Elmer + */ +class ProteinByExperimentBrowerToolBar extends ToolBar +{ + private ProteinByExperimentBrowserGrid browserGrid; + + ProteinByExperimentBrowerToolBar(IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + setBorders(true); + add(new LabelToolItem(viewContext.getMessage(Dict.SELECTED_EXPERIMENT_LABEL) + + GenericConstants.LABEL_SEPARATOR)); + final ExperimentChooserFieldAdaptor chooser = + ExperimentChooserField.create("", false, null, viewContext.getCommonViewContext()); + TextField<String> textField = chooser.getTextField(); + textField.setReadOnly(true); + textField.addListener(Events.Valid, new Listener<BaseEvent>() + { + public void handleEvent(BaseEvent be) + { + ExperimentIdentifier identifier = chooser.getValue(); + if (identifier != null) + { + System.out.println("Experiment:" + identifier.getIdentifier()); + browserGrid.update(identifier); + } + } + }); + add(new AdapterToolItem(textField)); + add(new AdapterToolItem(chooser.getChooseButton())); + } + + void setBrowserGrid(ProteinByExperimentBrowserGrid browserGrid) + { + this.browserGrid = browserGrid; + } +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserGrid.java new file mode 100644 index 0000000000000000000000000000000000000000..50a3b400f8bcf7cb3aea74ab9828c24485827745 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserGrid.java @@ -0,0 +1,116 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.AbstractSimpleBrowserGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentIdentifier; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IColumnDefinition; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; + +/** + * + * + * @author Franz-Josef Elmer + */ +class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<Protein> +{ + private static final String PREFIX = GenericConstants.ID_PREFIX + "protein-by-experiment-browser"; + + // browser consists of the grid and additional toolbars (paging, filtering) + public static final String BROWSER_ID = PREFIX + "_main"; + + public static final String GRID_ID = PREFIX + "_grid"; + + private final IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext; + + private ListProteinByExperimentCriteria criteria; + + static IDisposableComponent create( + final IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + final ProteinByExperimentBrowerToolBar toolbar = + new ProteinByExperimentBrowerToolBar(viewContext); + final ProteinByExperimentBrowserGrid browserGrid = + new ProteinByExperimentBrowserGrid(viewContext); + toolbar.setBrowserGrid(browserGrid); + return browserGrid.asDisposableWithToolbar(toolbar); + } + + private ProteinByExperimentBrowserGrid(IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + super(viewContext.getCommonViewContext(), BROWSER_ID, GRID_ID); + specificViewContext = viewContext; + setDisplayTypeIDGenerator(PhosphoNetXDisplayTypeIDGenerator.PROTEIN_BY_EXPERIMENT_BROWSER_GRID); + } + + void update(ExperimentIdentifier identifier) + { + criteria = new ListProteinByExperimentCriteria(); + criteria.setExperimentID(identifier.getTechID()); + refresh(); + } + + @Override + protected IColumnDefinitionKind<Protein>[] getStaticColumnsDefinition() + { + return ProteinColDefKind.values(); + } + + @Override + protected List<IColumnDefinition<Protein>> getInitialFilters() + { + return asColumnFilters(new ProteinColDefKind[] {ProteinColDefKind.DESCRIPTION}); + } + + @Override + protected void listEntities(DefaultResultSetConfig<String, Protein> resultSetConfig, + AbstractAsyncCallback<ResultSet<Protein>> callback) + { + if (criteria != null) + { + specificViewContext.getService().listProteinsByExperiment(criteria, callback); + } + } + + @Override + protected void prepareExportEntities(TableExportCriteria<Protein> exportCriteria, + AbstractAsyncCallback<String> callback) + { + specificViewContext.getService().prepareExportProteins(exportCriteria, callback); + } + + public DatabaseModificationKind[] getRelevantModifications() + { + return new DatabaseModificationKind[] + { DatabaseModificationKind.createOrDelete(ObjectKind.DATA_SET) }; + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserWidget.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserWidget.java new file mode 100644 index 0000000000000000000000000000000000000000..bc80b993ff5848cfbd64797a770f0aecffb5bb5a --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserWidget.java @@ -0,0 +1,55 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import java.util.Set; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; + +/** + * + * + * @author Franz-Josef Elmer + */ +class ProteinByExperimentBrowserWidget extends QueryWidget +{ + + private IDisposableComponent disposableComponent; + + ProteinByExperimentBrowserWidget(IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + super(viewContext); + disposableComponent = ProteinByExperimentBrowserGrid.create(viewContext); + add(disposableComponent.getComponent()); + } + + @Override + public DatabaseModificationKind[] getRelevantModifications() + { + return disposableComponent.getRelevantModifications(); + } + + @Override + public void update(Set<DatabaseModificationKind> observedModifications) + { + disposableComponent.update(observedModifications); + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinColDefKind.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinColDefKind.java new file mode 100644 index 0000000000000000000000000000000000000000..546cfef4c8170d37fde397379c42e8b58551a0a4 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinColDefKind.java @@ -0,0 +1,54 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.AbstractColumnDefinitionKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; + +/** + * @author Franz-Josef Elmer + */ +public enum ProteinColDefKind implements IColumnDefinitionKind<Protein> +{ + DESCRIPTION(new AbstractColumnDefinitionKind<Protein>(Dict.PROTEIN_DESCRIPTION, true) + { + @Override + public String tryGetValue(Protein entity) + { + return entity.getDescription(); + } + }), + ; + + private final AbstractColumnDefinitionKind<Protein> columnDefinitionKind; + + private ProteinColDefKind(AbstractColumnDefinitionKind<Protein> columnDefinitionKind) + { + this.columnDefinitionKind = columnDefinitionKind; + } + + public String id() + { + return name(); + } + + public AbstractColumnDefinitionKind<Protein> getDescriptor() + { + return columnDefinitionKind; + } +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryMenu.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryMenu.java new file mode 100644 index 0000000000000000000000000000000000000000..a3e23d7b016f1597c15b0558987874c22b51f3e6 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryMenu.java @@ -0,0 +1,102 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import com.extjs.gxt.ui.client.widget.menu.Menu; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItemFactory; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ActionMenu; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.IActionMenuItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenuItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class QueryMenu extends TopMenuItem +{ + public static final String ID = GenericConstants.ID_PREFIX + "-phosphonetx-"; + + private static enum ActionMenuKind implements IActionMenuItem + { + ALL_PROTEINS_OF_AN_EXPERIMENT; + + public String getMenuId() + { + return ID + "_" + this.name(); + } + + public String getMenuText(IMessageProvider messageProvider) + { + return messageProvider.getMessage(this.name()); + } + } + + private static final class TabItemFactory implements ITabItemFactory + { + protected final IViewContext<IPhosphoNetXClientServiceAsync> viewContext; + private final String id; + private final String tabLabelKey; + private final QueryWidget widget; + + TabItemFactory(IViewContext<IPhosphoNetXClientServiceAsync> viewContext, + String tabLabelKey, QueryWidget widget) + { + this.viewContext = viewContext; + this.tabLabelKey = tabLabelKey; + this.widget = widget; + this.id = ID + tabLabelKey; + } + + public String getId() + { + return id; + } + + public ITabItem create() + { + String menuItemText = viewContext.getMessage(tabLabelKey); + DatabaseModificationAwareComponent component = + new DatabaseModificationAwareComponent(widget, widget); + return DefaultTabItem.create(menuItemText, component, viewContext, false); + } + } + + public QueryMenu(IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + super(viewContext.getMessage(Dict.QUERY_MENU_TITLE)); + setIconStyle(TopMenu.ICON_STYLE); + + Menu menu = new Menu(); + QueryWidget widget = new ProteinByExperimentBrowserWidget(viewContext); + TabItemFactory factory = + new TabItemFactory(viewContext, Dict.QUERY_ALL_PROTEINS_BY_EXPERIMENT, widget); + ActionMenu actionMenu = + new ActionMenu(ActionMenuKind.ALL_PROTEINS_OF_AN_EXPERIMENT, viewContext, factory); + menu.add(actionMenu); + setMenu(menu); + } +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryWidget.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryWidget.java new file mode 100644 index 0000000000000000000000000000000000000000..9aff082bf8acf1ea14f358002ae37b8dc3519234 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/QueryWidget.java @@ -0,0 +1,51 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import java.util.Set; + +import com.extjs.gxt.ui.client.widget.ContentPanel; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class QueryWidget extends ContentPanel implements IDatabaseModificationObserver +{ + protected final IViewContext<IPhosphoNetXClientServiceAsync> viewContext; + + public QueryWidget(IViewContext<IPhosphoNetXClientServiceAsync> viewContext) + { + this.viewContext = viewContext; + } + + public DatabaseModificationKind[] getRelevantModifications() + { + return new DatabaseModificationKind[] {}; + } + + public void update(Set<DatabaseModificationKind> observedModifications) + { + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ViewContext.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ViewContext.java new file mode 100644 index 0000000000000000000000000000000000000000..0fe66f33095a688a1727429f8a0253c322dfd20b --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ViewContext.java @@ -0,0 +1,54 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; + +import com.google.gwt.core.client.GWT; + +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractPluginViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class ViewContext extends AbstractPluginViewContext<IPhosphoNetXClientServiceAsync> +{ + private static final String TECHNOLOGY_NAME = "phosphonetx"; + + public ViewContext(IViewContext<ICommonClientServiceAsync> commonViewContext) + { + super(commonViewContext); + } + + @Override + protected String getTechnology() + { + return TECHNOLOGY_NAME; + } + + + @Override + protected IPhosphoNetXClientServiceAsync createClientServiceAsync() + { + return GWT.create(IPhosphoNetXClientService.class); + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/dto/ListProteinByExperimentCriteria.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/dto/ListProteinByExperimentCriteria.java new file mode 100644 index 0000000000000000000000000000000000000000..55a91b822857a8bf385917c3385fd65e8b804d13 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/dto/ListProteinByExperimentCriteria.java @@ -0,0 +1,45 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto; + +import com.google.gwt.user.client.rpc.IsSerializable; + +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class ListProteinByExperimentCriteria extends DefaultResultSetConfig<String, Protein> implements IsSerializable +{ + private TechId experimentID; + + public final TechId getExperimentID() + { + return experimentID; + } + + public final void setExperimentID(TechId experimentID) + { + this.experimentID = experimentID; + } + + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js index 26406c3600d49f9e719b40581ed7c8726dddc8ab..19e63043a9bb3d5c71232d661ab69509fd4843a3 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/public/phosphonetx-dictionary.js @@ -1,6 +1,9 @@ // PhosphoNetX dictionary -var phospohonetx = { - +var phosphonetx = { + query_menu_title: "Queries", + ALL_PROTEINS_OF_AN_EXPERIMENT: "All Proteins of an Experiment", + query_all_proteins_by_experiment: "Proteins of an Experiment", + selected_experiment_label: "Experiment", // LAST LINE: KEEP IT AT THE END lastline: "" // we need a line without a comma diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/ListProteinOriginalDataProvider.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/ListProteinOriginalDataProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..b8ee1e75b71e7e112a6b7a07f323b72d9ab491a0 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/ListProteinOriginalDataProvider.java @@ -0,0 +1,50 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.server; + +import java.util.List; + +import ch.systemsx.cisd.common.exceptions.UserFailureException; +import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDataProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; + +/** + * + * + * @author Franz-Josef Elmer + */ +class ListProteinOriginalDataProvider implements IOriginalDataProvider<Protein> +{ + private final IPhosphoNetXServer server; + private final String sessionToken; + private final TechId experimentID; + + ListProteinOriginalDataProvider(IPhosphoNetXServer server, String sessionToken, TechId experimentID) + { + this.server = server; + this.sessionToken = sessionToken; + this.experimentID = experimentID; + } + + public List<Protein> getOriginalData() throws UserFailureException + { + return server.listProteinsByExperiment(sessionToken, experimentID); + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientService.java new file mode 100644 index 0000000000000000000000000000000000000000..2d94bd83e2132ee79b6dd6a724765a8175cc892c --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientService.java @@ -0,0 +1,76 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.server; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import ch.systemsx.cisd.common.servlet.IRequestContextProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.client.web.server.AbstractClientService; +import ch.systemsx.cisd.openbis.generic.shared.IServer; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.ResourceNames; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; + +/** + * + * + * @author Franz-Josef Elmer + */ +@Component(value = ResourceNames.PHOSPHONETX_PLUGIN_SERVICE) +public class PhosphoNetXClientService extends AbstractClientService implements IPhosphoNetXClientService +{ + @Resource(name = ResourceNames.PHOSPHONETX_PLUGIN_SERVER) + private IPhosphoNetXServer server; + + public PhosphoNetXClientService() + { + super(); + } + + public PhosphoNetXClientService(IRequestContextProvider requestContextProvider) + { + super(requestContextProvider); + } + + @Override + protected IServer getServer() + { + return server; + } + + public ResultSet<Protein> listProteinsByExperiment(ListProteinByExperimentCriteria criteria) throws UserFailureException + { + final String sessionToken = getSessionToken(); + return listEntities(criteria, new ListProteinOriginalDataProvider(server, + sessionToken, criteria.getExperimentID())); + } + + public String prepareExportProteins(TableExportCriteria<Protein> exportCriteria) + throws UserFailureException + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientServiceServlet.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientServiceServlet.java new file mode 100644 index 0000000000000000000000000000000000000000..2f979d6021b90492396339a5f97e2a21c278b844 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/server/PhosphoNetXClientServiceServlet.java @@ -0,0 +1,48 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.server; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +import ch.systemsx.cisd.common.servlet.GWTRPCServiceExporter; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientService; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.ResourceNames; + +/** + * + * + * @author Franz-Josef Elmer + */ +@Controller +@RequestMapping({"/phosphonetx", "/openbis/phosphonetx"}) +public class PhosphoNetXClientServiceServlet extends GWTRPCServiceExporter +{ + private static final long serialVersionUID = 1L; + + @Resource(name = ResourceNames.PHOSPHONETX_PLUGIN_SERVICE) + private IPhosphoNetXClientService service; + + @Override + protected Object getService() + { + return service; + } + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServer.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServer.java index 96e5fb1c2dc2a302cbbfe3b00fe9be5975ef96e7..28f67d912b3ef8309b4ad5fdfb50b915b33704dd 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServer.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServer.java @@ -16,17 +16,23 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.server; +import java.util.ArrayList; +import java.util.List; + import org.springframework.stereotype.Component; import ch.rinn.restrictions.Private; import ch.systemsx.cisd.authentication.ISessionManager; +import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.server.AbstractServer; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; import ch.systemsx.cisd.openbis.generic.server.plugin.IDataSetTypeSlaveServerPlugin; import ch.systemsx.cisd.openbis.generic.server.plugin.ISampleTypeSlaveServerPlugin; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.ResourceNames; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; /** * @author Franz-Josef Elmer @@ -58,5 +64,12 @@ public class PhosphoNetXServer extends AbstractServer<IPhosphoNetXServer> implem { return new PhosphoNetXServerLogger(getSessionManager(), invocationSuccessful); } + + public List<Protein> listProteinsByExperiment(String sessionToken, TechId experimentId) + throws UserFailureException + { + ArrayList<Protein> proteins = new ArrayList<Protein>(); + return proteins; + } } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServerLogger.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServerLogger.java index c6e8456d40074e3b7063e7865787328a078b47d4..8b4f7ddb9ece61a6631807c7845f38b58cad0de4 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServerLogger.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/PhosphoNetXServerLogger.java @@ -28,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SampleGenerationDTO; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; /** * @@ -63,4 +64,11 @@ public class PhosphoNetXServerLogger extends AbstractServerLogger implements IPh newSample.getSampleType(), newSample.getIdentifier(), attachments.size()); } + public List<Protein> listProteinsByExperiment(String sessionToken, TechId experimentId) + throws UserFailureException + { + logAccess(sessionToken, "list_proteins_by_experiment", "ID(%s)", experimentId); + return null; + } + } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IPhosphoNetXServer.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IPhosphoNetXServer.java index e72021c36f86393203d6ec0ae44981fbe61a5352..6b01c312183e48ee3d3aba9422319ae6ca6fd023 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IPhosphoNetXServer.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/IPhosphoNetXServer.java @@ -16,7 +16,18 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.shared; +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.IServer; +import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.AuthorizationGuard; +import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RoleSet; +import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed; +import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.AbstractTechIdPredicate.ExperimentTechIdPredicate; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Protein; /** * @@ -25,5 +36,9 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ public interface IPhosphoNetXServer extends IServer { - + @Transactional + @RolesAllowed(RoleSet.OBSERVER) + public List<Protein> listProteinsByExperiment(String sessionToken, + @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) + TechId experimentId) throws UserFailureException; } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/basic/dto/AccessionNumberType.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/basic/dto/AccessionNumberType.java new file mode 100644 index 0000000000000000000000000000000000000000..208316f717c5ae58b1b6f9d84b5021aa9408d6d9 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/basic/dto/AccessionNumberType.java @@ -0,0 +1,30 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * + * + * @author Franz-Josef Elmer + */ +public enum AccessionNumberType implements IsSerializable +{ + IPI, REF_SEQ, SWISS_PROT, ENSEMBL, TREMBL, LOCUS_LINK, FLYBASE; + +} diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/basic/dto/Protein.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/basic/dto/Protein.java new file mode 100644 index 0000000000000000000000000000000000000000..c6390c9aae0902f3de59f11ba5442059f9312239 --- /dev/null +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/basic/dto/Protein.java @@ -0,0 +1,64 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class Protein implements IsSerializable +{ + private AccessionNumberType accessionNumberType; + + private String accessionNumber; + + private String description; + + public final AccessionNumberType getAccessionNumberType() + { + return accessionNumberType; + } + + public final void setAccessionNumberType(AccessionNumberType accessionNumberType) + { + this.accessionNumberType = accessionNumberType; + } + + public final String getAccessionNumber() + { + return accessionNumber; + } + + public final void setAccessionNumber(String accessionNumber) + { + this.accessionNumber = accessionNumber; + } + + public final String getDescription() + { + return description; + } + + public final void setDescription(String description) + { + this.description = description; + } + +} diff --git a/rtd_phosphonetx/source/sql/postgresql/001/schema-001.sql b/rtd_phosphonetx/source/sql/postgresql/001/schema-001.sql index 62979f8b28b2fada328cbb552035c2c90985b7f7..223c86cff06e3f7018a186073a6243255bd0b6c8 100644 --- a/rtd_phosphonetx/source/sql/postgresql/001/schema-001.sql +++ b/rtd_phosphonetx/source/sql/postgresql/001/schema-001.sql @@ -189,8 +189,7 @@ ALTER TABLE PROTEIN_STATISTICS ADD CONSTRAINT PRST_PK PRIMARY KEY (ID) CREATE TABLE PROTEINS( ID BIGSERIAL NOT NULL, - DATA_SET_CODE CODE NOT NULL, - SEQU_ID TECH_ID, + DATA_SET_PERM_ID CODE NOT NULL, ABUN_ID TECH_ID, PRST_ID TECH_ID )