How to use wildcard in Apache Ant's to define property value - properties

I have a property tags where I need to define property value using wildcard
to use it for "11.0.11; 11.0.13; 11.0.16; etc..".
<property name="java.version" value="11.0.*" />
How to use wildcard to define property value?
Thank you.

Related

Wix installer: access multiple property values

If I create a property with multiple arguments like
<Property Id="MyProp" Value="Arg1=value1;Arg2=value2" />
How can I access a specific value in a CustomAction, e.g.
<CustomAction Id="MyCA" Property="MyProp" Value="[MyProp.Arg1]" />
Typically you wouldn't set the value to "Arg1=value1;Arg2=value2", you'd set the property to "value1;value2" and then tokenize the substrings around the ';' character. The custom action should know what to do with the arguments without needing to list argument names.

Ignored default value in Lucee Orm

I set my persistent component with this property:
<cfproperty name="active" ormType="timestamp" notnull="true" dbDefault="now()" />
Now, if I save an entity by not specifying its created_at value, I get an error: not-null property references a null or transient value: User.active.
How can I skip specifying all the columns when creating entities?
Thanks!
Rather than setting defaults in the database schema, I would define them in your entity's properties using the default attribute to avoid null values.
However, bear in mind that only simple and non-dynamic values - such as fixed strings and numbers - can be defined as defaults. If you need to define a complex value, like an array, or a dynamic one, such as Now(), you'll need to set those in the entity's init() method.
component name="user" accessors=true persistent=true{
property name="active" ormtype="boolean" default=false;
property name="created_at" ormtype="timestamp";
function init(){
variables.created_at=Now();
return this;
}
}

Can you assign a WiX Property to CommonAppDataFolder?

I would like to set an overrideable property for a WiX property to the current location of CommonAppDataFolder. So far I have tried the following:
<Property Id="GHOSTSCRIPT" Value="[CommonAppDataFolder]"/>
as well as
<Property Id="GHOSTSCRIPT" Value="CommonAppDataFolder"/>
Neither one resolves correctly. Is there a way to do this?
The Property element writes a row to the Windows Installer Property table. The value column is type "text" not type "formatted" so the [PROPNAME] doesn't work.
The SetProperty element schedules a Property Custom Action (Type 51) in the needed sequence and it supports what you are trying to do.
SetProperty Element

NHibernate mapping customization

I'm using Nhibernate 3.3.1 and I need to ensure that none of my string columns would have lengths smaller than 15 i.e.
I'm trying to check it no AfterMapProperty/BeforeMapProperty events of ModelMapper, but as I know Length property is private of PropertyMapper class or some base class of it.
I'm tryign to avoid to use Reflection to access private property to get Length and check it.
Can you help me?
You can use the check attribute to achieve this.. In your mapping file you need to define something like this:
<property name="Foo" type="string">
<column name="foo" check="DATALENGTH(foo) > 15"/>
</property>
This will create a check constraint.. I am not too sure about the DATALENGTH method but you can confirm that..
Refer section 20.1.1 of NH docs here: http://nhibernate.info/doc/nh/en/index.html

Variable in an attribute in Struts custom tag

I am trying to use a variable inside a custom Struts tag something like follows -
for(String currentMacro : (List<String>)(request.getAttribute("individualMacros"))) {
name = currentMacro.<some-operation>
<html:mce name = "hmtl_<%= name %>" />
Something like this. But <%=name%> is not replaced with the variable value. It works when I am using the variable with a pure HTML tags.
Is there any any way to accomplish this in this case?
Thanks.
Use JSP EL (assuming JSP 2.0, and you put "name" into scope). You could also check to the if the TLD allows rtexprs.
<html:mce name="html_${name}"/>
But why use scriptlets? There's rarely (ever?) a good reason.
Since we are taking about a custom tag, my guess is that in the TLD file there isn't the rtexprvalue option set to true for that particular tag attribute:
<attribute>
<name>name</name>
<rtexprvalue>true</rtexprvalue>
.......
</attribute>
The rtexprvalue specifies that the attribute value may be dynamically evaluated at runtime.
If set to "false" it means that the attribute has a static value which is evaluated at translation; if set to "true" it means the value can be determined dynamically at runtime. Default is "false".
If the scriptlet does not work, it most likely means rtexprvalue is false. If you don't have the liberty to change that, then expressions won't work on that particular attribute.