Data Replicator connection string for use with Data Hub - exact-online

I am trying to set up Invantive Data Hub with Replicator. The default discovery creates entries for Exact Online and others, but there is no entry in settings.xml which shows me how to configure data cache.
This one exists for example:
<connection name="Exact Online (nl)" id="c149becf-01d3-4a58-9ee7-7369f34bdff5" description="{res:itgen_demo_exact_online_combined_nl}" sortingOrder="1000" authentication="Application" userLogonCodeMode="Auto" passwordMode="Auto" createdBy="jbu" createdOn="WS102" creationDate="2017-08-17T13:53:23.9351965+02:00">
<database order="0" createdBy="jbu" createdOn="WS102" creationDate="2017-08-17T13:53:23.9071956+02:00" provider="ExactOnlineAll" connectionString="apiUrl=https://start.exactonline.nl" />
</connection>
The console app has no editor for the settings.xml, so it must be done manually.
How can I configure the Replicator connection string to be used?

Using Google with different keywords, I've found a working setup. First Add a file settings-something.xml in the %USERPROFILE%\invantive.
The give it contents like below:
<?xml version="1.0" encoding="utf-16"?>
<settings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3" forcedefault="false">
<group name="Jurriaan" >
<connection name="Exact Online with PostgreSQL Data Cache" dataCacheConnectionString="provider=PostgreSql;connectionString={Server=dbserver;Database=db;User Id=db_owner;Password=db_pwd}" >
<database provider="ExactOnlineAll" connectionString="apiUrl=https://start.exactonline.nl" />
</connection>
</group>
</settings>
It would be handy when there would be a connection editor on Data Hub or at least a sample :-)

Related

Microsoft EWS api GetItem (mail) response ErrorInvalidUserPrincipalName but principal name is correct

I used Microsoft EWS api GetItem to get mail message item, but for certain users, server response ErrorInvalidUserPrincipalName (other users are work without errors), and I check principal name is correct with Microsoft Graph api.
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013"/>
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrincipalName>xxx#xxx.com</t:PrincipalName>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetItem>
<m:ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:IncludeMimeContent>true</t:IncludeMimeContent>
</m:ItemShape>
<m:ItemIds>
<t:ItemId Id="xxx"/>
</m:ItemIds>
</m:GetItem>
</soap:Body>
</soap:Envelope>
And server response ErrorInvalidUserPrincipalName.
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorInvalidUserPrincipalName</faultcode>
<faultstring xml:lang="en-US">The impersonation principal name is invalid.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInvalidUserPrincipalName</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The impersonation principal name is invalid.</e:Message>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
I used Microsoft Graph user api to check principal name, the principal name is same as I bring in EWS GetItem request but still get ErrorInvalidUserPrincipalName response.
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"id": "zzz",
"businessPhones": [],
"displayName": "yyy",
"mail": "xxx#xxx.com",
"userPrincipalName": "xxx#xxx.com"
...
}
I tried to send same EWS GetItem with PrimarySmtpAddress tag rather than PrincipalName (smtp address is same as principal name), and it works without error, I don't know why use PrincipalName will get ErrorInvalidUserPrincipalName response even principal name looks correct.
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013"/>
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrimarySmtpAddress>xxx#xxx.com</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetItem>
<m:ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:IncludeMimeContent>true</t:IncludeMimeContent>
</m:ItemShape>
<m:ItemIds>
<t:ItemId Id="xxx"/>
</m:ItemIds>
</m:GetItem>
</soap:Body>
</soap:Envelope>
Is anyone occur same problem and can help me to solve this?
Thanks!
Does the Mailbox have a valid licence (the EXCHANGEDESKLESS Exchange Online Kiosk licence also doesn't have EWS access) and is it enabled and has been logged on to at least once. Typically when you get this error its because your trying to impersonate a disabled account.
After use PowerShell check, found UserPrincipalName is inconsistent on Exchange Server.
Get-Mailbox | Select-Object -ExpandProperty UserPrincipalName
Output:
aaa#aaa.com
But Graph api return UserPrincipalName is xxx#xxx.com
Then contact Microsoft support, they help to set UserPrincipalName consistent, after UserPrincipalName consistent, EWS api GetItem can work perfectly with PrincipalName.
Thanks.

Insert Static Nodes in XML with Google App Script

I have a Google App Script which generates XML from Google Sheet data. Each row of the sheet is an Athlete. In the XML file, I want to insert a static (i.e. not connected to a Sheet) set of nodes at the beginning.
Example:
<MEET>
<CLASSES>
<CLASS>
<NAME>Track</NAME>
</CLASS>
<CLASS>
<NAME>Field</NAME>
</CLASS>
</CLASSES>
<EVENTS>
<EVENT>
<NAME>Run</NAME>
</EVENT>
<EVENT>
<NAME>Throw</NAME>
</EVENT>
<EVENT>
<NAME>Jump</NAME>
</EVENT>
</EVENTS>
<ATHLETES>
<ATHLETE>
<NAME>Joe Smith</NAME>
<ADDRESS>123 Main St, Anytown, NY 12121</ADDRESS>
<EMAIL>joe#smith.com</EMAIL>
<PHONE>518-555-1234</PHONE>
<EMERGENCYNAME>Jane Smith</EMERGENCYNAME>
<EMERGENCYPHONE>518-555-5678</EMERGENCYPHONE>
<CLASS>Track</CLASS>
</ATHLETE>
</ATHLETES>
</MEET>
In this example, the root node is MEET and has numerous ATHLETE nodes added to it, based on the rows of the Google Sheet. However, the CLASSES and EVENTS will never change. I do want to be able to access them in the data though.
How do I insert these nodes before my dynamic content, within the root node?
Created a new Google Sheet for those elements, pulled them in same way as others.

Mysterious EOF error message while updating a SOLR index

I am using atomic update to update meta-data in a SOLR document collection. To do so, I use an external .json file where I record all document IDs in the collection and possible meta-data, and use the "set" command to commit requested updates. But I figured out that whenever the external file is larger than approx 8200 bytes / 220 lines, I get this error message :
"org.apache.solr.common.SolrException: Cannot parse provided JSON: Unexpected EOF: char=(EOF),position=8191 BEFORE=''"
This does'nt seem to be related to the actual content of the file (or possible missing parenthesis or other) as I reproduced it with different databases. Moreover, If I cut the external file into smaller, less than 8000 bytes, updates work perfectly. Has anyone an idea of where this could come from ?
The curl command to update the collection is as follow :
curl 'http://localhost:8983/solr/these/update/json?commit=true' -d #test5.json
The SOLR main configuration file is available after the post. I can provide the json update file if needed. I'm available for any further elements.
Thanks in advance for your help,
Barthélémy
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This is a DEMO configuration highlighting elements
specifically needed to get this example running
such as libraries and request handler specifics.
It uses defaults or does not define most of production-level settings
such as various caches or auto-commit policies.
See Solr Reference Guide and other examples for
more details on a well configured solrconfig.xml
https://cwiki.apache.org/confluence/display/solr/The+Well-Configured+Solr+Instance
-->
<config>
<!-- Controls what version of Lucene various components of Solr
adhere to. Generally, you want to use the latest version to
get all bug fixes and improvements. It is highly recommended
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
<luceneMatchVersion>6.6.0</luceneMatchVersion>
<!-- Load Data Import Handler and Apache Tika (extraction) libraries -->
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar"/>
<lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar"/>
<lib dir="${solr.install.dir:../../../..}/contrib/langid/lib" regex=".*\.jar"/>
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-.*\.jar"/>
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="df">text</str>
</lst>
</requestHandler>
<requestHandler name="/dataimport" class="solr.DataImportHandler">
<lst name="defaults">
<str name="config">tika-data-config.xml</str>
</lst>
</requestHandler>
<updateRequestProcessorChain name="langid" default="true" onError = "skip">
<processor class="org.apache.solr.update.processor.LangDetectLanguageIdentifierUpdateProcessorFactory"
onError = "continue">
<str name="langid.fl">text</str>
<str name="langid.langField">language_s</str>
<str name="langid.threshold">0.8</str>
<str name="langid.fallback">en</str>
</processor>
<processor class="solr.LogUpdateProcessorFactory" onError = "skip"/>
<processor class="solr.RunUpdateProcessorFactory" onError = "skip"/>
</updateRequestProcessorChain>
<!-- The default high-performance update handler -->
<updateHandler class="solr.DirectUpdateHandler2">
<!-- Enables a transaction log, used for real-time get, durability, and
and solr cloud replica recovery. The log can grow as big as
uncommitted changes to the index, so use of a hard autoCommit
is recommended (see below).
"dir" - the target directory for transaction logs, defaults to the
solr data directory. -->
<updateLog>
<str name="dir">${solr.ulog.dir:}</str>
</updateLog>
</updateHandler>
</config>
I don't know if this will solve it for anybody else that runs into this but I ran into this same issue.
My inital command looked like this:
curl http://localhost:8983/solr/your_solr_core/update?commit=true --data-binary #test5.json -H "Content-type:application/json"
Updating it to this solved the problem
curl http://localhost:8983/solr/your_solr_core/update?commit=true -H "Content-Type: application/json" -T "test5.json" -X POST
apparently it has something to do with curl loading the whole file into memory with the first command which causes issues, whereas the second command uses minimal memory.
try editing server/etc/jetty.xml and tweak requestHeaderSize:
<Set name="requestHeaderSize"><Property
name="solr.jetty.request.header.size" default="8192" /></Set>
to something larger than your file limit.

NLog mySQL database as target configuration

I am using Nlog with MYsql as target database.
MY configuration is as below:
<target name="databaselog" type="Database" keepConnection="true"
useTransactions="false"
dbProvider="MySql.Data.MySqlClient"
connectionString="Server=localhost;Database=****;User ID=****;Password=****;Connect Timeout=5;"
commandText=" insert into logs(time_stamp,logger,message,log_level) Values(#TIME_STAMP,#LOGGER,#MESSAGE,#LOGLEVEL)">
<parameter name="#TIME_STAMP" layout="${longdate}"/>
<parameter name="#LOGGER" layout="${logger}"/>
<parameter name="#MESSAGE" layout="${message}"/>
<parameter name="#LOGLEVEL" layout="${level:uppercase=true}"/>
</target>
.
Still not able to insert the info or any level message in MYSql DB.
Can anyone please help me out ?
bye the I also tried command text as
insert into logs(time_stamp,logger,message,log_level) Values(?,?,?,?)
but not able to insert the data in mysql db.
From NLog docs:
NLog is designed to swallow run-time exceptions that may result from logging. The following settings can change this behavior and/or redirect these messages.
<nlog throwExceptions="true" /> - adding the throwExceptions attribute in the config file causes NLog to stop masking exceptions and pass them to the calling application instead. This attribute is useful at deployment time to quickly locate any problems. It’s recommended to set throwExceptions to "false" as soon as the application is properly configured to run, so that any accidental logging problems won’t crash the application.
<nlog internalLogFile="file.txt" /> - adding internalLogFile causes NLog to write its internal debugging messages to the specified file. This includes any exceptions that may be thrown during logging.
<nlog internalLogLevel="Trace|Debug|Info|Warn|Error|Fatal" /> – determines the internal log level. The higher the level, the less verbose the internal log output.
<nlog internalLogToConsole="false|true" /> – determines whether internal logging messages are sent to the console.
<nlog internalLogToConsoleError="false|true" /> – determines whether internal logging messages are sent to the console error output (stderr).
Right click on NLog configuration file. Set value to "Copy always" of property "Copy to Output Directory"

Jabber Openfire server v3.6.0a+ - how do I use Hybrid authentication?

I'm setting up a Jabber server for my website. I've already got some user accounts in place in the openfire database, and working IMs between them.
I'm now looking to add (some) of the users from my main database (members table, with login, password[plain text]) and allowed_to_IM[0 or 1] fields) to allow them to communicate between themselves. The Hybrid authentication is a new feature in v3.6.0a however, and there's little documentation in what configuration is required in the openfire.xml file for the database connectivity (to a second database), and what else may go in the properties (which have also taken much of the config's info away of the XML file).
My question is: Does anyone have a complete example that checks multiple databases? All the examples I'm seen seem to be just fragments.
I have it using ldap and mysql and if it helps you my setting from openfire.xml are:
<connectionProvider>
<className>org.jivesoftware.database.DefaultConnectionProvider</className>
</connectionProvider>
<database>
<defaultProvider>
<driver>com.mysql.jdbc.Driver</driver>
<serverURL>jdbc:mysql://127.0.0.1:3306/openfire</serverURL>
<username>username</username>
<password>pass</password>
<minConnections>5</minConnections>
<maxConnections>15</maxConnections>
<connectionTimeout>1.0</connectionTimeout>
</defaultProvider>
</database>
<ldap>
ldapsetting removed
</ldap>
<hybridAuthProvider>
<primaryProvider>
<className>org.jivesoftware.openfire.auth.DefaultAuthProvider</className>
</primaryProvider>
<secondaryProvider>
<className>org.jivesoftware.openfire.ldap.LdapAuthProvider</className>
</secondaryProvider>
</hybridAuthProvider>
<provider>
<auth>
<className>org.jivesoftware.openfire.auth.HybridAuthProvider</className>
</auth>
<vcard>
<className>org.jivesoftware.openfire.auth.DefaultAuthProvider</className>
</vcard>
<user>
<className>org.jivesoftware.openfire.ldap.LdapUserProvider</className>
</user>
<auth>
<className>org.jivesoftware.openfire.ldap.LdapAuthProvider</className>
</auth>
<group>
<className>org.jivesoftware.openfire.ldap.LdapGroupProvider</className>
</group>
</provider>