Presentation is loading. Please wait.

Presentation is loading. Please wait.

Abstracting the Underlying Multiple Operating System Architecture for Comprehensive Command Line Graphical Interface.

Similar presentations


Presentation on theme: "Abstracting the Underlying Multiple Operating System Architecture for Comprehensive Command Line Graphical Interface."— Presentation transcript:

1 Abstracting the Underlying Multiple Operating System Architecture for Comprehensive Command Line Graphical Interface

2 Objectives  Bridge the gap for new users  Create a more user friendly environment with the Command Line feel  Dynamic program that fits the user’s needs

3 Design

4 GUI Interface

5

6 Data Storage Data about functions are stored in an XML file. Additional functions can be added as they are needed. Follows a standard format so Linux & Windows commands can easily be swapped and the same parser can be used. XML allows for commands to easily be added and removed (not hardcoded).

7 Data Storage This is what our XML syntax is: view help pages This command is used to view help pages for... Common parameters for this command include... man [-acdfFhkKtwW] [--path] [-m system] [-p string]... man formats and displays the on-line manual pages. If... Specify the configuration file... Specify the list of directories to... displays the manpage for the ls command displays very short description of what...

8 Parser The parser is the part of the project that takes the data from the XML and makes it available to the calling class. It is agnostic to whether the XML is for Linux or Windows. It simply takes the file as a parameter and parses it. It provides the parsed data as a series of get() methods. There are no set() methods.

9 Parser The parser generates a DOM (Document-Object Model) tree from the XML document. This tree is then parsed and the data from the tree is placed into a hash-table The hash-table structure allows very quick O(1) access time for the data. All the work is done on instantiation.

10 Testing Testing was crucial to make sure that everything worked. Several interacting parts Run with or without SSH Run on Linux/Windows/Mac Proper Dropdowns Help text Parser XML Files

11

12 Research and Operating System Principles Process Builder allows for execution of system processes similar to concepts of Process Creation in Chapter 3 of our textbook ProcessBuilder.start()  fork ProcessBuilder.waitFor()  join

13 Research and Operating System Principles

14 Threads used to isolate the execution of the thread so the main GUI remained responsive (avoids complexity of thread synchronization) two ways to implement threads in Java implement the Runnable interface extend the Thread class Research and Operating System Principles

15 Threads override run() method with code wanted to be run separately as a thread start a thread by simply calling the Thread.start() method. Research and Operating System Principles

16 Networking Class Sends commands directly to a server bypassing third party programs such as Putty or Chameleon Application receives output sent from server and displays it in the command prompt window.

17 Networking Class

18 Modification of the open source terminal emulator JCTerm by Jcraft. Licensed under GNU LGPL License (allows use of library in proprietary programs, either open or closed source) JC Term is in turn based on the JSch SSH client, also by Jcraft Licensed under BSD License (same restrictions as LGPL, BSD code used in Mac OS X)

19 Networking Class Features of JCTerm Local/Remote Port Forwarding SFTP Support SSH2 Protocol Support Pack Compression Support Anti-Aliasing (set to disabled for Morph)

20 Interfacing with Command Line If not using the networking class, the command is executed using on the user’s local operating system using the ProcessBuilder class. Since different tasks are independent and isolated processes, an additional command will be needed to get the current working directory. Works on any operating systems, but the syntax is obviously different

21 Interfacing with Command Line Windows Commands must be preceded by “cmd /c” This especially calls the Windows command interpreter with the /c switch indicating to execute the command and then exit Example: “cmd /c dir”  command to list contents of current directory To get current directory, append command with “ & cd” (ex: “cmd /c cd.. & cd”)

22 Interfacing with Command Line Linux Commands must be preceded by “/bin/bash -c” This especially passes the Linux command to the bash shell which then executes the command Example: “/bin/bash -c ls”  command to list contents of current directory To get current directory, append command with “;pwd” (ex: “/bin/bash cd..;pwd”)

23

24 Commands Linux Windows clear cp ls mv mkdir rm ps top kill cd Compilation commands (javac, g++, gcc) Execute commands (java, gdb, a.out) man grep locate lpr exit ping ifconfig vi cls copy xcopy dir move mkdir rmdir del tasklist taskkill cd javac java help find findstr print exit ping ipconfig rename

25

26 References Alexander, A. (2010, February 4). Java exec - execute system processes with Java ProcessBuilder and Process (part 2). devdaily. Retrieved December 2, 2010, from http://www.devdaily.com/java/java-exec-processbuilder-process-2 Class ProcessBuilder. (2010).Java API. Retrieved December 2, 2010, from http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ProcessBuilder.ht ml Class System. (2010). Java API. Retrieved December 2, 2010, from http://download.oracle.com/javase/1.4.2/docs/api/java/lang/System.html Display ToolTip in JComboBox. (n.d.). Happy Codings - Java Programming. Retrieved December 2, 2010, from http://www.java.happycodings.com/Java_Swing/code17.html Drake, Donald. G. (1996, April 1). Introduction to Java threads.JavaWorld. Retrieved December 3, 2010, from http://www.javaworld.com/javaworld/jw-04- 1996/jw-04-threads.html Freitag, P. (2005, September 27). Parsing, Modifying, and outputting XML Documents with Java. Retrieved December 2, 2010, from http://www.petefreitag.com/

27 References From Runtime.exec() to ProcessBuilder. (2008). Java Tips. Retrieved December 2, 2010, from http://www.java-tips.org/java-se-tips/java.util/from- runtime.exec-to-processbuilder.html How to read XML file in Java. (n.d.). Java Tips - Home. Retrieved December 2, 2010, from http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to- read-xml-file-in-java.html Img source: http://www3.ntu.edu.sg/home/ehchua/programming/java/J6d_xml.html JCTerm - SSH2 Terminal Emulator in Pure Java. (2010). JCraft. Retrieved December 2, 2010, from http://www.jcraft.com/jcterm/ Jericho HTML Parser. (n.d.).Jericho HTML Parser. Retrieved December 2, 2010, from http://jericho.htmlparser.net/docs/index.html JSch - Java Secure Channel. (n.d.). JCraft. Retrieved December 2, 2010, from http://www.jcraft.com/jsch/ Tutorial: XML generation with Java. (2002, July 5).JavaZOOM. Retrieved December 2, 2010, from http://www.javazoom.net/ XML Tutorial. (2010). W3Schools Online Web Tutorials. Retrieved December 2, 2010, from http://www.w3schools.com/xml/

28


Download ppt "Abstracting the Underlying Multiple Operating System Architecture for Comprehensive Command Line Graphical Interface."

Similar presentations


Ads by Google