Is it possible to have more than one pretty-faces.xml file? - prettyfaces

I've inherited a project from another person in the company I'm working now, it uses jsf, and it uses pretty-faces to hide the urls.
Issue here, is that pretty-faces.xml file is kind of large(it's up to 492 lines), and I wonder if there is a way to divide it in several files and keep it working the same, just for the sake of organization and maintenance.
I've read the pretty-faces docs but I'found nothing on this direction.
Any answer is really appreciated. Thanks in advance.

Sure, you can add a context parameter to tell PrettyFaces about your configuration files:
<context-param>
<param-name>com.ocpsoft.pretty.CONFIG_FILES</param-name>
<param-value>/WEB-INF/custom-mappings.xml,/META-INF/another-config.xml</param-value>
</context-param>
See:
http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/GettingStarted.html#getstarted.prettyconfigxml

Related

Is there a way to write to a file in online CMS from a local C++ program?

I created a very customized leaflet map on a Bitrix website (they forced me to, not my choice). Now other coworkers who are basically "afraid" of code need to be able to add markers to that. I already created a C++ program where they can simply enter all the details they want (what category, whats the popupcontent etc.) and it spits out the geoJSON code for the marker for them to copy and paste into the website.
To make it even more easy for them I am wondering if there is a way to basically have my program connect to the internet, go to the backend of my website and, after asking for login, adds the code to the respective .js file that contains only the marker code.
I have been googling the problem but unfortunately couldnt find any other related posts.
Okay I finally found the I guess easiest way, I will force my colleagues to install python and write a little thingy to concatenate the code and upload it using Selenium. Thanks for your help guys!

Configuration Management and SlowCheetah

I need to apply xdt transformations to other files than *.config ones.
I found the SlowCeetah extension which seems to provide this kind of feature as authors and extension page says, but, even if I setup the trasformation for xml files, and note that the
preview tool works well.., according to solution configuration manager configuratoins, no
transformation is applied.
For example I setup the trasformation for log4net.xml file, by using the tooling command "Add Transformation" which added log4net.{configname}.xml files but nothing happen when I deploy the solution or simply build with the specific build configuration.
Anyone has seen this issue?
Googlin' around I found that trasnformations to xml files should be applied to files setup as Content and Copy Always, anyone has suggestion about that?
I 'm very sad becaues I made all my configurations with transformations, and if I cannot solve that issue I lost 2 days of boring config job and I just can do that manually
Thanks in advance
Cheers

configuring an application architecture

I have a C++ application which has written for years. There are a lot of classes.
Every time we want to change some parameter values, we need to manually update them in the code and recompile it. It is not convenient as the growing demands of the users. We would like the values of the classes to be configured out side of the application. Probably, reading form an xml is the best? for each user, we can make an xml configuration setting and send it together with the application. Is it a good approach?
For every class e.g: Class classA, should we create another class called: ConfigClassA then classA will use the configuration setting from ConfigClassA? We dont want to make a lot of changes in the current implementation.
Suppose there is a structure of an xml file:
<classes>
<class name="ClassA">
<variable id="isUp" value="true" />
</class>
</classes>
In Xml, we can get the portion classA and parse it to ConfigClassA then classA has an instance of ConfigClass.
Or anybody has a better approach?
Thanks in advance.
In general I think that the whole configuration should be loaded when an application is launched, so you can immediately notify the user in case of an invalid configuration. In order to validate an XML file, you can use XML Schema.
However, if you don't want to make a lot of changes in the current implementation, your idea could be a valid solution.
Using JSON or YAML will be more lightweight than XML, since the parser of the config file will be simpler. Anyway, XML is also feasible.
It's actually quite common to have configuration files. The format in which they are stored is not important. They are usually loaded only once, at the beginning of the program, not queried each time a method requests something.
Also, you should make a tool available for editing these files (such as a "Preferences..." panel).

WS_CPLUSPLUS with WWSAPI

I am implementing a relatively complex object model service using WWSAPI (WCF hosted) and have successfully downloaded the wsdl and code gen'd the service implementation. My question is, has anyone else noticed all of the
#if defined(WS_CPLUSPLUS)
defines littered throughout the generated code? Inside them is a C++ object representation of my service payload that would be 100x easier to use, however when I define WS_CPLUSPLUS all sorts of bad breaks loose on the compiler.
My question is this:
Has anyone successfully gotten that define to work, and if so, what resource or example did you use to get it to work?
Ok, answered my own question after digging through the sdk samples.
Once you generate the schema and wsdl files and import them into your project do the following:
Select all of the generated .c files, and right click -> properties
In the [Precompiled Headers] section: Change [Precompiled Header] to "Not Using Precompiled Headers"
In the [Advanced] section: Change [Compile As] to "Compile as C++ Code (/TP)"
Once you do this, you should successfully be able to add the "WS_CPLUSPLUS" preprocessor definition. I hope this can help brighten someones day

Extracting IIS Configuration in C++

I need to extract IIS Configuration into text files to finally compare those files (using WinDiff)
to make sure that I have the same configuration on every server we have ( there are too many of them - we offer on demand services ).
In that purpose, I'm looking for a way to extract / dump IIS Configuration through a C++ program. I've already tried to read "applicationHost" XML file, but we can't do so.
If somebody have already done that kind of things thanks for helping.
I've seen that there is an API given but the MSDN documentation is not that clear for me.
Thanks.