Property configuration AEM Day lib - cookies

We are using the lib
"Day Commons Library - HTTP Client 3.1 Bundling
(com.day.commons.osgi.wrapper.commons-httpclient)"
in our AEM 6.0 system.
We'd like to change the property http.protocol.cookie-policy of this lib to another value. (It's the cookie policy https://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/cookie/CookiePolicy.html).
What is the best way to do that?
The property is not visible in the OSGi console, there are only other values of this lib configurable (like HTTP Proxy User etc.)
According to https://docs.adobe.com/docs/en/aem/6-0/deploy/configuring/configuring-osgi.html
one could create a configuration in
/apps/system/config
But how can we ensure that the library reloads exactly this configuration when we restart the bundle/service in OSGi console?
Does the entry in JCR require to be named like the class
org.apache.commons.httpclient.cookie.CookiePolicy
and the value in the jcr:content has to be of type String and has to contain the other cookie policy, e.g. BROWSER_COMPATIBILITY, correct?
How can we determine later if the value was loaded? The problem is: the lib is not our code, we can't simply add a log line.

The httpclient osgi bundle loads only select properties defined in metatype.xml (This is an example. not the actual config used in day common httpclient). so your config will not be used.
You should be able to use setCookiePolicy method of org.apache.commons.httpclient.params.HttpMethodParams.

Related

Loopback - Setting Up environment specific configuration

Hi can I get some help with setting environment specific configuration.
I have two files for datasource
server/datasources.json
server/datasources.test.json
I use the script "SET NODE_ENV=test && mocha test/**/*.test.js" on WIndows to run my test cases and set the node environment to test.
Loopback does not load server/datasource.test.json instead the datasource from server/datasource.json is loaded.
I have confirmend the environment using process.env.NODE_ENV which logs "test
I have tried to change server/datasource.json to server/datasource.local.json, But then I get an error
WARNING: Main config file "datasources.json" is missing.
I dont understand what I am doing wrong.Am I supposed to create all the config files for the test environment like *.test.json.
Or is there a different config file where I have to define envrionment specific files.
Please check this repo https://github.com/dhruv004/sample-loopback-example
From the code If you run npm run test It loads data from local.json which is the data source for development environment.It should load data from test.json(datasource for test environment)
Looking on your repository, I can see this note from LoopBack documentation particulary relevant for you:
A LoopBack application can load multiple configuration files, that can potentially conflict with each other. The value set by the file with the highest priority will always take effect. The priorities are:
Environment-specific configuration, based on the value of NODE_ENV; for example, server/config.staging.json.
Local configuration file; for example, server/config.local.json.
Default configuration file; for example, server/config.json.
In your model-config.json all models have datasource set to db so in your case LoopBack application loads first datasources.test.json. It cannot find datasource db there (only testdb), so it falls back to datasources.json. There it finds datasource db and it uses it. Try renaming testdb in datasources.test.json to db and it will take a precedense.

Obtain VCAP_APPLICATION's application_name value on Spring's application.yml

I'm trying to set a logging pattern using 'logging.pattern.console' that needs to include the CloudFoundry's application name of a given application. I know that application names can be found as part of the VCAP_APPLICATION env variable with the 'application_name' key, and I can resolve env variables on Spring Cloud applications using the standard Spring placeholder notation, available on the application.yml file; but as the variable is a Json, I can't parse it nor use SpEL to obtain the requested value only.
Is there any other way to obtain the application name as set on the manifest.yml file in the application.yml?
If you are using Spring Boot, you can access the application name with the property vcap.application.name. You should be able to reference this anywhere that properties are available, like #Value annotations or in application.properties.
Spring Boot's CloudFoundryVcapEnvironmentPostProcessor takes the VCAP_SERVICES & VCAP_APPLICATION environment variables and makes them available as properties through Spring's Environment api. This should happen automatically, no config or work necessary.

Automate Deployment IWS Webservices on IBMi

How does one go about automating the creation of Webservices on the IBMi?
Using the GUI at http://my.ibmi:2001/HTTPAdmin is a painfully slow process, and prone to fat finger errors. Thus my quest for automation.
During my research, I was unable to find the CL commands to export my RPGLE *SRVPGM procedures as Web Services.
Automation for IBMi V6R1 or V7R1.
Reference Sites:
http://www.ibm.com/systems/power/software/i/iws/‎
http://www-03.ibm.com/systems/resources/integrated_web_application_server_information.pdf
http://www-03.ibm.com/systems/resources/systems_i_software_iws_pdf_WebServicesClient_new.pdf
CL based method for adding HTTP Servers on IBMi system
http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_61
Answer found at
http://www.volubis.fr/news/liens/courshtm/AS400web/V6R1_LWI.htm
All scripts relating to Webservices are in
/QIBM/ProdData/OS/WebServices/V1/server/bin
Step:
STRQSH
cd /QIBM/ProdData/OS/WebServices/V1/server/bin
installWebService.sh -h
Command usage:
installWebService.sh
-server 'server-name' -programObject 'program-object'
[-service 'service-name'] [-pcml 'pcml-file'] [-userid 'userid']
[-libraryList 'library-list'] [-libraryListPosition '*FIRST|*LAST']
[-disableNillableWSDLElements] [-disableOptionalWSDLElements]
[-addUnderscoreToWSDLElementNames] [-libraryListPosition '*FIRST|*LAST']
[-printErrorDetails] [-help]
Where:
server is the name of the Web services server in which the service
will be installed.
programObject is the integrated file system path to the ILE program or
service program. For example, '/QSYS.LIB/MYLIB.LIB/MYPGM.[SRVPGM or PGM]'
service is the name of Web service to be installed. This parameter is
optional. If not specified, the program object name will be used.
pcml is a path to the PCML file. This parameter is optional. If not
specified, the program object must contain the PCML data.
userid is the user profile the Web service will be modified to run under.
This parameter is optional. If not specified, the Web service will run
under the Web services server user profile. Note: The Web service server's
user profile needs to have *USE authority to the user profile specified on
this parameter. A value of *SERVER will ensure the Web service runs under the
same user profile as the Web services server.
libraryList is a list of libraries, that will be added to the library
list prior to invoking the Web service. Each library in the list must
be delimited by a colon. This parameter is optional.
libraryListPosition is the position in the user portion of the job
library list where the list of libraries specified in -libraryList will be
placed. A value of *FIRST inserts the libraries at the beginning of
the user portion of the library list. A value of *LAST inserts the libraries
at the end of the user portion of the library list. This parameter is
optional. If not specified the default value of *LAST is used.
disableNillableWSDLElements will define elements in generated WSDL as
not nillable. If not specified, elements are defined as nillable.
This parameter is ignored for version 1.3 of Web services engine.
disableOptionalWSDLElements will define elements in generated WSDL as
not optional. If not specified, elements are defined as optional.
This parameter is ignored for version 1.3 of Web services engine.
addUnderscoreToWSDLElementNames will generate WSDL element names
that start with the underscore (_) character, as was always done in
version 1.3 of the Web services engine. If not specified, element names
in WSDL will not start with the underscore character.
This parameter is ignored for version 1.3 of Web services engine.
printErrorDetails will show additional error information, such as stack
traces and error codes, if the command fails. This parameter is optional.
help displays the command syntax. This parameter is optional.

WSO2 GR: add application artifact and lifecyle when defining new application in the GR

I have a WSO2 Goverance Registry setup conformant to this blog post http://blog.shelan.org/2013/02/application-governance-with-wso2-greg.html.
When defining a new application in the WSO2 GR using the menu: Metadata > Add > Application I would like to be able to directly add the actual application artifact (war/car file).
The selected file should then by placed in the SVN location conforming to the initial state of the lifecycle to which I will bind the application. This of course implies that I would also need to be able to directly add the lifecycle when defining a new application.
The new application form would then be something like this:
Name: ExampleApplication-1.0.0
Type: .war (is now redundant)
Description: My Example Application Artifact: Selected file
ExampleApplication-1.0.0.war Lifecyle: MyDTAP-Lifecycle_v1
Does anybody know a good starting point for adding this functionality in terms of code hooks or extension points?
If I have understood you correctly, what you need to do is basically provide an file upload option in your "Application" RXT (Governance Artifact Configuration) which will upload what ever your file type and based on that you want to fill the derivable information to the meta data of the artifact. And also to attach a selected/pre defined life cycle to it at artifact creation. What you are looking for is Registry Handlers [1]. You can achieve all aforementioned tasks probably through a single handler.
[1] - http://docs.wso2.org/wiki/display/Governance453/Handlers

SSIS Web Service Task: Dynamically setting WSDLFile

Is there any way to dynamically set the WSDLFile (the one on the Web Service Task Editor) for a SSIS service, so that the filepath is not hardcoded on the package? We want to be able to change this value the way you change values with .config files, is it possible?
Yes you can set the WSDLFile property via an Expression. Select the task, then properties, then Expressions and select WSDLFile from the drop down. You can then populate it from a variable which you can set in the config file. Alternatively, you can set the WSDLFile directly from a Package Configuration.