I have used the custom date format 'EEE' to display the day of week in short form. i.e. Mo, Di, Mi (in German). In my development environment (eclipse) it works as desired. However on both the Test and Production platform I get the day-of-week index - 1, 2, 3, ...
Other Date and Numerical formats in the report are working fine and are appropriate for the German Locale.
Any ideas what might be causing this? (BIRT: org.eclipse.birt.runtime_3.7.2.v20120214-1408)
<cell id="2347">
<property name="borderRightColor">#C0C0C0</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<data id="2381">
<structure name="dateTimeFormat">
<property name="category">Custom</property>
<property name="pattern">EEE</property>
</structure>
<property name="textAlign">center</property>
<property name="resultSetColumn">Date</property>
</data>
<data id="2388">
<structure name="dateTimeFormat">
<property name="category">Custom</property>
<property name="pattern">d. MMM</property>
</structure>
<property name="textAlign">center</property>
<property name="resultSetColumn">Date</property>
</data>
</cell>
What I expect is
Mi
11. Sep
what I get is
4
11. Sep
Not really an answer but this is my work-around.
["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"][BirtDateTime.weekDay(row["Date"], 3)]
This is hardcoded for German. I needed an immediate solution....
Related
I am making custom effects with Direct2D, based on Microsoft Learn page. The problem is that, I wanted to make a Direct2D effect which support a variable input count, like Direct2D Composite Effect, while the XML registration string used for ID2D1Factory1::RegisterEffectFromString seemed to take fixed <Input> properties. What should be done in XML registration string?
My XML is almost the same as one from Microsoft Learn page. Still I will provide mine.
auto xml_AxisRotation = XML(
<?xml version='1.0'?>
<Effect>
<!--System Properties-->
<Property name='DisplayName' type='string' value='MultiInput Effect'/>
<Property name='Author' type='string' value='Nan_ok'/>
<Property name='Category' type='string' value='None'/>
<Property name='Description' type='string' value='asdfasdfasdf'/>
<Inputs>
<Input name='Source1'/>
<Input name='Source2'/>
//...?
</Inputs>
<!--Custom Properties go here-->
<Property name='Mode' type='int32'>
<Property name='DisplayName' type='string' value='Mode'/>
<Property name='Default' type='int32' value='1'/>
</Property>
</Effect>
);
I once deliberately omitted the whole <Input> part, but it failed to perform; E_INVALIDARG has been returned.
The XML registration and actual Direct2D effect's input taking worked differently. By proper implementing ID2D1EffectImpl::SetGraph and calling ID2D1Effect::SetInputCount, I was able to set variable numbers of target.
It seemed ok to leave <Inputs> with no <Input> property. here is my XML example.
auto xml_AxisRotation = XML(
<?xml version='1.0'?>
<Effect>
<!--System Properties-->
<Property name='DisplayName' type='string' value='MultiInput Effect'/>
<Property name='Author' type='string' value='Nan_o'/>
<Property name='Category' type='string' value='None'/>
<Property name='Description' type='string' value='asdfasdfasdf'/>
<Inputs> </Inputs> <!--Leaving like this is ok-->
<!--Custom Properties go here-->
<Property name='Mode' type='int32'>
<Property name='DisplayName' type='string' value='Mode'/>
<Property name='Default' type='int32' value='1'/>
</Property>
</Effect>
);
sorry for my poor english, my current config like this:
<bean class="org.springframework.session.web.http.DefaultCookieSerializer">
<property name="cookieName" value="test_sessionid"></property>
<property name="cookiePath" value="/"></property>
<!-- <property name="domainName" value="example.com"></property> -->
<property name="domainNamePattern" value="^.+?\\.(\\w+\\.[a-z]+)$"></property>
</bean>
i want to custom a domain,it is working well while i configured the domainName property.but when i configure the domainNamePattern as above,it just working on localhost and ip address,but no
www.example.com
test.example.com
tks.
It looks like you are not using a valid Regular Expression (the expression is escaped for Java String but you are using XML). The expression will not match any of the domains so it will always use the current domain. Try the following instead:
<bean class="org.springframework.session.web.http.DefaultCookieSerializer">
<property name="cookieName" value="test_sessionid"></property>
<property name="cookiePath" value="/"></property>
<!-- <property name="domainName" value="example.com"></property> -->
<property name="domainNamePattern" value="^.+?\.(\w+\.[a-z]+)$"></property>
</bean>
Can the token itself be parsed from other values from within the property file?
Is it possible to evaluate the token key, without hardcoding the token? Can the token itself be parsed from other values from within the property file?
For example, if the properties file has the following tokens (test.properties):
module_no = 01
module_code = bb
title_01_aa = ABC
title_02_aa = DEF
title_03_aa = GHI
title_01_bb = JKL
title_02_bb = MNO
title_03_bb = PQR
Contents of build.xml
<?xml version="1.0" encoding="utf-8"?>
<project default="repl">
<property file="test.properties" />
<target name="repl">
<replace file="test.txt" token="module_title" value="title_${module_no}_${module_code}" />
</target>
</project>
Sample content with text:
Welcome to module_title.
The replace task will result in:
Welcome to title_01_bb.
How to achieve this instead?
Welcome to JKL.
This might be very basic, but please do guide me in the right direction. Thank you.
Nested property expansion does not work by default in Ant as described in the documentation:
Nesting of Braces
In its default configuration Ant will not try to balance braces in property expansions, it will only consume the text up to the first closing brace when creating a property name. I.e. when expanding something like ${a${b}} it will be translated into two parts:
the expansion of property a${b - likely nothing useful.
the literal text } resulting from the second closing brace
This means you can't use easily expand properties whose names are given by properties, but there are some workarounds for older versions of Ant. With Ant 1.8.0 and the the props Antlib you can configure Ant to use the NestedPropertyExpander defined there if you need such a feature.
If you check the workarounds link, one solution is to use a macrodef to copy the property:
<property file="test.properties" />
<target name="repl">
<gettitleprop name="titleprop" moduleno="${module_no}" modulecode="${module_code}" />
<replace file="test.txt" token="module_title" value="${titleprop}" />
</target>
<macrodef name="gettitleprop">
<attribute name="name"/>
<attribute name="moduleno"/>
<attribute name="modulecode"/>
<sequential>
<property name="#{name}" value="${title_#{moduleno}_#{modulecode}}"/>
</sequential>
</macrodef>
I want my version numbers of the installer files to be like installer-02.
I have the following entry in <entry key="build.number" type="int" value="2" />
How to achieve this.
You can specify pattern for int type when you add entry to property file http://ant.apache.org/manual/Tasks/propertyfile.html.
<propertyfile
file="my.properties"
comment="My properties">
<entry key="build.number" type="int" value="2" pattern="00"/>
</propertyfile>
<property file="my.properties"/>
<echo message="build.number : ${build.number}"/>
Please note with above eg, it will prefix build # with 0 for values from 0-9.
In my build.xml file I am incrementing a build version number in a property file like so:
<target name="minor">
<propertyfile file="build_info.properties">
<entry key="build.minor.number" type="int" operation="+" value="1" pattern="00" />
<entry key="build.revision.number" type="int" value="0" pattern="00" />
</propertyfile>
</target>
I also have similar entries for the major and revision. (from Build numbers: major.minor.revision)
This works great. Now I would like to take this incremented build number and inject it into my source code:
//Main.as
public static const VERSION:String = "#(#)00.00.00)#";
By using:
<target name="documentVersion">
<replaceregexp file="${referer}" match="#\(#\).*#" replace="#(#)${build.major.number}.${build.minor.number}.${build.revision.number})#" />
</target>
Now this sorta works. It does indeed replace the version but with the outdated version number. So whenever I run the ANT script the build_info.properties is updated to the correct version but my source code file is using the pre updated value.
I have echoed to check that indeed I am incrementing the build number before I call the replace and I have noticed that echoing:
<echo>${build.minor.number}</echo>
//After updating it still shows old non updated value here but the new value in the property file.
So is there a way to retrieve the updated value in the property file so I can use it to inject into my source code?
Cheers
So after spending hours not being able to solve this, I post this question and then figure it out 20 minutes later.
The problem was I had this at the top of my build file:
<property file="build_info.properties"/>
I guess it was due to scoping and that properties are immutable thus I was never able to update the value. Removing that line and then adding the following got it working perfectly:
<target name="injectVersion">
<property file="build_info.properties"/>
<replaceregexp file="${referer}" match="#\(#\).*#" replace="#(#)${build.major.number}.${build.minor.number}.${build.revision.number})#" />
</target>
Why not just use <buildnumber/>?
Project used to increment build number in build.properties file
file parameters:
version.number=
build.number=
if changes version.number then build.number starts from 1
====================================================================== -->
<property name="versionFileName" value="build.properties" />
<property file="${versionFileName}" />
<property name="currentVersion" value="0.1.37"/>
<target name="calculate.version.build">
<script language="javascript">
<![CDATA[
var currentVersion = project.getProperty("currentVersion");
var oldVersion = project.getProperty("version.number");
var buildNumber = project.getProperty("build.number");
if (!currentVersion.equals(oldVersion)){
project.setProperty("currentBuild", 1);
} else {
var newBuildNumber = ++buildNumber;
project.setProperty("currentBuild", newBuildNumber);
}
]]>
</script>
</target>
<target name="update.version.build" depends="calculate.version.build">
<propertyfile file="${versionFileName}">
<entry key="build.number" type="int" operation="=" value="${currentBuild}" />
<entry key="version.number" type="string" operation="=" value="${currentVersion}" />
</propertyfile>
<echo message="New version: ${currentVersion}.${currentBuild}" />
</target>