Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this assignment, re-implement the Media Library applications in C++ and Java

ID: 667875 • Letter: I

Question

In this assignment, re-implement the Media Library applications in C++ and Java, adding serialization by importing the Library from a Json file to initialize the library, and exporting to a Json file to save the library.

Use the file media.json ( http://pastebin.com/0XAiLPsf ) to initialize the Media Library, and export a modified Json file to save the library upon completion of the program.

One approach to completing this assignment is to add constructors to both your MediaLibrary and MediaDescription classes that initialize from Json. For example, your Java MediaDescription class may have a constructor

      public MediaDescription(JSONObject jsonObj)

and your MediaLibrary class may have a constructor that initializes the library from a file containing Json. In Java this may be

      public  MediaLibrary(String  jsonFileName)

Each of these classes may contain methods to export to Json. In MediaDescription this may be

      public  JSONObject  toJson( )

And in MediaLibrary this may be

      public  void  toJsonFile(String  jsonFileName)

The Java main program would use the MediaLibrary constructor to initialize the library from a file, and call the toJsonFile method to save the library. Similar methods and constructors would exist in theC++ program.

Structure of your Solution Directory

Submit your solution as a Java archive file (jar) of the project directory: Assign3. Grading your project will be done by extracting the jar and executing the project using Ant from the command-line. The project directory should include only the following files, subdirectories and classes:

The Ant directive file build.xml. The build should contain targets for targets, clean, prepare, build.cpp, execute.cpp, and build.java. The execute.java.

media.json

Subdirectory: src for source files. The src directory contains subdirectories for the Java and C++ source files in java and cpp respectively.

Subdirectory classes used to store the compiled Java class files.

This is what I have from previous project... ( https://app.box.com/s/oa36br6edgtwmrefn9tcowzvfah4fxns )

This question needs the following completed:

Properly formated and named solution file. The Assign3 directory should have the files specified above (only) (4 points).

Screen shot showing exection of your solutions. This may be one screenshot for Java and one for C++ (4 points). Same as prior assignment.

Json Import Functionality. Programs are able to import the library from the media.json file. (6 points).

Json Export Functionality. Programs are able to export the media library to Json file (6 points).

Explanation / Answer

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

    pageEncoding="ISO-8859-1"

    import="jquery.datatables.model.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "http://www.w3.org/TR/html4/loose.dtd">

<html>

    <head>

        <title>Applying jQuery DataTables plugin in the Java Server application</title>

        <link href="media/dataTables/demo_page.css" rel="stylesheet" type="text/css" />

        <link href="media/dataTables/demo_table.css" rel="stylesheet" type="text/css" />

        <link href="media/dataTables/demo_table_jui.css" rel="stylesheet" type="text/css" />

        <link href="media/themes/base/jquery-ui.css" rel="stylesheet"

           type="text/css" media="all" />

        <link href="media/themes/smoothness/jquery-ui-1.7.2.custom.css"

           rel="stylesheet" type="text/css" media="all" />

        <script src="scripts/jquery-1.4.4.min.js"

           type="text/javascript"></script>

        <script src="scripts/jquery.dataTables.min.js"

           type="text/javascript"></script>

        <script type="text/javascript">

        $(document).ready(function () {

            $("#companies").dataTable({

                "sPaginationType": "full_numbers",

                "bJQueryUI": true

            });

        });

        </script>

    </head>

    <body id="dt_example">

        <div id="container">

            <div id="demo_jui">

                <table id="companies" class="display">

                    <thead>

                        <tr>

                            <th>Company name</th>

                            <th>Address</th>

                            <th>Town</th>

                        </tr>

                    </thead>

                    <tbody>

                      <% for(Company c: DataRepository.GetCompanies()){ %>

                    <tr>

                             <td><%=c.getName()%></td>

                         <td><%=c.getAddress()%></td>

                         <td><%=c.getTown()%></td>

                    </tr>

                <% } %>

                    </tbody>

                </table>

         </div>

        </div>

    </body>

</html>

<!DOCTYPE html>

<html>

    <head>

        <title>Using jQuery DataTables plugin with AJAX

           source implemented in Java web application</title>

        <link href="media/dataTables/demo_page.css"

           rel="stylesheet" type="text/css" />

        <link href="media/dataTables/demo_table.css"

           rel="stylesheet" type="text/css" />

        <link href="media/dataTables/demo_table_jui.css"

           rel="stylesheet" type="text/css" />

        <link href="media/themes/base/jquery-ui.css"

          rel="stylesheet" type="text/css" media="all" />

        <link href="media/themes/smoothness/jquery-ui-1.7.2.custom.css"

          rel="stylesheet" type="text/css" media="all" />

        <script src="scripts/jquery-1.4.4.min.js"

          type="text/javascript"></script>

        <script src="scripts/jquery.dataTables.min.js"

          type="text/javascript"></script>

        <script type="text/javascript">

        $(document).ready(function () {

            $("#companies").dataTable({

                "bServerSide": true,

                "sAjaxSource": "/JQueryDataTables/CompanyAjaxDataSource",

                "bProcessing": true,

                "sPaginationType": "full_numbers",

                "bJQueryUI": true

            });

        });

        </script>

    </head>

    <body id="dt_example">

        <div id="container">

            <div id="demo_jui">

        <table id="companies" class="display">

              <thead>

                  <tr>

                       <th>Company name</th>

                       <th>Address</th>

                       <th>Town</th>

                  </tr>

              </thead>

              <tbody>

              </tbody>

        </table>

        </div>

        </div>

    </body>

</html>