summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul
diff options
context:
space:
mode:
authorMurilo Araujo2014-06-02 11:00:11 +0200
committerMurilo Araujo2014-06-02 11:00:11 +0200
commitbb41e7ef7a43fe03c28f8875a5436d2eb0f73506 (patch)
treebfc3307bd7d7fdfb264a54ddce5b93fc18d467dc /Dozentenmodul
parenttest (diff)
parentMerge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module (diff)
downloadtutor-module-bb41e7ef7a43fe03c28f8875a5436d2eb0f73506.tar.gz
tutor-module-bb41e7ef7a43fe03c28f8875a5436d2eb0f73506.tar.xz
tutor-module-bb41e7ef7a43fe03c28f8875a5436d2eb0f73506.zip
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Conflicts: ffffDozentenmodul/src/models/Links.java
Diffstat (limited to 'Dozentenmodul')
-rw-r--r--Dozentenmodul/bin/gui/intro/Login_GUI.classbin10083 -> 9662 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.classbin692 -> 692 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.classbin2247 -> 2247 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$2.classbin1088 -> 1088 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$3.classbin1006 -> 1006 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$4.classbin977 -> 977 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$5.classbin1068 -> 1068 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$6.classbin1083 -> 1083 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$7.classbin974 -> 974 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$8.classbin996 -> 996 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI$9.classbin1096 -> 1096 bytes
-rw-r--r--Dozentenmodul/bin/gui/intro/MainMenue_GUI.classbin10476 -> 10476 bytes
-rw-r--r--Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java88
-rw-r--r--Dozentenmodul/src/gui/intro/Login_GUI.java44
-rw-r--r--Dozentenmodul/src/gui/intro/MainMenue_GUI.java1
-rw-r--r--Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java15
-rw-r--r--Dozentenmodul/src/models/Links.java86
17 files changed, 137 insertions, 97 deletions
diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class
index 15cb2ba1..78bcd9b7 100644
--- a/Dozentenmodul/bin/gui/intro/Login_GUI.class
+++ b/Dozentenmodul/bin/gui/intro/Login_GUI.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class
index 4e2296e7..359af1fe 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class
index 569827ad..1bbaae71 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$2.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$2.class
index e827afb1..1f8d4f7e 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$2.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$2.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$3.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$3.class
index 31a514d3..acfc42b0 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$3.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$3.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$4.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$4.class
index 852d5e14..17a2d992 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$4.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$4.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$5.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$5.class
index 34afa967..de6193d4 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$5.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$5.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$6.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$6.class
index 045661b3..24e03d07 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$6.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$6.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$7.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$7.class
index 8da2716a..302b8c84 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$7.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$7.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$8.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$8.class
index d411f9ab..cfa89387 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$8.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$8.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$9.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$9.class
index 5b26c8f5..31dd1069 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$9.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$9.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class
index 4418d210..f14366f8 100644
--- a/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class
+++ b/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class
Binary files differ
diff --git a/Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java b/Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java
index ce77282a..df610f6b 100644
--- a/Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java
+++ b/Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java
@@ -1,6 +1,5 @@
package gui.image;
-
import gui.intro.MainMenue_GUI;
import java.awt.Dimension;
@@ -26,15 +25,10 @@ import javax.swing.JMenuItem;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.border.TitledBorder;
-import javax.swing.JTextArea;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
-
-import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
-import javax.swing.JSpinner;
-import javax.swing.SpinnerNumberModel;
import models.Image;
import models.Links;
@@ -61,7 +55,7 @@ public class CreateImageFreigabe_GUI extends JFrame {
}
});
setResizable(false);
-
+
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException
@@ -71,10 +65,10 @@ public class CreateImageFreigabe_GUI extends JFrame {
}
setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- int top=(screenSize.height - 722) / 2;
- int left=(screenSize.width - 603) / 2;
+ int top = (screenSize.height - 722) / 2;
+ int left = (screenSize.width - 603) / 2;
setBounds(left, top, 603, 722);
- //setBounds(100, 100, 603, 722);
+ // setBounds(100, 100, 603, 722);
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
@@ -88,11 +82,12 @@ public class CreateImageFreigabe_GUI extends JFrame {
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
}
-
+
JTextPane txtpnBitteWhlenSie = new JTextPane();
txtpnBitteWhlenSie.setEditable(false);
txtpnBitteWhlenSie.setBackground(SystemColor.menu);
- txtpnBitteWhlenSie.setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus.");
+ txtpnBitteWhlenSie
+ .setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus.");
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
@@ -101,51 +96,54 @@ public class CreateImageFreigabe_GUI extends JFrame {
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
contentPanel.setLayout(null);
-
+
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.menu);
- panel_1.setBorder(new TitledBorder(null, "Freigabe", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBorder(new TitledBorder(null, "Freigabe",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
panel_1.setBounds(10, 51, 557, 124);
contentPanel.add(panel_1);
panel_1.setLayout(null);
-
+
JLabel lblNewLabel_2 = new JLabel("Freigabemodus:");
lblNewLabel_2.setBounds(10, 55, 250, 20);
panel_1.add(lblNewLabel_2);
-
+
comboBox = new JComboBox();
- comboBox.setModel(new DefaultComboBoxModel(new String[] {"Lokal (Eigene Hochschule)", "\u00D6ffentlich (Alle Hochschulen)"}));
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {
+ "Lokal (Eigene Hochschule)",
+ "\u00D6ffentlich (Alle Hochschulen)" }));
comboBox.setSelectedIndex(0);
comboBox.setBounds(270, 55, 250, 20);
panel_1.add(comboBox);
-
+
JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
-
+
CreateImageFreigabe_GUI.this.setVisible(false);
- MainMenue_GUI main=new MainMenue_GUI();
+ MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
}
});
lblHauptmen.setForeground(Color.BLUE);
lblHauptmen.setBounds(10, 11, 61, 14);
contentPanel.add(lblHauptmen);
-
+
JLabel label_1 = new JLabel(">");
label_1.setBounds(69, 11, 13, 14);
contentPanel.add(label_1);
-
+
JLabel lblVlimage = new JLabel("VL-Image");
lblVlimage.setForeground(Color.BLUE);
lblVlimage.setBounds(81, 11, 45, 14);
contentPanel.add(lblVlimage);
-
+
JLabel label_2 = new JLabel(">");
label_2.setBounds(133, 11, 13, 14);
contentPanel.add(label_2);
-
+
JLabel lblNewLabel_1 = new JLabel("Neu");
lblNewLabel_1.setBounds(146, 11, 46, 14);
contentPanel.add(lblNewLabel_1);
@@ -159,26 +157,26 @@ public class CreateImageFreigabe_GUI extends JFrame {
JButton cancelButton = new JButton("Zur\u00FCck");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
-
+
Image.image.setShareMode(comboBox.getSelectedIndex());
- CreateImageTechnisch_GUI sr=new CreateImageTechnisch_GUI();
+ CreateImageTechnisch_GUI sr = new CreateImageTechnisch_GUI();
sr.setVisible(true);
dispose();
}
});
cancelButton.setActionCommand("OK");
buttonPane.add(cancelButton);
- //getRootPane().setDefaultButton(cancelButton);
+ // getRootPane().setDefaultButton(cancelButton);
}
{
JButton continueButton = new JButton("Weiter");
continueButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Image.image.setShareMode(comboBox.getSelectedIndex());
- FTPCreateUploader_GUI ea=new FTPCreateUploader_GUI();
+ FTPCreateUploader_GUI ea = new FTPCreateUploader_GUI();
ea.setVisible(true);
dispose();
-
+
}
});
continueButton.setActionCommand("Cancel");
@@ -186,38 +184,39 @@ public class CreateImageFreigabe_GUI extends JFrame {
getRootPane().setDefaultButton(continueButton);
}
}
-
+
JSeparator separator = new JSeparator();
separator.setBounds(0, 78, 597, 2);
getContentPane().add(separator);
-
+
JSeparator separator_1 = new JSeparator();
separator_1.setBounds(0, 627, 597, 2);
getContentPane().add(separator_1);
-
+
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
-
+
JMenu mnNewMenu = new JMenu("Suchen");
menuBar.add(mnNewMenu);
-
+
JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
mnNewMenu.add(mntmVlSuche);
-
+
JMenu mnNewMenu_1 = new JMenu("Hilfe");
menuBar.add(mnNewMenu_1);
-
+
JMenuItem mntmFaq = new JMenuItem("FAQ");
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
String faq;
-
+
faq = Links.getFAQ();
try {
- Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + faq );
+ Runtime.getRuntime().exec(
+ "rundll32 url.dll,FileProtocolHandler " + faq);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -226,17 +225,18 @@ public class CreateImageFreigabe_GUI extends JFrame {
});
mnNewMenu_1.add(mntmFaq);
-
+
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
String otrs;
-
+
otrs = Links.getOTRS();
-
+
try {
- Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + otrs );
+ Runtime.getRuntime().exec(
+ "rundll32 url.dll,FileProtocolHandler " + otrs);
} catch (IOException f) {
// TODO Auto-generated catch block
f.printStackTrace();
@@ -246,6 +246,6 @@ public class CreateImageFreigabe_GUI extends JFrame {
});
mnNewMenu_1.add(mntmOtrs);
-
+
}
}
diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java
index 5b4ecbd9..5b47f4e0 100644
--- a/Dozentenmodul/src/gui/intro/Login_GUI.java
+++ b/Dozentenmodul/src/gui/intro/Login_GUI.java
@@ -196,9 +196,6 @@ public class Login_GUI extends JFrame {
try {
login = true;
String passText = new String(lblpass.getPassword());
- System.out.println("Benutzer: " + lblusername.getText()
- + "\nPasswort: " + passText);
-
// check if client has received a connection with information or a
// null package
if (checkClientPackage() == true) {
@@ -207,28 +204,17 @@ public class Login_GUI extends JFrame {
SessionData.session.setAuthToken(result.authToken);
SessionData.session.setSessionID(result.sessionId);
SessionData.session.setServerAdress(result.serverAddress);
- System.out.println("Satellit-Adresse: " + result.serverAddress);
-
- //set connection to bwLehrpoolSuiteServer
- ThriftConnection bwthrift=new ThriftConnection();
- server.Server.Client bwClient=bwthrift.getThriftConnection();
- System.out.println("Connection zu Satellit aufgebaut!");
+
+ // set connection to bwLehrpoolSuiteServer
+ ThriftConnection bwthrift = new ThriftConnection();
+ server.Server.Client bwClient = bwthrift.getThriftConnection();
models.Client.clientcon.setClient(bwClient);
-
-
- System.out
- .println("Konnte mich beim MasterServer authentifizieren. Meine Session-ID ist "
- + result.sessionId
- + ", mein Token f\u00fcr den Satelliten "
- + result.authToken);
- if (login == true) {
- /*
- *
- *
- * Hier Daten speichern
- */
+ System.out.println("Session-ID: " + result.sessionId
+ + "\nToken: " + result.authToken);
+ if (login == true) {
+ //Daten speichern
if (SessionData.session.getAuthToken() == null) {
System.out.println("Token ist null");
JOptionPane.showMessageDialog(null,
@@ -239,8 +225,8 @@ public class Login_GUI extends JFrame {
UserInfo user = client.getUserFromToken(SessionData.session
.getAuthToken());
- String hochschule = user.eMail.substring(
- user.eMail.indexOf("@") + 1);
+ String hochschule = user.eMail.substring(user.eMail
+ .indexOf("@") + 1);
person.verantwortlicher.setUsername(lblusername.getText()
.substring(0, lblusername.getText().indexOf("@")));
@@ -248,7 +234,7 @@ public class Login_GUI extends JFrame {
person.verantwortlicher.setVorname(user.firstName);
person.verantwortlicher.setEMail(user.eMail);
person.verantwortlicher.setHochschule(hochschule);
-
+
try {
// Lege config File an und entscheide welches Fenster
// als naechstes geoeffnet wird
@@ -332,14 +318,12 @@ public class Login_GUI extends JFrame {
if (client != null) {
// client contains information
isClientReturnedCorrectly = true;
- System.out.println("Masterserver (" + masterServerIP
- + ") ist erreichbar, Verbindungsinformationen erhalten");
+ System.out.println("Verbindungsinformationen erhalten");
} else {
// client has returned with error
isClientReturnedCorrectly = false;
- System.out.println("Fehler: Client hat von Masterserver ("
- + masterServerIP
- + ") keine korrekten Verbindungsdaten erhalten.");
+ System.out
+ .println("Fehler: Keine korrekten Verbindungsdaten erhalten.");
}
return isClientReturnedCorrectly;
diff --git a/Dozentenmodul/src/gui/intro/MainMenue_GUI.java b/Dozentenmodul/src/gui/intro/MainMenue_GUI.java
index b7dab076..59a35df3 100644
--- a/Dozentenmodul/src/gui/intro/MainMenue_GUI.java
+++ b/Dozentenmodul/src/gui/intro/MainMenue_GUI.java
@@ -31,7 +31,6 @@ import javax.swing.border.TitledBorder;
import java.awt.ScrollPane;
import javax.swing.JTextArea;
import javax.swing.ImageIcon;
-
import models.Links;
import models.SessionData;
import java.awt.event.MouseAdapter;
diff --git a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java
index 65960c81..9db4be3b 100644
--- a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java
+++ b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java
@@ -68,7 +68,6 @@ public class EditLectureLink_GUI extends JFrame {
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
-
/**
* Create the dialog.
*/
@@ -174,8 +173,9 @@ public class EditLectureLink_GUI extends JFrame {
lblErweiterteSuche.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
- //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
- //es.setVisible(true);
+ // ExtendedSearchForImages_GUI es = new
+ // ExtendedSearchForImages_GUI();
+ // es.setVisible(true);
}
});
lblErweiterteSuche.setForeground(Color.BLUE);
@@ -405,8 +405,7 @@ public class EditLectureLink_GUI extends JFrame {
JOptionPane.INFORMATION_MESSAGE);
}
-
-
+
MainMenue_GUI m = new MainMenue_GUI();
m.setVisible(true);
dispose();
@@ -442,9 +441,9 @@ public class EditLectureLink_GUI extends JFrame {
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
Links.openFAQ();
-
+
}
});
@@ -454,7 +453,7 @@ public class EditLectureLink_GUI extends JFrame {
mntmOtrs.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
Links.openOTRS();
}
diff --git a/Dozentenmodul/src/models/Links.java b/Dozentenmodul/src/models/Links.java
index b01d99e9..3e3dfb0e 100644
--- a/Dozentenmodul/src/models/Links.java
+++ b/Dozentenmodul/src/models/Links.java
@@ -6,28 +6,29 @@ import java.net.URISyntaxException;
import java.net.URL;
public class Links {
-
+
private static String FAQ = "http://bwlehrpool.hs-offenburg.de/";
private static String OTRS = "https://bwlehrpool-otrs.rz.hs-offenburg.de//otrs/customer.pl";
- private static String uriWindows="https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
- private static String uriLinux="https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
-
+ private static String uriWindows = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
+ private static String uriLinux = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
+
public static String getFAQ() {
return FAQ;
}
-
+
public static String getOTRS() {
return OTRS;
}
public static void openFAQ() {
-
+
String faq = FAQ;
Runtime rt = Runtime.getRuntime();
String os = System.getProperty("os.name");
try {
-
+
+
if (os.indexOf( "Win" ) >= 0) {
rt.exec( "rundll32 url.dll,FileProtocolHandler " + faq);
@@ -50,21 +51,50 @@ public class Links {
rt.exec(new String[] { "sh", "-c", cmd.toString() });
}
+ if (os.indexOf("Win") >= 0) {
+
+ // this doesn't support showing urls in the form of
+ // "page.html#nameLink"
+ rt.exec("rundll32 url.dll,FileProtocolHandler " + faq);
+
+ } else if (os.indexOf("Mac") >= 0) {
+
+ rt.exec("open " + faq);
+
+ } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {
+
+ // Do a best guess on unix until we get a platform independent
+ // way
+ // Build a list of browsers to try, in this order.
+ String[] browsers = { "epiphany", "firefox", "mozilla",
+ "konqueror", "netscape", "opera", "links", "lynx" };
+
+ // Build a command string which looks like
+ // "browser1 "url" || browser2 "url" ||..."
+ StringBuffer cmd = new StringBuffer();
+ for (int i = 0; i < browsers.length; i++)
+ cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \""
+ + faq + "\" ");
+
+ rt.exec(new String[] { "sh", "-c", cmd.toString() });
+ }
+
+
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
-
-public static void openOTRS() {
-
+
+ public static void openOTRS() {
+
String otrs = OTRS;
Runtime rt = Runtime.getRuntime();
String os = System.getProperty("os.name");
try {
-
+
if (os.indexOf( "Win" ) >= 0) {
rt.exec( "rundll32 url.dll,FileProtocolHandler " + otrs);
@@ -85,19 +115,47 @@ public static void openOTRS() {
rt.exec(new String[] { "sh", "-c", cmd.toString() });
}
+ if (os.indexOf("Win") >= 0) {
+
+ // this doesn't support showing urls in the form of
+ // "page.html#nameLink"
+ rt.exec("rundll32 url.dll,FileProtocolHandler " + otrs);
+
+ } else if (os.indexOf("Mac") >= 0) {
+
+ rt.exec("open " + otrs);
+
+ } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {
+
+ // Do a best guess on unix until we get a platform independent
+ // way
+ // Build a list of browsers to try, in this order.
+ String[] browsers = { "epiphany", "firefox", "mozilla",
+ "konqueror", "netscape", "opera", "links", "lynx" };
+
+ // Build a command string which looks like
+ // "browser1 "url" || browser2 "url" ||..."
+ StringBuffer cmd = new StringBuffer();
+ for (int i = 0; i < browsers.length; i++)
+ cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \""
+ + otrs + "\" ");
+
+ rt.exec(new String[] { "sh", "-c", cmd.toString() });
+ }
+
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
public static String getUriWindows() {
return uriWindows;
}
-
+
public static String getUriLinux() {
return uriLinux;
}
-
+
}