• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/135

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

135 Cards in this Set

  • Front
  • Back

What language will you be coding the client side project in?

Typescript

What does the typescript language get compiled to?

Regular JavaScript

What file in the client side project specified the underlying technologies to be incorporated in the client side project?

Package.json

What software actually uses the package.json file?

Node.js/npm

What is the minimum version to use for node.js?

6.3.1

What file did we add to the client project to specify where the typescript compilation output gets placed?

tsconfig.json

What is the purpose of the typings.json file?

Provides type definitions for the 3 libraries we're using in the index.html file from the typings registry

What is SystemJS known as?

JavaScript Module Loader

What html tag did we add in the index.html to provide the starting point for our application?

<basehref= "/" />

What is the purpose of the
<exercises-app>...</exercises-app>


tag in index.html?

placeholderwhere SPA will execute

To use external modules in angular component, what typescript verb do we use?

Import

When we run the "npm start" script, what is happening in the background?

2Things:




1) starts the lite web server, which starts loading our application




2) Monitors changes made to the files, there's a watch process happening on all of our .ts files, so if they're changed a recompilation occurs and the browser refreshes automatically

What JAVA EE api is used server side to provide REST services to the client?

JAX-RS - Java API for RESTful Web Services

What data format does JAX-RS return to the client?

JSON

What WebStorm tool can you use to exercise these server side services?

Test RESTful WebService

What database is this course going to utilize?

Java DB -Implementation of Apache Derby

What JAVA EE server are we using in this course?

Payara/Glassfish4.1

What does the server side project get built into and deployed as?

A web archive (WAR)

What is a DTO?

Data TransferObject - A collection class that will contain data going to/from server orbetween different packages on the server

What JDBC class did we utilize to execute the employees query?

PreparedStatement




e.g:
PreparedStatement pstmt;
Connection con = null;


con = ds.getConnection();



String sql = "SELECT * FROM Products";
pstmt = con.prepareStatement(sql);

try (ResultSet rs = pstmt.executeQuery()) { while (rs.next()) {




}

What java class was used in the model to establish a connection?

Datasource (instantiated in the resource class)

Explain the purpose of this JAX-RS annotation: @Path

The main route to the resource



Explain the purpose of this JAX-RSannotation: @GET

Designates the method usehttp gets

Explain the purpose of this JAX-RS annotation: @Produces

Used on themethod to convertresults to JSON

Why did we need to add the class NewCrossOriginResourceSharingFilter class?

The ClientExercises project uses a different web browser and such is considered a different domain than the NetBeans project. Different domains by default are not able to access data/services, this filter allows such access

Given this URL: http://localhost:8080/ServerExercises/exercises/employee where does the "exercises" part get created in the server project?

Known as the@ApplicationPath, found in the ApplicationConfig.java class

What is an angular2 service?

An angular2 class that provides non-visual functionality (eg employee.service.ts)




recall-- whereas a component doeshave a visual part to it

What is rxjs?

Reactive Extensions for JavaScript is a non-angular, 3rd party library for transforming, composing and querying streams of data.




The important part is it deals with streams (we'reusing it for streams of data in our project for the asynchronous calls over thenetwork). It creates something called observables

What 2 rxjs methods did we utilize last class on those observables?

Map, subscribe

What is the purpose of the angular2 @Input annotation?

It sets up a public property in achild component, that gets loaded from the parent

What intrinsic angular2 function can we use to iterate through an array in the template code?

*ngFor

Describe the following component property:


Selector

Htmltag to use in the SPA(single pg app) html page (wherethe html will get inserted)

Describe the following component property:


Template

Markupthat component will generate

Describe the following component property:


Directives

Othercomponents to be accessed by the current component

Describe the following component property:


Providers

Other non-components (eg. Services)to be accessed by the component

What role does the ngOnInit method provide?

Typically you should only usea constructor to initialize your class variables and anything else you want todo at startup time do it in the ngOnInit, it runs right after the constructor runs (before the view gets rendered)

What did we do in the ngOnInit method last class (during a GET)?

We subscribed to the load()method of the service's map command in the HomeComponents's ngOnInit() method

To output data to the browser, we use something called interpolation. What syntax would I see in the template code to represent interpolation?

{{…}}

What method is used on the PreparedStatement to actually perform a database update?

executeUpdate

What annotation is used on the JAX-RS resource to facilitate an http update?

@Put

What gets returned as JSON from the JAX-RS update method?

The number of rows updated by the database (an int in JSON format)

What annotation did we use for the resource update method?

@Consumes


or


@Produces

@Consumes (cuz ittakes a json object to update the db)

What annotation is used in a component to pass data in from a parent component in angular2?

@Input

What annotation is used in a child component to raise events that can be handled by a parent component in angular2?

@Output

What Angular object is used to contain html form fields in angular2?




What attribute is used in the template code to link to it?

ControlGroup, [formGroup]

What Angular object is used to contain a single form element? What attribute is used in the html template code to link to it?

FormControl, [(ngModel)]

What syntax is used in the template markup to indicate: One way binding

[. . . . ]

What syntax is used in the template markup to indicate: Two way binding

[( .. . )]

What syntax is used in the template code to raise an event from the child component?

(click)="saved.emit(selectedEmployee)"

What syntax is used in the template code to handle an event like this: (click)="saved.emit(selectedEmployee)" in the parent component?

(saved)="update($event)"

Explain this line of typescript code: this.employees.map(


emp=> emp.id === employee.id


?


(Object).assign({}, emp, employee)


:


emp


);

For eachemp in the employees collection, compare the id property to an externalvariable called employee.id,




If they'reequal, replace the current emp contents with an object named employee,




If they're not,leave everything the same. This was used in the update method.

What is returned from the employee model class whenexecuting the Delete method?

An intrepresenting the # of rows deleted

What constant is passed in the initialization of a PreparedStatement that utilizes auto numbering by JavaDB?

PreparedStatement.RETURN_GENERATED_KEYS

What method is executed on the PreparedStatement when retrieving the new value of the PK when autonumbering is in effect?

getGeneratedKeys()

When coding an JAX-RS method, what additional annotation is added to the method in addition to the @DELETE annotation?

@Path("/{id}")

What annotation is used in the the deleteEmployee method of the JAX-RS class's argument list?

@PathParam("id")int id

How does a child component containing a html form notify the parent component that abutton has been clicked?

@outputannotation (Event Emitter)

What is the name of the operator used in this line of code (not the equal sign):



this.employee = […this.employees, employee];

The spread operator- used to add to the array

What was different between the delete method and the add/update methods in the employee.service class in how data was transmitted to the server?

The deletepasses an int to the server, add/update pass an entire object

Describe this attribute taken from a parent component's template code:




(saved) = "save ($event)"

(saved) isthe name of the @Output annotation in the child component,




save is the name ofthe event handling method in the parent component

How was the delete button hiding when doing the "add" scenario?

We use thehidden property binding


"[hidden]=boolean" attribute on the button'smarkup, note you can also use


"bind-hidden=boolean"

Did the save method handle an add or update scenario?

Both (viathe save method)

What JavaScript operator did the save method utilize to determine if we were doing an add or an update?

? (ternaryoperator)

What did we load in the Validators.compose method of employee-detail.component.ts?

An array of validators

How many *ngIf statements did we use in the original validation example, and what were they?

Check if the field is valid, then checked for the required condition

Explain how the save button was disabled if a field was in error on the form?

[disabled] ="!employeeForm.valid"

What programming construct is used in our custom phone# validator?

A regular expression

How is the actual error name created in a custom validator?

We set it as a property in the return statement




return {invalidPhone: true};

What did we add to the app.module.ts to make our custom validators available for use?

A providers property - providers: [ValidatorService]

How many *ngIfs are on the error div after adding acustom validator?

3 - if fieldvalid, if required, if !required and custom

How does the menu button of app-component.html.ts work?

Uses a boolean menuIsCollapsed and


[ngClass]="{hide: menuIsCollapsed} property binding, the boolean gets toggled on the click of both the button and menu entry to hide and show the divs

What type does the appRoute variable (array that contains all of the applications routing info) have in app.routes.ts?

Routes

What 2 properties are defined in the appRoute variable?

Path and component

What property binding was used on the anchors in the menu from last class?

[routerLink]

What is the purpose of this tag:




<router-outlet></router-outlet>


In the template where the route contents (our application) should be rendered

List the 3 server side classes to handle expense processing in the exercises project

ExpenseDTO,


ExpenseModel,


ExpenseResource

When adding the ExpenseResource class in the ServerExercises project, what other class was updated if using the NetBeans New Restful WebService from Patterns wizard?

ApplicationConfig(needs an entry for the new resource in the addRestResources method)

What did we replace the ListItem markup (employeeListComponent) with when listing out expenses? (ExpenseTableComponent)?

<tr>...</tr>

How did we toggle between ascending and descending sorts in the sort method?

sortOrder =!sortOrder

What standard html control was utilized last class to determine if a receipt was available or not?

checkbox

How did we populate the 2 html selects used in the expense details markup?

For employees, *ngFor using employees array,




For categories, hard coded options

What does this line of code do:


this.sortedExpenses =this.expenses.slice(0);

Copies the entire expenses array to a new array called sortedExpenses

What directive did we add to the markup in


app-component.html to incorporate expense processing?

[routerLink] ="['expenses']"

What file was modified to allow for the directive


[routerLink] ="['expenses']" to actually be usable?

App.routing.ts

What new validator was added to the amount field from last class?

Decimal validator

What typescript type did we use for the dateincurred field?

any

What html tag did we use for the datincurred field?

<input type="date">

="date">

What problem may happen when doing an add to the product table?

May run into a duplicate PK error (pk is not generated)

What was suggested as a fix for the potential problems from adding to the products table to avoid the duplicate PK error?

Create a customvalidator to search the existing client side product array

T/F the custom validator for assessing if a products id is unique or not, should be coded in the validators.ts code?

F- we need to access the products array so we put it in product-home.component

How many validators will be on the product code field?

2 (required and the custom)

If we’re not doing an add, what should we do via html/css on the PK field?

Make it r/o (read only)

What is the purpose of making the product id field read only when not doing an add?

User's shouldn't be allowed to change existing PK's

What bootstrap component are we using to divide up information on the product form?

panel

How many panels will we utilize?

2 - product information, inventory information

What other bootstrap construct are we utilizing in the panel headings?

glyphicons

What 2 glyphicons were utilized in the product panel headings?

Chevron-down, chevron-right

What ngClass property was used to collapse either of the panels?

[ngClass] = "{hide: pIsCollapsed }"

What do the acronyms EOQ and QOO stand for?

EOQ - economic order quantity most feasible amount to order


QOO - quantity on order - goods we've ordered but haven't received yet

How many FK's are in the ExpenseReportItem table and what are they?

2 FKs - ReportId, ExpenseID

Describe the relationship between the ReportDTO and the ReportItemDTO classes on the server

ReportDTO contains an ArrayList property of ReportItemDTO's

What java object was used last class to format the expense report's date with a format of "MM/dd/YYYY"

SimpleDateFormat

Why do we need a transaction in the report generator model?

More than one row will be inserted in more than one table

What java.sql class do all jdbc transation methods get invoked on?

Connection

How do we indicate when a transation is to begin with jdbc code?

con.setAutoCommit(false);

After we're done inserting data, how do we indicate the transaction is over?

con.commit()

What else should we code in one of the catch clauses?

con.rollback()

What http verb did we code in theExpenseReportResource.addExpenseReport?

POST

What do we return from the method ExpenseReportResource.addExpenseReport()

The new report PK value (int)

What path do we specify in the WebStorm ide Request panel to test the server side method ExpenseReportResource.addExpenseReport()

/ServerExercises/exercises/expensereport

What Name/Value pair should we add to the request header in order to pass example data over to the ExpenseReportResource?

Content-Type, application/json

If you want to hard code a default option for an html select, what syntax could you use?

<option selected disabled>


Choose Employee


</option>

What was the purpose of the boolean pickedEmployee in report-generator.html.ts?

Whether or not the expenses dropdown was disabled

What was the purpose of the boolean hasItems?

Whether or not the lines/totals are displayed

What is supposed to happen when the user switches employees when using the expense generator?

The expensedropdown gets reloaded,


hasItems gets reset


and the bottom part of the display is suppressed.

Describe this line of client side code


{{total |currency: 'USD':true:'1.2-2'}}

Using interpolation display the variable total using the built-in currency pipe, U.S. dollars show the dollar sign and use a max of 2 and a min of 2 decimal places

Other than locating the desired employee data, what else did we do in the pickEmployee method?

Reset


items array,


selectedExpenses array,


hasItems boolean,


pickedExpenses boolean

What services were added to the "providers" property in the report.model component last class?

ExpenseService,EmployeeService, ReportService

What rsjx verb was used to grab only the expenses for a particular employee?

filter - this.employeeexpenses = this.expenses.filter(ex => ex.employeeid == id);

What rsjx verb was used to locate a particular employeee in the employees array?

Find -this.selectedEmployee = this.employees.find (e => e.id == id);

What new dropdown was added to the case study generator that was not in the exercises generator?

Qty

What wrinkle do you need to account for with this extra drop down?

The default value of EOQ, you need to determine this for each selected product

How is a product removed from case study generator?

Enter a qty of zero for the product you want to remove

What is the name and version of the java pdf library we'll be utilizing?

Itextpdf 5.5.9

Where do we place the itext jar file so that glassfish is aware of it?

Payara41\glassfish\domains\domain1\lib\ext

T/F - Glassfish will be aware of the library once it has been copied to Payara41\glassfish\domains\domain1\lib\ext?

F - we need to restart glassfish

What other software do we need to make aware of the new jar?

NetBeans - Library--> add external jar

2 files from c:\temp were utilized in the sample pdf program, what were they?

Input SomeLogo.png,


output FirstPdf.pdf

What is a servlet?

An extension of the web server

What implementation of the Servlet Interface does Oracle provide for us to extend?

HttpServlet

In the provided servlet code, what does the parameter urlPatterns do?

Provides an alias for the servlet

What did we write the pdf to do instead of a local file in the sample servlet?

ByeArrayOutputStream

What servlet intrinsic object did we utilize to get the report id the server was interested in?

request

If all is working, how will the user end up seeing the pdf?

It will download as an attachment

What url would I provide to the browser to see report "20" in the exercises project?

Http://localhost:8080/ServerExercises/ExpenseReportPDF?reportid=20