How to load my custom adapter configuration properties in BizTalk 2020 in property browser using IAdapterConfig? - adapter

I have a custom Adapter in BizTalk 2020 that reads data from MongoDB GridFS. But since the code was earlier in 2013 R2 Framework, now while migrating it to 2020 Framework, it throws error like
IAdapterInterface is not implemented
I then added this Microsoft.Adapter.Biztalk.AdapterFramework namespace in my projects so now I inherited the IAdapterInterface.
But How do I implement its methods(GetConfigSchema() and GetSchema() to load the Receive handler/send handler/ schema in property browser in admin console?

GetConfigSchema()
See https://learn.microsoft.com/en-us/biztalk/core/adapter-configuration-schemas to get an idea of setting the config name, default value and creating a "drop-down" of values to choose from.
GetSchema()
See https://learn.microsoft.com/en-us/biztalk/core/adapter-getschema-method on explanation when you need to return null or an actual schema.

Related

Thymeleaf timezone

I want to get current time in GMT+6 but can not make it work. what is the correct format to pass the timezone?
I've tried the followings -
[[${#dates.createNowForTimeZone('ASIA/DHAKA')}]]
[[${#dates.createNowForTimeZone("ASIA/DHAKA")}]]
[[${#dates.createNowForTimeZone('GMT+6')}]]
[[${#dates.createNowForTimeZone("GMT+6")}]]
But, all give the time in EDT.
UPDATE November 2022
Thymeleaf version 3.1 now includes built-in support for java.time:
The thymeleaf-extras-java8time extras module has been integrated into the Thymeleaf core: the #temporals expression utility object is now always available.
You no longer need to add the extra JAR mentioned below, for Thyeleaf 3.1 onwards.
(Spring Boot 3.0 uses Thymeleaf 3.1, if you are using that.)
Thymeleaf 3.0 and earlier
I recommend you use the Thymeleaf "extras" library for handling Java 8's java.time classes, and avoid anything related to the old and flawed java.util.Date class.
The library:
Thymeleaf - Module for Java 8 Time API compatibility
If you are using Maven, you can add it to your project using the following dependency:
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
<version>3.0.4.RELEASE</version>
</dependency>
Otherwise you can download the JARs manually from here.
Once you have installed the new JAR, you can use this:
${#temporals.createNowForTimeZone(zoneId)} // return a instance of java.time.ZonedDateTime
For example, as follows:
<div th:text="${#temporals.createNowForTimeZone('Asia/Dhaka')}"></div>
Or, using the syntax in your question, as follows:
[[${#temporals.createNowForTimeZone('Asia/Dhaka')}]]
Example output:
2022-05-19T18:57:32.190245400+06:00[Asia/Dhaka]
That was generated for the target timezone, when my local datetime was Thu May 19 08:57:32 EDT 2022.
Note about zone IDs:
You can read about valid zone IDs here. In your case, you need to be careful to match the exact case of the ID text - so it has to be Asia/Dhaka - not ASIA/DHAKA.
See also Where is the official list of zone names for java.time?
Note about formatting
There is a chance that you are going to want to format the date string, in which case take a look at the various #temporals.format() functions listed here.
But you may also want to consider formatting the string in Java, to keep your Thymeleaf template less cluttered.

FireDAC (FDQuery) - database with dot in it's name

I have got this problem with FireDAC -> FDQuery component when it tries to select data from a database with '.' (dot) in its name.
The database name is TEST_2.0 and the error on Opening the dataset says:
Could not find server 'TEST_2' in sys.servers [...]
I have tried {TEST_2.0} (curly brackets) and [TEST_2.0] (square brackets). Also setting QuotedIdentifiers (Format Opetions) property to True does not seem to fix the problem. In SQL query I can add 'SET QUOTED_IDENTIFIER ON;' but this breaks inserts to the dataset.
The FDConnection component can connect to that server and that database using MSSQL driver without problems. It seems it is the dataset that dosn't handle it. UniDAC seems to handle everything without any problems.
I am using RadStudio 10.2.
Has anyone found any solution to this? Thanks in advance for any replies
I got a response from Emarcadero and it works for me:
"The problem is not in FireDAC, but in SQL Server ODBC driver
SQLPrimaryKeys function. It fails to work with a catalog name
containing a dot. FireDAC uses this function to get primary key fields
for a result set, when fiMeta is included into FetchOptions.Items. So,
as a workaround / solution, please exclude fiMeta from
FetchOptions.Items."
What is wrong?
I was able to reproduce what you've described here. I've ended up on metainformation command, specifically the SQLPrimaryKeys ODBC function call. I have used SQL Server Native Client 11.0 driver connected to Microsoft SQL Server Express 12.0.2000.8, local database server instance.
When I tried to execute the following SQL command (with TEST_2.0 database created) through a TFDQuery component instance with default settings (linked connection object was left with empty database connection parameter) in Delphi Tokyo application:
SELECT * FROM [TEST_2.0].INFORMATION_SCHEMA.TABLES
I got this exception raised when the SQLPrimaryKeys function was called with the CatalogName parameter set to TEST_2.0 (from within the metainformation statement method Execute):
[FireDAC][Phys][ODBC][Microsoft][SQL Server Native Client 11.0][SQL
Server]Could not find server 'TEST_2' in sys.servers. Verify that the
correct server name was specified. If necessary, execute the stored
procedure sp_addlinkedserver to add the server to sys.servers.'.
My next attempt was naturally modifying that CatalogName parameter value to [TEST_2.0] whilst debugging, but even that failed with similar reason (just failed for the name [TEST_2), so for me it seems that the SQLPrimaryKeys ODBC function implementation with the driver I've used cannot properly handle dotted CatalogName parameter values (it seems to ignore everything after dot).
What can I do?
The only solution seems to be just fixing ODBC drivers. Workaround I would suggest is not using dots in database names (as discussed e.g. in this thread). Another might be preventing FireDAC from getting dataset object metadata (by excluding fiMeta option from the Items option set). That will bring you the responsability of supplying dataset object metadata by yourself (at this time only primary key definition).

Tfs project creation results in error: TF400930: Field 'System.ExternalLinkCount' is defined multiple times

I have recently upgraded an on-premises Team Foundation Server from Tfs 2015 to Tfs2015.Update3 (14.102.25423.0)
The upgrade was completed and all other functionality seems to work as usual.
A day or so ago I attempted to create a new Tfs project (TFVC) and that resulted in an error.
When I look at the application tier log files, I see the following:
[10:31:30.153] Executing step: Create the Team Project.
[10:31:30.167] Executing step: 'Create the Team Project.' WorkItemTracking.CreateTeamProject (4 of 13)
[10:31:30.183] Getting process template.
[10:31:31.463] Refreshing server caches.
[10:31:31.463] Importing work item link types.
[10:31:32.180] Importing work item types
[10:31:33.727] Importing work item types
[10:31:34.413] [Error] TF400930: Field 'System.ExternalLinkCount' is defined multiple times with different field definitions. Correct the field definition and try again.
[10:31:34.507] Microsoft.TeamFoundation.WorkItemTracking.Server.LegacyValidationException: TF400930: Field 'System.ExternalLinkCount' is defined multiple times with different field definitions. Correct the field definition and try again.
[10:31:34.507] at Microsoft.TeamFoundation.WorkItemTracking.Server.ProvisioningService.InternalImportWorkItemTypesOrGlobalWorkflows(IVssRequestContext requestContext, Int32 projectId, String methodologyName, IEnumerable`1 typeElements, ProvisioningActionType actionType, InternalSchemaType schemaType, Boolean overwrite, ProvisioningImportEventsCallback importEventCallback)
We are unfortunately making use of a customized template (which is based on the Scrum template) and it is exactly this template that causes the error.
When creating a new Tfs project (TFVC) based on the standard Scrum or Agile templates it works fine.
I downloaded the customized scrum template in question and did a grep search on “System.ExternalLinkCount”.
When I look at the fields they do seem to be of the same type.
Any ideas or suggestion why it is acting up in this way?
You can just remove the field definition from these work items, it's a standard field which will be added to all your work item types automatically.

Using TFS Client Object Model to get who has currently checked out a file

I am using the 2012 edition of the TFS Client Object Model to retrieve some file information within repositories. Given a string specifying the path to a file in a TFS project, I'd like to find out who has checked out a file if it is locked. I use VersionControlServer.GetItems(...).Items and a Where predicate to get only the files (not folders) I am interested in.
QueryPendingSets is your friend!
Sample:
PendingSet[] queryPendingSets = versionControlServer.QueryPendingSets(new [] {"$/A/B/C.txt"},RecursionType.None, null, null );
This lists all pending changes for the specified file.
You can get them all by looking at:
queryPendingSets[0].PendingChanges

Delphi 2005 Web Services problem

I'm having an issue trying to access a web service through Delphi. I've consumed a java WSDL with the 2007 version of the WSDLimp tool and it looks like it's created all of the objects correctly. When I make a tester program however that calls the service every object is empty. If I dump the SOAPResponse object in the HTTPRIOAfterExecute method I can see that I've gotten back a properly formatted XML Soap packet that contains all the data I would expect, but I can't access it through the objects. So is there something I'm missing?
The web service response contains aliased namespaces for each attribute. These aliases are not defined in the WSDL. For example, the WSDL contains a namespace of "http://www.example.com/SomeService" and the request aliases that on-the-fly as xmlns:ns3="http://www.example.com/SomeService" in the top level node. So attributes in the response look like ns3:somePropertyName="[value]".
In the OPToSOAPDomConv unit, in the TSOAPDomConv.InitObjectFromSOAP, it's attempting to look up an attribute name without the namespace prefix. This is causing the look up to fail and the object property to be left blank. This is happening even with the 2007 source files.
The best fix I can see is to modify the InitObjectFromSOAP routine.
Around line 4181, add:
RemTypeRegistry.InfoToURI(PropList[i].PropType^, NS, PropName, IsScalar);
and change the AttrNode.HasAttribute to pass the NS variable as a second parameter so it looks like:
if AttrNode.HasAttribute(ExternalPropName, NS) then
Also, a few lines down is a SetObjectPropFromText call. The last parameter is the attribute value, and you'll need to change Attr.Attributes[ExternalPropName] to
SetObjectPropFromText(Instance, PropList[I], AttrNode.GetAttributeNS(ExternalPropName, NS))
And of course declare the NS, PropName and IsScalar vars.
Delphi dropped the ball on web service support after Delphi 7 and didn't get their act together again until Delphi 2007 (though 2006 was an improvement).
If it works for you in Delphi 2007, you can probably get this working in Delphi 2005 by using the updated SOAP runtime.
http://cc.embarcadero.com/Item/24535
You could try the solution discussed at http://www.borlandtalk.com/1-vt102378.html?start=0
I re-read the question and the fact that it's a Java web service made me remember something.
Making sure you use the latest WSDLImp and SOAP units. Look in the imported unit for the call to RegisterInvokeOptions. The second parameter should be ioDocument. What happens if you change this to ioDefault.
I remember a post somewhere that suggested this for Java NetBeans (maybe?) web services, but haven't tried it.

Resources