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

XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

1

XINS 2.0 features

101 new features of XINS 2.0.

This presentation has 102 pages

Page 2: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

2

XML Schema to types

● New target xins xsd-to-types● Generates .typ files with the types

defined in the given XML Schema files for the specified API.

● Parameter xsd.dir is used to get the directory where the *.xsd files are located.

Page 3: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

3

_WSDL Meta function

● New meta function _WSDL

● The WSDL file is included in the WAR file and returned if requested.

● WSDL is an industry standard to describe an API.– http://www.w3.org/TR/wsdl

Page 4: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

4

XINS FF HTML Error

● Error due to XSLT will produce an HTML page containing the details of the Error instead of HTTP 500 Internal Server Error.

● The XSLT used to generate the page could be configured with the xinsff.error.page bootstrap property.

Page 5: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

5

_SMD Meta function

● New meta function _SMD.

● Return the Simple Method Description of the API.– http://dojo.jot.com/SMD

Page 6: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

6

XML to Object with mapping

● Added utility method to fill an Object with an XML Element that performs mapping of element names or attribute name.

● Object BeanUtils.xmlToObject(Element xml, Object target, Map<String, String> elementMapping, Map<String, String> attributeMapping);

Page 7: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

7

API.getResourceAsStream()

● New method to get the InputStream of a resource located in the WAR file.– Improve compatibility with the different

Servlet containers.– Avoid code duplication.– Useful for _WSDL, get script files.

Page 8: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

8

Help in impl.xml

● When writing the impl.xml file, the order of the element matters. The order of the elements is added as comment in the generated impl.xml file when executing xins create-api.

<!-- The order of the elements is logdoc, bootstrap-properties, runtime-properties, content, dependency, calling-convention, instance. -->

Page 9: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

9

Debug fix in NetBeans menu

● Added debug fix (apply patch) in the project pop-up menu in NetBeans.– Debug fix allow to apply changes to the code

without recreating the WAR file or restarting the server.

Page 10: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

10

Tomcat deployment in NetBeans

● Added deploy-tomcat target to the nbbuild.xml– Useful if you want to replace the internal

Servlet container with Tomcat– You can then use the NetBeans HTTP Monitor

tools to monitor the HTTP messages received and returned when using the API.

Page 11: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

11

Improved generated WSDL

● The description of the parameter and attributes has been added to the generated WSDL.

● Correct indentation of the generated WSDL.

Page 12: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

12

Error parameters in WSDL

● WSDL also specifies the output parameters and output data section of the errors.

Page 13: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

13

Tests with Javadoc

● The generated unit tests now also contain Javadoc.

Page 14: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

14

Javadoc in Maven

● Javadoc of the XINS libraries has been added to the XINS Maven modules.– IDE supporting Maven will show the Javadoc

with code completion

Page 15: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

15

pom.xml improvements

● Improvement in the Maven generated pom.xml:– Added Jetty plug-in– Added name for the WAR file

Page 16: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

16

Logging of XSLT location

● The location of the XSLT file is logged when the file is loaded and compiled in the XSLT calling convention.– Know which XSLT is used– Faster to detect the problem in case of error– Once cached -> no logs.

Page 17: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

17

ElementParser.parse(String)

● Parse an XML String.

Page 18: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

18

Conversion List/Set

● New methods to convert a org.xins.common.types.Set/List.Value to a java.util.Set/List and vice-versa.– add(Collection items)– Collection get()

Page 19: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

19

Check tool more flexible

● Class fields not starting with underscores are allowed (e.g. private String description;).

● Star imports are allowed (e.g. import java.io.*;)

Page 20: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

20

help-tools target

● Displays the help for the tools targets.– Included the required and optional

parameters

Page 21: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

21

smd target

● Generates the SMD (Simple Method Description) for an API.– xins smd– optional parameter: smd.endpoint

Page 22: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

22

tests target

● Runs the tests of all the APIs that have tests.– Useful for automated testing

Page 23: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

23

readFully

● Added new utility method to read an InputStream:– String IOReader.readFully(InputStream)– Remove code duplication.

Page 24: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

24

_EnableAPI and _DisableAPI

● New meta functions _EnableAPI and _DisableAPI in order to disable an API for example during the maintenance of resources used by the API.

Page 25: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

25

ElementParser.parse(InputStream)

● New utility method to parse XML based on an InputStream.

Page 26: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

26

JMX default disabled

● JMX is by default disabled– org.xins.server.jmx=true to enable it– Faster start-up

Page 27: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

27

PatternUtils.createPattern

● Utility method to compile a regular expression.– Catches and logs PatternExceptions– Avoid code duplication.

Page 28: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

28

Support for default in WSDL

● If a parameter or an attribute has a default value, the default value is also specified in the generated WSDL file.

Page 29: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

29

Build Java version

● The build Java version is stored in the web.xml– Easier to find the problem when class loading

errors occur.

Page 30: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

30

Optional call to the function

● You can now specify in a calling convention to not execute the function.– e.g. XINSFF functions defined in bootstrap

properties.– e.g. system.describe for JSONRPC CC.– e.g. You want to return a specific error such

as "not logged in".

Page 31: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

31

test libraries

● JAR files added to the <api name>\test directory are added to the classpath when executing the tests– e.g. httpunit.jar

Page 32: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

32

Removed alpha stuff

● Alpha DTD removed● Old directory structure (pre 1.0) no

longer supported● _xins_old calling convention removed

Page 33: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

33

Article about scripting

● New article on how to implement an API using a scripting language.– http://xins.sf.net/scripting.html

Page 34: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

34

Confirmation for stub

● Ask confirmation before generating the stub files.– Prevent from removing the real

implementation.

Page 35: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

35

Auto-fill test forms

● Auto-fill the test form with one of the pre-defined examples– Faster to use when testing

Page 36: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

36

Map to Object

● BeanUtils.setParameters(Map<String, ?>, Object)– Populates the Object with the content of the

Map.– The key of the map is the parameter name– Conversion of the value is performed if

needed.

Page 37: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

37

Better changes detection

● Several improvements in detection of changes in the specification:– Shared types and error codes– WSDL with errors– OpenDoc– CAPI.java

Page 38: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

38

Detection of XINSFF

● Detection of the XINS Front-end Framework– Based on command query parameter– or empty HTTP GET.

Page 39: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

39

Indentation 4 spaces

● The indentation of the generated editable Java files is 4 spaces.– Java standard code convention– No need to configure your IDE

Page 40: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

40

Clean-up logging

● Log messages have been cleaned:– Start-up of the API.

● creating, created, bootstrapping, bootstrapped, initializing, initialized -> creating, bootstrapping, initializing.

● Only the default calling convention is created and initialized.

– When calling another API.● No more time-out specified unless a time-out

exception occured.

Page 41: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

41

Less Ant logs

● Ant target that are not executed are no longer logged.

● The fact that a Java file is not generated for a function is no longer logged.

Page 42: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

42

Cleaner code in XINS

● No unneeded 'extends Objects'● Renamed some 'String s ='● Removed used of ThreadLocal in

CallResultOutputter● Class fields defined before the constructor● Static methods set after the constructor

Page 43: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

43

Conditional redirection

● In XINS Front-end Framework, the conditional redirection will not happen if the function returns an error.

Page 44: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

44

DataElement removed

● The org.xins.client.DataElement class has been removed, replaced by org.xins.common.xml.Element– Can be used with BeanUtils– Can be stored in the XINS FF session– Can be edited– Remove code duplication

Page 45: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

45

CAPI source not in Zip

● The generated source code of the CAPI is no longer included in the Zip file created by the client-<api name> target.

Page 46: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

46

Download tools target

● New target: "download-tools"– Download third party libraries needed for the

tools.– e.g. checkstyle.jar, j2h.jar, jmeter.jar,

pmd.jar, FindBugs, ...– Makes it easier to run the available tools

Page 47: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

47

Editable Element

● The org.xins.common.xml.Element object is now editable:– new Element()– addChild()– setAttribute()– setText()– setLocalName()

Page 48: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

48

EnumItem in session

● EnumItem stored in the session of the XINS front-end framework are also put in the result XML.

Page 49: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

49

Toolbox example

● Added new example API named toolbox.● Implementation of the functions is done

using Groovy scripting language.

Page 50: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

50

Ajax DOJO toolkit example

● Added new Ajax example using the Ajax DOJO toolkit.– Very simple using the generated smd file.

Page 51: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

51

Deprecated classes

● FastStringBuffer and FastStringWriter are no longer used as Java StringBuffer and BufferedWriter are faster.

● No longer used in XINS code, left for external APIs that might use them.

Page 52: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

52

Error code public

● The generated error code classes are now public.– useful for BeanUtils methods.– useful for Spring framwork.

Page 53: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

53

Unique properties

● If a runtime property is set more than once in the runtime property file the API will log it as an error and fail to start.– In 1.5 a warning message was logged.

Page 54: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

54

Invalid value visible

● If value is invalid, the invalid value is also given in the message.– Easier to debug

Page 55: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

55

Improved convertion

● Improved conversion in BeanUtils:– Date– Timestamp– Collections (List/Set)– Primitive types (int, boolean, ...)

Page 56: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

56

Improved detection of files

● api.xml is searched only in apis/*/api.xml● impl.xml is searched only in

apis/*/impl*/impl.xml● No longer search for environment.xml

● Before **/api.xml **/impl.xml and **/environment.xml

● Faster generation of build.xml

Page 57: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

57

Better Integration with the Spring Framework

● New package org.xins.common.spring– XinsCapiFactoryBean– XinsClientInterceptor– XinsCapiRequestValidator– XinsFunctionResultValidator

Page 58: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

58

JSON-RPC calling convention

● New JSON-RPC calling convention in core– _xins_jsonrpc– Support 1.0 and 1.1 specifications

(automatic detection)– Support system.describe function

Page 59: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

59

Calling conventions on demand

● Lazy creation and initialisation of the calling conventions.– Only the default calling convention is created

and initialized when the Servlet is started– Faster start-up– Less logging (including possible exception)– Less memory

Page 60: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

60

Limited logs

● On client side only the 160 first characters of a parameter value are logged– Allow to use binary types _hex and _base64

without slowing the console or filling the log file.

– "..." is added at the end of the value.

Page 61: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

61

build.properties loaded for tools

● The build.properties file is loaded when executing the tool targets– Allow to reuse the current settings (e.g.

test.start.servlet for the code coverage)– Avoid to have to enter the same settings

(e.g. api.name=myproject)

Page 62: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

62

Object to Map

● Added utility method Map<String,?> BeanUtils.getParameters(Object)– Put the parameters of the object in a Map

Page 63: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

63

Object to Map II

● New utility method Map<String,?> BeanUtils.getParametersAsObject(Object)– Gets the parameter as standard Java object– Useful for passing parameters to a script

language that won't know XINS specific types (EnumItem, List, PropertyReader)

Page 64: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

64

Object to Map III

● New utility method Map<String,String> BeanUtils.getParametersAsString(Object)– Put the String representation of the

parameters in a Map.

Page 65: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

65

SOAP CC flexible

● Methods of the SOAPCallingConvention have been changed from private to protected.– Depending on the framework, SOAP request

for a given WSDL can be different. This feature avoid user to have to write a completely new calling convention if the SOAP messages are different than the expected ones.

Page 66: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

66

Class fields before constructor

● The class fields have been moved before the constructor.– Fits the Java coding convention.

Page 67: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

67

testforms.js

● Most of the Javascript used in the test forms has been moved to a testform.js file.– Avoid duplication of code– Smaller test form HTML pages

Page 68: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

68

Static methods after constructor

● The static methods have been moved after the constructor.– Fits the Java coding conventions

Page 69: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

69

New TextUtils methods

● Added new utility methods for text manipulation:– String firstCharLower(String);– String firstCharUpper(String);– String removeCharacter(String, char);

Page 70: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

70

New version system

● 2.0.0 -> 2.0

Page 71: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

71

Conversion

● New utility method for conversion of objects:– Object BeanUtils.convert(Object source,

Class destinationClass);– Convert XINS types, Java types, String.

Page 72: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

72

No exception in get methods

● Removed the ParameterNotInitializedException that was thrown in the Request.get<Param>() methods for optional parameters and attributes– null is returned if the parameter is not set– This also means that if optional the get

method will return the Object type (Boolean, Integer, ...) instead of the primitive type.

Page 73: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

73

Removed obsolete code

● Most of the deprecated classes and methods have been removed:– org.xins.client.DataElement, org.xins.common.ExceptionUtils,

org.xins.common.ant.CallTargetTasks, org.xins.common.text.WhislEncoding, org.xins.common.text.NonASCIIException, org.xins.common.threads.QueueTimeOutException, org.xins.logdoc.LogdocExceptionUtils, org.xins.logdoc.LogdocHexConverter, org.xins.logdoc.LogdocSerializable, org.xins.logdoc.LogdocStringBuffer, org.xins.logdoc.MandatoryArgumentChecker, org.xins.logdoc.AbstractLogdocSerializable, org.xins.logdoc.UnsupportedLocaleError, org.xins.server.Element

Page 74: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

74

Renamed XSLT property

● Renamed templates.parameter.prefix runtime property to templates.<api name>.xins-xslt.parameter.prefix.– Different properties for different APIs– More consistent with XINS Front-end

Framework

Page 75: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

75

Renamed XSLT property II

● Replaced the templates.callingconvention.source property of the _xins-xslt CC to templates.<api name>.xins-xslt.source.– Different properties for different APIs– More consistent with XINS Front-end

Framework

Page 76: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

76

Reorganized WAR file

● The generated WAR file has been reorganized:– Removed impl.xml file.– Added WSDL file.– specs moved to the WEB-INF directory.

Page 77: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

77

Removed unneeded comments

● Removed comments that separated the different sections:– In generated code and in XINS sources

Page 78: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

78

Logging exception simplified

● Removed unneeded parameters to the call to Utils.logIgnoredException and Utils.logProgrammingException.– Automatic detection of the class/method

throwing the exception and of the class/method logging the exception.

– Cleaner code

Page 79: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

79

REST example

● Added pure REST example– REST is Representational State Transfer– http://en.wikipedia.org/wiki/Representational_State_Transfer

– RESTCallingConvention

Page 80: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

80

Several bug fixes

● Several bugs have been fixed in this release.– The most important ones have been

integrated in XINS 1.5.2.

Page 81: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

81

Servlet container improvements

● Several improvements done for the Servlet container.– better path support for cookies and Servlets

Page 82: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

82

Shared error code

● Added shared error code.– Works as shared types

Page 83: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

83

No stack trace for ignorable exception

● The stack trace is no longer logged when logging an ignorable exception.– smaller logs– more readable, easier to detect real

problems

Page 84: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

84

Coverage without server

● Starting the Servlet container for the test coverage is now optional.– Execute the code coverage with the API

running in Tomcat, Jetty or your J2EE server.

Page 85: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

85

Keep environment in test forms

● Test forms remember the last environment chosen.– When moving from one test form to another

one, the last chosen environment is stored in the cookies.

Page 86: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

86

Rebuild war when testing

● test-<api name> target depends on war-<api name> target if the server should be started.

Page 87: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

87

Dependencies in test classpath

● The API dependencies are added to the classpath for compiling the tests.

Page 88: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

88

Full path for build directory

● The full path is used to specify the build directory used to generate and compile and the files.– Could be specify to somewhere else.

-Dbuilddir=...– Fixed some problems when the script is

executed from another directory like within IDEs.

Page 89: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

89

Calling convention extendable

● The calling conventions are now public and extendable.– Easier to create a calling convention similar

to an already existing one.

Page 90: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

90

HTML for Control command

● The Control command of the XINS front-end framework will return an HTML page– Also if an Control action is executed

Page 91: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

91

Location of created logdoc

● The create-logdoc target now informs where are the files created.

Page 92: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

92

Public check method

● The FunctionResult.checkOutputParameters() method is now public in order to enable external validation.

Page 93: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

93

Indented WSDL

● The generated WSDL file is correctly indented with tabs.

Page 94: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

94

public get method

● The get methods of the FunctionRequest object are now public.– Usable with BeanUtils or Spring Framework

for example.

Page 95: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

95

Unix xins as xins.bat

● The Unix xins script now uses make-build.xml to create the build.xml file instead of bootstrap.xml.

Page 96: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

96

Version printed if known

● The version of the API is printed in the footer in the specdocs only when known.– Avoid to have “version ?.?”

Page 97: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

97

Updated libraries

● Updated libraries:– commons-logging (1.1)– Windows installer (better Vista support)– Sarissa (Ajax lib)

Page 98: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

98

mode=source forwarded

● When mode=source is used in XINS FF, the redirection also forward this parameter.– Easier for (unit) testing– Easier for debugging

Page 99: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

99

WSDL to API

● Generates the specification of an API based on a WSDL.– Tested with a lot of different WSDL (.Net,

Axis, ...)– The input can be a WSDL file or a WSDL URL

Page 100: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

100

Yahoo! JSON calling convention

● Added new JSON calling convention– Yahoo! JSON calling convention– Includes support for callback– Automatic detection if output=json– Easy to use with GWT (Google Web Toolkit)

Page 101: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

101

Fixed _ReloadProperties

● The _ReloadProperties meta function did not work when the watching interval was higher than 0. This is fixed.

Page 102: XINS 2.0 featuresxins.sourceforge.net/presentations/xins2.0-features.pdfXINS 2.0 features 101 new features of XINS 2.0. This presentation has 102 pages 2 XML Schema to types New target

102

Performance

● Internal Servlet container 50% faster● Parameters serialized only if logged● No parsing of the specs to know if a error

code is functional or technical● Optimized HTTPServiceCaller