Set [Embed] attribute value dynamically - actionscript

I am new to Action script.
Is there any possibility to set the source attribute value dynamically at run time?
for e.g
in the code
Embed(source="assets/images/image.pdf",mimeType="application/octet-stream");
I need to set
source="set pdf file name using a variable or reading from config xml"
Please provide some example snippets or links for reference
Thanks in advance.
Thanks
SRR

Maybe Conditional Compilation will get you some way to achieving what you want.

Related

Is thre any way that i can read properties from one .properties file into another in java springboot?

I have a requirement o read values from one properties file and set it in another. I have two properties file: application-default.yml and application-prod.yml. I have send config vars in deployment enviroment and set the variable in application.prod. Howerver, i need to set values for application-default.yml but i do not want to commit those values into source control.
My propoose solution: I create another values.properties file that contains the values needed for application-default.yml however, i can't seem to find a way to set those values in application-default.yml.
Hope you get my point and i appreciate any suggestion to achieve this.

Duplicate Variable Definition Inside Choose Block

I think the code below should work in a Word BI Publisher template, but it's not. When I use the BI Publisher Template Viewer app to test, it is showing Duplicate variable 'branch' definition. If only the matching <?when: ...?> block should be executed, how is the variable defined more than once?
I have experience in other programming languages, but XML/XSL/BIP, etc. is new to me. Can anyone shed some light on the below code?
Thanks!
<?variable:payco; xdoxslt:trim(Remit_to_Name_ID445)?>
<?choose:?>
<?when: $payco=”Company1”?>
<?variable#begin:branch;'CO1'?>
<?end when?>
<?when: $payco=’Company2’?>
<?variable#begin:branch;'CO2'?>
<?end when?>
<?when: $payco=’Company3’?>
<?variable#begin:branch;'CO3'?>
<?end when?>
<?end choose?>
I can think of a few options to solve your logo problem.
Update the data definition SQL to do a decode/concatenation or something to get your logo filename or variable in the SQL as its own field that's extracted into the XML. That way you can use this when determining the image path:
url:{concat('/logos/',branch,'-logo.jpg')}
Use if statements or choose/when in your RTF to select an entire image section. This would mean you need to update the RTF every time you add a branch/brand, but it's doable.

Is there a way to order properties in a maven archetype? [duplicate]

Anybody knows is it possible to make substitution for default value of one requredProperty to another in archetype-metadata.xml ?
So, I try to do something like this:
<requiredProperty key="name"/>
<requiredProperty key="groupId">
<defaultValue>com.mycompamy.${name}</defaultValue>
</requiredProperty>
But when I start to generate project from artifact in interactive mode, maven asks me about groupId property first. But not for name as I expected.
Is it possible to change this behaviour?
Your problem is caused by required property loading order. Maven loads every custom required property in alphabetical order. You probably cant change it. But there are 2 ways which will solve your problem:
Renaming ur variables like this:
"0_name"
"1_groupId"
Now it will ask you about name firstly.
Use full maven command, passing only name parameter
mvn archetype:generate -DarchetypeGroupId=?? -DarchetypeArtifactId=?? -DgroupId=?? -DartifactId=?? -Dversion=?? -Dpackage=?? -Dname=??
Replace ?? with valid parameters
Hope it will helps you.
EDIT: now i see an asked time. Pretty offtopic but maybe it will help someone else

Access process i18n property files before compilation

I have a following situation: in some of my i18n property files there are properties containing a special word:
prop.example=specialword just for example
prop.test=just for test specialword
I want to have a possibility of having a property somewhere in my Config.groovy that would contain a specific value for this specialword so that if I specify:
specialword=Value of special word
in a Config.groovy then I want my i18n properties to be resolved like:
prop.example=Value of special word just for example
prop.test=just for test Value of special word
for that purpose, when building the project, I want to access property files in order to look for occurences of specialword and to replace them with value of specialwordvalue from Config.groovy.
Is that possible somehow? Perhaps, someone faced similar situation? I would really appreciate any help.
Thanks, Cheers
Instead of trying to change the way the properties are compiled, you would be better off passing the special value as an argument to your message code (as discussed in the comments to your question).
For instance:
<g:message code="my.key.code" args="[someVariableWithAValueFromConfig]" />
If your message code doesn't use the argument it will simply be ignored. This seems like the best approach to the problem you are trying to solve.

Changing the value of HtmlHelpers.ValidationSummaryCssClassName

Yes, it's a bit ass-about-face, but what's the best way to change the css class name output for validation errors, across a project?
The source is available here: http://aspnet.codeplex.com/SourceControl/changeset/view/21528#266468
You can't its a readonly value.
You just have to style the elements created with those css names.

Resources