I've created a global.properties file containing several key-value pairs. It works very well all around my struts2 project. I use tiles plugin with struts.
I just want to use a properties file key in tiles.xml. I've tried something like <put-attribute name="title" value="${global.reg}'"/> but it didn't work. But still the title shows ${global.reg}.
How can I use property file values in my Tiles configuration?
Related
How can I get a path to file being installed from a WiX custom action?
I'm creating a WIX Extension, which has a custom element which can be nested under <File> component like this:
<Component Id="FooComponent">
<File Id="filekey" Name="foo.txt">
<myextension:Stuff />
</File>
</Component>
The extension has its custom table which has a foreign key columns pointing to "Component" and "File" tables, and it is executed when a file's component is being installed/uninstalled (like the built-in IIS extension or SQL extension for example)
What I want to achieve is, in my deferred (sheduled) custom action, figure out the target path of the file the extension isbound to. I.e. basically in the differed custom action, I want to get value of [!filekey] (in terms of MSI formatted string). How can I go about that?
I have found a somewhat similar topic here
One of the solutions suggested was to use MsiFormatRecord from a custom action and pass that [#filekey] to that function. It resolves properly then.
I've found examples of using this approach in WiX sources, in gaming extension and NetFX extensions; they use code like this:
StrAllocFormatted(&pwzFormattedFile, L"[#%s]", pwzFileId);
WcaGetFormattedString(pwzFormattedFile, &pwzGamePath);
Here WcaGetFormattedString is basically a wrapper for MsiFormatRecord
Still unanswered, is this a right approach to the issue?
Basically you pass that [!filekey] to the deferred custom action in that format, using the CustomActionData indirect way of doing that. Then in your custom action you get the property value [CustomActionData] . This might help:
How to pass CustomActionData to a CustomAction using WiX?
To spell it out, if your type 51 custom action that is used to prepare CustomActionData has a Target of [!filekey] then when you retrieve the value of the CustomActionData property inside your custom action then it will contain the full path to the file, the entire path and filename. This demonstrably works, although it wouldn't be practical if you were doing this for many files.
I would like to have the same text displayed as the tooltip for a Button and as the text of a TextBlock. Here's my simplified xaml:
<Button x:Uid="SweetButton">
<TextBlock x:Uid="SweetTextBlock"/>
</Button>
Right now I have two entries in my .resw file:
<data name="SweetButton.ToolTipService.ToolTip" xml:space="preserve">
<value>The same text</value>
</data>
<data name="SweetTextBlock.Text" xml:space="preserve">
<value>The same text</value>
</data>
Is there any way for me to only have one entry in my .resw file?
I've tried giving the data element two name attributes, but that's not allowed. I thought of somehow referencing the value of one data element as the value of the second data element, but I'm not sure how.
Sadly you can't re-use that resource entry while still using the x:Uid syntax as you're trying to fill in 2 complete different properties (ToolTip and Text). The universal resource system with x:Uid is very powerful and can have about any attached property in your resource file, but the downside is repeatability of resource values.
UWP XAML has somewhat different rules for x:Uid uniqueness than previous XAML-utilizing technologies used. For UWP XAML it is legal for the same x:Uid ID value to exist as a directive on multiple XAML elements. However, each such element must then share the same resolution logic when resolving the resources in a resource file. Also, all XAML files in a project share a single resource scope for purposes of x:Uid resolution, there is no concept of x:Uid scopes being aligned to individual XAML files.
Source: https://msdn.microsoft.com/en-us/library/windows/apps/mt204791.aspx
If you have a lot of duplicate resource values, you could consider using one of the 'old' ways to handle resources and bind the resources yourself.
We're updating some old WiX scripts to take advantage of the Feature attribute of components, so that we don't have to update the file in two places whenever we add or remove a component (once to add the Component and again to add a ComponentRef to the ComponentGroup).
We separate out WiX project into separate files, one per fragment to make things more manageable. But my fragment defining the components for a feature is no longer getting included. It sounds identical to Tomas's issue in his response to the Feature attribute announcement. But while he is using Heat to auto-generate his Wix file, we're manually crafting them from scratch.
I tried creating a dummy property in the fragment's .wxs file and then referencing it in the main .wxs within the Product element. The fragment was still not included and I got an invalid property ID.
We initially tried using the strategy described here to reference directories in the component, but while this eliminates the need for a separate ComponentGroup full of ComponentRefs, it also separates my component definition from the directory tree definition, which kind of defeats the purpose of only needing to look in one place to do an update.
Will I need to pull all of my fragments into the main Product.wxs file simply to take advantage of the Feature attribute, and avoid having to update the file in two places per component? Or is there an easy way to get the fragment to include? Again using a dummy property reference didn't seem to work.
Edit: I think I found the issue in my build--I had defined a Directory under the Product Tag and then a DirectoryRef in the Fragment, rather than the other way around.
Take a look at how we authored the WiX setup itself: Author Components under ComponentGroups and use ComponentGroupRef to pull those into Features. That eliminates most duplication. You can author Directory and DirectoryRef elements in fragments in the same file as your Components/ComponentGroups.
Hi I have tried every ways and means to load dojo page into ContentPane.
It seems That I am not able to do that. Correct me if I am wrong.
Looks like the only solution is through the creation and destroy of any widget while running
Clement
The dojo docs for dojox/layout/ContentPane (which allows references to script files) mentions your issue:
NOTE that dojo.require in script in the fetched file isn't recommended Many widgets need to be required at page load to work properly
#see http://dojotoolkit.org/api/1.8/dojox/layout/ContentPane
It looks like you just need to require these files in the parent widget.
The Objective:
Set a different path by default on my Telerik Upload component.
The Problem:
The path should be like "\\Server\Folder" and the porperty ScriptFilePath requires a path starting with ~/. I was looking telerik tutorials but ther's no help about that.
The Code: View
C# MVC3
#(Html.Telerik().Upload()
.Name("attach")
.Multiple(false)
**.ScriptFilesPath("~/")**
.Async(async => async
.Save(Actions.FileLoader_GetFile, Controllers.FileLoader)
.Remove(Actions.FileLoader_Remove, Controllers.FileLoader)
.AutoUpload(true)
))
According with Teklerik, it is not posible.
Is not possible to set a "default' directory for the <input type='file' /> html element, this is restriction by the browsers and there is no way to workaround it.
I suppose that this restriction makes sense since there is no guarantee that the folder set as default for the upload will exist on the given client.