Ivy load info description from file - ivy

I want to describe my project in ivy.xml,m thats why I added the description field. It looks likes this:
...
<info organisation="blabla" module="blubb" revision="1.7.3-rc3">
<ivyauthor name="aliceWonderland" />
<description> Bla ...
bla ...
bla ... x 10000 = word count
....
many lines ...
</description>
</info>
...
Does someone know if I can load text from file? My Usecase is, that after publishing via "

You could try using an XML entity to include a file:
https://www.freebsd.org/doc/en/books/fdp-primer/xml-primer-include.html

Related

How to set request body params in karate for soap request [duplicate]

I have the following xml:
<?xml version="1.0" encoding="utf-8"?>
<request>
<head>
<session-id>none</session-id>
</head>
<service name="test">
<function name="testFunc">
<guids>
<guid>#guid#</guid>
<guid>#guid#</guid>
</guids>
</function>
</service>
</request>
I have 2 test cases:
i want to test with single guid.
I want to test with 2 guids.
I created 2 separate xml for both the test cases and it worked.
The question here is how can i use a common xml?
Also i tried using remove but how do i remove single guid from the xml?
There is something called "embedded expressions" in Karate. Read the docs: https://github.com/intuit/karate#embedded-expressions
Example:
* def guids = <guids><guid>one</guid><guid>two</guid></guids>
* def body = <root>#(guids)</root>
Also refer this file, it has a lot of other examples and ideas for XML data-driven tests: xml.feature.

Replacing XML node key using dataprovider karate

I am reading my xml structure from a file and replacing the values from the examples
def inputXml = read('classpath:xml/input.xml')
My xml structure is like below
<input>
<data>
<props>
<p n="AMOUNT">1000</p>
<p n="NAME">name</p>
<p n="{ACCOUNTTYPE}">purpose</p>
</props>
</data>
</input>
I am driving data from examples and setting/replacing the input xml as below
* set inputXml/input/data/props/p[#n='AMOUNT'] = <AMOUNT> -- Works fine
* set inputXml/input/data/props/p[#n='NAME'] = <NAME> -- Works fine
Examples:
|AMOUNT|NAME|ACCOUNTTYPE|PURPOSE|
|100|abc|BUSINESS|smallbusiness|
|2000|def|PERSONAL|home|
I want to update the "n" tag name ACCOUNTTYPE and corresponsding PURPOSE similar to above(both key and value). Is there a way to achieve this in Karate? Please suggest.
Is is possible to use '#(accountType)' and '#(purpose)' inside the xml file similar to json and run?
Is is possible to use '#(accountType)' and '#(purpose)' inside the xml file
Yes. Please read the docs: https://github.com/intuit/karate#embedded-expressions
And the examples: xml.feature
Given def user = <user><name>john</name></user>
And def lang = 'en'
When def session = <session><locale>#(lang)</locale><sessionUser>#(user)</sessionUser></session>

how to customize xml headers

I have a resultSet formed by:
LazyList<DeliveryLabel> deliveryLabels = DeliveryLabel.findBySQL(sql);
String wxml = deliveryLabels.toXml(true, true);
The xml generated start with:
<delivery_labels>
<delivery_label>
<data>
</delivery_label>
</delivery_labels>
how to generate only:
<labels>
<label>
<data>
</label>
</labels>
I´m can´t rename the class to Label.java, because it already exists in the project.
[]´s
Currently ActiveJDBC uses Inflections to pick names for XML tags. If you need custom tags or structure, you will have to implement a custom toXml() method.

CA1703 CodeAnalysis Error and CasingExceptions

I have a text resource "{0} by Test GmbH" which is correctly spelled because GmbH is the official Abbreviation for "Gesellschaft mit beschränkter Haftung". I understand that Microsoft CodeAnalysing tries to tokenize it into "Gmb" and "H" however I think it should be possible to introduce this term as known with that specific spelling and casing with this CodeAnalysingDictionary:
<?xml version="1.0" encoding="utf-8" ?>
<Dictionary>
<Words>
<Unrecognized>
</Unrecognized>
<Recognized>
<Word>Gmbh</Word>
</Recognized>
<Deprecated>
</Deprecated>
<DiscreteExceptions>
<Term>GmbH</Term>
</DiscreteExceptions>
</Words>
<Acronyms>
<CasingExceptions>
<Acronym>GmbH</Acronym>
</CasingExceptions>
</Acronyms>
</Dictionary>
However it does not work out:
CA1703 Resource strings should be spelled correctly
In resource 'MyCode.Properties.Resources.resx',
referenced by name 'CopyrightWithCompanyName',
correct the spelling of 'Gmb' in string value '{0} by Test GmbH'.
How can I adjust the dictionary correctly?
Actually, provided that GmbH should be interpreted as a compound word that consists of the words Gmb and H, the casing of GmbH is correct.
So, in order for GmbH to be seen as valid by Code Analysis and thereby eliminate CA1703, simply add gmb as a recognized word to your custom dictionary file:
<Dictionary>
<Words>
<Recognized>
<Word>gmb</Word>
<!-- ... -->
</Recognized>
<!-- ... -->
</Words>
<!-- ... -->
</Dictionary>
I confirmed that this works in Visual Studio 2013.
According to http://msdn.microsoft.com/en-us/library/bb514188.aspx#bkmk_dictionaryacronymscasingexceptionsacronym
entries in the CasingExceptions are only applied to CA1709: Identifiers should be cased correctly, not to resources.
I have the exact same problem but no solution other then suppress the warning

Automated alternatives to creating hierarchical categories in mediaWiki manually?

I want to start a mediaWiki based site, but rather than manually adding categories and subcategories I want to add them in an automated fashion, where I provide something like an xml file and the bot/script/algorithm/... goes through the list and creates the categories and subcategories with their pages automatically.
There are no pages yet, but I want to start with a clean set of categories, helping users to sort the pages.
I found the pywikipediabot, but I can't figure out how to use it for my purposes - it seems to only work for categories of existing pages. Would you use pywikipediabot for creating hierarchies of new categories and if yes how? Can an xml file be used as a template?
I found a solution to my initial problem of creating categories in bulk, however I don't mark the question as closed, if you know a better solution - please post.
MediaWiki has an import functionality. With your admin account go to
http://yourMediaWiki/index.php/Special:Import
This allows you to choose to import an xml file, which has to follow a certain structure: see here
For a category with the name "Test Category" and the text "Category Testing", you have to create a 'page' element like this:
<page>
<title>Category:Test Category</title> <!-- Name of the category, don't forget to prefix with 'Categroy:' -->
<ns>14</ns> <!-- 14 is the namespace of categories -->
<id>n</id> <!-- identifier for category -->
<revision>
<id>16</id> <!-- number of revision -->
<timestamp>2013-02-10T22:07:46Z</timestamp> <!-- Creation date & time -->
<contributor>
<username>admin</username> <!-- Name of user who created the category -->
<id>1</id> <!-- ID of the user -->
</contributor>
<comment></comment> <!-- Comment about the category. Can be left blank -->
<sha1></sha1> <!-- sha1 hash can be left blank -->
<text xml:space="preserve" bytes="1">Category Testing</text> <!-- It seems it doesn't matter what you write into the bytes attribute. -->
</revision>
</page>
If you want to create hierarchies of categories just add the parent category tags into the text element. Say the category should be part of the 'Parent Category' category then the text element should look like this:
<text xml:space="preserve" bytes="1">Category Testing [[Category:Parent Category]]</text>
If you are able to get pywikibot up and running, then you can use the its Category class. Main entry point on Github search for class Category(Page).
Categories in Mediawiki are basically standard pages but in Namespace 14. To include any page in a Category - including a page which is a category - in the wikitext of the page you include [[Category:<The-Category>]]
So you can do something like this
>>> import pywikibot as pwb
#Your site will be different than this
>>> testwiki = pwb.Site('en','test')
>>> catA = pwb.Category(testwiki, 'testCatA')
>>> catA.namespace()
14
>>> catA._text = u'[[Category:testCatB]]'
>>> catA.save()
Page [[test:Category:TestCatA]] saved
Now you have a page Category:TestCatA which is a subcategory of Category:TestCatB.