diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Chrome & Vivaldi Developer Tool Settings.md b/tiddlers/content/labs/lab07/$__Labs_07_Chrome & Vivaldi Developer Tool Settings.md new file mode 100644 index 0000000..855ea99 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Chrome & Vivaldi Developer Tool Settings.md @@ -0,0 +1,17 @@ +Chrome/Vivaldi has the best set of developer tools of the available browsers in the labs, so we will be using this as the primary browser for developing the web site. Vivaldi (which is what we use in the Linux lab) is base on Chrome. + + 1. Hit <> in Chrome/Vivaldi to bring up the developer tools. + + 2. Click somewhere inside the developer tools pane to give it focus, and hit <> to bring up the settings. + + 3. In the <> section, untick <> and <>. Source maps allow the tools to work with minified code. We won't be using minification and having these settings enabled means that Chrome will be asking our server for a bunch of map files that we don't have which will cause a lot of 404 errors to appear in the output. This is annoying, so we are disabling it. + + If you are wondering what minification is, it is when the code is processed to shrink all of the variable and function names and all unneeded white space is removed. This significantly reduces the amount of bandwidth required to send the files overs the internet, but makes them unusable to developers. Map files effectively allow the developer tools to reverse the minification process. Our code is not minified, so we don't need to use map files. + + 4. In the <> section, tick <>. We don't ever want to be testing our system using cached versions of files that don't include our most recent changes. + + So long as we have the developer tools open we now know that we will always be looking at the latest versions. You should get into the habit of keeping the developer tools, and more specifically the console open. This allows you to see any errors that occur, in addition to disabling the cache. + + 5. Under the <> section, tick <>. We will be doing a lot of client-side redirection so we don't want the messages to vanish every time the browser is redirected to a new page. + +6. Also in the <> section, tick <>. With this option enabled, the log will now show you when your JavaScript code is sending HTTP requests to the service. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Chrome & Vivaldi Developer Tool Settings.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Chrome & Vivaldi Developer Tool Settings.md.meta new file mode 100644 index 0000000..f9fb6f3 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Chrome & Vivaldi Developer Tool Settings.md.meta @@ -0,0 +1,4 @@ +section: 6 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Chrome & Vivaldi Developer Tool Settings +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Create the Module.md b/tiddlers/content/labs/lab07/$__Labs_07_Create the Module.md new file mode 100644 index 0000000..c1c082b --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Create the Module.md @@ -0,0 +1,33 @@ +The web service API for this module looks like: + +| URI | HTTP Verb | DAO Operation | +|- | - | - | +| /api/customers/{username} | GET | getCustomer(username) | +| /api/register | POST | saveCustomer(customer) | + +We are using two different paths (`/api/customers` and `/api/register`) here because we will need to differentiate these operations when we implement authentication in a later lab. The GET operation should require the user to be authenticated, but the POST operation should not (otherwise the user would need to authenticate before they could create an account which is a catch-22). Having different URI paths makes it easier to differentiate the operations. + + 1. Create a new module class named `CustomerModule` for managing customer accounts. Use the `ProductModule` as a guide. Don't forget to inject the DAO into the constructor. + + 2. Implement the GET operation using the `ProductModule` as a guide. + + 3. The POST operation looks like this: + + ```java + post("/api/register", ctx -> { + Customer customer = ctx.body().to(Customer.class); + custDao.saveCustomer(customer); + return ctx.send(StatusCode.CREATED); + }); + ``` + + Jooby is taking the request message body and converting it into a `Customer` object for us. The only reason that this works is that the message body is going to be JSON encoded and we have added the Gson module to the filter chain. Gson is doing the hard work for you. + + The last line of code is about returning a useful response to the client. This sends a `201/Created` response (https://httpstatuses.com/201) to inform the client that a resource was created in response to their request. + + 4. Add a line of code to the server constructor that mounts the customer module. You will need to create a Customer DAO field and pass it into the module. + + 5. Run the server. Enter the URI for one of the customers in the DAO (you should be able to work out what URI you need). There are some hard-coded customers in the DAO that you can use for testing with. + + Leave this page open since we will use the JSON in the next section. + diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Create the Module.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Create the Module.md.meta new file mode 100644 index 0000000..1fe508a --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Create the Module.md.meta @@ -0,0 +1,4 @@ +section: 4.2 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Create the Module +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Create the Static Resources Folder.md b/tiddlers/content/labs/lab07/$__Labs_07_Create the Static Resources Folder.md new file mode 100644 index 0000000..a45069b --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Create the Static Resources Folder.md @@ -0,0 +1,49 @@ +NetBeans is not very good at creating missing source/resource directories so we will add a couple of Gradle tasks to the `build.gradle` file that will do this for us. Hopefully, you now are starting to see the power of a decent build tool like Gradle --- if an IDE or editor can't do something for us, we can probably do it through the build tool. + +1. Add the following code to the bottom of your `build.gradle` file: + + ```gradle + task createMissingSourceFolders { + group = "Directories" + description = "Create all of the missing source folders for this project." + doFirst { + sourceSets.each { def sourceRoot -> + sourceRoot.allSource.srcDirTrees.each { def sourceDir -> + if (!sourceDir.dir.exists()) { + println "Creating ${sourceDir}" + mkdir sourceDir.dir + } + } + } + } + } + + task deleteEmptySourceFolders { + group = "Directories" + description = "Delete all empty source folders." + doFirst { + sourceSets.each { def sourceRoot -> + sourceRoot.allSource.srcDirTrees.each { def sourceDir -> + if (sourceDir.dir.exists() && sourceDir.dir.isDirectory() && sourceDir.dir.list().length == 0) { + println "Removing empty ${sourceDir}" + sourceDir.dir.delete() + } + } + } + } + } + ``` + + Save the file once you have done this. + + 2. To run the task, select the root of the project and look for the < createMissingSourceFolders">> task in the navigator pane. If you don't see the navigator pane then show it using < Navigator">>. + + Double click the task to run it. + + 3. You should see a new folder in your project --- <>. In the files pane you will see this folder at <> in the root of your project. + + If you are in the labs --- NetBeans has a hard time detecting when new source folders have been created due to the network file servers. You may need to restart NetBeans to get it to notice the new folder. + + This folder is where you will add any JavaScript, HTML, CSS, images, and any other static resources that your web client will need. + +The `deleteEmptySourceFolders` task be be used to get rid of any source folders that have been created but are not actually being used. This is handy to get rid of any uneeded source folders that are cluttering up your projects pane. Don't run it just yet since the static resources folder that was just created is still empty and will be deleted if you run the task now. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Create the Static Resources Folder.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Create the Static Resources Folder.md.meta new file mode 100644 index 0000000..b3e99fe --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Create the Static Resources Folder.md.meta @@ -0,0 +1,4 @@ +section: 7.2 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Create the Static Resources Folder +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Customer JDBI DAO.md b/tiddlers/content/labs/lab07/$__Labs_07_Customer JDBI DAO.md new file mode 100644 index 0000000..e387859 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Customer JDBI DAO.md @@ -0,0 +1 @@ +Since we have a functional collections based customer DAO, this is not that urgent. Add an issue to GitBucket to remind yourself to create a JDBI version of the customer DAO at some point before the milestone 3 deadline. You will also need to create a customer table in the database. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Customer JDBI DAO.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Customer JDBI DAO.md.meta new file mode 100644 index 0000000..ea57c45 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Customer JDBI DAO.md.meta @@ -0,0 +1,4 @@ +section: 10.1 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Customer JDBI DAO +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Customer Module.md b/tiddlers/content/labs/lab07/$__Labs_07_Customer Module.md new file mode 100644 index 0000000..d9ff9c4 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Customer Module.md @@ -0,0 +1 @@ +The customer module will contain routes relating to customer account management operations. We will need a Jooby module, and a Customer DAO. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Customer Module.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Customer Module.md.meta new file mode 100644 index 0000000..91d4ba8 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Customer Module.md.meta @@ -0,0 +1,4 @@ +section: 4 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Customer Module +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Jooby and Static Assets.md b/tiddlers/content/labs/lab07/$__Labs_07_Jooby and Static Assets.md new file mode 100644 index 0000000..1f84f64 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Jooby and Static Assets.md @@ -0,0 +1 @@ +Jooby (combined with Netty) provides us with a web server. We need to put our HTML, CSS, JavaScript, image files, and whatever other statics assets we need for the online shop somewhere, so it makes sense to serve them out of the same Jooby server that is providing the web service. Again, this is breaking the rules of microservices, but it would be very easy to split this out if needed, and it makes your life easier to have a single server for the whole project. diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Jooby and Static Assets.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Jooby and Static Assets.md.meta new file mode 100644 index 0000000..1ffd9ff --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Jooby and Static Assets.md.meta @@ -0,0 +1,4 @@ +section: 7 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Jooby and Static Assets +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Project Tasks.md b/tiddlers/content/labs/lab07/$__Labs_07_Project Tasks.md new file mode 100644 index 0000000..dc15e87 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Project Tasks.md @@ -0,0 +1 @@ +The milestone 3 specification is now available in the [project specification document](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#/Milestone%203/Milestone%203:%5B%5B/Milestone%203/Milestone%203%5D%5D). \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Project Tasks.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Project Tasks.md.meta new file mode 100644 index 0000000..addca89 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Project Tasks.md.meta @@ -0,0 +1,4 @@ +section: 10 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Project Tasks +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Source Folders.md b/tiddlers/content/labs/lab07/$__Labs_07_Source Folders.md new file mode 100644 index 0000000..7e806d6 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Source Folders.md @@ -0,0 +1,11 @@ +We now have all of the source folders that we are going to be using so remove the unnecessary ones using the <> Gradle task. This helps to reduce some unnecessary clutter in your project pane --- you will now only see source folders that you are actually using. + +It is important that you create files in the correct source folder: + + * Java classes (including Jooby related classes) go in the <> folder. + + * Any Java classes relating to automated testing go in the <> folder. + + * Configuration files (such as `logback.xml`) go in the <> folder. We won't be adding any more files to this folder until we get to the security labs. + + * Static assets for the web client, such as HTML, CSS, JavaScript, images or fonts go in the <> folder. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Source Folders.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Source Folders.md.meta new file mode 100644 index 0000000..109b73f --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Source Folders.md.meta @@ -0,0 +1,4 @@ +section: 9 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Source Folders +type: text/x-markdown \ No newline at end of file diff --git "a/tiddlers/content/labs/lab07/$__Labs_07_The \047static\047 Resource Folder.md" "b/tiddlers/content/labs/lab07/$__Labs_07_The \047static\047 Resource Folder.md" new file mode 100644 index 0000000..f8babc3 --- /dev/null +++ "b/tiddlers/content/labs/lab07/$__Labs_07_The \047static\047 Resource Folder.md" @@ -0,0 +1,16 @@ +To make it easier for you to access your static assets in NetBeans we will add the `static` folder (which is where will will put the static assets) to the Gradle project as a resource folder. + +Add the following section to the bottom of the `build.gradle` file: + +```gradle +sourceSets { + 'static' { + resources { + srcDirs = ['static'] + } + java { + srcDirs = [] + } + } +} +``` \ No newline at end of file diff --git "a/tiddlers/content/labs/lab07/$__Labs_07_The \047static\047 Resource Folder.md.meta" "b/tiddlers/content/labs/lab07/$__Labs_07_The \047static\047 Resource Folder.md.meta" new file mode 100644 index 0000000..1dd9406 --- /dev/null +++ "b/tiddlers/content/labs/lab07/$__Labs_07_The \047static\047 Resource Folder.md.meta" @@ -0,0 +1,4 @@ +section: 7.1 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/The 'static' Resource Folder +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_The Home Page.md b/tiddlers/content/labs/lab07/$__Labs_07_The Home Page.md new file mode 100644 index 0000000..72be060 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_The Home Page.md @@ -0,0 +1,24 @@ +Let's create a simple home page to demonstrate how to host it via Jooby. + + 1. Right click the <> folder in your project. Create the HTML file using < Other > Other > HTML File">>. + + Name it `index`. The folder should be `static`. + + Note that this page will become your landing/welcome page for your web site. + + Jooby will automatically map requests to the root path (<>) to the <> file. + + 2. Restart the server. + + 3. Open the page in the browser (use the URI printed in the output console). + + You should see the TODO message in the browser. + + 4. Leaving the server running, change the TODO message in the `
` tag to something else. + + 5. Save the page and reload the page in the browser. You should see the updated version. If not, hit <> to open the dev tools, and reload again. Having the dev tools open will prevent the browser from displaying old cached versions of your files. You should get into the habit of leaving the dev tools open while working on your web client. + + Note that you did not need to restart the server this time. You can make changes to static assets without needing to restart the server --- you just need to reload the page in the browser. + + If you make changes to any Java classes you will need to restart the server to see those changes. + diff --git a/tiddlers/content/labs/lab07/$__Labs_07_The Home Page.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_The Home Page.md.meta new file mode 100644 index 0000000..2eaf961 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_The Home Page.md.meta @@ -0,0 +1,4 @@ +section: 8 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/The Home Page +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_The Static Asset Module.md b/tiddlers/content/labs/lab07/$__Labs_07_The Static Asset Module.md new file mode 100644 index 0000000..20c3d90 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_The Static Asset Module.md @@ -0,0 +1,28 @@ +We need to tell Jooby which static assets it is allowed to serve. We will create another module for doing this. + +Create a new class named `StaticAssetModule` in the `web` package (in the <> source folder). The completed module looks like: + +```java +public class StaticAssetModule extends Jooby { + + public StaticAssetModule() { + + // handle favicons (silent 404) + get("/favicon.ico", Route.FAVICON); + + // serve anything that matches a file in the static folder + assets("/*", Paths.get("static")); + } +} + +``` + +The `get` is there to allow the server to handle requests for favicons (the little icons that sometimes appear in the browser tabs). Without this we would see a lot of 404 errors in our server output console when the browser requests a favicon from our server. This route will return a 404 error to the browser to tell it that we don't have a favicon, but will not produce a 404 error in the log output. + +The `assets` line will tell Jooby that it can serve any file that exists in the `static` folder. This includes files in sub-folders inside `static`. + +Add the following to the constructor of the `Server` class to register the module: + +```java +mount(new StaticAssetModule()); +``` diff --git a/tiddlers/content/labs/lab07/$__Labs_07_The Static Asset Module.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_The Static Asset Module.md.meta new file mode 100644 index 0000000..4345935 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_The Static Asset Module.md.meta @@ -0,0 +1,4 @@ +section: 7.3 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/The Static Asset Module +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Web Pages.md b/tiddlers/content/labs/lab07/$__Labs_07_Web Pages.md new file mode 100644 index 0000000..e30171d --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Web Pages.md @@ -0,0 +1,19 @@ +For next week's lab you will need to have created the following web pages: + + * The 'create account' page. Refer to section [4.2](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FCreate%20Account) of the milestone 3 specification. + + * The 'sign in' page. Refer to section [4.3](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FSign%20In) of the milestone 3 specification. + + * The 'view products' page. Refer to section [4.5](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FView%20Products) of the milestone 3 specification. + + * The 'quantity to purchase' page. Refer to section [4.6](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FUser%20Clicks%20'Buy'%20Button%20for%20a%20Product) of the milestone 3 specification. + +You only need to create static HTML pages at this point. You can add some hard coded dummy data as place holders for the dynamic content. We will show you how to add the dynamic content in the lab next week. + +These files should be created inside the <> folder of your project. + +You can start adding CSS to style the pages if you wish (refer to section [5.2](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FOnline%20Shop) of the milestone 3 specification for details on what we expect for styling). There is no lab material covering CSS styling --- it is up to you to complete this before the milestone 3 deadline --- add an issue to GitBucket to remind yourself. + +Note that we gave you a very quick introduction to HTML and CSS in INFO201 lecture 24. You can find this lecture in the INFO202 Blackboard under < Review material > INFO 201 > Lectures">>. + +We also covered HTML and CSS in lab 13 of INFO201. However, most of that content is not going to be useful since we were using SSR technologies in that lab (JSP and servlets). \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Web Pages.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Web Pages.md.meta new file mode 100644 index 0000000..0eb5dca --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Web Pages.md.meta @@ -0,0 +1,4 @@ +section: 10.3 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Web Pages +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Web Service Modules.md b/tiddlers/content/labs/lab07/$__Labs_07_Web Service Modules.md new file mode 100644 index 0000000..f84ee3e --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Web Service Modules.md @@ -0,0 +1,15 @@ +The complete API for the web service for milestone 3 is: + + | URI | Jooby Module | HTTP Verb | Operation | DAO Method + |-----|--------------------------------------------|----------------|--------------| --- | + /api/products/ | Product | GET | Get all products | getProducts + /api/products/{id} | Product | GET | Get product by ID | searchById + /api/categories/ | Product | GET | Get categories | getCategories + /api/categories/{category} | Product | GET | Get products by category |filterByCategory + /api/register/ | Customer | POST | Create customer | saveCustomer + /api/customers/{username} | Customer | GET | Get customer by username | getCustomer + /api/sales | Sale | POST | Create sale | saveSale + +For next week's lab you will need to have completed the Product module (you have already completed half of these operations). You have already completed the Customer module. The Sale module is not needed for a couple of weeks, so add another issue to GitBucket to remind yourself to complete this before lab 10. + +You may find the following section of the reference useful: <> \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/$__Labs_07_Web Service Modules.md.meta b/tiddlers/content/labs/lab07/$__Labs_07_Web Service Modules.md.meta new file mode 100644 index 0000000..924c080 --- /dev/null +++ b/tiddlers/content/labs/lab07/$__Labs_07_Web Service Modules.md.meta @@ -0,0 +1,4 @@ +section: 10.2 +tags: lab07 lab incomplete hidden +title: $:/Labs/07/Web Service Modules +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md b/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md index d7f83ea..6779be0 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md +++ b/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md @@ -1,15 +1,15 @@ -Add the following to the `dependencies` section of your `build.gradle` file: +Add the following to the `dependencies` section of your <> file: ```gradle -def joobyVer = '2.10.0' -implementation group: 'io.jooby', name: 'jooby-netty', version: joobyVer -implementation group: 'io.jooby', name: 'jooby-gson', version: joobyVer +def joobyVer = '2.15.1' +implementation group: 'io.jooby', name: 'jooby-netty', version: joobyVer; +implementation group: 'io.jooby', name: 'jooby-gson', version: joobyVer; ``` Save and build the project to force Gradle to download the libraries. -Jooby does not provide its own web server so needs to be run on top of another server. In this case we are using Netty as the server. Netty provides a high-performance Java-based web server. +Jooby does not provide its own web server so needs to be run on top of another server. In this case we are using Netty as the server. Netty provides a high-performance Java-based web server. We could use Jetty here, but we don't need all of the extra Java EE stuff that Jetty provides --- Netty is smaller and faster. The Gson dependency allows Jooby to convert domain objects to and from JSON. -Jooby itself is installed as a transitive dependency of either of the other two libraries so we don't need to explicitly add it to the `build.gradle`. \ No newline at end of file +Jooby itself is installed as a transitive dependency of either of the other two libraries so we don't need to explicitly add Jooby to the <> file. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md.meta index a283cae..8bc3244 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md.meta +++ b/tiddlers/content/labs/lab07/_Labs_07_Add Jooby to Your Project.md.meta @@ -1,4 +1,4 @@ -section: 2 -tags: lab08 lab hidden -title: $:/Labs/08/Add Jooby to Your Project +section: 2.1 +tags: lab07 lab +title: /Labs/07/Add Jooby to Your Project type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Chrome & Vivaldi Developer Tool Settings.md b/tiddlers/content/labs/lab07/_Labs_07_Chrome & Vivaldi Developer Tool Settings.md deleted file mode 100644 index 855ea99..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Chrome & Vivaldi Developer Tool Settings.md +++ /dev/null @@ -1,17 +0,0 @@ -Chrome/Vivaldi has the best set of developer tools of the available browsers in the labs, so we will be using this as the primary browser for developing the web site. Vivaldi (which is what we use in the Linux lab) is base on Chrome. - - 1. Hit <> in Chrome/Vivaldi to bring up the developer tools. - - 2. Click somewhere inside the developer tools pane to give it focus, and hit <> to bring up the settings. - - 3. In the <> section, untick <> and <>. Source maps allow the tools to work with minified code. We won't be using minification and having these settings enabled means that Chrome will be asking our server for a bunch of map files that we don't have which will cause a lot of 404 errors to appear in the output. This is annoying, so we are disabling it. - - If you are wondering what minification is, it is when the code is processed to shrink all of the variable and function names and all unneeded white space is removed. This significantly reduces the amount of bandwidth required to send the files overs the internet, but makes them unusable to developers. Map files effectively allow the developer tools to reverse the minification process. Our code is not minified, so we don't need to use map files. - - 4. In the <> section, tick <>. We don't ever want to be testing our system using cached versions of files that don't include our most recent changes. - - So long as we have the developer tools open we now know that we will always be looking at the latest versions. You should get into the habit of keeping the developer tools, and more specifically the console open. This allows you to see any errors that occur, in addition to disabling the cache. - - 5. Under the <> section, tick <>. We will be doing a lot of client-side redirection so we don't want the messages to vanish every time the browser is redirected to a new page. - -6. Also in the <> section, tick <>. With this option enabled, the log will now show you when your JavaScript code is sending HTTP requests to the service. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Chrome & Vivaldi Developer Tool Settings.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Chrome & Vivaldi Developer Tool Settings.md.meta deleted file mode 100644 index 66d4e66..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Chrome & Vivaldi Developer Tool Settings.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 6 -tags: lab08 lab hidden -title: $:/Labs/08/Chrome & Vivaldi Developer Tool Settings -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Create a Customer DAO.md b/tiddlers/content/labs/lab07/_Labs_07_Create a Customer DAO.md deleted file mode 100644 index 719c135..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Create a Customer DAO.md +++ /dev/null @@ -1,11 +0,0 @@ -The `CustomerDAO` interface should have the following API: - -```java -void saveCustomer(Customer customer); -Customer getCustomer(String username); -Boolean validateCredentials(String username, String password); -``` - -It should be reasonably obvious what these methods are going to be used for. Create an interface named `CustomerDAO` in the `dao` package that has this API. - -Create a collections-based DAO named `CustomerCollectionsDAO` that implements the interface. To save you some time, the complete collections DAO is available in the [useful-files](https://isgb.otago.ac.nz/info202/shared/useful-files) repository on GitBucket. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Create a Customer DAO.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Create a Customer DAO.md.meta deleted file mode 100644 index 20b4d18..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Create a Customer DAO.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 4.1 -tags: lab08 lab hidden -title: $:/Labs/08/Create a Customer DAO -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Create a Simple Jooby Server.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Create a Simple Jooby Server.md.meta index b615b40..2732564 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Create a Simple Jooby Server.md.meta +++ b/tiddlers/content/labs/lab07/_Labs_07_Create a Simple Jooby Server.md.meta @@ -1,4 +1,4 @@ section: 3 -tags: lab08 lab hidden -title: $:/Labs/08/Create a Simple Jooby Server +tags: lab07 lab incomplete +title: /Labs/07/Create a Simple Jooby Server type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Create the Module.md b/tiddlers/content/labs/lab07/_Labs_07_Create the Module.md deleted file mode 100644 index c1c082b..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Create the Module.md +++ /dev/null @@ -1,33 +0,0 @@ -The web service API for this module looks like: - -| URI | HTTP Verb | DAO Operation | -|- | - | - | -| /api/customers/{username} | GET | getCustomer(username) | -| /api/register | POST | saveCustomer(customer) | - -We are using two different paths (`/api/customers` and `/api/register`) here because we will need to differentiate these operations when we implement authentication in a later lab. The GET operation should require the user to be authenticated, but the POST operation should not (otherwise the user would need to authenticate before they could create an account which is a catch-22). Having different URI paths makes it easier to differentiate the operations. - - 1. Create a new module class named `CustomerModule` for managing customer accounts. Use the `ProductModule` as a guide. Don't forget to inject the DAO into the constructor. - - 2. Implement the GET operation using the `ProductModule` as a guide. - - 3. The POST operation looks like this: - - ```java - post("/api/register", ctx -> { - Customer customer = ctx.body().to(Customer.class); - custDao.saveCustomer(customer); - return ctx.send(StatusCode.CREATED); - }); - ``` - - Jooby is taking the request message body and converting it into a `Customer` object for us. The only reason that this works is that the message body is going to be JSON encoded and we have added the Gson module to the filter chain. Gson is doing the hard work for you. - - The last line of code is about returning a useful response to the client. This sends a `201/Created` response (https://httpstatuses.com/201) to inform the client that a resource was created in response to their request. - - 4. Add a line of code to the server constructor that mounts the customer module. You will need to create a Customer DAO field and pass it into the module. - - 5. Run the server. Enter the URI for one of the customers in the DAO (you should be able to work out what URI you need). There are some hard-coded customers in the DAO that you can use for testing with. - - Leave this page open since we will use the JSON in the next section. - diff --git a/tiddlers/content/labs/lab07/_Labs_07_Create the Module.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Create the Module.md.meta deleted file mode 100644 index 1364f4b..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Create the Module.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 4.2 -tags: lab08 lab hidden -title: $:/Labs/08/Create the Module -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Create the Static Resources Folder.md b/tiddlers/content/labs/lab07/_Labs_07_Create the Static Resources Folder.md deleted file mode 100644 index a45069b..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Create the Static Resources Folder.md +++ /dev/null @@ -1,49 +0,0 @@ -NetBeans is not very good at creating missing source/resource directories so we will add a couple of Gradle tasks to the `build.gradle` file that will do this for us. Hopefully, you now are starting to see the power of a decent build tool like Gradle --- if an IDE or editor can't do something for us, we can probably do it through the build tool. - -1. Add the following code to the bottom of your `build.gradle` file: - - ```gradle - task createMissingSourceFolders { - group = "Directories" - description = "Create all of the missing source folders for this project." - doFirst { - sourceSets.each { def sourceRoot -> - sourceRoot.allSource.srcDirTrees.each { def sourceDir -> - if (!sourceDir.dir.exists()) { - println "Creating ${sourceDir}" - mkdir sourceDir.dir - } - } - } - } - } - - task deleteEmptySourceFolders { - group = "Directories" - description = "Delete all empty source folders." - doFirst { - sourceSets.each { def sourceRoot -> - sourceRoot.allSource.srcDirTrees.each { def sourceDir -> - if (sourceDir.dir.exists() && sourceDir.dir.isDirectory() && sourceDir.dir.list().length == 0) { - println "Removing empty ${sourceDir}" - sourceDir.dir.delete() - } - } - } - } - } - ``` - - Save the file once you have done this. - - 2. To run the task, select the root of the project and look for the < createMissingSourceFolders">> task in the navigator pane. If you don't see the navigator pane then show it using < Navigator">>. - - Double click the task to run it. - - 3. You should see a new folder in your project --- <>. In the files pane you will see this folder at <> in the root of your project. - - If you are in the labs --- NetBeans has a hard time detecting when new source folders have been created due to the network file servers. You may need to restart NetBeans to get it to notice the new folder. - - This folder is where you will add any JavaScript, HTML, CSS, images, and any other static resources that your web client will need. - -The `deleteEmptySourceFolders` task be be used to get rid of any source folders that have been created but are not actually being used. This is handy to get rid of any uneeded source folders that are cluttering up your projects pane. Don't run it just yet since the static resources folder that was just created is still empty and will be deleted if you run the task now. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Create the Static Resources Folder.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Create the Static Resources Folder.md.meta deleted file mode 100644 index e4215cb..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Create the Static Resources Folder.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 7.2 -tags: lab08 lab hidden -title: $:/Labs/08/Create the Static Resources Folder -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Customer JDBI DAO.md b/tiddlers/content/labs/lab07/_Labs_07_Customer JDBI DAO.md deleted file mode 100644 index e387859..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Customer JDBI DAO.md +++ /dev/null @@ -1 +0,0 @@ -Since we have a functional collections based customer DAO, this is not that urgent. Add an issue to GitBucket to remind yourself to create a JDBI version of the customer DAO at some point before the milestone 3 deadline. You will also need to create a customer table in the database. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Customer JDBI DAO.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Customer JDBI DAO.md.meta deleted file mode 100644 index 4a32fdd..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Customer JDBI DAO.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 10.1 -tags: lab08 lab hidden -title: $:/Labs/08/Customer JDBI DAO -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Customer Module.md b/tiddlers/content/labs/lab07/_Labs_07_Customer Module.md deleted file mode 100644 index d9ff9c4..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Customer Module.md +++ /dev/null @@ -1 +0,0 @@ -The customer module will contain routes relating to customer account management operations. We will need a Jooby module, and a Customer DAO. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Customer Module.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Customer Module.md.meta deleted file mode 100644 index b9220c2..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Customer Module.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 4 -tags: lab08 lab hidden -title: $:/Labs/08/Customer Module -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md b/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md index b8c888c..471c805 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md +++ b/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md @@ -1,3 +1,3 @@ -We are leaving out a lot of important details relating to web services in INFO202. We are teaching you the bare minimum that you need to get a functional web service up and running. We don't have time in INFO202 to cover it all. +We are leaving out a lot of important details relating to web services in {{$:/ou/parameters/Paper Code}}. We are teaching you the bare minimum that you need to get a functional web service up and running. We don't have time in {{$:/ou/parameters/Paper Code}} to cover it all. -If you have an interest in learning more about web services (and you should since it is a big part of systems development these days) then take INFO303 in the first semester next year. +If you have an interest in learning more about web services (and you should since it is a big part of systems development these days) then take INFO 303 in the first semester next year. diff --git a/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md.meta index fdbfa48..875fd79 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md.meta +++ b/tiddlers/content/labs/lab07/_Labs_07_Disclaimer.md.meta @@ -1,4 +1,4 @@ -section: 5 -tags: lab08 lab hidden -title: $:/Labs/08/Disclaimer +section: 4.4 +tags: lab07 lab incomplete +title: /Labs/07/Disclaimer type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Introduction.md b/tiddlers/content/labs/lab07/_Labs_07_Introduction.md index 4d9005c..e912aba 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Introduction.md +++ b/tiddlers/content/labs/lab07/_Labs_07_Introduction.md @@ -1,15 +1,13 @@ -Modern web development is about having stateless REST web services serving and managing domain resources and AJAX clients using those services to present the web pages to the user. We discussed these topics in lectures 13 and 14. +Modern web development is about having stateless REST web services serving and managing domain resources and AJAX clients using those services to present the web pages to the user. We discussed these topics in lectures 8 and 9. -We will be using a framework called Jooby to create the web service (http://jooby.org/). +We will be using a framework called Jooby to create the web service (https://jooby.io/). In this lab we will be: * Creating a Jooby service that handles: - * Getting the products. + * Getting the students. - * Creating a customer account. + * Creating a new student. - * Creating a home page for your shopping web site. - -Note that Jooby makes heavy use of Java lambda expressions. That means that you will be seeing some code today that looks very different from what you are used to. Despite being different, the code is simpler, easy to follow, and you will get used to it pretty quickly --- however you do need to be more careful with your formatting and brackets. \ No newline at end of file + Note that Jooby makes heavy use of Java lambda expressions. That means that you will be seeing some code today that looks very different from what you are used to. Despite being different, the code is simpler, easy to follow, and you will get used to it pretty quickly --- however you do need to be more careful with your formatting and brackets. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Introduction.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Introduction.md.meta index 6388bc4..66ff881 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Introduction.md.meta +++ b/tiddlers/content/labs/lab07/_Labs_07_Introduction.md.meta @@ -1,4 +1,4 @@ section: 1 -tags: lab08 lab hidden -title: $:/Labs/08/Introduction +tags: lab07 lab +title: /Labs/07/Introduction type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md b/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md index b21305a..2d1e2fc 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md +++ b/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md @@ -1,4 +1,4 @@ -As mentioned, Jooby is currently using the product's `toString` method. This is not so useful since we need the web service to return all of the product details in a nicely encoded format. JSON is the answer. If you aren't sure what JSON is then take a look at lecture 13. +As mentioned, Jooby is currently using the student's `toString` method. This is not so useful since we need the web service to return all of the student details in a nicely encoded format. JSON is the answer. If you aren't sure what JSON is then take a look at lecture 8. Add the following to the server constructor just above where you added the product module, and fix the imports: @@ -10,4 +10,4 @@ Restart and test. You should now see a JSON representation of the products in the browser. -Note that the NetBeans generated `toString` methods produce output that looks a lot like JSON. It is sometimes hard to tell them apart. You should see the entire product's details in the JSON version. \ No newline at end of file +Note that the NetBeans generated `toString` methods produce output that looks a lot like JSON. It is sometimes hard to tell them apart. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md.meta b/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md.meta index c373bd5..4053f85 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md.meta +++ b/tiddlers/content/labs/lab07/_Labs_07_JSON Support.md.meta @@ -1,4 +1,4 @@ section: 3.3 -tags: lab08 lab hidden -title: $:/Labs/08/JSON Support +tags: lab07 lab incomplete +title: /Labs/07/JSON Support type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Jooby and Static Assets.md b/tiddlers/content/labs/lab07/_Labs_07_Jooby and Static Assets.md deleted file mode 100644 index 1f84f64..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Jooby and Static Assets.md +++ /dev/null @@ -1 +0,0 @@ -Jooby (combined with Netty) provides us with a web server. We need to put our HTML, CSS, JavaScript, image files, and whatever other statics assets we need for the online shop somewhere, so it makes sense to serve them out of the same Jooby server that is providing the web service. Again, this is breaking the rules of microservices, but it would be very easy to split this out if needed, and it makes your life easier to have a single server for the whole project. diff --git a/tiddlers/content/labs/lab07/_Labs_07_Jooby and Static Assets.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Jooby and Static Assets.md.meta deleted file mode 100644 index def415b..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Jooby and Static Assets.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 7 -tags: lab08 lab hidden -title: $:/Labs/08/Jooby and Static Assets -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Lab 7_ Jooby REST Web Service.tid b/tiddlers/content/labs/lab07/_Labs_07_Lab 7_ Jooby REST Web Service.tid new file mode 100644 index 0000000..e82fcf1 --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_Lab 7_ Jooby REST Web Service.tid @@ -0,0 +1,11 @@ +created: 20200702091026430 +modified: 20200707005526287 +tags: lab toc lab07 incomplete +title: /Labs/07/Lab 7: Jooby REST Web Service +type: text/vnd.tiddlywiki + +!! Contents +<$set name="path" value="/Labs/07/"> +<$macrocall $name="contents-tree" path=<> /> +
<$macrocall $name="openByPath" path=<> />
+ \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Lab 8_ Jooby REST Web Service.tid b/tiddlers/content/labs/lab07/_Labs_07_Lab 8_ Jooby REST Web Service.tid deleted file mode 100644 index f00a4db..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Lab 8_ Jooby REST Web Service.tid +++ /dev/null @@ -1,11 +0,0 @@ -created: 20200702091026430 -modified: 20200707005526287 -tags: lab toc lab08 hidden -title: $:/Labs/08/Lab 8: Jooby REST Web Service -type: text/vnd.tiddlywiki - -!! Contents -<$set name="path" value="/Labs/08/"> -<$macrocall $name="contents-tree" path=<> /> -
<$macrocall $name="openByPath" path=<> />
- \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Odds and Ends.md b/tiddlers/content/labs/lab07/_Labs_07_Odds and Ends.md new file mode 100644 index 0000000..3c28f34 --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_Odds and Ends.md @@ -0,0 +1,9 @@ +There are a few remaining things that you need to do to: + +* Filter by major + +* DAO Exception handling + +* Encapsulating the DAOs. + +* Diagrams diff --git a/tiddlers/content/labs/lab07/_Labs_07_Odds and Ends.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Odds and Ends.md.meta new file mode 100644 index 0000000..a885fda --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_Odds and Ends.md.meta @@ -0,0 +1,4 @@ +section: 5 +tags: lab07 lab incomplete +title: /Labs/07/Odds and Ends +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Products.md b/tiddlers/content/labs/lab07/_Labs_07_Products.md deleted file mode 100644 index 432962c..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Products.md +++ /dev/null @@ -1,43 +0,0 @@ -Let's make the service return some products. - - 1. Start H2 if you haven't already. - - 1. Add a `ProductDAO` field named `productDao` to the `Server` class. Initialise the field with an instance of `ProductJdbiDAO` (use the factory). - - 2. Change the `Hello World` code in the constructor to: - - ```java - get("/api/products", ctx -> productDao.getProducts()); - ``` - - 3. Stop and run the server again. You need to remember to stop the server first since if you try to run it twice you will get a connection error since the port is already in use. - - 4. Reload the page in the browser. Append `api/products` to the URI. - - You should see some products. Jooby is using the `toString` method to display the products. - - Since we are going to be serving 3 modules (products, customer, and sales) and one web site out of the same web server we need to be careful with the URI paths which is why we now have `api/products` in the URI. - - 5. Add the following to the constructor (below what is already here). - - ```java - get("/api/products/{id}", ctx -> { - String id = ctx.path("id").value(); - Product product = productDao.searchById(id); - - if(product == null) { - // no product with that ID found, so return a 404/Not Found error - return ctx.send(StatusCode.NOT_FOUND); - } else { - return product; - } - }); - ``` - - The variable `ctx` holds the HTTP context which includes the request details. In this case we are extracting a path parameter named `id` out of the context. - - If a non-existent ID is provided then the service should return a `404/Not Found` response rather than a null. - - 6. Stop and run. Append a product ID for a product that exists in your database to the end of the URI in the browser. You should see the details for a that product appear in the browser. - - The ID that you added to the end of the URI becomes the `id` path parameter. diff --git a/tiddlers/content/labs/lab07/_Labs_07_Products.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Products.md.meta deleted file mode 100644 index 08ecf16..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Products.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 3.1 -tags: lab08 lab hidden -title: $:/Labs/08/Products -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Project Tasks.md b/tiddlers/content/labs/lab07/_Labs_07_Project Tasks.md deleted file mode 100644 index dc15e87..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Project Tasks.md +++ /dev/null @@ -1 +0,0 @@ -The milestone 3 specification is now available in the [project specification document](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#/Milestone%203/Milestone%203:%5B%5B/Milestone%203/Milestone%203%5D%5D). \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Project Tasks.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Project Tasks.md.meta deleted file mode 100644 index baa6670..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Project Tasks.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 10 -tags: lab08 lab hidden -title: $:/Labs/08/Project Tasks -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Source Folders.md b/tiddlers/content/labs/lab07/_Labs_07_Source Folders.md deleted file mode 100644 index 7e806d6..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Source Folders.md +++ /dev/null @@ -1,11 +0,0 @@ -We now have all of the source folders that we are going to be using so remove the unnecessary ones using the <> Gradle task. This helps to reduce some unnecessary clutter in your project pane --- you will now only see source folders that you are actually using. - -It is important that you create files in the correct source folder: - - * Java classes (including Jooby related classes) go in the <> folder. - - * Any Java classes relating to automated testing go in the <> folder. - - * Configuration files (such as `logback.xml`) go in the <> folder. We won't be adding any more files to this folder until we get to the security labs. - - * Static assets for the web client, such as HTML, CSS, JavaScript, images or fonts go in the <> folder. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Source Folders.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Source Folders.md.meta deleted file mode 100644 index d77bae3..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Source Folders.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 9 -tags: lab08 lab hidden -title: $:/Labs/08/Source Folders -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Starting Project.md b/tiddlers/content/labs/lab07/_Labs_07_Starting Project.md new file mode 100644 index 0000000..2ec93e4 --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_Starting Project.md @@ -0,0 +1,17 @@ +We will be starting with a new project this week. This project is a version of the student system that includes the Swing GUI from lab 3. + +https://isgb.otago.ac.nz/info202/shared/lab07 + +1. Open that page in a browser, copy the clone URL, and clone the project in NetBeans into your <> folder. + +1. Create your own `lab07` repository on GitBucket. + +1. <> the cloned project to your own repository. + +1. Push. Make sure that the project appears in your repository. + +1. Copy your `JdbiDaoFactory` class and `StudentJdbiDAO` interface from your lab 6 project into the `dao` package of the new project. You can copy and paste between projects in NetBeans. + +1. Copy your test classes from the lab 6 project into the <> source folder of the new project. Make sure that they end up in the same package in the new project. + +1. We want to be able to add students to the database via the Swing GUI, so we need to modify the `dao` variable in the `App` class (in the default package) so that it uses the JDBI DAO rather than the collections DAO. Do this now. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Starting Project.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Starting Project.md.meta new file mode 100644 index 0000000..7648620 --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_Starting Project.md.meta @@ -0,0 +1,4 @@ +section: 2 +tags: lab07 lab incomplete +title: /Labs/07/Starting Project +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Students.md b/tiddlers/content/labs/lab07/_Labs_07_Students.md new file mode 100644 index 0000000..f3a31c2 --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_Students.md @@ -0,0 +1,51 @@ +Let's make the service return some students. + + 1. Start H2 if you haven't already. + + 1. Add a `StudentDAO` field named `dao` to the `Server` class. Initialise the field with an instance of `StudentJdbiDAO` (use the factory). + + 2. Change the `Hello World` code in the constructor to: + + ```java + get("/api/students", ctx -> dao.getStudents()); + ``` + + 3. Stop and run the server again. + + 4. Reload the page in the browser. Append `api/products` to the URI. + + You should see some students. Jooby is using the `toString` method to display the students. + + REST APIs were covered in lecture 8. Recall from that lecture that an operation is made up of: + + * A path that represents a unique resource, or a collection of resources. In this case `/api/students` refers to a collection of students. + + * An HTTP method that defines what the operation will do to the resource. In this case `GET`. + + So this *route* (that is what Jooby calls these things) will return the collection of students. + + 5. Add the following to the constructor (below what is already here). + + ```java + get("/api/students/{id}", ctx -> { + + Integer id = ctx.path("id").intValue(); + + Student student = dao.getByID(id); + + if(student == null) { + // no product with that ID found, so return a 404/Not Found error + return ctx.send(StatusCode.NOT_FOUND); + } else { + return product; + } + }); + ``` + + The variable `ctx` holds the HTTP context which includes the request details. In this case we are extracting a path parameter named `id` out of the context. + + If a non-existent ID is provided then the service should return a `404/Not Found` response rather than a null. + + 6. Stop and run. Append a student ID for a student that exists in your database to the end of the URI in the browser. You should see the details for a that student appear in the browser. + + The ID that you added to the end of the URI becomes the `id` path parameter. diff --git a/tiddlers/content/labs/lab07/_Labs_07_Students.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Students.md.meta new file mode 100644 index 0000000..5026558 --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_Students.md.meta @@ -0,0 +1,4 @@ +section: 3.1 +tags: lab07 lab incomplete +title: /Labs/07/Students +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Testing POST Operations.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Testing POST Operations.md.meta index 742a666..ccf5b68 100644 --- a/tiddlers/content/labs/lab07/_Labs_07_Testing POST Operations.md.meta +++ b/tiddlers/content/labs/lab07/_Labs_07_Testing POST Operations.md.meta @@ -1,4 +1,4 @@ section: 4.3 -tags: lab08 lab hidden -title: $:/Labs/08/Testing POST Operations +tags: lab07 lab incomplete +title: /Labs/07/Testing POST Operations type: text/x-markdown \ No newline at end of file diff --git "a/tiddlers/content/labs/lab07/_Labs_07_The \047static\047 Resource Folder.md" "b/tiddlers/content/labs/lab07/_Labs_07_The \047static\047 Resource Folder.md" deleted file mode 100644 index f8babc3..0000000 --- "a/tiddlers/content/labs/lab07/_Labs_07_The \047static\047 Resource Folder.md" +++ /dev/null @@ -1,16 +0,0 @@ -To make it easier for you to access your static assets in NetBeans we will add the `static` folder (which is where will will put the static assets) to the Gradle project as a resource folder. - -Add the following section to the bottom of the `build.gradle` file: - -```gradle -sourceSets { - 'static' { - resources { - srcDirs = ['static'] - } - java { - srcDirs = [] - } - } -} -``` \ No newline at end of file diff --git "a/tiddlers/content/labs/lab07/_Labs_07_The \047static\047 Resource Folder.md.meta" "b/tiddlers/content/labs/lab07/_Labs_07_The \047static\047 Resource Folder.md.meta" deleted file mode 100644 index d6d2dc9..0000000 --- "a/tiddlers/content/labs/lab07/_Labs_07_The \047static\047 Resource Folder.md.meta" +++ /dev/null @@ -1,4 +0,0 @@ -section: 7.1 -tags: lab08 lab hidden -title: $:/Labs/08/The 'static' Resource Folder -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Home Page.md b/tiddlers/content/labs/lab07/_Labs_07_The Home Page.md deleted file mode 100644 index 72be060..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_The Home Page.md +++ /dev/null @@ -1,24 +0,0 @@ -Let's create a simple home page to demonstrate how to host it via Jooby. - - 1. Right click the <> folder in your project. Create the HTML file using < Other > Other > HTML File">>. - - Name it `index`. The folder should be `static`. - - Note that this page will become your landing/welcome page for your web site. - - Jooby will automatically map requests to the root path (<>) to the <> file. - - 2. Restart the server. - - 3. Open the page in the browser (use the URI printed in the output console). - - You should see the TODO message in the browser. - - 4. Leaving the server running, change the TODO message in the `
` tag to something else. - - 5. Save the page and reload the page in the browser. You should see the updated version. If not, hit <> to open the dev tools, and reload again. Having the dev tools open will prevent the browser from displaying old cached versions of your files. You should get into the habit of leaving the dev tools open while working on your web client. - - Note that you did not need to restart the server this time. You can make changes to static assets without needing to restart the server --- you just need to reload the page in the browser. - - If you make changes to any Java classes you will need to restart the server to see those changes. - diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Home Page.md.meta b/tiddlers/content/labs/lab07/_Labs_07_The Home Page.md.meta deleted file mode 100644 index a6c2612..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_The Home Page.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 8 -tags: lab08 lab hidden -title: $:/Labs/08/The Home Page -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Product Module.md b/tiddlers/content/labs/lab07/_Labs_07_The Product Module.md deleted file mode 100644 index b6b6e10..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_The Product Module.md +++ /dev/null @@ -1,23 +0,0 @@ -We don't want to add all of our API routes (that is what these lambda expressions are called in Jooby) to the `Server` class (since we will end up with quite a few before we are finished). We should create a product module that defines the web service API for managing product domain data. This also allows us to easily turn the product module into its own microservice since we can create a server class that only loads this module. - - 1. Create a new class in the `web` package named `ProductModule`. Make it extend `Jooby`. - - 2. Add a default constructor. - - 3. Move the two routes from the server constructor into the constructor of the new class. You should remove the original versions of the routes from the `Server` class. - - Leave the `setServerOptions` call, and DAO field where they. - - 4. DAO injection time. Modify the constructor in the new class so that it takes the DAO as a parameter. Remember to use the interface type. - - The server class will create the DAOs and pass them into the modules. - - 5. Back in the server class add the following to the constructor: - - ```java - mount(new ProductModule(productDao)); - ``` - - The `mount` method will add all of the routes that were declared in the `ProductModule` to the service. - - 6. Restart and test that the server still works correctly. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Product Module.md.meta b/tiddlers/content/labs/lab07/_Labs_07_The Product Module.md.meta deleted file mode 100644 index 42f7b1d..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_The Product Module.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 3.2 -tags: lab08 lab hidden -title: $:/Labs/08/The Product Module -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Static Asset Module.md b/tiddlers/content/labs/lab07/_Labs_07_The Static Asset Module.md deleted file mode 100644 index 20c3d90..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_The Static Asset Module.md +++ /dev/null @@ -1,28 +0,0 @@ -We need to tell Jooby which static assets it is allowed to serve. We will create another module for doing this. - -Create a new class named `StaticAssetModule` in the `web` package (in the <> source folder). The completed module looks like: - -```java -public class StaticAssetModule extends Jooby { - - public StaticAssetModule() { - - // handle favicons (silent 404) - get("/favicon.ico", Route.FAVICON); - - // serve anything that matches a file in the static folder - assets("/*", Paths.get("static")); - } -} - -``` - -The `get` is there to allow the server to handle requests for favicons (the little icons that sometimes appear in the browser tabs). Without this we would see a lot of 404 errors in our server output console when the browser requests a favicon from our server. This route will return a 404 error to the browser to tell it that we don't have a favicon, but will not produce a 404 error in the log output. - -The `assets` line will tell Jooby that it can serve any file that exists in the `static` folder. This includes files in sub-folders inside `static`. - -Add the following to the constructor of the `Server` class to register the module: - -```java -mount(new StaticAssetModule()); -``` diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Static Asset Module.md.meta b/tiddlers/content/labs/lab07/_Labs_07_The Static Asset Module.md.meta deleted file mode 100644 index e10bd6d..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_The Static Asset Module.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 7.3 -tags: lab08 lab hidden -title: $:/Labs/08/The Static Asset Module -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Student Module.md b/tiddlers/content/labs/lab07/_Labs_07_The Student Module.md new file mode 100644 index 0000000..11aeb3c --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_The Student Module.md @@ -0,0 +1,23 @@ +We don't want to add all of our API routes (that is what these lambda expressions are called in Jooby) to the `Server` class (since we will end up with quite a few before we are finished). We should create a student module that defines the web service API for managing student domain data. This also allows us to easily turn the student module into its own microservice since we can create a server class that only loads this module. + + 1. Create a new class in the `web` package named `StudentModule`. Make it extend `Jooby`. + + 2. Add a default constructor. + + 3. *Move* the two routes from the server constructor into the constructor of the new class. You should remove the original versions of the routes from the `Server` class. + + Leave the `setServerOptions` call and DAO field where they. + + 4. DAO injection time. Modify the constructor in the new class so that it takes the DAO as a parameter. Remember to use the interface type. + + The server class will create the DAOs and pass them into the modules. + + 5. Back in the server class add the following to the constructor: + + ```java + mount(new StudentModule(dao)); + ``` + + The `mount` method will add all of the routes that were declared in the `StudentModule` to the service. + + 6. Restart and test that the server still works correctly. \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_The Student Module.md.meta b/tiddlers/content/labs/lab07/_Labs_07_The Student Module.md.meta new file mode 100644 index 0000000..cac3bb4 --- /dev/null +++ b/tiddlers/content/labs/lab07/_Labs_07_The Student Module.md.meta @@ -0,0 +1,4 @@ +section: 3.2 +tags: lab07 lab incomplete +title: /Labs/07/The Student Module +type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Web Pages.md b/tiddlers/content/labs/lab07/_Labs_07_Web Pages.md deleted file mode 100644 index e30171d..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Web Pages.md +++ /dev/null @@ -1,19 +0,0 @@ -For next week's lab you will need to have created the following web pages: - - * The 'create account' page. Refer to section [4.2](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FCreate%20Account) of the milestone 3 specification. - - * The 'sign in' page. Refer to section [4.3](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FSign%20In) of the milestone 3 specification. - - * The 'view products' page. Refer to section [4.5](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FView%20Products) of the milestone 3 specification. - - * The 'quantity to purchase' page. Refer to section [4.6](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FUser%20Clicks%20'Buy'%20Button%20for%20a%20Product) of the milestone 3 specification. - -You only need to create static HTML pages at this point. You can add some hard coded dummy data as place holders for the dynamic content. We will show you how to add the dynamic content in the lab next week. - -These files should be created inside the <> folder of your project. - -You can start adding CSS to style the pages if you wish (refer to section [5.2](https://isgb.otago.ac.nz/info202/shared/project/raw/master/output/info202_project.html#%2FMilestone%203%2FOnline%20Shop) of the milestone 3 specification for details on what we expect for styling). There is no lab material covering CSS styling --- it is up to you to complete this before the milestone 3 deadline --- add an issue to GitBucket to remind yourself. - -Note that we gave you a very quick introduction to HTML and CSS in INFO201 lecture 24. You can find this lecture in the INFO202 Blackboard under < Review material > INFO 201 > Lectures">>. - -We also covered HTML and CSS in lab 13 of INFO201. However, most of that content is not going to be useful since we were using SSR technologies in that lab (JSP and servlets). \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Web Pages.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Web Pages.md.meta deleted file mode 100644 index 0433080..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Web Pages.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 10.3 -tags: lab08 lab hidden -title: $:/Labs/08/Web Pages -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Web Service Modules.md b/tiddlers/content/labs/lab07/_Labs_07_Web Service Modules.md deleted file mode 100644 index f84ee3e..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Web Service Modules.md +++ /dev/null @@ -1,15 +0,0 @@ -The complete API for the web service for milestone 3 is: - - | URI | Jooby Module | HTTP Verb | Operation | DAO Method - |-----|--------------------------------------------|----------------|--------------| --- | - /api/products/ | Product | GET | Get all products | getProducts - /api/products/{id} | Product | GET | Get product by ID | searchById - /api/categories/ | Product | GET | Get categories | getCategories - /api/categories/{category} | Product | GET | Get products by category |filterByCategory - /api/register/ | Customer | POST | Create customer | saveCustomer - /api/customers/{username} | Customer | GET | Get customer by username | getCustomer - /api/sales | Sale | POST | Create sale | saveSale - -For next week's lab you will need to have completed the Product module (you have already completed half of these operations). You have already completed the Customer module. The Sale module is not needed for a couple of weeks, so add another issue to GitBucket to remind yourself to complete this before lab 10. - -You may find the following section of the reference useful: <> \ No newline at end of file diff --git a/tiddlers/content/labs/lab07/_Labs_07_Web Service Modules.md.meta b/tiddlers/content/labs/lab07/_Labs_07_Web Service Modules.md.meta deleted file mode 100644 index b561c28..0000000 --- a/tiddlers/content/labs/lab07/_Labs_07_Web Service Modules.md.meta +++ /dev/null @@ -1,4 +0,0 @@ -section: 10.2 -tags: lab08 lab hidden -title: $:/Labs/08/Web Service Modules -type: text/x-markdown \ No newline at end of file diff --git a/tiddlers/system/shadows/$__config_PageControlButtons_Visibility_$__plugins_tiddlywiki_markdown_new-markdown-button.tid b/tiddlers/system/shadows/$__config_PageControlButtons_Visibility_$__plugins_tiddlywiki_markdown_new-markdown-button.tid index 04fac6b..c07f721 100644 --- a/tiddlers/system/shadows/$__config_PageControlButtons_Visibility_$__plugins_tiddlywiki_markdown_new-markdown-button.tid +++ b/tiddlers/system/shadows/$__config_PageControlButtons_Visibility_$__plugins_tiddlywiki_markdown_new-markdown-button.tid @@ -3,4 +3,4 @@ title: $:/config/PageControlButtons/Visibility/$:/plugins/tiddlywiki/markdown/new-markdown-button type: text/vnd.tiddlywiki -hide \ No newline at end of file +show \ No newline at end of file diff --git a/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_edit.tid b/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_edit.tid index 518ac9d..70267e5 100644 --- a/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_edit.tid +++ b/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_edit.tid @@ -1,4 +1,4 @@ title: $:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit type: text/vnd.tiddlywiki -hide \ No newline at end of file +show \ No newline at end of file diff --git a/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_info.tid b/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_info.tid index 9a194ba..ac2d2ef 100644 --- a/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_info.tid +++ b/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_info.tid @@ -1,4 +1,4 @@ title: $:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/info type: text/vnd.tiddlywiki -hide \ No newline at end of file +show \ No newline at end of file diff --git a/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_more-tiddler-actions.tid b/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_more-tiddler-actions.tid index b7b2894..c3700f4 100644 --- a/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_more-tiddler-actions.tid +++ b/tiddlers/system/shadows/$__config_ViewToolbarButtons_Visibility_$__core_ui_Buttons_more-tiddler-actions.tid @@ -3,4 +3,4 @@ title: $:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/more-tiddler-actions type: text/vnd.tiddlywiki -hide \ No newline at end of file +show \ No newline at end of file diff --git a/tiddlers/system/shadows/$__core_ui_SideBar_More.tid b/tiddlers/system/shadows/$__core_ui_SideBar_More.tid index ad10bd7..69d2f64 100644 --- a/tiddlers/system/shadows/$__core_ui_SideBar_More.tid +++ b/tiddlers/system/shadows/$__core_ui_SideBar_More.tid @@ -1,4 +1,5 @@ caption: {{$:/language/SideBar/More/Caption}} +tags: $:/tags/SideBar title: $:/core/ui/SideBar/More type: text/vnd.tiddlywiki