Skip to content
Snippets Groups Projects
Commit 9d602b5e authored by izabel's avatar izabel
Browse files

[LMS-1447] simple view mode - only one tab

SVN: 15521
parent b76c303c
No related branches found
No related tags found
No related merge requests found
Showing
with 261 additions and 53 deletions
...@@ -190,4 +190,8 @@ public abstract class AbstractPluginViewContext<T extends IClientServiceAsync> i ...@@ -190,4 +190,8 @@ public abstract class AbstractPluginViewContext<T extends IClientServiceAsync> i
} }
public boolean isSimpleMode()
{
return commonViewContext.isSimpleMode();
}
} }
...@@ -23,7 +23,8 @@ import com.extjs.gxt.ui.client.mvc.Controller; ...@@ -23,7 +23,8 @@ import com.extjs.gxt.ui.client.mvc.Controller;
import com.extjs.gxt.ui.client.mvc.Dispatcher; import com.extjs.gxt.ui.client.mvc.Dispatcher;
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL; import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.ServiceDefTarget; 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.IClientServiceAsync;
...@@ -55,6 +56,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext; ...@@ -55,6 +56,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext;
*/ */
public class Client implements EntryPoint public class Client implements EntryPoint
{ {
private static final String SIMPLE = "simple";
private static final String VIEW_MODE_KEY = "viewMode";
/** name of the URL parameter which decides if looging is switched on or off */ /** name of the URL parameter which decides if looging is switched on or off */
private static final String LOGGING_PARAM = "log"; private static final String LOGGING_PARAM = "log";
...@@ -63,7 +68,7 @@ public class Client implements EntryPoint ...@@ -63,7 +68,7 @@ public class Client implements EntryPoint
private IViewContext<ICommonClientServiceAsync> viewContext; private IViewContext<ICommonClientServiceAsync> viewContext;
private List<Controller> controllers = new ArrayList<Controller>(); private final List<Controller> controllers = new ArrayList<Controller>();
public final IViewContext<ICommonClientServiceAsync> tryToGetViewContext() public final IViewContext<ICommonClientServiceAsync> tryToGetViewContext()
{ {
...@@ -92,15 +97,23 @@ public class Client implements EntryPoint ...@@ -92,15 +97,23 @@ public class Client implements EntryPoint
} }
onModuleLoad(); onModuleLoad();
} }
}; };
CommonViewContext commonContext = CommonViewContext commonContext =
new CommonViewContext(service, imageBundle, pageController, isLoggingEnabled()); new CommonViewContext(service, imageBundle, pageController, isLoggingEnabled(),
isSimpleMode());
commonContext.setClientPluginFactoryProvider(createPluginFactoryProvider(commonContext)); commonContext.setClientPluginFactoryProvider(createPluginFactoryProvider(commonContext));
initializeLocatorHandlerRegistry(commonContext.getLocatorResolverRegistry(), commonContext); initializeLocatorHandlerRegistry(commonContext.getLocatorResolverRegistry(), commonContext);
return commonContext; return commonContext;
} }
private boolean isSimpleMode()
{
String viewModeParameter = Window.Location.getParameter(VIEW_MODE_KEY);
return viewModeParameter != null && viewModeParameter.equals(SIMPLE);
}
private boolean isLoggingEnabled() private boolean isLoggingEnabled()
{ {
return GWTUtils.getParamString() != null return GWTUtils.getParamString() != null
...@@ -154,8 +167,7 @@ public class Client implements EntryPoint ...@@ -154,8 +167,7 @@ public class Client implements EntryPoint
viewContext = createViewContext(openUrlController); viewContext = createViewContext(openUrlController);
initializeControllers(openUrlController); initializeControllers(openUrlController);
} }
final ViewLocator locator = createViewLocator(History.getToken());
final ViewLocator locator = createViewLocator(GWTUtils.getParamString());
final IClientServiceAsync service = getServiceForRetrievingApplicationInfo(viewContext); final IClientServiceAsync service = getServiceForRetrievingApplicationInfo(viewContext);
service.getApplicationInfo(new AbstractAsyncCallback<ApplicationInfo>(viewContext) service.getApplicationInfo(new AbstractAsyncCallback<ApplicationInfo>(viewContext)
...@@ -180,9 +192,10 @@ public class Client implements EntryPoint ...@@ -180,9 +192,10 @@ public class Client implements EntryPoint
}); });
} }
public static ViewLocator createViewLocator(String urlParams) public static ViewLocator createViewLocator(String historyToken)
{ {
return new ViewLocator(URL.decodeComponent(urlParams)); // String decodeComponent = URL.decodeComponent(historyToken);FIXME?
return new ViewLocator(historyToken);
} }
protected IClientServiceAsync getServiceForRetrievingApplicationInfo( protected IClientServiceAsync getServiceForRetrievingApplicationInfo(
......
...@@ -51,19 +51,22 @@ public final class CommonViewContext implements IViewContext<ICommonClientServic ...@@ -51,19 +51,22 @@ public final class CommonViewContext implements IViewContext<ICommonClientServic
private IClientPluginFactoryProvider clientPluginFactoryProvider; private IClientPluginFactoryProvider clientPluginFactoryProvider;
private CompositeMessageProvider messageProvider; private final CompositeMessageProvider messageProvider;
private final ViewLocatorResolverRegistry locatorHandlerRegistry; private final ViewLocatorResolverRegistry locatorHandlerRegistry;
private final IProfilingTable profilingTable; private final IProfilingTable profilingTable;
private final boolean simpleMode;
CommonViewContext(final ICommonClientServiceAsync service, CommonViewContext(final ICommonClientServiceAsync service,
final IGenericImageBundle imageBundle, final IGenericImageBundle imageBundle, final IPageController pageController,
final IPageController pageController, boolean isLoggingEnabled) boolean isLoggingEnabled, boolean isSimpleMode)
{ {
this.service = service; this.service = service;
this.imageBundle = imageBundle; this.imageBundle = imageBundle;
this.pageController = pageController; this.pageController = pageController;
this.simpleMode = isSimpleMode;
this.profilingTable = ProfilingTable.create(isLoggingEnabled); this.profilingTable = ProfilingTable.create(isLoggingEnabled);
messageProvider = new CompositeMessageProvider(); messageProvider = new CompositeMessageProvider();
messageProvider.add(new DictonaryBasedMessageProvider(TECHNOLOGY_NAME)); messageProvider.add(new DictonaryBasedMessageProvider(TECHNOLOGY_NAME));
...@@ -210,4 +213,9 @@ public final class CommonViewContext implements IViewContext<ICommonClientServic ...@@ -210,4 +213,9 @@ public final class CommonViewContext implements IViewContext<ICommonClientServic
return profilingTable.isLoggingEnabled(); return profilingTable.isLoggingEnabled();
} }
public boolean isSimpleMode()
{
return simpleMode;
}
} }
...@@ -62,6 +62,8 @@ public abstract class Dict ...@@ -62,6 +62,8 @@ public abstract class Dict
public static final String PERM_ID = "perm_id"; public static final String PERM_ID = "perm_id";
public static final String LOCATOR = "locator";
public static final String REGISTRATOR = "registrator"; public static final String REGISTRATOR = "registrator";
public static final String REGISTRATION_DATE = "registration_date"; public static final String REGISTRATION_DATE = "registration_date";
......
...@@ -29,7 +29,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.log.I ...@@ -29,7 +29,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.log.I
* *
* @author Christian Ribeaud * @author Christian Ribeaud
*/ */
public interface IViewContext<T extends IClientServiceAsync> extends IMessageProvider, IProfilingTable public interface IViewContext<T extends IClientServiceAsync> extends IMessageProvider,
IProfilingTable
{ {
public void addMessageSource(String messageSource); public void addMessageSource(String messageSource);
...@@ -52,4 +53,7 @@ public interface IViewContext<T extends IClientServiceAsync> extends IMessagePro ...@@ -52,4 +53,7 @@ public interface IViewContext<T extends IClientServiceAsync> extends IMessagePro
public ICommonClientServiceAsync getCommonService(); public ICommonClientServiceAsync getCommonService();
public ViewLocatorResolverRegistry getLocatorResolverRegistry(); public ViewLocatorResolverRegistry getLocatorResolverRegistry();
public boolean isSimpleMode();
} }
...@@ -20,7 +20,6 @@ import com.extjs.gxt.ui.client.Style.LayoutRegion; ...@@ -20,7 +20,6 @@ import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.mvc.AppEvent; import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller; import com.extjs.gxt.ui.client.mvc.Controller;
import com.extjs.gxt.ui.client.mvc.View; import com.extjs.gxt.ui.client.mvc.View;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.Viewport; import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout; import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData; import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
...@@ -41,7 +40,7 @@ final class AppView extends View ...@@ -41,7 +40,7 @@ final class AppView extends View
private Viewport viewport; private Viewport viewport;
private MainTabPanel center; private IMainPanel mainPanel;
private TopMenu north; private TopMenu north;
...@@ -58,16 +57,19 @@ final class AppView extends View ...@@ -58,16 +57,19 @@ final class AppView extends View
return event.getData(); return event.getData();
} }
private final void activateTab(final AbstractTabItemFactory tabItemFactory) private final void activate(final AbstractTabItemFactory tabItemFactory)
{ {
center.openTab(tabItemFactory); mainPanel.open(tabItemFactory);
} }
private final void initUI() private final void initUI()
{ {
viewport = new Viewport(); viewport = new Viewport();
viewport.setLayout(new BorderLayout()); viewport.setLayout(new BorderLayout());
createNorth(); if (viewContext.isSimpleMode() == false)
{
createNorth();
}
createCenter(); createCenter();
createSouth(); createSouth();
RootPanel.get().clear(); RootPanel.get().clear();
...@@ -83,11 +85,10 @@ final class AppView extends View ...@@ -83,11 +85,10 @@ final class AppView extends View
private final void createCenter() private final void createCenter()
{ {
center = new MainTabPanel(viewContext); mainPanel = createMainPanel(viewContext);
componentProvider.setMainTabPanel(center); componentProvider.setMainPanel(mainPanel);
final BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER); final BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER);
data.setMargins(new Margins(5)); viewport.add(mainPanel.asWidget(), data);
viewport.add(center, data);
} }
private final void createSouth() private final void createSouth()
...@@ -116,7 +117,18 @@ final class AppView extends View ...@@ -116,7 +117,18 @@ final class AppView extends View
initUI(); initUI();
} else if (event.getType() == AppEvents.NAVI_EVENT) } else if (event.getType() == AppEvents.NAVI_EVENT)
{ {
activateTab(getData(event)); activate(getData(event));
}
}
private static IMainPanel createMainPanel(CommonViewContext context)
{
if (context.isSimpleMode())
{
return new MainPagePanel(context);
} else
{
return new MainTabPanel(context);
} }
} }
} }
...@@ -67,7 +67,7 @@ public final class ComponentProvider ...@@ -67,7 +67,7 @@ public final class ComponentProvider
{ {
private final IViewContext<ICommonClientServiceAsync> viewContext; private final IViewContext<ICommonClientServiceAsync> viewContext;
private MainTabPanel mainTabPanelOrNull; private IMainPanel mainTabPanelOrNull;
public ComponentProvider(final IViewContext<ICommonClientServiceAsync> viewContext) public ComponentProvider(final IViewContext<ICommonClientServiceAsync> viewContext)
{ {
...@@ -870,12 +870,12 @@ public final class ComponentProvider ...@@ -870,12 +870,12 @@ public final class ComponentProvider
}; };
} }
public MainTabPanel tryGetMainTabPanel() public IMainPanel tryGetMainTabPanel()
{ {
return mainTabPanelOrNull; return mainTabPanelOrNull;
} }
public void setMainTabPanel(MainTabPanel mainTabPanel) public void setMainPanel(IMainPanel mainTabPanel)
{ {
this.mainTabPanelOrNull = mainTabPanel; this.mainTabPanelOrNull = mainTabPanel;
} }
......
...@@ -48,13 +48,12 @@ public final class DispatcherHelper ...@@ -48,13 +48,12 @@ public final class DispatcherHelper
public final static void dispatchNaviEvent(final AbstractTabItemFactory tabItemFactory) public final static void dispatchNaviEvent(final AbstractTabItemFactory tabItemFactory)
{ {
AppEvent event = createEvent(AppEvents.NAVI_EVENT, tabItemFactory); AppEvent event = createEvent(AppEvents.NAVI_EVENT, tabItemFactory);
Dispatcher.get().dispatch(event); Dispatcher.get().dispatch(event);// FIXME: add history token
} }
private final static AppEvent createEvent(EventType eventType, Object data) private final static AppEvent createEvent(EventType eventType, Object data)
{ {
final AppEvent event = new AppEvent(eventType); final AppEvent event = new AppEvent(eventType, data);
event.setData(data);
return event; return event;
} }
} }
/*
* Copyright 2010 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.framework;
import com.extjs.gxt.ui.client.widget.Component;
/**
* Interface for pages with special close action.
*
* @author Izabela Adamczyk
*/
public interface IClosableItem
{
/**
* Returns the {@link Component}.
*/
public Component getComponent();
/** Performs cleaning operations, should be called before the item is closed. */
public void onClose();
}
/*
* 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.application.framework;
import com.google.gwt.user.client.ui.Widget;
/**
* Main panel - where the pages will open.
*
* @author Izabela Adamczyk
*/
public interface IMainPanel
{
void open(final AbstractTabItemFactory tabItemFactory);
void reset();
Widget asWidget();
}
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework; package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework;
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.TabItem; import com.extjs.gxt.ui.client.widget.TabItem;
/** /**
...@@ -24,21 +23,13 @@ import com.extjs.gxt.ui.client.widget.TabItem; ...@@ -24,21 +23,13 @@ import com.extjs.gxt.ui.client.widget.TabItem;
* *
* @author Christian Ribeaud * @author Christian Ribeaud
*/ */
public interface ITabItem public interface ITabItem extends IClosableItem
{ {
/** /**
* Returns the title updater. * Returns the title updater.
*/ */
public TabTitleUpdater getTabTitleUpdater(); public TabTitleUpdater getTabTitleUpdater();
/**
* Returns the {@link Component} which composes this tab item.
*/
public Component getComponent();
/** Performs cleaning operations, should be called before the tab is closed. */
public void onClose();
/** /**
* Performs operations relevant to the tab when it is activated, namely when we opened this tab * Performs operations relevant to the tab when it is activated, namely when we opened this tab
* for the first time or we switched from another tab to this one. * for the first time or we switched from another tab to this one.
......
/*
* 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.application.framework;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider;
/**
* Main panel - where the pages will open.
*
* @author Izabela Adamczyk
*/
public class MainPagePanel extends ContentPanel implements IMainPanel
{
private IClosableItem content;
private final IMessageProvider messageProvider;
public MainPagePanel(IMessageProvider messageProvider)
{
this.messageProvider = messageProvider;
setLayout(new FitLayout());
setBodyBorder(false);
setBorders(false);
setHeaderVisible(false);
getElement().setInnerText(createWelcomeText());
}
public final void open(final AbstractTabItemFactory tabItemFactory)
{
reset();
content = tabItemFactory.create();
add(content.getComponent());
layout();
}
public final void reset()
{
if (content != null)
{
remove(content.getComponent());
content.onClose();
}
}
public Widget asWidget()
{
return this;
}
private final String createWelcomeText()
{
final Element div = DOM.createDiv();
div.setClassName("intro-tab");
div.setInnerText(messageProvider.getMessage(Dict.WELCOME));
return div.getString();
}
}
...@@ -33,9 +33,10 @@ import com.extjs.gxt.ui.client.widget.TabPanel; ...@@ -33,9 +33,10 @@ import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.layout.CenterLayout; import com.extjs.gxt.ui.client.widget.layout.CenterLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.menu.MenuItem; import com.extjs.gxt.ui.client.widget.menu.MenuItem;
import com.google.gwt.dom.client.Element;
import com.google.gwt.http.client.URL; import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict;
...@@ -51,7 +52,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; ...@@ -51,7 +52,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters;
* *
* @author Izabela Adamczyk * @author Izabela Adamczyk
*/ */
public class MainTabPanel extends TabPanel public class MainTabPanel extends TabPanel implements IMainPanel
{ {
private static final String PREFIX = GenericConstants.ID_PREFIX + "main-tab-panel_"; private static final String PREFIX = GenericConstants.ID_PREFIX + "main-tab-panel_";
...@@ -72,6 +73,10 @@ public class MainTabPanel extends TabPanel ...@@ -72,6 +73,10 @@ public class MainTabPanel extends TabPanel
setTabScroll(true); setTabScroll(true);
setId(ID); setId(ID);
setCloseContextMenu(true); setCloseContextMenu(true);
setPlain(true);
setBodyBorder(false);
setBorders(false);
setBorderStyle(false);
add(createWelcomePanel()); add(createWelcomePanel());
} }
...@@ -108,7 +113,7 @@ public class MainTabPanel extends TabPanel ...@@ -108,7 +113,7 @@ public class MainTabPanel extends TabPanel
* be generated out of given {@link ITabItem}. * be generated out of given {@link ITabItem}.
* </p> * </p>
*/ */
public final void openTab(final AbstractTabItemFactory tabItemFactory) public final void open(final AbstractTabItemFactory tabItemFactory)
{ {
boolean inBackground = tabItemFactory.isInBackground(); boolean inBackground = tabItemFactory.isInBackground();
final MainTabItem tab = tryFindTab(tabItemFactory); final MainTabItem tab = tryFindTab(tabItemFactory);
...@@ -241,6 +246,10 @@ public class MainTabPanel extends TabPanel ...@@ -241,6 +246,10 @@ public class MainTabPanel extends TabPanel
{ {
tabItem.onClose(); tabItem.onClose();
openTabs.remove(idPrefix); openTabs.remove(idPrefix);
if (openTabs.size() == 0)
{
MainTabPanel.this.syncSize();
}
} }
private Listener<ComponentEvent> createCloseViewerListener() private Listener<ComponentEvent> createCloseViewerListener()
...@@ -305,4 +314,9 @@ public class MainTabPanel extends TabPanel ...@@ -305,4 +314,9 @@ public class MainTabPanel extends TabPanel
}; };
} }
} }
public Widget asWidget()
{
return this;
}
} }
...@@ -20,6 +20,7 @@ import java.util.Collections; ...@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.StringUtils;
import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities;
/** /**
...@@ -58,13 +59,13 @@ public class ViewLocator ...@@ -58,13 +59,13 @@ public class ViewLocator
// Public API // Public API
/** /**
* Create a ViewLocator initialized from the url parameters * Create a ViewLocator initialized from the history token
* *
* @param urlParams * @param token
*/ */
public ViewLocator(String urlParams) public ViewLocator(String token)
{ {
initializeFromURLParameterString(urlParams); initializeFromHistoryToken(token);
} }
/** /**
...@@ -112,13 +113,15 @@ public class ViewLocator ...@@ -112,13 +113,15 @@ public class ViewLocator
// Private methods // Private methods
/** /**
* Extract the information for locating a view from the URL parameters * Extract the information for locating a view from the history token
*/ */
private void initializeFromURLParameterString(String urlParams) private void initializeFromHistoryToken(String token)
{ {
assert urlParams != null; if (StringUtils.isBlank(token))
{
final String[] params = urlParams.split(PARAMETER_SEPARATOR); return;
}
final String[] params = token.split(PARAMETER_SEPARATOR);
for (int i = 0; i < params.length; i++) for (int i = 0; i < params.length; i++)
{ {
final String[] paramPair = params[i].split(KEY_VALUE_SEPARATOR); final String[] paramPair = params[i].split(KEY_VALUE_SEPARATOR);
......
...@@ -22,7 +22,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs ...@@ -22,7 +22,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs
import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.MainTabPanel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IMainPanel;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ActionMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ActionMenu;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenuItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenuItem;
...@@ -88,7 +88,7 @@ public final class LoggedUserMenu extends TopMenuItem ...@@ -88,7 +88,7 @@ public final class LoggedUserMenu extends TopMenuItem
{ {
public void execute() public void execute()
{ {
final MainTabPanel tabPanelOrNull = componentProvider.tryGetMainTabPanel(); final IMainPanel tabPanelOrNull = componentProvider.tryGetMainTabPanel();
if (tabPanelOrNull == null) if (tabPanelOrNull == null)
{ {
// ignore // ignore
......
...@@ -33,11 +33,12 @@ public class PermlinkUtilities ...@@ -33,11 +33,12 @@ public class PermlinkUtilities
public static final String ENTITY_KIND_PARAMETER_KEY = "entity"; public static final String ENTITY_KIND_PARAMETER_KEY = "entity";
public final static String createPermlinkURL(final String baseIndexURL, public final static String createPermlinkURL(final String baseIndexURL,
final EntityKind entityKind, final String identifier) final EntityKind entityKind, final String permId)
{ {
URLMethodWithParameters ulrWithParameters = new URLMethodWithParameters(baseIndexURL); URLMethodWithParameters ulrWithParameters = new URLMethodWithParameters(baseIndexURL);
ulrWithParameters.startHistoryToken();
ulrWithParameters.addParameter(ENTITY_KIND_PARAMETER_KEY, entityKind.name()); ulrWithParameters.addParameter(ENTITY_KIND_PARAMETER_KEY, entityKind.name());
ulrWithParameters.addParameter(PERM_ID_PARAMETER_KEY, identifier); ulrWithParameters.addParameter(PERM_ID_PARAMETER_KEY, permId);
return ulrWithParameters.toString(); return ulrWithParameters.toString();
} }
......
...@@ -67,6 +67,14 @@ public class URLMethodWithParameters implements IsSerializable ...@@ -67,6 +67,14 @@ public class URLMethodWithParameters implements IsSerializable
addParameter(parameterName, value, true); addParameter(parameterName, value, true);
} }
/**
* Sets '#' as the next separator.
*/
public void startHistoryToken()
{
delim = '#';
}
/** /**
* Adds a parameter with specified name and value with optional encoding. * Adds a parameter with specified name and value with optional encoding.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment