nested loops TXMLMap Talend - talend

I have a problem when I'm trying to read XML from tRestclient > tXMLMap
tRestclient GET message :
<content type="application/xml">
<mSmiley Tongueroperties>
<d:FileSystemObjectType >0</d:FileSystemObjectType>
<d:Id>13</d:Id>
<d:Title>health</d:Title>
<d:c3vxId m:type="Collection(Edm.Int32)">
<d:element>198</d:element>
<d:element>101</d:element>
</d:c3vxId>
</properties>
<properties>
<d:FileSystemObjectType >1</d:FileSystemObjectType>
<d:Id>13</d:Id>
<d:Title>human</d:Title>
<d:c3vxId m:type="Collection(Edm.Int32)">
<d:element>200</d:element>
<d:element>101</d:element>
</d:c3vxId>
</properties>
<properties>
<d:FileSystemObjectType >2</d:FileSystemObjectType>
<d:Id>13</d:Id>
<d:Title>technology</d:Title>
<d:c3vxId m:type="Collection(Edm.Int32)">
<d:element>108</d:element>
<d:element>101</d:element>
</d:c3vxId>
</pperties>
</content
the problem is that I can't loop on because it's a child node.
Do you have any solutions for this please ?
thank's
Data Integration

Related

How to access only virtual views and hide physical tables with a standalone-vdb.xml wildfly/Teiid domain

We are using standalone-vdb.xml domain to create a vdb and then make it accessible through Jupiter for other users.
Now based on the xml file below as an example, we created the VIEW "customer_view"
from the table "Export2.customer_table" and they are both accessible from the Jupiter.
However, we only want the VIEWS to be accessible and not the physical tables
which property can be used to hide the tables and only expose the VIEWS for the end user.
Any one have a clue which property can do that? I tried to find it from the documentation but couldn't find any mentioning for that.
we are using WildFly Full 17.0.1 through the HAL management interface in a Docker container environment and Postgresql database.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="stock" version="1">
<description>The VDB</description>
<property name="UseConnectorMetadata" value="true" />
<model visible="true" name="Export2">
<property name="importer.useFullSchemaName" value="false"/>
<property name="importer.schemaPattern" value="public"/>
<property name="importer.tableTypes" value="TABLES,VIEW"/>
<source name="stockDS" translator-name="postgresql" connection-jndi-name="java:jboss/datasources/stockDS"/>
</model>
<model visible="true" name="Data" type="VIRTUAL">
<metadata type="DDL"><![CDATA[
CREATE VIEW customer_view (
field_names string,
field_description string
) AS
SELECT variable_name, variable_description
FROM Export2.customer_table;
]]> </metadata>
</model>
<data-role name="RoleA" any-authenticated="true">
<description>Allow Reads and Writes to tables and procedures</description>
<permission>
<resource-name>Export2.customer_table</resource-name>
<allow-create>true</allow-create>
<allow-read>true</allow-read>
<allow-update>true</allow-update>
</permission>
<mapped-role-name>Admin</mapped-role-name>
</data-role>
</vdb>
see http://teiid.github.io/teiid-documents/master/content/reference/r_xml-deployment-mode.html
you need to define the model with visibility to false like
<model visible="false" name="Export2">
note that this will remove the metadata exposure from any APIs, however, if someone knows the schema they still can use the same connection to issue the query and see the data. If you want to avoid that then you need to look into data security policies to avoid any access.

How to delete a file with the Pentaho REST API

My Pentaho REST API is working expected for one feature : delete folder or file, I tried this syntax and some others but it didn't work :
PUT method : http://my-server/pentaho/api/repo/files/delete/public:basic.xml
I tried to change the method (DELETE) and other syntax but nothing worked
According to the documentation you PUT to:
/repo/files/delete
or
/repo/files/deletepermanent
with the body:
A comma-separated list of the files to be moved to the trash folder
or
A comma-separated list of the files to be deleted
Your PUT request should be :
http://servername.domain.com:8080/pentaho/api/repo/files/delete
and in the request body you need to put ID of deleted file.
This ID you can get making request like :
http://servername.domain.com:8080/pentaho/api/repo/files/home/karp/ARCH/children?locale=en
Answer will be similar to :
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<repositoryFileDtoes>
<repositoryFileDto>
<aclNode>false</aclNode>
<createdDate>1579701212208</createdDate>
<fileSize>8923</fileSize>
<folder>false</folder>
<hidden>false</hidden>
<id>6f43abcc-0e05-4dbe-8bf9-fc383a9e7983</id>
<lastModifiedDate>1579701212208</lastModifiedDate>
<locale>pl</locale>
<localePropertiesMapEntries>
<locale>default</locale>
<properties>
<key>file.title</key>
<value>Ankieta_po</value>
</properties>
<properties>
<key>jcr:primaryType</key>
<value>nt:unstructured</value>
</properties>
<properties>
<key>title</key>
<value>Ankieta_po</value>
</properties>
</localePropertiesMapEntries>
<locked>false</locked>
<name>Ankieta_po.prpt</name>
<notSchedulable>false</notSchedulable>
<ownerType>-1</ownerType>
<path>/home/karp/ARCH/Ankieta_po.prpt</path>
<title>Ankieta_po</title>
<versionCommentEnabled>false</versionCommentEnabled>
<versionId>1.1</versionId>
<versioned>true</versioned>
<versioningEnabled>false</versioningEnabled>
</repositoryFileDto>
</repositoryFileDtoes>
So , your request should looks like this (below from Postman) :
enter image description here

Cannot get openjpa tools to run from the command line

What I did:
download and extract the latest openjpa release (3.0.0)
download the mariadb jdbc driver jar and copy it to the same directory where openjpa-all-3.0.0.jar is located
inside the same directory, create a subdirectory META_INF and a file META-INF/persistence.xml with the following contents:
<?xml version="1.0"?>
<persistence version="1.0">
<persistence-unit name="openjpa">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<properties>
<property name="openjpa.ConnectionURL" value="jdbc:mariadb://localhost:3306/databasename"/>
<property name="openjpa.ConnectionDriverName" value="org.mariadb.jdbc.Driver"/>
<property name="openjpa.ConnectionUserName" value="dbuser"/>
<property name="openjpa.ConnectionPassword" value="dbpassword"/>
<property name="openjpa.DynamicEnhancementAgent" value="false"/>
<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
<property name="openjpa.Log" value="SQL=TRACE"/>
<property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=120, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000"/>
</properties>
</persistence-unit>
create an empty directory src as a sub-directory of where the openjpa and mariadb driver jars are
ran the following command:
java -cp ./:openjpa-all-3.0.0.jar:mariadb-java-client-2.4.0.jar:openjpa-all-3.0.0.jar org.apache.openjpa.jdbc.meta.ReverseMappingTool -pkg some.package -d ./src
Instead of getting any kind of output, or an error related to generation, I get:
8 INFO [main] openjpa.Tool - The reverse mapping tool will run on the database. The tool is gathering schema information; this process may take some time. Enable the org.apache.openjpa.jdbc.Schema logging category to see messages about schema data.
Exception in thread "main" <openjpa-3.0.0-r422266:1833209 fatal user error> org.apache.openjpa.util.UserException: The persistence provider is attempting to use properties in the persistence.xml file to resolve the data source. A Java Database Connectivity (JDBC) driver or data source class name must be specified in the openjpa.ConnectionDriverName or javax.persistence.jdbc.driver property. The following properties are available in the configuration: "org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl#f248234b".
at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:71)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:850)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDataSource(JDBCConfigurationImpl.java:879)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDataSource2(JDBCConfigurationImpl.java:921)
at org.apache.openjpa.jdbc.schema.SchemaGenerator.<init>(SchemaGenerator.java:86)
at org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:2027)
at org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:2005)
at org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:1882)
at org.apache.openjpa.jdbc.meta.ReverseMappingTool$1.run(ReverseMappingTool.java:1863)
at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:762)
at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:747)
at org.apache.openjpa.jdbc.meta.ReverseMappingTool.main(ReverseMappingTool.java:1858)
What am I doing wrong?
I tried variations of this, by adding -p persistence.xml#openjpa, -p #openjpa and -connectionDriverName org.mariadb.jdbc.Driver to the command line, but it made no difference.

WSO2 Data Service Server - Adding a Custom Data Source

Can anyone help me on how to configure/create a Custom Data Source and using WSO2 4.0.2
Here is a sample wso2-dss-connector for Mongo DB ( Link : https://github.com/wso2/wso2-dss-connectors/tree/master/mongodb) . How to deploy this with WSO2. While building this project,we can get a jar ,so how to integrate this with wso2 for creating a custom datasource
I am new to wso2,i didn't get a clear picture from the official doc
Thanks in advance
If you want a connector for mongo db you can use the above link you mentioned and build this jar and you can put this in the DSSHOME/repository/component/dropins folder and restart the server. Once you have added the jar to dropins you can use the following database descriptor file (dbs) to test this
In this example we create a data source call "mongo_ds" and our query will be called mongo_find, which will retreive set of Documents elements.
<config id="mongo_ds">
<property name="custom_query_datasource_class">org.wso2.dss.connectors.mongodb.MongoDBDataSource</property>
<property name="custom_datasource_props">
<property name="servers">localhost</property>
<property name="database">mydb</property>
</property>
</config>
<query id="mongo_find" useConfig="mongo_ds">
<expression>things.find()</expression>
<result element="Documents" rowName="Document">
<element column="document" name="Data" xsdType="string"/>
</result>
</query>
If you want to write custom data sources for other data sources please refer the following guide.

eReviewBoard can't raise review request

I have my reviewboard 1.7 configured and I am using eReviewBoard and Subclipse plugins in Eclipse IDE.
The issue is when I try to raise the review request it fails giving "timed out" as "Failed creating new review request : Exception executing PutMethod on http://10.203.3.244/api/review-requests/380/draft/ : Read timed out"
When I checked the info at "http://10.203.3.244/api/review-requests/380" I can't find the PUT method for "http://10.203.3.244/api/review-requests/380/draft" instead it is only for "http://10.203.3.244/api/review-requests/380"
Below is the xml:
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<stat>ok</stat>
<review_request>
<status>pending</status>
<last_updated>2014-01-22T07:38:34Z</last_updated>
<description>Testing... </description>
<links>
<diffs>
<href>http://10.203.3.244/api/review-requests/380/diffs/</href>
<method>GET</method>
</diffs>
<repository>
<href>http://10.203.3.244/api/repositories/3/</href>
<method>GET</method>
<title>M2M Repository</title>
</repository>
<screenshots>
<href>http://10.203.3.244/api/review-requests/380/screenshots/</href>
<method>GET</method>
</screenshots>
<self>
<href>http://10.203.3.244/api/review-requests/380/</href>
<method>GET</method>
</self>
<update>
<href>http://10.203.3.244/api/review-requests/380/</href>
<method>PUT</method>
</update>
<last_update>
<href>http://10.203.3.244/api/review-requests/380/last-update/</href>
<method>GET</method>
</last_update>
<reviews>
<href>http://10.203.3.244/api/review-requests/380/reviews/</href>
<method>GET</method>
</reviews>
<draft>
<href>http://10.203.3.244/api/review-requests/380/draft/</href>
<method>GET</method>
</draft>
<file_attachments>
<href>http://10.203.3.244/api/review-requests/380/file-attachments/</href>
<method>GET</method>
</file_attachments>
<submitter>
<href>http://10.203.3.244/api/users/amritpal/</href>
<method>GET</method>
<title>amritpal</title>
</submitter>
<changes>
<href>http://10.203.3.244/api/review-requests/380/changes/</href>
<method>GET</method>
</changes>
<delete>
<href>http://10.203.3.244/api/review-requests/380/</href>
<method>DELETE</method>
</delete>
</links>
I don't know what to do next. I understand this info is generated and read by the plugin itself??!!
Has anyone faced this issue?
It looks like you raised this issue with the project, which is what I was going to recommend you do:
https://github.com/rombert/ereviewboard/issues/129