AtlasMap can't get target document from .adm file imported into java - atlasmap

I imported the target xml file into the AtlasMap Data Mapper UI as below:
<?xml version="1.0" encoding="UTF-8"?>
<ns:XmlOE xmlns:ns="http://atlasmap.io/xml/test/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns:Address>
<ns:addressLine1>1040 Notexisting St</ns:addressLine1>
<ns:zipCode>01886</ns:zipCode>
</ns:Address>
<ns:Contact>
<ns:fullName>Totton</ns:fullName>
<ns:phoneNumber>123-456-7890</ns:phoneNumber>
<ns:zipCode>01886</ns:zipCode>
</ns:Contact>
</ns:XmlOE>
Then I exported it to *.adm file and after that importing it to the eclipse.
There is the log:
log_and_code
I run main class and get errors.
If I use *.adm file from example project and re-export it from AtlasMap Data Mapper UI, it work well.

The answer from #igarashitm
You'd need to copy Document ID of the imported target document from
UI and use it as a key to retrieve a target document. Or simply use
getDefaultTargetDocumentIO. When you import a document, an auto
generated Document ID is assigned which has GUID suffix. So the
target document is no longer XMLInstanceSource.
In my case getDefaultTargetDocument() works well.
I believe it is the Document ID he is referring to.

Related

Can I set "usedWithCloudKit" to false in core data contents

I'm trying to disable/ remove cloud kit in my project so that I can have ordered relationships in core data. From what I can tell, the only reference to cloudKit anywhere in my project is inside CoreDataDB.xcdatamodeld/My_Project.xcdatamodel/contents and these are the first two lines of the file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="19574" systemVersion="20G314" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithCloudKit="YES" userDefinedModelVersionIdentifier="">
...
line 2 has this snippet: usedWithCloudKit="YES"
Can I safely switch it to NO or is there another way I should go about removing cloud kit.
Extra notes:
Cloud Kit is not enabled in Signing and Capabilities
I'm not using NSPersistentCloudKitContainer
The original error I'm trying to solve is CloudKit Integration MyEntity.myCustomRelationship must not be ordered [8]
Check to see under "Configurations" if "Default" or any custom configurations you have in your Data Model file has "Used with CloudKit" checked. Should appear in the right panel when you select a configuration.

Even after adding new mime type for Tika file is still detected as application/x-bplist

I was trying to use Apache Tika to detect a .memgraph file exported out of Xcode. But the problem is that it was getting detected as application/x-bplist using the Tika() detector. So I created a new file org/apache/tika/mime/custom-mimetypes.xmland added the following to it:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info>
<mime-type type="application/memgraph">
<glob pattern="*.memgraph"/>
</mime-type>
</mime-info>
But even after adding this the file was still getting detected as application/x-bplist. Will I have to write my own custom detector? And how will I go about writing one?

importing a wsdl file in delphi XE3

I have to address a webservice with SOAP.
the WSDL file is http://www.healthconnect.be/sites/default/files/support/ConsultMyCareNet.wsdl
However when I import this WSDL file in my project (Delphi XE3) with file- new - other - WSDL importer there are some faults,
In top of the new *.pas file I find:
The following types, referred to in the WSDL document are not being represented
in this file. They are either aliases[#] of other types represented or were referred
to but never[!] declared in the document. The types from the latter category
typically map to predefined/known XML or Embarcadero types; however, they could also
indicate incorrect WSDL documents that failed to declare or import a schema type.*
// !:GetMCNStatusRequest - "urn:be:healthconnect:rrnconnector:ws:1_0:messages"
// !:GetMCNStatusResponse - "urn:be:healthconnect:rrnconnector:ws:1_0:messages"**
and thus the following important and necessary function for addressing the webservice cannot be compiled
with the message:
Cannot unwrap:
- Input part does not refer to an element
- Output part does not refer to an element*
function getMCNStatus(const parameters: GetMCNStatusRequest): GetMCNStatusResponse; stdcall;
But I need this function 'getMCNStatus' as It is a the first function to call since this function tests if the connection with the webservice is Ok. Without this function the rest does not work.
So how can I make this function work anyway?
Must I define the classes GetMCNStatusRequest and GetMCNStatusResponse myself and what Do I have to define in the classes ? Can I find the answer in the wsdl file ?
open your wsdl file.
Remove following lines within types tag.
<xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:person" schemaLocation="person-1-0.xsd" />
<xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:common" schemaLocation="common-1-0.xsd" />
<xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:messages" schemaLocation="messages-1-0.xsd" />
Now , you won't get any error while importing wsdl.
Update: Reason
Why is it happening?
Instead of defining element types in your wsdl file, you are importing these namespaces which has defined xsd files like person-1-0.xsd or common-1-0.xsd Which is not accessible. These namesapaces should be like
"http://healthconnect/example"

Is it possible to have a dynamic resource path for import?

I have a Spring.NET program with a configuration file. To smooth the transition from test to prod I'd like to have an environment variable that gives the path to a shared config file, and use that to import a resource, however it appears the <import resource="path"/> is not being resolved. For example if I try to load the file <import resource="\\server\share\${computername}\SpringConfig.xml"/> I get a file not found exception as below:
System.Configuration.ConfigurationErrorsException: Error creating context 'spring.root': file [\server\share\${computername}\SpringConfig.xml] cannot be resolved to local file path - resource does not use 'file:' protocol. ---> Spring.Objects.Factory.ObjectDefinitionStoreException: IOException parsing XML document from file [\server\share\${computername}\SpringConfig.xml] ---> System.IO.FileNotFoundException: file [\server\share\${computername}\SpringConfig.xml] cannot be resolved to local file path - resource does not use 'file:' protocol.
Is there a way I can have a dynamic import path in Spring.NET, preferably without writing code?
You can do that anyway with some extra code:
Create your own FileSystemResource that will replace placeholders in the resource name. Start from overriding the existing FileSystemResource (In Spring.Core.IO namespace)
Register your new IResource implementation in the container using your own protocol name (ex: myfile://) See ref docs here for an example :
In .NET configuration file (app.config/web.config)
http://www.springframework.net/doc-latest/reference/html/resources.html#d4e2911
In Spring configuration files
http://www.springframework.net/doc-latest/reference/html/objects.html#context-custom-resourcehandler
Use it!
resource="myfile://\server\share\${computername}\SpringConfig.xml"
I don't think we can do that with the current version.
Latest Java version supports it, so we can expect this feature in a future version (Using variables environnement by default)

how to embed an xml file to a resource file

i want to embed a xml file to a resource file in my project,whenever i need the file i must get it from resource and use it,how to do this and i want to modify the contents of the xml file depending upon my requirements.how to do this
If you add the XML file to a Visual Studio project and, in the Property window for it, select Build Action: Embedded resource, the file will be embedded into the build output artifact for that project.
To access it from code, use something like:
string resourceName = "Namespace.Prefix.FileName.xml";
Assembly someAssembly = LoadYourAssemblyContainingTheResource();
XmlDocument xml = new XmlDocument();
using (Stream resourceStream = someAssembly.GetManifestResourceStream(resourceName))
{
xml.Load(resourceStream);
}
// The embedded XML resource is now available in: xml
If the resource you're loading is embedded in your own assembly, you can do something like Assembly.GetExecutingAssembly() to achieve what I listed as LoadYourAssemblyContainingTheResource() above, or possibly typeof(SomeTypeInYourResourceAssembly).Assembly
It's unclear what you mean by "want to modify the contents" - you cannot modify the resource inside the assembly at run-time, but whenever you change the XML file and recompile, the new version will be embedded.

Resources