git.netxms.org
/
public
/
netxms.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6e36577
)
fixed URL parameters access in web UI (caused by changes RAP 3.0)
author
Victor Kirhenshtein
<victor@netxms.org>
Thu, 8 Sep 2016 13:09:11 +0000
(16:09 +0300)
committer
Victor Kirhenshtein
<victor@netxms.org>
Thu, 8 Sep 2016 13:09:11 +0000
(16:09 +0300)
webui/webapp/Core/src/org/netxms/ui/eclipse/console/Application.java
patch
|
blob
|
blame
|
history
webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchAdvisor.java
patch
|
blob
|
blame
|
history
webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchWindowAdvisor.java
patch
|
blob
|
blame
|
history
diff --git
a/webui/webapp/Core/src/org/netxms/ui/eclipse/console/Application.java
b/webui/webapp/Core/src/org/netxms/ui/eclipse/console/Application.java
index
ce96e4c
..
49c00c7
100644
(file)
--- a/
webui/webapp/Core/src/org/netxms/ui/eclipse/console/Application.java
+++ b/
webui/webapp/Core/src/org/netxms/ui/eclipse/console/Application.java
@@
-25,6
+25,7
@@
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.rap.rwt.client.service.ClientInfo;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.rap.rwt.client.service.ClientInfo;
+import org.eclipse.rap.rwt.client.service.StartupParameters;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.WorkbenchAdvisor;
@@
-43,7
+44,7
@@
public class Application implements IApplication
*/
public Object start(IApplicationContext context) throws Exception
{
*/
public Object start(IApplicationContext context) throws Exception
{
- String lang =
RWT.getRequest().
getParameter("lang"); //$NON-NLS-1$
+ String lang = getParameter("lang"); //$NON-NLS-1$
if (lang != null)
RWT.setLocale(new Locale(lang));
if (lang != null)
RWT.setLocale(new Locale(lang));
@@
-91,4
+92,16
@@
public class Application implements IApplication
{
// Do nothing
}
{
// Do nothing
}
+
+ /**
+ * Get application's parameter (passed as part of URL)
+ *
+ * @param name parameter's name
+ * @return parameter's value or null if not found
+ */
+ public static String getParameter(final String name)
+ {
+ StartupParameters sp = RWT.getClient().getService(StartupParameters.class);
+ return (sp != null) ? sp.getParameter(name) : null;
+ }
}
}
diff --git
a/webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchAdvisor.java
b/webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchAdvisor.java
index
069b33f
..
c3d1601
100644
(file)
--- a/
webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchAdvisor.java
+++ b/
webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchAdvisor.java
@@
-140,26
+140,26
@@
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor
final Properties properties = new AppPropertiesLoader().load();
String password = "";
final Properties properties = new AppPropertiesLoader().load();
String password = "";
- boolean autoLogin = (
RWT.getRequest()
.getParameter("auto") != null); //$NON-NLS-1$
+ boolean autoLogin = (
Application
.getParameter("auto") != null); //$NON-NLS-1$
- String ssoTicket =
RWT.getRequest()
.getParameter("ticket");
+ String ssoTicket =
Application
.getParameter("ticket");
if (ssoTicket != null)
{
autoLogin = true;
if (ssoTicket != null)
{
autoLogin = true;
- String server =
RWT.getRequest()
.getParameter("server"); //$NON-NLS-1$
+ String server =
Application
.getParameter("server"); //$NON-NLS-1$
if (server == null)
server = properties.getProperty("server", "127.0.0.1"); //$NON-NLS-1$ //$NON-NLS-2$
success = connectToServer(server, null, ssoTicket);
}
else if (autoLogin)
{
if (server == null)
server = properties.getProperty("server", "127.0.0.1"); //$NON-NLS-1$ //$NON-NLS-2$
success = connectToServer(server, null, ssoTicket);
}
else if (autoLogin)
{
- String server =
RWT.getRequest()
.getParameter("server"); //$NON-NLS-1$
+ String server =
Application
.getParameter("server"); //$NON-NLS-1$
if (server == null)
server = properties.getProperty("server", "127.0.0.1"); //$NON-NLS-1$ //$NON-NLS-2$
if (server == null)
server = properties.getProperty("server", "127.0.0.1"); //$NON-NLS-1$ //$NON-NLS-2$
- String login =
RWT.getRequest()
.getParameter("login"); //$NON-NLS-1$
+ String login =
Application
.getParameter("login"); //$NON-NLS-1$
if (login == null)
login = "guest";
if (login == null)
login = "guest";
- password =
RWT.getRequest()
.getParameter("password"); //$NON-NLS-1$
+ password =
Application
.getParameter("password"); //$NON-NLS-1$
if (password == null)
password = "";
success = connectToServer(server, login, password);
if (password == null)
password = "";
success = connectToServer(server, login, password);
diff --git
a/webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchWindowAdvisor.java
b/webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchWindowAdvisor.java
index
36c87d2
..
2243891
100644
(file)
--- a/
webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchWindowAdvisor.java
+++ b/
webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchWindowAdvisor.java
@@
-148,7
+148,7
@@
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor
@Override
public void postWindowOpen()
{
@Override
public void postWindowOpen()
{
- String dashboardId =
RWT.getRequest()
.getParameter("dashboard"); //$NON-NLS-1$
+ String dashboardId =
Application
.getParameter("dashboard"); //$NON-NLS-1$
if (dashboardId != null)
showDashboard(dashboardId);
}
if (dashboardId != null)
showDashboard(dashboardId);
}