1 XINS 1.5.0 features 101 new features of XINS 1.5.0. This presentation has 102 pages

Preview:

Citation preview

1

XINS 1.5.0 features

101 new features of XINS 1.5.0.

This presentation has 102 pages

2

API version

● Added the possibility to set a different version for an API.

● Just create a .version.properties in the apis\<api name> directory.

3

API specific log system

● Log system can be defined at the API level allowing to have different log systems for different APIs started in the same Servlet container.

● log4j.<api name>.rootLogger=...● If not found log4j.rootLogger used as

default.

4

logIgnorableException

● Added convenient utility method to log exceptions that should be ignored:– Utils.logIgnorableException(Throwable)

5

Supported methods

● Calling conventions can define which HTTP methods are supported.

● String[] getSupportedMethods()● String[]

getSupportedMethods(HttpRequest)

6

XML Element to Object

● Added utility method to fill an Object with an XML Element.– Useful for filling Result objects with data

sections.

● Object BeanUtils.xmlToObject(Element, Object);

7

Object filler

● Copy the value of an object to another object.– Using the get and set method– Converting types whenever possible– Mapping of names possible– Useful for filling Request and Result objects– Useful with tools as String Framework or JPA

● Object BeanUtils.populate(Object source, Object destination)

8

Bug fixes

● Many bug fixes (probably more than 101)● See changes file for more details

9

CallResultOutputter

● New public class CallResultOutputter. – This class will ease the custom calling

convention to return a result similar to the XINS standard calling convention

● org.xins.server.CallResultOutputter

10

Calling Convention primer

● New tutorial to help you create a custom calling convention.

● http://xins.sf.net/ccprimer.html

11

Links to API in categories

● Generated category pages have a link to the API in which it's defined.

12

Checked with updated tools

● XINS 1.5.0 has been checked with the updated versions of the following analysis tools:– FindBugs 1.1.1– PMD 3.8

13

Checkstyle

● Check the style your Java code.– Creates the checkstyle HTML report for the

implementation of the API.

● xins checkstyle

14

Code coverage

● Generates a unit test coverage report– uses Cobertura

● xins coverage

15

Conditional redirection

● In XINS FF, it's now possible to redirect to another page based on an XPath expression

● <bootstrap-property name="xinsff.redirect.LoginOkay[parameter[@name='session.username']='superuser']">Admin</bootstrap-property><bootstrap-property name="xinsff.redirect.LoginOkay">MainPage</bootstrap-property>

16

Control command with XSLT

● The command=Control returns HTML– Looks better than XML– Includes the links to manage the cache and

the links to the meta functions

17

CVS Change log

● Generate the CVS report for the specified API.– Report is in HTML– /!\ There seems to be a bug with all non-US

locales (in Ant)

● xins cvschangelog

18

Date utility method

● New utility method to convert a long to a human-readable date.

● String DateConverter.toDateString(long date)

19

Default attribute

● Added possibility to set a default value for a parameter or an attribute.– Only for optional parameters

● <param name="inputInt" required="false" type="_int32" default="33"> <description>An example of input for an integer with a default value.</description></param>

20

Documentation page

● Documentation is now on a separate page– Sorted in categories

● http://xins.sf.net/documentation.html

21

Easter egg

● There is now an easter egg. It's very easy to find it, all you need to do is …

22

Eclipse integration

● Creation of an Eclipse project for an API– Much easier than doing it by hand– One project per API

● xins eclipse

23

Element to session

● Element objects which are stored in the XINS FF (front-end framework) session are returned in the data section.

24

Feature sheet

● XINS features list on one page.

● http://xins.sf.net/features.html

25

FindBugs

● Analyse your API for bugs

● xins findbugs

26

XINS FF in core

● The xins front-end framework is part of the xins core (in server.jar)– But still a custom calling convention

● package org.xins.server.frontend

27

Full path for build dir

● All generated files that refer to the build directory, reference it using the full path.– Allows the execution of the script from other

directories

28

Function.getName()

● getName() method of the Function object is now public.

29

Public Request and Result

● The generated Request and Result objects are now public– Allows the use of them as a container object– Allows the use of them with utility methods

(like BeanUtils)

30

JMeter tests generation

● XINS can generate JMeter tests based on the examples provided in the function.

● xins jmeter

31

Equals Requests

● The Request object overrides the hashCode() and equals() methods.– Two similar requests are now equal– Useful for result caching

32

Generic debug log

● A new generic DEBUG log message has been added to ease logging.

● Log.log_1053(message);

33

Maven repository

● XINS 1.5.0 will be submitted to the Maven repository– Ease of use with the dependencies

● <dependency> <groupId>xins</groupId> <artifactId>xins</artifactId> <version>1.5.0</version></dependency>

34

HEAD handling

● HTTP HEAD requests are handled according to the HTTP specifications.– using the internal Servlet container

35

XSLT handling

● reload.stylesheet has been added to correct an XSLT processor error that sometimes shows up.

● Also a bug with the XSLT transformation using the Ant version of Eclipse has been identified. The action to fix this problem has been documented in the user guide and the FAQ.

36

Improved Servlet Container

● Several improvements have been done in the internal Servlet container:– Handles different HTTP Methods– Better handling of HTTP headers– Clean-up of the code

37

XML Element faster

● Removed unneeded code in XML Element object– 5% improvement of the query on the

_GetStatistics function at ERROR log level.

38

Installation Guide

● New installation guide– Shorter XINS primer

● http://xins.sourceforge.net/install.html

39

Installation in pf\xins

● Installation of XINS using the installer is now in c:\Program Files\xins– Correct place– Avoid multiple directories

40

JDK 1.5 support

● Use of generics if the code is compiled for Java 1.5

● List<Product> listProduct();

41

JDepend target

● Generation of the dependency report for your API– HTML report

● xins jdepend

42

JMX support

● Java Management Extension support– Usable with HP OpenView– statistics– properties– list of functions– versions– NoOp and ReloadProperties operations

43

Java coding convention

● New document for coding convention

● http://xins.sourceforge.net/XINS%20Java%20Coding%20Conventions%20-%20v1.0%20-%20July%202006.pdf

44

Lint4J target

● Analyses your API for possible bugs

● xins lint4j

45

Local call to API

● Call an API using the XINS Client Framework without using HTTP– Just a Java method call– Uses the internal servlet container– Faster, avoids network overhead

● capis=service, file:////usr/MyApi.war, 2000

46

Maven target

● Creates the Maven file to describe your API.– From the Maven file, a lot of different targets

can be called.

● xins maven– ->pom.xml in the api directory.

47

Control command

● More information is returned by the Control command in the XINS FF.

48

Added more unit tests

● More tests– New portal API in tests– HTTP compliance tests– Tests for new features

49

Sending files

● Added MultipartCallingConvention to the examples with the fileupload demo.– Directly send binaries over the network as

specified with HTTP

50

NetBeans integration

● Improvements:– Copy project files for an existing API (added

also in 1.4.2)– Specdocs in context menu.– Better profiler detection.

51

Checked with Lint4J

● XINS code has been analyzed with Lint4J tools for possible bugs.

52

Removed NPE

● A few exceptions were thrown when creating a CAPI. This has been fixed.– Easier to debug

53

Release notes in HTML

● The release notes file is available on the web site in HTML form.– Issues found after the release can be added– Looks better

54

PMD target

● New target to analyze the code of the API.

● xins pmd

55

Page number in ODT

● The generated OpenDocument Format has numbered pages.– Easy to read when printed

56

Param-combo in ODT

● The generated OpenDocument Format contains documentation of the param-combos or attribute-combos defined in the API.

57

Value dependency

● Added the possibility to require a parameter if another parameter has a specific value.– There are also other combinations (See

example or user guide)

58

Rebranded

● Changed copyright to Orange Nederland Breedband BV. E-mails changed to @orange-ft.com

59

Regeneration of ODT

● The OpenDocument Format is regenerated when a function or a type changes.

60

xiff -> XINS FF

● Renamed xiff to XINS FF for xins front-end framework.

61

Result caching

● New article on how to do result caching

– List advantages, drawbacks

● http://xins.sf.net/resultcaching.html

62

JMeter run target

● Added possibility to run JMeter to measure the performance of your API from xins– Default uses the location of the generated

JMeter tests

● xins -Djmeter.home=... run-jmeter

63

Session properties

● In the XINS FF, input parameters are set in the session only when the method is successful and the input fields are specified as input parameters.

64

Shared types

● Possibility to share types between APIs– Corporate types– Avoids errors– Reduces the number of files

65

HTTP 1.0 supported

● The internal Servlet container also supports HTTP 1.0– Used by WebMethods

66

OPTION * supported

● The HTTP request “OPTIONS *” will return the full list of supported methods

67

Tested by other teams

● Cap Gemini using WebMethods– Used the WSDL/SOAP/opendoc targets

● Axioss

68

Ant 1.7 Beta support

● Tested with Ant 1.7 Beta– Found and fixed problem.

69

Java SE 6

● Tested with Java SE 6 (rc-b90 – rc-b99).– No problems found

70

This presentation

● 1.5.0 features presentation

71

Tomcat for Eclipse

● Tomcat files needed for Eclipse are generated– No need to copy the WAR file manually after

every build

72

Updated examples

● Added some of the new features to the examples

73

Upgraded libraries

● HTTPClient 3.0.1● Log4J 1.2.14

74

Upgraded docbook

● Documentation generated with XSLT docbook version 1.71.1

75

WSDL without input

● WSDL file can be generated even if the function doesn't have any input section.

76

Dir with spaces

● XINS works when installed in a directory with spaces in the name

77

Hex type

● New type for binaries– _hex– <hex min=”...” max=”...” />

78

_list type

● New _list type for a list of text items

79

_set type

● New _set type for a set of text items

80

_userAgent session

● It's possible to get the HTTP user agent in XINS FF using the _userAgent session property.

81

_inputs session property

● The list of the input parameters sent to the XINS FF is available in the _inputs session property.

82

Compilation version

● New build property “build.java.version” to specify the Java version used at runtime.– Default the same as the one used to compile

● build.java.version=1.4

83

callxins task

● New Ant task to call a xins API.– Returned values are stored in Ant properties

● <callxins function=”SayHello” apilocation=”http://localhost:8080/myapi/” prefix=”foo”>

<param name=”firstName”>Peter</param></callxins>-> foo.message=”Hello Peter” where foo.message is a new Ant property.

84

API information public

● getBootstrapProperties() and getFunctionList() public in API.java

85

build release improved

● nodocs and nomanuals properties to skip the generation of the documentation

● -init-release used for release related targets

86

Java2html target

● Generates the HTML pages of the API implementation source code.

● xins java2html

87

Improved code coverage

● Generated log files are no longer taken into account in the code coverage of XINS.

88

Request and Result as beans

● The Request and Result object are Serializable to better fit the Java beans specification– Used for data binding

89

set method with object

● a set method with object for primitive types is also generated– Before: setApproved(boolean approved)– Now: setApproved(boolean approved) and

setApproved(Boolean approved)

90

Test with NetBeans

● Test target for API is now compatible with the NetBeans IDE.– Uses NetBeans UI for result

91

Front-end framework documentation

● New document explaining the XINS Front-end Framework.

● http://xins.sf.net/frontend/

92

XINS FF fixes

● Fixed several possible problems in the XINS FF:– Possible null pointer when no command

specified– Param-combo generated a HTTP 500 error

93

xins task

● Call a xins target using the xins task– Generates build.xml if needed

● <xins api=”myproject” target=”specdocs” />

94

Tested with Web Logic

● Tested with Web Logic and Java 1.3.

95

Detection of multiple input

● The calling convention will detect if an input parameter is passed more than once in the request and return HTTP 400 Bad request in such case.

96

Logging in XINS FF

● Logging in the XINS FF uses logdoc

97

HTTP correctness

● Correct HTTP error code returned if the HTTP method used for the request is incorrect (like unknown HTTP method).

98

Updated online examples

● Demos on the web site are using xins 1.5

99

New flash demo

● Available on Google– Using NetBeans

100

Log.java in correct dir

● The Log.java file is now generated in the correct directory– Eclipse was showing warnings about it

101

Relative file for XSLT

● Loading XSLT using the XSLTCallingConvention can locate relative XSLT files.

102

XINS FF tested in real application

● XINS FF has been used for the migration of an application containing about 20 pages– Help to detect bugs in the framework– Help to detect improvement areas in the

framework– Help in testing the framework

Recommended