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 542ecb4e52e5eeeea36fcc4c41891b436a727470..38534a3beebe171ad5d764fb4191ed73c97437bd 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 @@ -46,6 +46,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.Ma import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.MetaprojectBrowserLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.MetaprojectLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.OpenViewAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.PermlinkEditingLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.PermlinkLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ProjectLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.SampleRegistrationLocatorResolver; @@ -439,6 +440,7 @@ public class Client implements EntryPoint, ValueChangeHandler<String> handlerRegistry.registerHandler(new ProjectLocatorResolver(context)); handlerRegistry.registerHandler(new MetaprojectLocatorResolver(context)); handlerRegistry.registerHandler(new AttachmentDownloadLocatorResolver(context)); + handlerRegistry.registerHandler(new PermlinkEditingLocatorResolver(context)); handlerRegistry.registerHandler(new PermlinkLocatorResolver(context)); handlerRegistry.registerHandler(new SearchLocatorResolver(context)); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkEditingLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkEditingLocatorResolver.java new file mode 100644 index 0000000000000000000000000000000000000000..5048d1ef1a9e3a6d56b62f7f1556b5af4ce02202 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkEditingLocatorResolver.java @@ -0,0 +1,63 @@ +/* + * Copyright 2013 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.application.locator; + +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.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.listener.OpenEntityEditorTabClickListener; +import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; + +/** + * Resolver for editing an entity. + * + * @author Franz-Josef Elmer + */ +public class PermlinkEditingLocatorResolver extends PermlinkLocatorResolver +{ + + private static final String EDIT_ACTION = "EDITING"; + + /** + * @param viewContext + */ + public PermlinkEditingLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) + { + super(EDIT_ACTION, viewContext); + } + + @Override + protected void openInitialEntityViewer(String entityKindValue, String permIdValue) throws UserFailureException + { + EntityKind entityKind = getEntityKind(entityKindValue); + + viewContext.getCommonService().getEntityInformationHolder(entityKind, permIdValue, + new AbstractAsyncCallback<IEntityInformationHolderWithPermId>(viewContext) + { + + @Override + protected void process(IEntityInformationHolderWithPermId result) + { + OpenEntityEditorTabClickListener.showEntityEditor(viewContext, result, false); + + } + }); + } + +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java index 5bfb17f6b2f6d77218ce3a42394d1363ae95d032..190ddfbcf08902a4cfe6236eaa6afc4b3c38f415 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java @@ -17,11 +17,16 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; */ public class PermlinkLocatorResolver extends AbstractViewLocatorResolver { - private final IViewContext<ICommonClientServiceAsync> viewContext; + protected final IViewContext<ICommonClientServiceAsync> viewContext; public PermlinkLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - super(ViewLocator.PERMLINK_ACTION); + this(ViewLocator.PERMLINK_ACTION, viewContext); + } + + protected PermlinkLocatorResolver(String action, IViewContext<ICommonClientServiceAsync> viewContext) + { + super(action); this.viewContext = viewContext; }