CXF wadl2java generate code from grammar - rest

The code generation with for the methods works fine, but it seems to me that the grammar part is omitted because no Pojo and JAXB annotations are generated. Do I have to specify some additional configuration? I used this command: wadl2java.bat -p packagename /path/to/wadl
Here is a snippet of the wadl.
<application
xmlns="http://wadl.dev.java.net/2009/02"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.tns.de">
<grammer>
<xsd:include href="file1.xsd"></xsd:include>
<xsd:include href="file2.xsd"></xsd:include>
<xsd:include href="file3.xsd"></xsd:include>
<xsd:include href="file14.xsd"></xsd:include>
</grammer>
<resources base="http:localhost:8080/rest">
<resource path="status/{id}" id="statusId">
<param name="id" type="xsd:unsignedInt" required="true" default="" style="template"/>
<method name="GET" id="getById">
<request>
<representation mediaType="application/json" element="tns:type1"/>
</request>
<response>
<representation mediaType="application/json" element="tns:type2"/>
</response>
</method>
....

I found my mistake. There was a typo in the wadl. Previously I used <grammer> but you have to use <grammars>
Now it works.
<application
xmlns="http://wadl.dev.java.net/2009/02"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.tns.de">
<grammars>
<include href="file1.xsd"></xsd:include>
<include href="file2.xsd"></xsd:include>
<include href="file3.xsd"></xsd:include>
<include href="file14.xsd"></xsd:include>
</grammars>
<resources base="http:localhost:8080/rest">
<resource path="status/{id}" id="statusId">
<param name="id" type="xsd:unsignedInt" required="true" default="" style="template"/>
<method name="GET" id="getById">
<request>
<representation mediaType="application/json" element="tns:type1"/>
</request>
<response>
<representation mediaType="application/json" element="tns:type2"/>
</response>
</method>

Related

[Wix][PostgreSQL] How to add an install condition in bundle

I'm trying to add a condition before installing PostgreSQL on Wix bundle.
I'm expecting it to check if there is an installed version of PostgreSQL as you can see on my following code:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Title" Version="1.0.0.0" Manufacturer="Manufacture" UpgradeCode="5aee5af2-10c7-42d1-bde6-c7dadf736786">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
<?define InstallPgCommand=--unattendedmodeui minimal --mode unattended --superpassword "super_pwd" --servicename "service_name" --servicepassword "service_pwd" --serverport 5433?>
<Chain>
<!-- Install postgres -->
<ExePackage
SourceFile="ThirdPartyApps\postgresql-14.3-1-windows-x64.exe"
Compressed ="yes"
Vital ="yes"
Permanent ="yes"
InstallCommand="$(var.InstallPgCommand)"
InstallCondition="NOT POSTGRESINSTALLED"
/>
</Chain>
</Bundle>
<Fragment>
<Property Id="POSTGRESINSTALLED">
<RegistrySearch Id="POSTGRESINSTALLED_SEARCH" Key="SOFTWARE\PostgreSQL\Installations\postgresql-x64-14" Root="HKLM" Type="raw" Name="Branding" />
</Property>
</Fragment>
</Wix>
But it didn't work as expect.
Can you tell me what I'm doing wrong ? Thanks everyone
RegistrySearch is for MSI packages. For bundles, use util:RegistrySearch instead.

Why the node's name in the console is different that the one in .launch file?

I am working with the bebop_driver package and running the bebop_driver_node.
The bebop_node.launch file is like this:
<?xml version="1.0"?>
<launch>
<arg name="namespace" default="bebop" />
<arg name="ip" default="10.202.0.1" />
<arg name="drone_type" default="bebop2" /> <!-- available drone types: bebop1, bebop2 -->
<arg name="config_file" default="$(find bebop_driver)/config/defaults.yaml" />
<arg name="camera_info_url" default="package://bebop_driver/data/$(arg drone_type)_camera_calib.yaml" />
<group ns="$(arg namespace)">
<node pkg="bebop_driver" name="bebop_driver" type="bebop_driver_node" output="screen">
<param name="camera_info_url" value="$(arg camera_info_url)" />
<param name="bebop_ip" value="$(arg ip)" />
<rosparam command="load" file="$(arg config_file)" />
</node>
<include file="$(find bebop_description)/launch/description.launch" />
</group>
</launch>
But when I run rosnode list I receive :
/bebop/bebop_driver
Since I am trying to use the rospy.init_node('node_name') this is a problem because I cant type a namespace.
The namespace and name of your node is defined in the launch file. You can find the documentation at thr ROS wiki: roslaunch/XML.
Namespace:
Since you are using a group, the node will be placed in it's namespace, defined by the ns attribute:
<group ns="$(arg namespace)">
In your case the namespace is defined by the argument namespace which is bebop by default:
<arg name="namespace" default="bebop" />
Note that multiple and nested groups are also possible to create namespaces.
Node name:
The node name is specified by its name attribute:
<node [...] name="bebop_driver" [...]
The result is bebop/bebop_driver what you can see by calling rosnode list.

phing dbdeploy with postgres

Hiho,
I want to use Phing an dbdeploy with a postgres DB.
the problem is that I can not connect to the database with the connection string because I can not define a password.
Does any one has an solution for this?
The following is the deply xml:
`
<!-- load the dbdeploy task -->
<taskdef name="dbdeploy" classname="phing.tasks.ext.dbdeploy.DbDeployTask" />
<!-- these two filenames will contain the generated SQL to do the deploy and roll it back -->
<property name="build.dbdeploy.deployfile" value="scripts/deploy-${DSTAMP}${TSTAMP}.sql" />
<property name="build.dbdeploy.undofile" value="scripts/undo-${DSTAMP}${TSTAMP}.sql" />
<!-- generate the deployment scripts -->
<dbdeploy
url="pgsql:host=${db.host};dbname=${db.name}"
userid="${db.username}"
password=""
dir="${phing.dir}/sql"
outputfile="${build.dbdeploy.deployfile}"
undooutputfile="${build.dbdeploy.undofile}" />
<!-- execute the SQL - Use psql command line to avoid trouble with large
files or many statements and PDO -->
<trycatch>
<try>
<exec
command="pqsql -h${db.host} -U${db.username} -p${db.port} -d${db.name} < ${build.dbdeploy.deployfile} -W"
dir="${phing.dir}"
checkreturn="true"
output="${phing.dir}/cache/deploy-${DSTAMP}${TSTAMP}.log"
error="${phing.dir}/cache/deploy-error-${DSTAMP}${TSTAMP}.log"
/>
<echo msg="Datenbank erfolgreich ausgerollt"/>
</try>
<catch>
<echo msg="Fehler beim ausrollen der Datenbank, führe Rollback durch"/>
<exec
command="pgsql -h${db.host} -U${db.username} -p${db.port} -d${db.name} < ${build.dbdeploy.undofile}"
dir="${phing.dir}"
checkreturn="true"
/>
<echo msg="Rollback erfolgreich"/>
</catch>
</trycatch>
</target>
<!-- ============================================ -->
<!-- Target: writeFiles -->
<!-- ============================================ -->
<target name="writeFiles" description="Write all properties in files">
<copy
file="${dir}config/autoload/local.php.dist"
tofile="${dir}config/autoload/local.php"
overwrite="true"
>
<filterchain>
<replacetokens begintoken="#" endtoken="#">
<token key="db.host" value="${db.host}"/>
<token key="db.username" value="${db.username}"/>
<token key="db.password" value="${db.password}"/>
<token key="db.name" value="${db.name}"/>
<token key="db.port" value="${db.port}"/>
</replacetokens>
</filterchain>
</copy>
<echo>local.php geschrieben.</echo>
</target>`
You can create a password file for the system user (the user which will execute the phing script).

Default components in install4j

When my "installation components" screen runs (I'm in console mode, if it matters), I get the list of components to install, as expected. However, the "default" response is to accept 2 of the components, even though their "Initially Selected for installation" option is false.
I want the user to be able to NOT select any of the optional components, and this isn't possible when it's defaulting to have some of them "Selected".
As far as I can tell, there are no varfiles being loaded.
Snippet from my install4j file:
<component name="A" id="527" customizedId="a" displayDescription="false" hideHelpButton="false" selected="false" changeable="true" downloadable="false" hidden="false">
<description />
<include all="false">
<entry location=".i4j_external_314/a" fileType="regular" />
<entry location=".i4j_external_2366/a" fileType="regular" />
<entry location=".i4j_external_316/a" fileType="regular" />
<entry location=".i4j_external_8155/a" fileType="regular" />
<entry location=".i4j_external_318/a" fileType="regular" />
</include>
<dependencies />
</component>
<component name="B" id="528" customizedId="b" displayDescription="false" hideHelpButton="false" selected="false" changeable="true" downloadable="false" hidden="false">
<description />
<include all="false">
<entry location=".i4j_external_316/b" fileType="regular" />
<entry location=".i4j_external_8155/b" fileType="regular" />
<entry location=".i4j_external_318/b" fileType="regular" />
</include>
<dependencies />
</component>
<component name="C" id="69" customizedId="c" displayDescription="false" hideHelpButton="false" selected="false" changeable="true" downloadable="false" hidden="false">
<description />
<include all="false">
<entry location=".i4j_external_316/c" fileType="regular" />
<entry location=".i4j_external_8155/c" fileType="regular" />
<entry location=".i4j_external_318/c" fileType="regular" />
</include>
<dependencies />
Notice that in all 3 components, "selected" is false, and "changeable" is true.
When the installer runs, though, here is how it is presented:
Which components should be installed?
*: D
*: E
1: A
2: B
3: C
Please enter a comma-separated list of the selected values or [Enter] for the default selection:
[1,2]
(D and E are fine - they're set to "selected" and "not user changeable")
So, even though A and B are not "selected", they show up as a default. Also notice that "C" is configured the same way as "A" and "B", yet doesn't show up in the default.
This is problematic, because I have no way to select "none" of the optional components. I have to select at least 1 in order to not accept the default.
Thanks for any info - if you need more detail, I'd be happy to provide it.

Setting multiple Phing properties from command line

<?xml version="1.0" ?>
<project name="first" basedir="." default="build-skeleton">
<property name="dirName" value="module" />
<property name="fileName" value="config" />
<target name="build-skeleton" description="Making folders">
<mkdir dir="./${dirName}/Block" />
<touch file="./${dirName}/etc/${fileName}.xml" />
</target>
</project>
phing -f mage_module.xml -DdirName=moduleX,fileName=config
phing -f mage_module.xml -DdirName=moduleX fileName=config
Both throw an error - no surprise there.
Is it possible to set multiple properties in Phing via command line?
Just repeating the -D parameter should work:
phing -f mage_module.xml -DdirName=moduleX -DfileName=config