diff --git a/openbis/resource/server/spring-servlet.xml b/openbis/resource/server/spring-servlet.xml index 8ec5724cdff99625fd5eca5bdca9f8a374cdc1e1..8c3b3ce6998fb6fc6f6bd32f153703b4815a0bcb 100644 --- a/openbis/resource/server/spring-servlet.xml +++ b/openbis/resource/server/spring-servlet.xml @@ -13,7 +13,7 @@ <context:annotation-config /> - <context:component-scan base-package="ch.systemsx.cisd.openbis.plugin" + <context:component-scan base-package="ch.systemsx.cisd.openbis" use-default-filters="false"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IClientServiceAsync.java index 77be56f15ebb1906a2a3b068e8fd367664e7f796..c47083e92ee7cbbe09632ca97cb1003519821f53 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IClientServiceAsync.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IClientServiceAsync.java @@ -27,16 +27,16 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext; public interface IClientServiceAsync { - /** @see IGenericClientService#getApplicationInfo() */ + /** @see ICommonClientService#getApplicationInfo() */ public void getApplicationInfo(AsyncCallback<ApplicationInfo> callback); - /** @see IGenericClientService#tryToGetCurrentSessionContext() */ + /** @see ICommonClientService#tryToGetCurrentSessionContext() */ public void tryToGetCurrentSessionContext(AsyncCallback<SessionContext> callback); - /** @see IGenericClientService#tryToLogin(String, String) */ + /** @see ICommonClientService#tryToLogin(String, String) */ public void tryToLogin(String userID, String password, AsyncCallback<SessionContext> callback); - /** @see IGenericClientService#logout() */ + /** @see ICommonClientService#logout() */ public void logout(AsyncCallback<Void> callback); } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java new file mode 100644 index 0000000000000000000000000000000000000000..16c3cebf094ad2ec828e4e0c8ddf25ae1687a57e --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java @@ -0,0 +1,135 @@ +/* + * Copyright 2008 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.generic.client.web.client; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExternalData; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.MatchingEntity; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Person; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.RoleAssignment; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Sample; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGeneration; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleToRegister; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity; +import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; + +/** + * Service interface for the generic GWT client. + * + * @author Franz-Josef Elmer + */ +public interface ICommonClientService extends IClientService +{ + /** + * Returns a list of all groups which belong to the specified database instance. + */ + public List<Group> listGroups(String databaseInstanceCode) throws UserFailureException; + + /** + * Registers a new group with specified code and optional description and group leader ID. + */ + public void registerGroup(String groupCode, String descriptionOrNull, String groupLeaderOrNull) + throws UserFailureException; + + /** + * Returns a list of all persons which belong to the current database instance. + */ + public List<Person> listPersons() throws UserFailureException; + + /** + * Registers a new person with specified code. + */ + public void registerPerson(String code) throws UserFailureException; + + /** + * Returns a list of all roles. + */ + public List<RoleAssignment> listRoles() throws UserFailureException; + + /** + * Registers a new role from given role set code, group code and person code + */ + public void registerGroupRole(String roleSetCode, String group, String person) + throws UserFailureException; + + /** + * Deletes the role described by given role set code, group code and person code + */ + public void deleteGroupRole(String roleSetCode, String group, String person) + throws UserFailureException; + + /** + * Registers a new role from given role set code and person code + */ + public void registerInstanceRole(String roleSetCode, String person) throws UserFailureException; + + /** + * Deletes the role described by given role set code and person code + */ + public void deleteInstanceRole(String roleSetCode, String person) throws UserFailureException; + + /** + * Returns a list of sample types. + */ + public List<SampleType> listSampleTypes() throws UserFailureException; + + /** + * Returns a list of samples for given sample type. + */ + public ResultSet<Sample> listSamples(final ListSampleCriteria criteria) + throws UserFailureException; + + /** + * For given <var>sampleIdentifier</var> returns corresponding {@link Sample}. + */ + public SampleGeneration getSampleInfo(final String sampleIdentifier) + throws UserFailureException; + + /** + * For given <var>sampleIdentifier</var> returns corresponding list of {@link ExternalData}. + */ + public List<ExternalData> listExternalData(final String sampleIdentifier) + throws UserFailureException; + + /** + * Lists the searchable entities. + */ + public List<SearchableEntity> listSearchableEntities() throws UserFailureException; + + /** + * Lists the entities matching the search. + */ + public ResultSet<MatchingEntity> listMatchingEntities( + final SearchableEntity searchableEntityOrNull, final String queryText, + final IResultSetConfig<String> resultSetConfig) throws UserFailureException; + + /** + * Removes the session result set associated with given key. + */ + public void removeResultSet(final String resultSetKey) throws UserFailureException; + + /** + * Registers a new sample. + */ + public void registerSample(final SampleToRegister sample) throws UserFailureException; +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java new file mode 100644 index 0000000000000000000000000000000000000000..609c8cc61509641e94d651105983fd931f6b7bc7 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java @@ -0,0 +1,120 @@ +/* + * Copyright 2008 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.generic.client.web.client; + +import java.util.List; + +import com.google.gwt.user.client.rpc.AsyncCallback; + +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExternalData; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.MatchingEntity; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Person; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.RoleAssignment; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Sample; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGeneration; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleToRegister; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity; +import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; + +/** + * Asynchronous version of {@link ICommonClientService}. + * + * @author Franz-Josef Elmer + */ +public interface ICommonClientServiceAsync extends IClientServiceAsync +{ + /** @see ICommonClientService#listGroups(String) */ + public void listGroups(String databaseInstanceCode, AsyncCallback<List<Group>> callback); + + /** @see ICommonClientService#registerGroup(String, String, String) */ + public void registerGroup(String groupCode, String descriptionOrNull, String groupLeaderOrNull, + AsyncCallback<Void> callback); + + /** @see ICommonClientService#listPersons() */ + public void listPersons(AsyncCallback<List<Person>> asyncCallback); + + /** @see ICommonClientService#registerPerson(String) */ + public void registerPerson(String code, AsyncCallback<Void> asyncCallback); + + /** @see ICommonClientService#listRoles() */ + public void listRoles(AsyncCallback<List<RoleAssignment>> asyncCallback); + + /** @see ICommonClientService#registerGroupRole(String, String, String) */ + public void registerGroupRole(String roleSetCode, String group, String person, + AsyncCallback<Void> asyncCallback); + + /** @see ICommonClientService#deleteGroupRole(String, String, String) */ + public void deleteGroupRole(String roleSetCode, String group, String person, + AsyncCallback<Void> asyncCallback); + + /** @see ICommonClientService#registerInstanceRole(String, String) */ + public void registerInstanceRole(String roleSetCode, String person, + AsyncCallback<Void> asyncCallback); + + /** @see ICommonClientService#deleteInstanceRole(String, String) */ + public void deleteInstanceRole(String roleSetCode, String person, + AsyncCallback<Void> asyncCallback); + + /** @see ICommonClientService#listSampleTypes() */ + public void listSampleTypes(AsyncCallback<List<SampleType>> asyncCallback); + + /** + * @see ICommonClientService#listSamples(ListSampleCriteria) + */ + public void listSamples(final ListSampleCriteria criteria, + AsyncCallback<ResultSet<Sample>> asyncCallback); + + /** + * @see ICommonClientService#getSampleInfo(String) + */ + public void getSampleInfo(final String sampleIdentifier, + AsyncCallback<SampleGeneration> asyncCallback); + + /** + * @see ICommonClientService#listExternalData(String) + */ + public void listExternalData(final String sampleIdentifier, + AsyncCallback<List<ExternalData>> asyncCallback); + + /** + * @see ICommonClientService#listSearchableEntities() + */ + public void listSearchableEntities(final AsyncCallback<List<SearchableEntity>> asyncCallback); + + /** + * @see ICommonClientService#listMatchingEntities(SearchableEntity, String, IResultSetConfig) + */ + public void listMatchingEntities(final SearchableEntity searchableEntity, + final String queryText, final IResultSetConfig<String> resultSetConfig, + final AsyncCallback<ResultSet<MatchingEntity>> asyncCallback); + + /** + * @see ICommonClientService#removeResultSet(String) + */ + public void removeResultSet(final String resultSetKey, final AsyncCallback<Void> asyncCallback); + + /** + * @see ICommonClientService#registerSample(SampleToRegister) + */ + public void registerSample(final SampleToRegister sample, + final AsyncCallback<Void> asyncCallback) throws UserFailureException; +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractClientPluginFactory.java index cfbb7d355b68d4473f068904972c8aabd78f7cfc..416fead57c31863c9ffd35a26a43e5a1e05e91a3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractClientPluginFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractClientPluginFactory.java @@ -17,7 +17,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application; import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; /** * An <i>abstract</i> {@link IClientPluginFactory} implementation. @@ -30,13 +30,13 @@ public abstract class AbstractClientPluginFactory<T extends IClientServiceAsync> private final IViewContext<T> viewContext; protected AbstractClientPluginFactory( - final IViewContext<IGenericClientServiceAsync> originalViewContext) + final IViewContext<ICommonClientServiceAsync> originalViewContext) { this.viewContext = createViewContext(originalViewContext); } protected abstract IViewContext<T> createViewContext( - IViewContext<IGenericClientServiceAsync> originalViewContext); + IViewContext<ICommonClientServiceAsync> originalViewContext); public final IViewContext<T> getViewContext() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java index 8bde311f06bdd3288ef4a373cdf6e61102938eab..ea92e69cdb761f17a9a586374de4b05cc5dddc63 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java @@ -22,8 +22,8 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.ServiceDefTarget; import ch.systemsx.cisd.openbis.generic.client.web.client.IClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientService; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AppController; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.LoginController; @@ -39,16 +39,16 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ApplicationInfo; */ public final class Client implements EntryPoint { - private IViewContext<IGenericClientServiceAsync> viewContext; + private IViewContext<ICommonClientServiceAsync> viewContext; - public final IViewContext<IGenericClientServiceAsync> tryToGetViewContext() + public final IViewContext<ICommonClientServiceAsync> tryToGetViewContext() { return viewContext; } - private final IViewContext<IGenericClientServiceAsync> createViewContext() + private final IViewContext<ICommonClientServiceAsync> createViewContext() { - final IGenericClientServiceAsync service = GWT.create(IGenericClientService.class); + final ICommonClientServiceAsync service = GWT.create(ICommonClientService.class); final ServiceDefTarget endpoint = (ServiceDefTarget) service; endpoint.setServiceEntryPoint(GenericConstants.GENERIC_SERVER_NAME); final IGenericImageBundle imageBundle = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DefaultClientPluginFactoryProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DefaultClientPluginFactoryProvider.java index d6ec75c9dd5a04665763454481eac34f1786fdd2..f17a1821066277ce7acdf1236423ce0b9ceb0ab0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DefaultClientPluginFactoryProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DefaultClientPluginFactoryProvider.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application; import java.util.HashSet; import java.util.Set; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.ClientPluginFactory; /** @@ -34,14 +34,14 @@ public final class DefaultClientPluginFactoryProvider implements IClientPluginFa private IClientPluginFactory genericPluginFactory; public DefaultClientPluginFactoryProvider( - final IViewContext<IGenericClientServiceAsync> originalViewContext) + final IViewContext<ICommonClientServiceAsync> originalViewContext) { genericPluginFactory = new ClientPluginFactory(originalViewContext); registerPluginFactories(originalViewContext); } private final void registerPluginFactories( - final IViewContext<IGenericClientServiceAsync> originalViewContext) + final IViewContext<ICommonClientServiceAsync> originalViewContext) { // Automatically generated part - START registerPluginFactory(new ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ClientPluginFactory(originalViewContext)); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java index 22ddf68eeef6746e7cedfb694650544ae85c69d4..0b7a4a1745c269a9a20e97c49bba11870b5bf8ca 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityChooser.java @@ -23,7 +23,7 @@ import com.extjs.gxt.ui.client.widget.form.ComboBox; import com.extjs.gxt.ui.client.widget.form.SimpleComboBox; import com.google.gwt.user.client.Element; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.SearchableEntityModel; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity; @@ -35,9 +35,9 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity; */ final class EntityChooser extends ComboBox<SearchableEntityModel> { - private final IViewContext<IGenericClientServiceAsync> genericContext; + private final IViewContext<ICommonClientServiceAsync> genericContext; - EntityChooser(final IViewContext<IGenericClientServiceAsync> genericContext) + EntityChooser(final IViewContext<ICommonClientServiceAsync> genericContext) { this.genericContext = genericContext; setEditable(false); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewContext.java index aff6bdab84c745875ff7f552bdb0ea2d4912550c..843e463d7ee63f1d12c7232049a99b4156956145 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericViewContext.java @@ -16,7 +16,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.CompositeMessageProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DictonaryBasedMessageProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; @@ -26,9 +26,9 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMess * * @author Franz-Josef Elmer */ -public final class GenericViewContext extends AbstractViewContext<IGenericClientServiceAsync> +public final class GenericViewContext extends AbstractViewContext<ICommonClientServiceAsync> { - private final IGenericClientServiceAsync service; + private final ICommonClientServiceAsync service; private final IMessageProvider messageProvider; @@ -40,7 +40,7 @@ public final class GenericViewContext extends AbstractViewContext<IGenericClient private final IClientPluginFactoryProvider clientPluginFactoryProvider; - GenericViewContext(final IGenericClientServiceAsync service, + GenericViewContext(final ICommonClientServiceAsync service, final IMessageProvider messageProvider, final IGenericImageBundle imageBundle, final IPageController pageController) { @@ -63,7 +63,7 @@ public final class GenericViewContext extends AbstractViewContext<IGenericClient return messageProvider; } - public final IGenericClientServiceAsync getService() + public final ICommonClientServiceAsync getService() { return service; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java index 0be7fcd49c7f3fec76181ae49088b3968813728d..a17ed455dcf46ad00e9299ec0600820285280ab1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java @@ -42,7 +42,7 @@ import com.extjs.gxt.ui.client.widget.grid.Grid; import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.google.gwt.user.client.rpc.AsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.MatchingEntityModel; @@ -69,7 +69,7 @@ final class MatchingEntitiesPanel extends ContentPanel implements Listener<TabPa static final String GRID_ID = PREFIX + "grid"; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; private final PagingLoader<PagingLoadConfig> matchingEntitiesLoader; @@ -81,7 +81,7 @@ final class MatchingEntitiesPanel extends ContentPanel implements Listener<TabPa private ResultSet<MatchingEntity> firstResultSet; - MatchingEntitiesPanel(final IViewContext<IGenericClientServiceAsync> viewContext, + MatchingEntitiesPanel(final IViewContext<ICommonClientServiceAsync> viewContext, final SearchableEntity searchableEntity, final String queryText) { this.viewContext = viewContext; @@ -257,7 +257,7 @@ final class MatchingEntitiesPanel extends ContentPanel implements Listener<TabPa private final int offset; - ListMatchingEntitiesCallback(final IViewContext<IGenericClientServiceAsync> viewContext, + ListMatchingEntitiesCallback(final IViewContext<ICommonClientServiceAsync> viewContext, final AsyncCallback<PagingLoadResult<MatchingEntityModel>> delegate, final int offset) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java index d4ca0d39cc08bb2e786705f2b660fbddce6182cf..506d617d6e42b52a7c14f583cf22cc34e87b54da 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java @@ -31,7 +31,7 @@ import com.extjs.gxt.ui.client.widget.form.TextField; import com.extjs.gxt.ui.client.widget.layout.TableRowLayout; import com.google.gwt.user.client.ui.Image; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AppEvents; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ITabItem; @@ -71,7 +71,7 @@ final class SearchWidget extends LayoutContainer private final TextField<String> textField; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; private final Button searchButton; @@ -79,7 +79,7 @@ final class SearchWidget extends LayoutContainer private final Image loadingImage; - SearchWidget(final IViewContext<IGenericClientServiceAsync> viewContext) + SearchWidget(final IViewContext<ICommonClientServiceAsync> viewContext) { final TableRowLayout tableRowLayout = createLayout(); setLayout(tableRowLayout); @@ -236,7 +236,7 @@ final class SearchWidget extends LayoutContainer private final String queryText; - SearchResultCallback(final IViewContext<IGenericClientServiceAsync> viewContext, + SearchResultCallback(final IViewContext<ICommonClientServiceAsync> viewContext, final SearchableEntity searchableEntityOrNull, final String queryText) { super(viewContext); @@ -245,9 +245,9 @@ final class SearchWidget extends LayoutContainer } @SuppressWarnings("unchecked") - private final IViewContext<IGenericClientServiceAsync> castViewContext() + private final IViewContext<ICommonClientServiceAsync> castViewContext() { - return (IViewContext<IGenericClientServiceAsync>) viewContext; + return (IViewContext<ICommonClientServiceAsync>) viewContext; } // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SessionContextCallback.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SessionContextCallback.java index b6c2c43dbf64648e4935240b9e26f47652412742..e5251aee148020aaadb2cd551666949cb7894fbd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SessionContextCallback.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SessionContextCallback.java @@ -18,13 +18,13 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application; import com.extjs.gxt.ui.client.mvc.Dispatcher; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientService; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AppEvents; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext; /** * Callback class which handles return value - * {@link IGenericClientService#tryToGetCurrentSessionContext()}. + * {@link ICommonClientService#tryToGetCurrentSessionContext()}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginController.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginController.java index a797fc5d7b9d97d761d6ddd385ec64f76672299d..48a20e98bb3532eb8a220b0075e530be6808fbf2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginController.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginController.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework import com.extjs.gxt.ui.client.mvc.AppEvent; import com.extjs.gxt.ui.client.mvc.Controller; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; /** @@ -31,7 +31,7 @@ public final class LoginController extends Controller { private final LoginView loginView; - public LoginController(final IViewContext<IGenericClientServiceAsync> viewContext) + public LoginController(final IViewContext<ICommonClientServiceAsync> viewContext) { registerEventTypes(AppEvents.LOGIN); loginView = new LoginView(this, viewContext); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java index f718009503e4ada010e624b815992a4aae29171d..f8f184253de03d6ec9ba5886d95f03a9c294e461 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java @@ -25,7 +25,7 @@ import com.extjs.gxt.ui.client.widget.Text; import com.extjs.gxt.ui.client.widget.VerticalPanel; import com.extjs.gxt.ui.client.widget.layout.CenterLayout; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.LoginWidget; @@ -37,7 +37,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.LoginWi final class LoginPage extends LayoutContainer { - LoginPage(final IViewContext<IGenericClientServiceAsync> viewContext) + LoginPage(final IViewContext<ICommonClientServiceAsync> viewContext) { setStyleName("login-page"); setLayout(new CenterLayout()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginView.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginView.java index d9fe80c07690fec94a7eec2daf2953289851b4c0..68cc2dbc3c50f31efbb9ee762d2e28f5baf0c1d2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginView.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginView.java @@ -21,7 +21,7 @@ import com.extjs.gxt.ui.client.mvc.Controller; import com.extjs.gxt.ui.client.mvc.View; import com.google.gwt.user.client.ui.RootPanel; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; /** @@ -33,10 +33,10 @@ public class LoginView extends View { private LoginPage loginPage; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; public LoginView(final Controller controller, - final IViewContext<IGenericClientServiceAsync> viewContext) + final IViewContext<ICommonClientServiceAsync> viewContext) { super(controller); this.viewContext = viewContext; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java index dd967da9e924a96dea611a0e981e90e063e92052..b90cfad7e2c2249b030d0d03c6c4f7a313fa7b76 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java @@ -27,7 +27,7 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.DOM; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; @@ -42,11 +42,11 @@ public class MainTabPanel extends TabPanel public static final String TAB_SUFFIX = "_tab"; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; public static final String ID = PREFIX.substring(0, PREFIX.length() - 1); - MainTabPanel(final IViewContext<IGenericClientServiceAsync> viewContext) + MainTabPanel(final IViewContext<ICommonClientServiceAsync> viewContext) { this.viewContext = viewContext; setLayout(new FitLayout()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/Footer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/Footer.java index 31f06c1d3b5a5fa4fddf711ae71e2174e5ca45c0..eac7ae7b15883674fd46e3f9dfd26c9e9c4176e1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/Footer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/Footer.java @@ -18,7 +18,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui; import com.extjs.gxt.ui.client.widget.Text; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; /** @@ -28,7 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte */ public final class Footer extends Text { - public Footer(final IViewContext<IGenericClientServiceAsync> viewContext) + public Footer(final IViewContext<ICommonClientServiceAsync> viewContext) { super(viewContext.getMessageProvider().getMessage("footer", viewContext.getModel().getApplicationInfo().getVersion())); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java index 23747df048863342cf2fb78e21d3432e3f436a64..46e841be84f2b0d7bcda14375817ffc82cf13272 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java @@ -29,7 +29,7 @@ import com.extjs.gxt.ui.client.widget.form.Field; import com.extjs.gxt.ui.client.widget.form.FormPanel; import com.extjs.gxt.ui.client.widget.form.TextField; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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; @@ -63,7 +63,7 @@ public class LoginWidget extends VerticalPanel private final FormPanel formPanel; - public LoginWidget(final IViewContext<IGenericClientServiceAsync> viewContext) + public LoginWidget(final IViewContext<ICommonClientServiceAsync> viewContext) { setSpacing(10); add(new Text(viewContext.getMessageProvider().getMessage(PREFIX + "invitation"))); @@ -90,7 +90,7 @@ public class LoginWidget extends VerticalPanel } private final TextField<String> createUserField( - final IViewContext<IGenericClientServiceAsync> viewContext) + final IViewContext<ICommonClientServiceAsync> viewContext) { final TextField<String> field = new TextField<String>(); field.setFieldLabel(viewContext.getMessageProvider().getMessage(PREFIX + "userLabel")); @@ -104,7 +104,7 @@ public class LoginWidget extends VerticalPanel } private final void addEnterKeyListener(final Field<String> field, - final IViewContext<IGenericClientServiceAsync> viewContext) + final IViewContext<ICommonClientServiceAsync> viewContext) { field.addKeyListener(new EnterKeyListener() { @@ -118,7 +118,7 @@ public class LoginWidget extends VerticalPanel } private final TextField<String> createPasswordField( - final IViewContext<IGenericClientServiceAsync> viewContext) + final IViewContext<ICommonClientServiceAsync> viewContext) { final TextField<String> field = new TextField<String>(); field.setPassword(true); @@ -130,7 +130,7 @@ public class LoginWidget extends VerticalPanel return field; } - private final Button createButton(final IViewContext<IGenericClientServiceAsync> viewContext) + private final Button createButton(final IViewContext<ICommonClientServiceAsync> viewContext) { final Button b = new Button(viewContext.getMessageProvider().getMessage(PREFIX + "buttonLabel")); @@ -151,7 +151,7 @@ public class LoginWidget extends VerticalPanel return b; } - private final void doLogin(final IViewContext<IGenericClientServiceAsync> viewContext) + private final void doLogin(final IViewContext<ICommonClientServiceAsync> viewContext) { if (GWTUtils.isTesting() || formPanel.isValid()) { @@ -186,7 +186,7 @@ public class LoginWidget extends VerticalPanel public final class LoginCallback extends AbstractAsyncCallback<SessionContext> { - private LoginCallback(final IViewContext<IGenericClientServiceAsync> viewContext) + private LoginCallback(final IViewContext<ICommonClientServiceAsync> viewContext) { super(viewContext); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/GroupSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/GroupSelectionWidget.java index 6724be0d67372b766e76f33ff27cb97ec8f45da1..05de467e2bdf4e2e8d3d645b9f9cca900691dd16 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/GroupSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/GroupSelectionWidget.java @@ -25,7 +25,7 @@ import com.extjs.gxt.ui.client.store.ListStore; import com.extjs.gxt.ui.client.widget.form.ComboBox; import com.google.gwt.user.client.Element; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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; @@ -66,11 +66,11 @@ public class GroupSelectionWidget extends ComboBox<GroupModel> static final String ID = GenericConstants.ID_PREFIX + PREFIX; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; private final ListStore<GroupModel> groupStore; - public GroupSelectionWidget(final IViewContext<IGenericClientServiceAsync> viewContext) + public GroupSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext) { this.viewContext = viewContext; setId(ID); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowser.java index d583d00062a345b11c842cf2afeb4268ae3a25c3..3dc2f1b8dfffbe5a70b66f4c286af6d5a8fef2b5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowser.java @@ -23,7 +23,7 @@ import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.extjs.gxt.ui.client.widget.layout.RowData; import com.extjs.gxt.ui.client.widget.layout.RowLayout; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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.VoidAsyncCallback; @@ -43,9 +43,9 @@ public final class SampleBrowser extends LayoutContainer implements Listener<Tab private SampleBrowserGrid sampleBrowserGrid; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; - public SampleBrowser(final IViewContext<IGenericClientServiceAsync> viewContext) + public SampleBrowser(final IViewContext<ICommonClientServiceAsync> viewContext) { this.viewContext = viewContext; setId(ID); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserGrid.java index 5c0da39bd586de58de3362a96ff55a0a976aa959..4951d5838230522d55feb410b30d7b7be170a8f9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserGrid.java @@ -40,7 +40,7 @@ import com.extjs.gxt.ui.client.widget.grid.Grid; import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.google.gwt.user.client.rpc.AsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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; @@ -70,7 +70,7 @@ final class SampleBrowserGrid extends LayoutContainer static final String GRID_ID = GenericConstants.ID_PREFIX + PREFIX + "grid"; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; private final CommonColumns commonColumns; @@ -88,7 +88,7 @@ final class SampleBrowserGrid extends LayoutContainer private String resultSetKey; - SampleBrowserGrid(final IViewContext<IGenericClientServiceAsync> viewContext, + SampleBrowserGrid(final IViewContext<ICommonClientServiceAsync> viewContext, final CommonColumns commonColumns, final ParentColumns parentColumns, final PropertyColumns propertyColumns) { @@ -280,7 +280,7 @@ final class SampleBrowserGrid extends LayoutContainer private final int offset; - ListSamplesCallback(final IViewContext<IGenericClientServiceAsync> viewContext, + ListSamplesCallback(final IViewContext<ICommonClientServiceAsync> viewContext, final AsyncCallback<PagingLoadResult<SampleModel>> delegate, final int offset) { super(viewContext); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java index d6854329ca4ace9232c020d0ad73c8a10638243f..40790faa545b3e3bcd3c3d001c78cf0d9f2e9108 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleBrowserToolbar.java @@ -34,7 +34,7 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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.AppEvents; @@ -78,7 +78,7 @@ class SampleBrowserToolbar extends ToolBar private final ColumnChooser columnChooser; - public SampleBrowserToolbar(final IViewContext<IGenericClientServiceAsync> viewContext, + public SampleBrowserToolbar(final IViewContext<ICommonClientServiceAsync> viewContext, final SampleBrowserGrid sampleBrowserGrid, final CommonColumns commonColumns, final ParentColumns parentColumns, final PropertyColumns propertyColumns) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java index 71bb5059e4605f4d4d621eb74376d4b81fd132f8..0c2e27e51c8b27be52f1f261da8a60d411759836 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample_browser/SampleTypeSelectionWidget.java @@ -26,7 +26,7 @@ import com.extjs.gxt.ui.client.store.ListStore; import com.extjs.gxt.ui.client.widget.form.ComboBox; import com.google.gwt.user.client.Element; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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; @@ -82,18 +82,18 @@ public class SampleTypeSelectionWidget extends ComboBox<SampleTypeModel> static final String ID = GenericConstants.ID_PREFIX + PREFIX; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; private final ListStore<SampleTypeModel> sampleTypeStore; private final boolean allowEmpty; - public SampleTypeSelectionWidget(final IViewContext<IGenericClientServiceAsync> viewContext) + public SampleTypeSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext) { this(viewContext, false); } - public SampleTypeSelectionWidget(final IViewContext<IGenericClientServiceAsync> viewContext, + public SampleTypeSelectionWidget(final IViewContext<ICommonClientServiceAsync> viewContext, final boolean allowEmpty) { this.viewContext = viewContext; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java new file mode 100644 index 0000000000000000000000000000000000000000..18f131b668b2813d5346e1f14ce836116327fde8 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java @@ -0,0 +1,433 @@ +/* + * Copyright 2008 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.generic.client.web.server; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import ch.rinn.restrictions.Friend; +import ch.rinn.restrictions.Private; +import ch.systemsx.cisd.common.exceptions.UserFailureException; +import ch.systemsx.cisd.common.servlet.IRequestContextProvider; +import ch.systemsx.cisd.common.utilities.BeanUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExternalData; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.MatchingEntity; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Person; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.RoleAssignment; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Sample; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleGeneration; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleToRegister; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleType; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity; +import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDataProvider; +import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSet; +import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSetManager; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.DtoConverters; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.GroupTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.ListSampleCriteriaTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.PersonTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.ResultSetTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.RoleAssignmentTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.RoleCodeTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.SampleToRegisterTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.SampleTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.SampleTypeTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.SearchableEntityTranslator; +import ch.systemsx.cisd.openbis.generic.client.web.server.util.UserFailureExceptionTranslator; +import ch.systemsx.cisd.openbis.generic.server.SessionConstants; +import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; +import ch.systemsx.cisd.openbis.generic.shared.IServer; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleAssignmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleGenerationDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.DatabaseInstanceIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.GroupIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifierFactory; +import ch.systemsx.cisd.openbis.plugin.AbstractClientService; + +/** + * The {@link ICommonClientService} implementation. + * + * @author Franz-Josef Elmer + */ +@Component(value = ch.systemsx.cisd.openbis.generic.shared.ResourceNames.COMMON_SERVICE) +@Friend(toClasses = AbstractClientService.class) +public final class CommonClientService extends AbstractClientService implements + ICommonClientService +{ + + @Resource(name = ch.systemsx.cisd.openbis.generic.shared.ResourceNames.COMMON_SERVER) + private ICommonServer genericServer; + + public CommonClientService() + { + } + + @Private + CommonClientService(final ICommonServer genericServer, + final IRequestContextProvider requestContextProvider) + { + super(requestContextProvider); + this.genericServer = genericServer; + } + + @SuppressWarnings("unchecked") + private final <K> IResultSetManager<K> getResultSetManager() + { + return (IResultSetManager<K>) getHttpSession().getAttribute( + SessionConstants.OPENBIS_RESULT_SET_MANAGER); + } + + // + // AbstractClientService + // + + @Override + protected final IServer getServer() + { + return genericServer; + } + + // + // IGenericClientService + // + + public final List<Group> listGroups(final String databaseInstanceCode) + { + try + { + final DatabaseInstanceIdentifier identifier = + new DatabaseInstanceIdentifier(databaseInstanceCode); + final List<Group> result = new ArrayList<Group>(); + final List<GroupPE> groups = genericServer.listGroups(getSessionToken(), identifier); + for (final GroupPE group : groups) + { + result.add(GroupTranslator.translate(group)); + } + return result; + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final void registerGroup(final String groupCode, final String descriptionOrNull, + final String groupLeaderOrNull) + { + try + { + final String sessionToken = getSessionToken(); + genericServer.registerGroup(sessionToken, groupCode, descriptionOrNull, + groupLeaderOrNull); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final List<Person> listPersons() + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + + try + { + final List<Person> result = new ArrayList<Person>(); + final List<PersonPE> persons = genericServer.listPersons(getSessionToken()); + for (final PersonPE person : persons) + { + result.add(PersonTranslator.translate(person)); + } + return result; + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final void registerPerson(final String code) + { + try + { + final String sessionToken = getSessionToken(); + genericServer.registerPerson(sessionToken, code); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final List<RoleAssignment> listRoles() + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final List<RoleAssignment> result = new ArrayList<RoleAssignment>(); + final List<RoleAssignmentPE> roles = genericServer.listRoles(getSessionToken()); + for (final RoleAssignmentPE role : roles) + { + result.add(RoleAssignmentTranslator.translate(role)); + } + return result; + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final void registerGroupRole(final String roleSetCode, final String group, + final String person) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final GroupIdentifier groupIdentifier = + new GroupIdentifier(DatabaseInstanceIdentifier.HOME, group); + final String sessionToken = getSessionToken(); + genericServer.registerGroupRole(sessionToken, + RoleCodeTranslator.translate(roleSetCode), groupIdentifier, person); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final void registerInstanceRole(final String roleSetCode, final String person) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final String sessionToken = getSessionToken(); + genericServer.registerInstanceRole(sessionToken, RoleCodeTranslator + .translate(roleSetCode), person); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final void deleteGroupRole(final String roleSetCode, final String group, + final String person) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final GroupIdentifier groupIdentifier = + new GroupIdentifier(DatabaseInstanceIdentifier.HOME, group); + final String sessionToken = getSessionToken(); + genericServer.deleteGroupRole(sessionToken, RoleCodeTranslator.translate(roleSetCode), + groupIdentifier, person); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + + } + + public final void deleteInstanceRole(final String roleSetCode, final String person) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final String sessionToken = getSessionToken(); + genericServer.deleteInstanceRole(sessionToken, RoleCodeTranslator + .translate(roleSetCode), person); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + + } + + public final List<SampleType> listSampleTypes() + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final List<SampleTypePE> sampleTypes = genericServer.listSampleTypes(getSessionToken()); + final List<SampleType> result = new ArrayList<SampleType>(); + for (final SampleTypePE sampleTypePE : sampleTypes) + { + result.add(SampleTypeTranslator.translate(sampleTypePE)); + } + return result; + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final ResultSet<Sample> listSamples(final ListSampleCriteria listCriteria) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final IResultSetManager<String> resultSetManager = getResultSetManager(); + final IResultSet<String, Sample> result = + resultSetManager.getResultSet(listCriteria, new IOriginalDataProvider<Sample>() + { + + // + // IDataRetriever + // + + public final List<Sample> getOriginalData() + { + final List<SamplePE> samples = + genericServer.listSamples(getSessionToken(), + ListSampleCriteriaTranslator + .translate(listCriteria)); + final List<Sample> list = new ArrayList<Sample>(samples.size()); + for (final SamplePE sample : samples) + { + list.add(SampleTranslator.translate(sample)); + } + return list; + } + }); + return ResultSetTranslator.translate(result); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final SampleGeneration getSampleInfo(final String sampleIdentifier) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final SampleIdentifier identifier = SampleIdentifierFactory.parse(sampleIdentifier); + final SampleGenerationDTO sampleGeneration = + genericServer.getSampleInfo(getSessionToken(), identifier); + return BeanUtils.createBean(SampleGeneration.class, sampleGeneration, DtoConverters + .getSampleConverter()); + } catch (final ch.systemsx.cisd.common.exceptions.UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final List<ExternalData> listExternalData(final String sampleIdentifier) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final SampleIdentifier identifier = SampleIdentifierFactory.parse(sampleIdentifier); + final List<ExternalDataPE> externalData = + genericServer.listExternalData(getSessionToken(), identifier); + return BeanUtils.createBeanList(ExternalData.class, externalData); + } catch (final ch.systemsx.cisd.common.exceptions.UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final List<SearchableEntity> listSearchableEntities() + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final List<SearchableEntity> searchableEntities = + BeanUtils.createBeanList(SearchableEntity.class, Arrays + .asList(ch.systemsx.cisd.openbis.generic.shared.dto.SearchableEntity + .values())); + Collections.sort(searchableEntities); + return searchableEntities; + } catch (final ch.systemsx.cisd.common.exceptions.UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final ResultSet<MatchingEntity> listMatchingEntities( + final SearchableEntity searchableEntityOrNull, final String queryText, + final IResultSetConfig<String> resultSetConfig) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final ch.systemsx.cisd.openbis.generic.shared.dto.SearchableEntity[] matchingEntities = + SearchableEntityTranslator.translate(searchableEntityOrNull); + final IResultSetManager<String> resultSetManager = getResultSetManager(); + final IResultSet<String, MatchingEntity> result = + resultSetManager.getResultSet(resultSetConfig, + new IOriginalDataProvider<MatchingEntity>() + { + + // + // IDataRetriever + // + + public final List<MatchingEntity> getOriginalData() + { + return BeanUtils.createBeanList(MatchingEntity.class, + genericServer.listMatchingEntities( + getSessionToken(), matchingEntities, + queryText), DtoConverters + .getMatchingEntityConverter()); + } + }); + return ResultSetTranslator.translate(result); + } catch (final ch.systemsx.cisd.common.exceptions.UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final void removeResultSet(final String resultSetKey) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final IResultSetManager<String> resultSetManager = getResultSetManager(); + resultSetManager.removeResultSet(resultSetKey); + } catch (final ch.systemsx.cisd.common.exceptions.UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + + public final void registerSample(SampleToRegister sample) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final String sessionToken = getSessionToken(); + genericServer + .registerSample(sessionToken, SampleToRegisterTranslator.translate(sample)); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceServlet.java new file mode 100644 index 0000000000000000000000000000000000000000..afc3c25219b8d9e0ec3e49c9d3bc07a52754b264 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceServlet.java @@ -0,0 +1,56 @@ +/* + * Copyright 2008 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.generic.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.generic.client.web.client.ICommonClientService; + +/** + * The {@link GWTRPCServiceExporter} for the <i>generic</i> service. + * <p> + * <i>URL</i> mappings are: <code>/common</code> and <code>/genericopenbis/common</code>. The + * encapsulated {@link ICommonClientService} service implementation is expected to be defined as + * bean with name <code>generic-service</code>. + * </p> + * + * @author Christian Ribeaud + */ +@Controller +@RequestMapping( + { "/common", "/genericopenbis/common" }) +public final class CommonClientServiceServlet extends GWTRPCServiceExporter +{ + private static final long serialVersionUID = 1L; + + @Resource(name = ch.systemsx.cisd.openbis.generic.shared.ResourceNames.COMMON_SERVICE) + private ICommonClientService service; + + // + // GWTRPCServiceExporter + // + + @Override + protected final Object getService() + { + return service; + } +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java index bd726b7360e30c1f43183437f3c5eda7bc5e1bfd..396175dbc247e0afe74c93ac4ed4175f59594a11 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java @@ -63,6 +63,7 @@ public abstract class AbstractServer<T extends IServer> implements IServer, protected AbstractServer() { + System.out.println(getClass()); } private final ProxyFactory getProxyFactory() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java new file mode 100644 index 0000000000000000000000000000000000000000..9fed5fac5a778489c339c61b46db2da0bc8ce093 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java @@ -0,0 +1,339 @@ +/* + * Copyright 2008 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.generic.server; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.dao.DataAccessException; +import org.springframework.stereotype.Component; + +import ch.systemsx.cisd.authentication.IAuthenticationService; +import ch.systemsx.cisd.authentication.ISessionManager; +import ch.systemsx.cisd.authentication.Principal; +import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException; +import ch.systemsx.cisd.common.exceptions.UserFailureException; +import ch.systemsx.cisd.common.utilities.ParameterChecker; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IExternalDataTable; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IGenericBusinessObjectFactory; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IGroupBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IRoleAssignmentTable; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleTable; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IRoleAssignmentDAO; +import ch.systemsx.cisd.openbis.generic.server.util.GroupIdentifierHelper; +import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; +import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.IMatchingEntity; +import ch.systemsx.cisd.openbis.generic.shared.dto.ListSampleCriteriaDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.NewRoleAssignment; +import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleAssignmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleCode; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleGenerationDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleToRegisterDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SearchableEntity; +import ch.systemsx.cisd.openbis.generic.shared.dto.Session; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.DatabaseInstanceIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.GroupIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; +import ch.systemsx.cisd.openbis.plugin.ISampleServerPlugin; +import ch.systemsx.cisd.openbis.plugin.SampleServerPluginRegistry; + +/** + * Implementation of client-server interface. + * + * @author Franz-Josef Elmer + */ +@Component(ch.systemsx.cisd.openbis.generic.shared.ResourceNames.COMMON_SERVER) +public final class CommonServer extends AbstractServer<ICommonServer> implements ICommonServer +{ + @Resource(name = ComponentNames.AUTHENTICATION_SERVICE) + private IAuthenticationService authenticationService; + + public CommonServer() + { + } + + CommonServer(final IAuthenticationService authenticationService, + final ISessionManager<Session> sessionManager, final IDAOFactory daoFactory, + final IGenericBusinessObjectFactory boFactory) + { + super(sessionManager, daoFactory, boFactory); + this.authenticationService = authenticationService; + } + + // + // AbstractServer + // + + @Override + protected final Class<ICommonServer> getProxyInterface() + { + return ICommonServer.class; + } + + // + // IInvocationLoggerFactory + // + + /** + * Creates a logger used to log invocations of objects of this class. + */ + public final ICommonServer createLogger(final boolean invocationSuccessful) + { + return new CommonServerLogger(getSessionManager(), invocationSuccessful); + } + + // + // IGenericServer + // + + public final List<GroupPE> listGroups(final String sessionToken, + final DatabaseInstanceIdentifier identifier) + { + final Session session = getSessionManager().getSession(sessionToken); + final DatabaseInstancePE databaseInstance = + GroupIdentifierHelper.getDatabaseInstance(identifier, getDAOFactory()); + final List<GroupPE> groups = getDAOFactory().getGroupDAO().listGroups(databaseInstance); + final Long homeGroupID = session.tryGetHomeGroupId(); + for (final GroupPE group : groups) + { + group.setHome(homeGroupID != null && homeGroupID.equals(group.getId())); + } + Collections.sort(groups); + return groups; + } + + public final void registerGroup(final String sessionToken, final String groupCode, + final String descriptionOrNull, final String groupLeaderOrNull) + { + final Session session = getSessionManager().getSession(sessionToken); + final IGroupBO groupBO = getBusinessObjectFactory().createGroupBO(session); + groupBO.define(groupCode, descriptionOrNull, groupLeaderOrNull); + groupBO.save(); + } + + public final void registerPerson(final String sessionToken, final String userID) + { + final Session session = getSessionManager().getSession(sessionToken); + final PersonPE person = getDAOFactory().getPersonDAO().tryFindPersonByUserId(userID); + if (person != null) + { + throw UserFailureException.fromTemplate("Person '%s' already exists.", userID); + } + final String applicationToken = authenticationService.authenticateApplication(); + if (applicationToken == null) + { + throw new EnvironmentFailureException("Authentication service cannot be accessed."); + } + try + { + final Principal principal = + authenticationService.getPrincipal(applicationToken, userID); + createPerson(principal, session.tryGetPerson()); + } catch (final IllegalArgumentException e) + { + throw new UserFailureException("Person '" + userID + + "' unknown by the authentication service."); + } + } + + public final List<RoleAssignmentPE> listRoles(final String sessionToken) + { + getSessionManager().getSession(sessionToken); + return getDAOFactory().getRoleAssignmentDAO().listRoleAssignments(); + } + + public final void registerGroupRole(final String sessionToken, final RoleCode roleCode, + final GroupIdentifier groupIdentifier, final String person) + { + final Session session = getSessionManager().getSession(sessionToken); + + final NewRoleAssignment newRoleAssignment = new NewRoleAssignment(); + newRoleAssignment.setUserId(person); + newRoleAssignment.setGroupIdentifier(groupIdentifier); + newRoleAssignment.setRole(roleCode); + + final IRoleAssignmentTable table = + getBusinessObjectFactory().createRoleAssignmentTable(session); + table.add(newRoleAssignment); + table.save(); + + } + + public final void registerInstanceRole(final String sessionToken, final RoleCode roleCode, + final String person) + { + final Session session = getSessionManager().getSession(sessionToken); + + final NewRoleAssignment newRoleAssignment = new NewRoleAssignment(); + newRoleAssignment.setUserId(person); + newRoleAssignment.setDatabaseInstanceIdentifier(new DatabaseInstanceIdentifier( + DatabaseInstanceIdentifier.HOME)); + newRoleAssignment.setRole(roleCode); + + final IRoleAssignmentTable table = + getBusinessObjectFactory().createRoleAssignmentTable(session); + table.add(newRoleAssignment); + table.save(); + + } + + public final void deleteGroupRole(final String sessionToken, final RoleCode roleCode, + final GroupIdentifier groupIdentifier, final String person) + { + final Session session = getSessionManager().getSession(sessionToken); + + final RoleAssignmentPE roleAssignment = + getDAOFactory().getRoleAssignmentDAO().tryFindGroupRoleAssignment(roleCode, + groupIdentifier.getGroupCode(), person); + if (roleAssignment == null) + { + throw new UserFailureException("Given group role does not exist."); + } + final PersonPE personPE = session.tryGetPerson(); + if (roleAssignment.getPerson().equals(personPE) + && roleAssignment.getRole().equals(RoleCode.ADMIN)) + { + boolean isInstanceAdmin = false; + for (final RoleAssignmentPE roleAssigment : personPE.getRoleAssignments()) + { + if (roleAssigment.getDatabaseInstance() != null + && roleAssigment.getRole().equals(RoleCode.ADMIN)) + { + isInstanceAdmin = true; + } + } + if (isInstanceAdmin == false) + { + throw new UserFailureException( + "For safety reason you cannot give away your own group admin power. " + + "Ask instance admin to do that for you."); + } + } + getDAOFactory().getRoleAssignmentDAO().deleteRoleAssignment(roleAssignment); + } + + public final void deleteInstanceRole(final String sessionToken, final RoleCode roleCode, + final String person) + { + final Session session = getSessionManager().getSession(sessionToken); + final IRoleAssignmentDAO roleAssignmentDAO = getDAOFactory().getRoleAssignmentDAO(); + final RoleAssignmentPE roleAssignment = + roleAssignmentDAO.tryFindInstanceRoleAssignment(roleCode, person); + if (roleAssignment == null) + { + throw new UserFailureException("Given database instance role does not exist."); + } + if (roleAssignment.getPerson().equals(session.tryGetPerson()) + && roleAssignment.getRole().equals(RoleCode.ADMIN) + && roleAssignment.getDatabaseInstance() != null) + { + throw new UserFailureException( + "For safety reason you cannot give away your own omnipotence. " + + "Ask another instance admin to do that for you."); + } + roleAssignmentDAO.deleteRoleAssignment(roleAssignment); + } + + public final List<PersonPE> listPersons(final String sessionToken) + { + getSessionManager().getSession(sessionToken); + final List<PersonPE> persons = getDAOFactory().getPersonDAO().listPersons(); + Collections.sort(persons); + return persons; + } + + public final List<SampleTypePE> listSampleTypes(final String sessionToken) + { + getSessionManager().getSession(sessionToken); + return getDAOFactory().getSampleTypeDAO().listSampleTypes(true); + } + + public final List<SamplePE> listSamples(final String sessionToken, + final ListSampleCriteriaDTO criteria) + { + final Session session = getSessionManager().getSession(sessionToken); + final ISampleTable sampleTable = getBusinessObjectFactory().createSampleTable(session); + sampleTable.loadSamplesByCriteria(criteria); + sampleTable.enrichWithValidProcedure(); + sampleTable.enrichWithProperties(); + return sampleTable.getSamples(); + } + + public final SampleGenerationDTO getSampleInfo(final String sessionToken, + final SampleIdentifier identifier) + { + final Session session = getSessionManager().getSession(sessionToken); + final ISampleBO sampleBO = getBusinessObjectFactory().createSampleBO(session); + sampleBO.loadBySampleIdentifier(identifier); + final SamplePE sample = sampleBO.getSample(); + final ISampleServerPlugin plugin = + SampleServerPluginRegistry.getPlugin(this, sample.getSampleType()); + return plugin.getSlaveServer().getSampleInfo(getDAOFactory(), session, sample); + } + + public final List<ExternalDataPE> listExternalData(final String sessionToken, + final SampleIdentifier identifier) + { + final Session session = getSessionManager().getSession(sessionToken); + final IExternalDataTable externalDataTable = + getBusinessObjectFactory().createExternalDataTable(session); + externalDataTable.loadBySampleIdentifier(identifier); + return externalDataTable.getExternalData(); + } + + public final List<IMatchingEntity> listMatchingEntities(final String sessionToken, + final SearchableEntity[] searchableEntities, final String queryText) + { + getSessionManager().getSession(sessionToken); + final List<IMatchingEntity> list = new ArrayList<IMatchingEntity>(); + try + { + for (final SearchableEntity searchableEntity : searchableEntities) + { + final List<IMatchingEntity> entities = + getDAOFactory().getHibernateSearchDAO().searchEntitiesByTerm( + searchableEntity.getMatchingEntityClass(), + searchableEntity.getFields(), queryText); + list.addAll(entities); + } + } catch (final DataAccessException ex) + { + throw new UserFailureException(ex.getMostSpecificCause().getMessage(), ex); + } + return list; + } + + public final void registerSample(final String sessionToken, final SampleToRegisterDTO newSample) + { + final Session session = getSessionManager().getSession(sessionToken); + ParameterChecker.checkIfNotNull(newSample, "sample"); + final ISampleBO sampleBO = getBusinessObjectFactory().createSampleBO(session); + sampleBO.define(newSample); + sampleBO.save(); + } +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServerLogger.java new file mode 100644 index 0000000000000000000000000000000000000000..bd0af1eccdf2bce848a582e98d1710b521600ed4 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServerLogger.java @@ -0,0 +1,182 @@ +/* + * Copyright 2008 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.generic.server; + +import java.util.Arrays; +import java.util.List; + +import ch.systemsx.cisd.authentication.ISessionManager; +import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.IMatchingEntity; +import ch.systemsx.cisd.openbis.generic.shared.dto.ListSampleCriteriaDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleAssignmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleCode; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleGenerationDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePropertyPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleToRegisterDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SearchableEntity; +import ch.systemsx.cisd.openbis.generic.shared.dto.Session; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.DatabaseInstanceIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.GroupIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; + +/** + * Logger class for {@link CommonServer} which creates readable logs of method invocations. + * + * @author Franz-Josef Elmer + */ +final class CommonServerLogger extends AbstractServerLogger implements ICommonServer +{ + /** + * Creates an instance for the specified session manager and invocation status. The session + * manager is used to retrieve user information which will be a part of the log message. + */ + CommonServerLogger(final ISessionManager<Session> sessionManager, + final boolean invocationSuccessful) + { + super(sessionManager, invocationSuccessful); + } + + // + // IGenericServer + // + + public List<GroupPE> listGroups(final String sessionToken, + final DatabaseInstanceIdentifier identifier) + { + final String command = "list_groups"; + if (identifier == null || identifier.getDatabaseInstanceCode() == null) + { + logAccess(sessionToken, command); + } else + { + logAccess(sessionToken, command, "DATABASE-INSTANCE(%s)", identifier); + } + return null; + } + + public void registerGroup(final String sessionToken, final String groupCode, + final String descriptionOrNull, final String groupLeaderOrNull) + { + logTracking(sessionToken, "register_group", "CODE(%s)", groupCode); + } + + public List<PersonPE> listPersons(final String sessionToken) + { + logAccess(sessionToken, "list_persons"); + return null; + } + + public void registerPerson(final String sessionToken, final String userID) + { + logTracking(sessionToken, "register_person", "CODE(%s)", userID); + + } + + public List<RoleAssignmentPE> listRoles(final String sessionToken) + { + logAccess(sessionToken, "list_roles"); + return null; + } + + public void registerGroupRole(final String sessionToken, final RoleCode roleCode, + final GroupIdentifier groupIdentifier, final String person) + { + logTracking(sessionToken, "register_role", "ROLE(%s) GROUP(%s) PERSON(%s)", roleCode, + groupIdentifier, person); + + } + + public void registerInstanceRole(final String sessionToken, final RoleCode roleCode, + final String person) + { + logTracking(sessionToken, "register_role", "ROLE(%s) PERSON(%s)", roleCode, person); + + } + + public void deleteGroupRole(final String sessionToken, final RoleCode roleCode, + final GroupIdentifier groupIdentifier, final String person) + { + logTracking(sessionToken, "delete_role", "ROLE(%s) GROUP(%s) PERSON(%s)", roleCode, + groupIdentifier, person); + + } + + public void deleteInstanceRole(final String sessionToken, final RoleCode roleCode, + final String person) + { + logTracking(sessionToken, "delete_role", "ROLE(%s) PERSON(%s)", roleCode, person); + + } + + public final List<SampleTypePE> listSampleTypes(final String sessionToken) + { + logAccess(sessionToken, "list_sample_types"); + return null; + } + + public final List<SamplePE> listSamples(final String sessionToken, + final ListSampleCriteriaDTO criteria) + { + logAccess(sessionToken, "list_samples", "TYPE(%s) OWNERS(%s)", criteria.getSampleType(), + criteria.getOwnerIdentifiers()); + return null; + } + + public final List<SamplePropertyPE> listSamplesProperties(final String sessionToken, + final ListSampleCriteriaDTO criteria, final List<PropertyTypePE> propertyCodes) + { + logAccess(sessionToken, "list_samples_properties", "CRITERIA(%s) PROPERTIES(%s)", criteria, + propertyCodes.size()); + return null; + } + + public final SampleGenerationDTO getSampleInfo(final String sessionToken, + final SampleIdentifier identifier) + { + logTracking(sessionToken, "get_sample_info", "IDENTIFIER(%s)", identifier); + return null; + } + + public final List<ExternalDataPE> listExternalData(final String sessionToken, + final SampleIdentifier identifier) + { + logTracking(sessionToken, "list_external_data", "IDENTIFIER(%s)", identifier); + return null; + } + + public final List<IMatchingEntity> listMatchingEntities(final String sessionToken, + final SearchableEntity[] searchableEntities, final String queryText) + { + logTracking(sessionToken, "list_matching_entities", + "SEARCHABLE-ENTITIES(%s) QUERY-TEXT(%s)", Arrays.toString(searchableEntities), + queryText); + return null; + } + + public void registerSample(String sessionToken, SampleToRegisterDTO newSample) + { + logTracking(sessionToken, "register_sample", "SAMPLE_TYPE(%s) SAMPLE(%S)", newSample + .getSampleTypeCode(), newSample.getSampleIdentifier()); + } +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java new file mode 100644 index 0000000000000000000000000000000000000000..2a092363f0ecec497853817e49c37ca842642a15 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java @@ -0,0 +1,172 @@ +/* + * Copyright 2008 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.generic.shared; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.AuthorizationGuard; +import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.ReturnValueFilter; +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.GroupIdentifierPredicate; +import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.SampleToRegisterDTOPredicate; +import ch.systemsx.cisd.openbis.generic.shared.authorization.validator.GroupValidator; +import ch.systemsx.cisd.openbis.generic.shared.authorization.validator.MatchingEntityValidator; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.IMatchingEntity; +import ch.systemsx.cisd.openbis.generic.shared.dto.ListSampleCriteriaDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleAssignmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleCode; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleGenerationDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleToRegisterDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SearchableEntity; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.DatabaseInstanceIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.GroupIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; + +/** + * Definition of the client-server interface. + * + * @author Franz-Josef Elmer + */ +public interface ICommonServer extends IServer +{ + /** + * Returns all groups which belong to the specified database instance. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.OBSERVER) + @ReturnValueFilter(validatorClass = GroupValidator.class) + public List<GroupPE> listGroups(String sessionToken, DatabaseInstanceIdentifier identifier); + + /** + * Registers a new group with specified code and optional description and group leader ID. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + public void registerGroup(String sessionToken, String groupCode, String descriptionOrNull, + String groupLeaderOrNull); + + /** + * Returns all persons from current instance. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.OBSERVER) + public List<PersonPE> listPersons(String sessionToken); + + /** + * Registers a new person. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + public void registerPerson(String sessionToken, String userID); + + /** + * Returns a list of all roles. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.GROUP_ADMIN) + public List<RoleAssignmentPE> listRoles(String sessionToken); + + /** + * Registers a new group role. + */ + @Transactional + @RolesAllowed(RoleSet.GROUP_ADMIN) + public void registerGroupRole(String sessionToken, RoleCode roleCode, + @AuthorizationGuard(guardClass = GroupIdentifierPredicate.class) + GroupIdentifier identifier, String person); + + /** + * Registers a new instance role. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + public void registerInstanceRole(String sessionToken, RoleCode roleCode, String person); + + /** + * Deletes role described by given role code, group identifier and user id. + */ + @Transactional + @RolesAllowed(RoleSet.GROUP_ADMIN) + public void deleteGroupRole(String sessionToken, RoleCode roleCode, + @AuthorizationGuard(guardClass = GroupIdentifierPredicate.class) + GroupIdentifier groupIdentifier, String person); + + /** + * Deletes role described by given role code and user id. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + public void deleteInstanceRole(String sessionToken, RoleCode roleCode, String person); + + /** + * Lists sample types which are appropriate for listing. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.OBSERVER) + public List<SampleTypePE> listSampleTypes(String sessionToken); + + /** + * Lists samples using given configuration.No properties are loaded. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.OBSERVER) + public List<SamplePE> listSamples(final String sessionToken, + final ListSampleCriteriaDTO criteria); + + /** + * For given {@link SampleIdentifier} returns the corresponding {@link SamplePE}. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.OBSERVER) + public SampleGenerationDTO getSampleInfo(final String sessionToken, + final SampleIdentifier identifier); + + /** + * For given {@link SampleIdentifier} returns the corresponding list of {@link ExternalDataPE}. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.OBSERVER) + public List<ExternalDataPE> listExternalData(final String sessionToken, + final SampleIdentifier identifier); + + /** + * Performs an <i>Hibernate Search</i> based on given parameters. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleSet.OBSERVER) + @ReturnValueFilter(validatorClass = MatchingEntityValidator.class) + public List<IMatchingEntity> listMatchingEntities(final String sessionToken, + final SearchableEntity[] searchableEntities, final String queryText); + + /** + * Registers a new sample. + */ + @Transactional + @RolesAllowed(RoleSet.USER) + public void registerSample(final String sessionToken, + @AuthorizationGuard(guardClass = SampleToRegisterDTOPredicate.class) + final SampleToRegisterDTO newSample); + +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ResourceNames.java new file mode 100644 index 0000000000000000000000000000000000000000..4b5445ad84f08d0c7674051f1f2704edb8701f75 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ResourceNames.java @@ -0,0 +1,39 @@ +/* + * Copyright 2008 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.generic.shared; + +/** + * Resource name used in <i>generic</i>. + * <p> + * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here + * should not conflict with already existing bean names. Look for other <code>ResourceNames</code> + * classes. + * </p> + * + * @author Christian Ribeaud + */ +public final class ResourceNames +{ + private ResourceNames() + { + // Can not be instantiated. + } + + public final static String COMMON_SERVICE = "common-service"; + + public final static String COMMON_SERVER = "common-server"; +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/SampleServerPluginRegistry.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/SampleServerPluginRegistry.java index 1353338a9a65dfcb4580d34ed3e2b5bd40973d67..21d010bd4fe9709f4179d3eb299f7c1fb1f4e3ff 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/SampleServerPluginRegistry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/SampleServerPluginRegistry.java @@ -24,7 +24,7 @@ import org.apache.log4j.Logger; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.common.utilities.AbstractHashable; -import ch.systemsx.cisd.openbis.generic.shared.IGenericServer; +import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; import ch.systemsx.cisd.openbis.plugin.generic.server.GenericSampleServerPlugin; @@ -99,7 +99,7 @@ public final class SampleServerPluginRegistry final T server, final SampleTypePE sampleType) { assert sampleType != null : "Unspecified sample type."; - if (server instanceof IGenericServer) + if (server instanceof ICommonServer) { return GENERIC_SAMPLE_SERVER_PLUGIN; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IGenericClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientService.java similarity index 97% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IGenericClientService.java rename to openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientService.java index 7889959b34fd7fa4ec8ad7d1c0592e302ed84fc0..3899bcce297330c0f9a12c3de623c393b93576f5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IGenericClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientService.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.client.web.client; +package ch.systemsx.cisd.openbis.plugin.generic.client.web.client; import java.util.List; +import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExternalData; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IGenericClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientServiceAsync.java similarity index 97% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IGenericClientServiceAsync.java rename to openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientServiceAsync.java index 3ea7c22879628530f8d7e21047dd80c854187388..6b9a909ba2fa11d87bcbb0956a001627ee801e9f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IGenericClientServiceAsync.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientServiceAsync.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.client.web.client; +package ch.systemsx.cisd.openbis.plugin.generic.client.web.client; import java.util.List; 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.ExternalData; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java index 69c900b33d3129ed0b5c33a899af0c020586aee6..581f2f52f33033db5085af6541ceb622007614c8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/ClientPluginFactory.java @@ -20,7 +20,7 @@ import java.util.Set; import com.google.gwt.user.client.ui.Widget; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ISampleViewClientPlugin; @@ -37,11 +37,11 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sam * @author Christian Ribeaud */ public final class ClientPluginFactory extends - AbstractClientPluginFactory<IGenericClientServiceAsync> + AbstractClientPluginFactory<ICommonClientServiceAsync> { private ISampleViewClientPlugin sampleViewClientPlugin; - public ClientPluginFactory(final IViewContext<IGenericClientServiceAsync> originalViewContext) + public ClientPluginFactory(final IViewContext<ICommonClientServiceAsync> originalViewContext) { super(originalViewContext); } @@ -51,8 +51,8 @@ public final class ClientPluginFactory extends // @Override - protected final IViewContext<IGenericClientServiceAsync> createViewContext( - final IViewContext<IGenericClientServiceAsync> originalViewContext) + protected final IViewContext<ICommonClientServiceAsync> createViewContext( + final IViewContext<ICommonClientServiceAsync> originalViewContext) { return originalViewContext; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java index 3b485adaf4b7b39c9e8f54df2d5d044bcfc986ca..c50725997f8c697bbcb061643852c496bc864ff2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java @@ -41,7 +41,7 @@ import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.ListBox; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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; @@ -67,7 +67,7 @@ public final class GenericSampleRegistrationForm extends FormPanel private static boolean SELECT_GROUP_BY_DEFAULT = true; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; private final SampleType sampleType; @@ -94,7 +94,7 @@ public final class GenericSampleRegistrationForm extends FormPanel private static final int FIELD_WIDTH = 400; public GenericSampleRegistrationForm( - final IViewContext<IGenericClientServiceAsync> viewContext, SampleType sampleType) + final IViewContext<ICommonClientServiceAsync> viewContext, SampleType sampleType) { this.viewContext = viewContext; this.sampleType = sampleType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java index 8553d739b7c42733d8d5936fc3bc302d38380a22..ab580d95887c0794b9b14bc366b10c8f54e7ade0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java @@ -48,7 +48,7 @@ import com.extjs.gxt.ui.client.widget.layout.RowData; import com.extjs.gxt.ui.client.widget.layout.RowLayout; import com.google.gwt.user.client.rpc.AsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; 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; @@ -87,7 +87,7 @@ public final class GenericSampleViewer extends LayoutContainer public static final String DATA_POSTFIX = "-data"; - private final IViewContext<IGenericClientServiceAsync> viewContext; + private final IViewContext<ICommonClientServiceAsync> viewContext; private Grid<SampleModel> partOfSamplesGrid; @@ -95,7 +95,7 @@ public final class GenericSampleViewer extends LayoutContainer private final String sampleIdentifier; - public GenericSampleViewer(final IViewContext<IGenericClientServiceAsync> viewContext, + public GenericSampleViewer(final IViewContext<ICommonClientServiceAsync> viewContext, final String sampleIdentifier) { setId(ID_PREFIX + sampleIdentifier); @@ -343,7 +343,7 @@ public final class GenericSampleViewer extends LayoutContainer { private final AsyncCallback<BaseListLoadResult<SampleModel>> delegate; - ListSamplesCallback(final IViewContext<IGenericClientServiceAsync> viewContext, + ListSamplesCallback(final IViewContext<ICommonClientServiceAsync> viewContext, final AsyncCallback<BaseListLoadResult<SampleModel>> callback) { super(viewContext); @@ -374,7 +374,7 @@ public final class GenericSampleViewer extends LayoutContainer { private final AsyncCallback<BaseListLoadResult<ExternalDataModel>> delegate; - ListExternalDataCallback(final IViewContext<IGenericClientServiceAsync> viewContext, + ListExternalDataCallback(final IViewContext<ICommonClientServiceAsync> viewContext, final AsyncCallback<BaseListLoadResult<ExternalDataModel>> callback) { super(viewContext); @@ -408,7 +408,7 @@ public final class GenericSampleViewer extends LayoutContainer private final GenericSampleViewer genericSampleViewer; private SampleGenerationInfoCallback( - final IViewContext<IGenericClientServiceAsync> viewContext, + final IViewContext<ICommonClientServiceAsync> viewContext, GenericSampleViewer genericSampleViewer) { super(viewContext); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java index 266d221adc4f614b604bb5765829fac24ec618e1..62efca32d76fd20db77ef6b11460df962f30d720 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java @@ -30,7 +30,6 @@ import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.common.servlet.IRequestContextProvider; import ch.systemsx.cisd.common.utilities.BeanUtils; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientService; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExternalData; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; @@ -60,7 +59,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.server.util.SampleTypeTransla import ch.systemsx.cisd.openbis.generic.client.web.server.util.SearchableEntityTranslator; import ch.systemsx.cisd.openbis.generic.client.web.server.util.UserFailureExceptionTranslator; import ch.systemsx.cisd.openbis.generic.server.SessionConstants; -import ch.systemsx.cisd.openbis.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; @@ -74,6 +72,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.GroupIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifierFactory; import ch.systemsx.cisd.openbis.plugin.AbstractClientService; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.IGenericClientService; +import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.plugin.generic.shared.ResourceNames; /** @@ -81,13 +81,13 @@ import ch.systemsx.cisd.openbis.plugin.generic.shared.ResourceNames; * * @author Franz-Josef Elmer */ -@Component(value = ResourceNames.GENERIC_SERVICE) +@Component(value = ResourceNames.GENERIC_PLUGIN_SERVICE) @Friend(toClasses = AbstractClientService.class) public final class GenericClientService extends AbstractClientService implements IGenericClientService { - @Resource(name = ResourceNames.GENERIC_SERVER) + @Resource(name = ResourceNames.GENERIC_PLUGIN_SERVER) private IGenericServer genericServer; public GenericClientService() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java index 3754ba142aac9bf84cd46af2b14d41c2ecc74a32..993148e25fc46744036fa86821fc10a1791369d2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java @@ -22,15 +22,16 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import ch.systemsx.cisd.common.servlet.GWTRPCServiceExporter; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientService; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.IGenericClientService; import ch.systemsx.cisd.openbis.plugin.generic.shared.ResourceNames; /** * The {@link GWTRPCServiceExporter} for the <i>generic</i> service. * <p> * <i>URL</i> mappings are: <code>/generic</code> and <code>/genericopenbis/generic</code>. - * The encapsulated {@link IGenericClientService} service implementation is expected to be defined - * as bean with name <code>generic-service</code>. + * The encapsulated {@link ICommonClientService} service implementation is expected to be defined as + * bean with name <code>generic-service</code>. * </p> * * @author Christian Ribeaud @@ -42,7 +43,7 @@ public final class GenericClientServiceServlet extends GWTRPCServiceExporter { private static final long serialVersionUID = 1L; - @Resource(name = ResourceNames.GENERIC_SERVICE) + @Resource(name = ResourceNames.GENERIC_PLUGIN_SERVICE) private IGenericClientService service; // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java index 704ba4bfd9bbdd70666248cd8f9b681ea1da7fb2..4520043f681cc3e4a4fefb2c5cb552bcd3120ea4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java @@ -42,7 +42,6 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleTable; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IRoleAssignmentDAO; import ch.systemsx.cisd.openbis.generic.server.util.GroupIdentifierHelper; -import ch.systemsx.cisd.openbis.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; @@ -63,6 +62,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.GroupIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.plugin.ISampleServerPlugin; import ch.systemsx.cisd.openbis.plugin.SampleServerPluginRegistry; +import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.plugin.generic.shared.ResourceNames; /** @@ -70,8 +70,9 @@ import ch.systemsx.cisd.openbis.plugin.generic.shared.ResourceNames; * * @author Franz-Josef Elmer */ -@Component(ResourceNames.GENERIC_SERVER) -public final class GenericServer extends AbstractServer<IGenericServer> implements IGenericServer +@Component(ResourceNames.GENERIC_PLUGIN_SERVER) +public final class GenericServer extends AbstractServer<IGenericServer> implements + ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer { @Resource(name = ComponentNames.AUTHENTICATION_SERVICE) private IAuthenticationService authenticationService; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java index f10f3628d074f1224de4829717a7fd12aa1160ff..a947c249d971cc629641ea0f2dc08aaf0f915d32 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java @@ -21,7 +21,6 @@ import java.util.List; import ch.systemsx.cisd.authentication.ISessionManager; import ch.systemsx.cisd.openbis.generic.server.AbstractServerLogger; -import ch.systemsx.cisd.openbis.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; import ch.systemsx.cisd.openbis.generic.shared.dto.IMatchingEntity; @@ -40,6 +39,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.DatabaseInstanceIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.GroupIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; +import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; /** * Logger class for {@link GenericServer} which creates readable logs of method invocations. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IGenericServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/IGenericServer.java similarity index 98% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IGenericServer.java rename to openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/IGenericServer.java index 004b3c04802d097e85606900886ec1f968a1e36a..8debae06cc7ec30e5c4cdb254bb85cca6ab6c373 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IGenericServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/IGenericServer.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.shared; +package ch.systemsx.cisd.openbis.plugin.generic.shared; import java.util.List; import org.springframework.transaction.annotation.Transactional; +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.ReturnValueFilter; import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RoleSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java index bab0e07d2fe901739630512f3e731a62ccd45d14..d631b45fbc8badcaeb77f7eb33ca076a0d0eb0a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java @@ -18,14 +18,19 @@ package ch.systemsx.cisd.openbis.plugin.generic.shared; /** * Resource name used in <i>generic</i> plug-in. + * <p> + * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here + * should not conflict with already existing bean names. Look for other <code>ResourceNames</code> + * classes. + * </p> * * @author Christian Ribeaud */ public final class ResourceNames { - public final static String GENERIC_SERVICE = "generic-service"; + public final static String GENERIC_PLUGIN_SERVICE = "generic-plugin-service"; - public final static String GENERIC_SERVER = "generic-server"; + public final static String GENERIC_PLUGIN_SERVER = "generic-plugin-server"; public final static String GENERIC_SAMPLE_TYPE_SLAVE_SERVER_PLUGIN = "generic-sample-type-slave-server-plugin"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java index 5d53d86496fae83f8b20d598881da41f88f1b059..8328698b0b0237c70a8211287256d52568526581 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java @@ -21,7 +21,7 @@ import java.util.Set; import com.google.gwt.user.client.ui.Widget; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IClientPluginFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ISampleViewClientPlugin; @@ -46,7 +46,7 @@ public final class ClientPluginFactory extends { private ISampleViewClientPlugin sampleViewClientPlugin; - public ClientPluginFactory(final IViewContext<IGenericClientServiceAsync> originalViewContext) + public ClientPluginFactory(final IViewContext<ICommonClientServiceAsync> originalViewContext) { super(originalViewContext); } @@ -57,7 +57,7 @@ public final class ClientPluginFactory extends @Override protected final IViewContext<IScreeningClientServiceAsync> createViewContext( - final IViewContext<IGenericClientServiceAsync> originalViewContext) + final IViewContext<ICommonClientServiceAsync> originalViewContext) { return new ScreeningViewContext(originalViewContext); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java index bb32e3260f8f6ed64e8a15c11ba60f10ee0cb745..b3c4db7a273aefd7818df3e038f2c37278c23aa8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningViewContext.java @@ -3,7 +3,7 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.ServiceDefTarget; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericViewModel; @@ -26,13 +26,13 @@ public final class ScreeningViewContext extends AbstractViewContext<IScreeningCl { private static final String TECHNOLOGY_NAME = "screening"; - private final IViewContext<IGenericClientServiceAsync> originalViewContext; + private final IViewContext<ICommonClientServiceAsync> originalViewContext; private final IMessageProvider messageProvider; private final IScreeningClientServiceAsync service; - public ScreeningViewContext(final IViewContext<IGenericClientServiceAsync> originalViewContext) + public ScreeningViewContext(final IViewContext<ICommonClientServiceAsync> originalViewContext) { this.originalViewContext = originalViewContext; this.messageProvider = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java index afb346befaa52728e8b629e5c37dc6c31df45c62..173161e678603005339d9a57b75f66fa686c10dc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java @@ -39,12 +39,12 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames; * * @author Christian Ribeaud */ -@Component(value = ResourceNames.SCREENING_SERVICE) +@Component(value = ResourceNames.SCREENING_PLUGIN_SERVICE) public final class ScreeningClientService extends AbstractClientService implements IScreeningClientService { - @Resource(name = ResourceNames.SCREENING_SERVER) + @Resource(name = ResourceNames.SCREENING_PLUGIN_SERVER) private IScreeningServer screeningServer; // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java index badf1579b71bf37945806e331ffd0c3ac43b5303..8ca3be0921070e03a7056f049bc1721f8369aa50 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientServiceServlet.java @@ -22,7 +22,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import ch.systemsx.cisd.common.servlet.GWTRPCServiceExporter; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientService; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientService; import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames; @@ -30,7 +30,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames; * The {@link GWTRPCServiceExporter} for the <i>screening</i> service. * <p> * <i>URL</i> mappings are: <code>/screening</code> and <code>/genericopenbis/screening</code>. - * The encapsulated {@link IGenericClientService} service implementation is expected to be defined + * The encapsulated {@link ICommonClientService} service implementation is expected to be defined * as bean with name <code>screening-service</code>. * </p> * @@ -43,7 +43,7 @@ public final class ScreeningClientServiceServlet extends GWTRPCServiceExporter { private static final long serialVersionUID = 1L; - @Resource(name = ResourceNames.SCREENING_SERVICE) + @Resource(name = ResourceNames.SCREENING_PLUGIN_SERVICE) private IScreeningClientService service; // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java index ad5fa082883035a0eba8e3ac3c32ccd4cddbb89f..f7fc323f10f541e6c5b0fa276f68b4a0a55b39fa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java @@ -37,7 +37,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.ResourceNames; * * @author Christian Ribeaud */ -@Component(ResourceNames.SCREENING_SERVER) +@Component(ResourceNames.SCREENING_PLUGIN_SERVER) public final class ScreeningServer extends AbstractServer<IScreeningServer> implements IScreeningServer { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java index e7b4b7e4fe39aec4defb33869ef101f4911a8e81..de34d57bfa16e03fc3bd189c9a17bdc0e5d6c2c8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/ResourceNames.java @@ -18,6 +18,11 @@ package ch.systemsx.cisd.openbis.plugin.screening.shared; /** * Resource name used in <i>screening</i> plug-in. + * <p> + * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here + * should not conflict with already existing bean names. Look for other <code>ResourceNames</code> + * classes. + * </p> * * @author Christian Ribeaud */ @@ -28,9 +33,9 @@ public final class ResourceNames // Can not be instantiated. } - public final static String SCREENING_SERVICE = "screening-service"; + public final static String SCREENING_PLUGIN_SERVICE = "screening-plugin-service"; - public final static String SCREENING_SERVER = "screening-server"; + public final static String SCREENING_PLUGIN_SERVER = "screening-plugin-server"; public final static String MASTER_PLATE_SAMPLE_SERVER_PLUGIN = "master-plate-sample-server-plugin"; diff --git a/openbis/source/java/genericApplicationContext.xml b/openbis/source/java/genericApplicationContext.xml index 42a67829c23f0eed0f3089303b93390b9b2a0de6..fccfe290eaf627a768091fc846180fdacbf5b2f0 100644 --- a/openbis/source/java/genericApplicationContext.xml +++ b/openbis/source/java/genericApplicationContext.xml @@ -106,7 +106,7 @@ <plugins:annotation-config /> - <plugins:component-scan base-package="ch.systemsx.cisd.openbis.plugin"> + <plugins:component-scan base-package="ch.systemsx.cisd.openbis"> <plugins:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </plugins:component-scan> diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java index 061585a5095c127d7936038705a67b1f8346e50c..bf182227e301780f568e7ab53801b3d50e05b21b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java @@ -21,7 +21,7 @@ import java.util.Date; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.user.client.rpc.AsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.IGenericClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Client; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; @@ -88,7 +88,7 @@ public abstract class AbstractGWTTestCase extends GWTTestCase { remoteConsole.cancelTimer(); AbstractAsyncCallback.setAllCallbackObjectsSilent(); - final IViewContext<IGenericClientServiceAsync> viewContext = client.tryToGetViewContext(); + final IViewContext<ICommonClientServiceAsync> viewContext = client.tryToGetViewContext(); if (viewContext != null) { viewContext.getService().logout(new AsyncCallback<Void>() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceTest.java index 8679dba2be78d06098201e79e20edd320af3d272..f650fa5123e2fa4a3412f58edb745313ef270aa5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceTest.java @@ -45,9 +45,9 @@ import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.DefaultResul import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDataProvider; import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSetManager; import ch.systemsx.cisd.openbis.generic.server.SessionConstants; -import ch.systemsx.cisd.openbis.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleToRegisterDTO; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; +import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; /** * Test cases for corresponding {@link GenericClientService} class. diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerTest.java index 4ff98f9d36d4e5460570266c7ce9501a94798de2..fbeb913f2f32bef21a40630e15555d1875c2752f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerTest.java @@ -25,7 +25,6 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.AbstractServerTestCase; -import ch.systemsx.cisd.openbis.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE; import ch.systemsx.cisd.openbis.generic.shared.dto.GroupPE; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; @@ -37,6 +36,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SampleToRegisterDTO; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.DatabaseInstanceIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; +import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; /** * Test cases for corresponding {@link GenericServer} class.