Defining file path on freemarker.properties - struts2

Is it possible to add a freemarker.properties file. Actually I need to include several ftl into a file by defining their directory path on freemarker.properties ? Also please tell me how to configure freemarker.properties in master ftl file since I am not using any action servlets?

For configuring freemarker engine in struts2 all you need is to add freemarker.properties to the classpath.
The supported properties are those that the FreeMarker Configuration object expects
See this link may be it will help you
Free Marker with Struts2

Related

In Unreal Engine editor, how to specify paths relative to the project folder root?

For a casual search in UE's docs I couldn't find environment variables that I could use in the settings within the Editor UI and would look like $PROJECT_ROOT. And my specified relative paths like path/to/my/subfolder seem to get resolved as relative to where the installed Unreal Engine is.
How should I specify the project root to be used by all relative paths filled in the project settings without hardcoding it?
There's no environmental variable. This is how to obtain the relative/full path of the project directory:
FString RelativePath = FPaths::GameContentDir();
FString FullPath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*RelativePath);
source.
I'll answer myself after some research.
For my purposes, i.e., filling forms in the Editor, the realistic solution is to run Editor script such as via the Python Editor Script plugin, where you could query the project data using unreal.GeneralProjectSettings.

Generation of Stub Class of WSDL using Maven

What We Have:
In our project we download the wsdl from nexus repository using maven.
Maven has been used for generating the stub class.
If we take a look into the stub class, it will have the WSDL path like "C:\Documents\target...."
Now the problem is if we deploy this package in development server where this path have no relevance.
Logically what we are thinking as part of the solution:
WSDL should be part of our project directory
and generated stub class should take the project context path instead of the path mentioned earlier.
Hope that is what we have to do logically, if our thinking logically wrong please correct us.
What Solution we Need:
Putting the WSDL file in project path, and change the POM file so that it will generate the stub using the WSDL which have in local.
Generated path should refer the WSDL from project directory instead of "C:\Documents\target...."
Looking for your help and support.
if you generated stub once. you need not to generate it again.
as far as wsdl location is concern put it in your project and specify the location inside the program

File Exist condition issue in Jenkins

I am working on product testing automation. I am using Jenkins to create a job that will first browse some file in a directory. But I got a problem with Conditional Step in File Exist condition. It is not working when I search *.job file, it only works with specific file name I put. Sorry I don't have enough reputation to post picture :)
Anyone can help me solve this issue. Thank so much for reading
I don't think File Exists supports more than one file, you could try the "File match condition". Definitions below:
File exists Run if the file exists.
The file is expanded using the Token Macro Plugin. If the file is
relative, then it is relative to the Base directory. If the file is
absolute, then it will be tested on the Node that contains the Base
directory (the master for $JENKINS_HOME and Artifacts dir).
Files match Run if one or more files match the selectors.
Separate multiple includes or excludes patterns with a comma. e.g.
Includes "target/site/**/*.html,target/site/images/" Excludes
"**/*.gif" If no includes pattern is configured, then the pattern
"**" will be used, which matches all files in the directory and all
sub directories. The includes and excludes are Ant Patterns.

Attachment using Editable Email Extension in Jenkins

I am using Editable Email plugin in Jenkins to attach a file with the email. The problem is that the plugin is unable to find the file to attach.
My file structure is like this -
ReportDirectory
workspace
ReportDirectory contains the report which I want to attach. I believe that the base directory for the plugin is the workspace. So I am giving the attachment location as
../ReportDirectory/DemoReport.html.
I have also tried
ReportDirectory/DemoReport.html
and many more options.
Am I doing something wrong?
I figured it out.
The Editable Email plugin uses the Ant File Syntax for locating the attachment. When I took at the documentation for Ant File Syntax ( http://ant.apache.org/manual/dirtasks.html ), it says that
In general, patterns are considered relative paths, relative to a task dependent base directory (the dir attribute in the case of ). Only files found below that base directory are considered. So while a pattern like ../foo.java is possible, it will not match anything when applied since the base directory's parent is never scanned for files.
Since the base directory in this case is the "workspace" and my directory "ReportDirectory" is not located in it so the Ant is not able to access it.
Two solutions exist:
Move the "Report Directory" somewhere in "workspace". I did not prefer this because I did not want to mess up the workspace.
Once the report has been created in "ReportDirectory", use your Ant\MSBuild script to copy it temporarily in the "workspace" and then the Email plugin shall be able to access it by something like **/Report.html or something.
#Amey - thanks for your efforts though :)
Another solution is create a symbolic link from $JENKINS_HOME/jobs/workspace/$workspace_name to the path with your $workspace_name. This way worked for me.
ReportDirectory/DemoReport.html
is the correct way to do it.
Please keep in mind that the path to the file and the file name is case sensitive so I assume your entering the correct name.
One more thing is to check is that the report is actually created and is located at the path mentioned by you.
Another thing you could try
ReportDirectory/*
Jenkins will use the directory available in its workspace.
You can send multiple attachments as below.
reportFolder/html/index.html, screenShotsFolder/screenShots/*.jpg
Simple answer:
Copy your file into the workspace(into your job directory), then under Attachment, just give the file name without any quotation or anything. This will automatically tell Jenkins to pick up your file. That's it!
Pls don't confuse yourself after seeing all the configurations.

MVC T4 Template: Change output file name

Simple question, could'nt find a straight answer. How can I modify the output file name of a T4 Template?
I'm using a T4 Template to bundle and minify all my javascript files. Now I want to include the current Assembly Hashcodein my filename. But how can I access this filename?
A workaround would be to rename the ouput file after generating it but this doesnt't seem nice to me.
You need to do something called auto-versioning, and this is usually done by URL rewriting. The physical files are not actually renamed.
See this question for details on javascript and css auto versioning:
How to force browser to reload cached CSS/JS files?
Note that if you use templates to generate a different physical file for every time you generate a file then you will lose a lot of benefits of source control (revisions etc), and you will end up with an unmanageably large set of files on disk.

Resources