what is the best way to implement multiple log location in portlet factory project? - portlet

I have to implement log4j for 7 modules(each module includes several models)in my IBM Web Experience Factory (formerly known as portlet factory) project. for each module I should implement the separate log location. How can I configure the log locations?

IBM Web Experience Factory (WEF) (formerly named WebSphere Portlet Factory and sometimes formerly referred to as wpf, but MS and most developers use that acronym to mean something else) shouldn't be tagged as wpf on SO, since that tag is specific to the MS wpf. If you could update your posting, I suggest removing that wpf tag (there is a WebSphere Portal tag that you could use, but not yet a tag specific to Web Experience Factory).
I'm not sure what you mean by "modules" (portlets? portlet WAR?), but each Portlet WAR will have it's own WEF log location (by default located under WEB-INF/logs in the deployed WAR) configured by WEB-INF/config/log4j.properties (in the project and then in the deployed WAR). I suggest searching for logging and log4j in the WEF documentation and WEF Wiki (URL in my signature below) and also on the Web Experience Factory forum (URL also below) for more info on customizing the logging.
IBM Web Experience Factory (WEF - formerly WebSphere Portlet Factory and sometimes also formerly called WPF) Forum: https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000000889
I hope that info helps,
..Mike Burati
http://www-10.lotus.com/ldd/pfwiki.nsf/
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

Related

ZK Project , Need Structural Advice for multiple ZK war applications

I need a advice for design purpose my structure of the application is as follows.
I have three module designed in ZK framework as a separate war application (web application) e.g finance-module , general-ledger and cash-account , all are separate war files can be deploy on tomcat as a separate war files,
Now I want to have a seperate war ZK application that has index or home page and have menu and from that menu I can able to call these three module or war application.
-------------------------- Main module -------------
Menu : general-ledger link , cash-account-link ,finance-module
1) This 4th Main module also has feature to user login and change user preference , means can also have code e.g view module as well as spring service.
Now the question is that how to call other war files zul pages and even if v call how to manage from 4th module and also how to share session across the four war files or applications.
Thanks
Vikas
I have worked in a similar scenario and this worked well for us:
When you create separate war's it means that they are independently running in it's own web context inside tomcat. Usually when you want to share resources like datasources, transactionManagers, or any other kind of jee resource you need to configure them at the tomcat instance level and they will be available in the JNDI directory of the tomcat server and any web application can pull any of them to use it.
https://tomcat.apache.org/tomcat-8.0-doc/config/context.html
https://tomcat.apache.org/tomcat-8.0-doc/jndi-resources-howto.html
There are several jee resources than you can share in the tomcat server but if you need more flexibility and robustness you might need a full stack java enterprise application server like wildfly http://wildfly.org/news/2014/11/20/WildFly82-Final-Released/ or any other commercial like WebSphere, Oracle Weblogic, etc
Now, if you want to share java classes, zul's or any other file, you may want to package them in separate common jars and use them in any war as a dependency and then reference them through the classpath of the web application.To organize and maintenance this modular projects Maven and Gradle are very good tools you can use.
From ZK you can call any other url of the other war's as simple as
<a href="htt://myserver/account/home.zul" label="Account"/>
<a href="htt://myserver/finnance/home.zul" label="Finance"/>
To share the session what you need is to implement a Single Sign On (there are other implementations like oracle opensso), you can configure it directly in tomcat but be aware of this Sharing security context between few web applications .
Spring Securityhas an extraordinary support for this kind of escenario.

CQ5 - Separate out a servlet's business logic into a standalone bundle

I am new to java, osgi, bundles, cq5 console etc..
Can someone please point me to a tutorial or a starting point from where I can learn how to do what I am trying to achieve.
Basically we have common search functionality in 3-4 CQ5 websites, all of which reside on a single cq instance. This same functionality is implemented in all websites as a servlet and is called from client side using javascript. Redundant code....
We would like to:
a) take this servlet's code out from all the websiteName-core bundles where it resides repeatedly as of now.
b) create a single separate standalone installable OSGI bundle which only contains a servlet.
Then we would like to call this single separated out bundle from all our CQ5 websites's client side.
Aprt from code redundancy, we wish to make this common search bundle shippable so that other development teams can use it in their projects by just installing it in their console and calling the servlet.
Long story short. I want to create an OSGI bundle that has a servlet.
I wish to have an understanding of the whole game here and would prefer to get a tutorial link that explains it from start to end.
You can start by turning the search code into a separate maven multi module project.The archetype and instructions for creating one can be found on adobe's documentation site (link)
The maven multimodule project will have two module's Bundle and content. Bundle will hold all the servlets, OSGI services and back-end stuff. The content module will have all the UI and authoring related stuff like templates and components. It maps to the repository on the CQ server. The UI nodes are serialized and stored on flat file systems as XML documents.
Since it is a maven project on it's own, it's dependencies will be self contained. In the bundle module add the search servlet and all the required classes. The compiled package of this project will be shippable.
As long as the package is installed in the server, any other website will be able to make calls to it.
Servlets in sling are implemented as OSGI services of javax.servlet.Servlet class. Any exported service of the Servlet class will be recognized by the sling servlet resolver, You can get more details of it at this link
Sharath Madappa's answer is correct if you want to create a set of related bundles and distribute them as a CQ content package.
If you just want to create a single bundle to package some OSGi services (including servlets) you just need to build the bundle jar with the required metadata. The Apache Sling GET servlets bundle is a good example of that.

(IBM Worklight) Shared Templates Vs (Import) Existing Project into Workspace

In worklight V6.1.0 and i see a new Project template as Shared Temlplates and i cant differentiate the use of the this provided by IBM and the normal import Existing Project into Workspace which is provided my the eclipse.
The final result is same and only the vendor and internal process are different
In eclipse we export it as the Generel->archive file and here we are just making it a template by (IBM Worklight->Worklight Project Template).
In eclipse we are importing it as General->Existing Project into Workspace and here we are just using Worklight Project->etc steps.
if there is any other difference please let me know?
IBM Worklight Project Template (Shared Template) enable you to accelerate the development of applications by not having to start from scratch. You can use Worklight project templates to provide value added services and you can add elements that are consistent with the look and feel of your brand.
And When we talk about exporting existing project into workspace then we don't have a choice of customization for e.g. certain elements like Company logo, company name etc. but in shared templates we have these capabilities, its totally customizable feature introduced in worklight 6.1
for more information please visit below link
http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.dev.doc%2Fstudio_ext_assets%2Fc_wl_project_templates.html
Application Component:
Application components are reusable libraries that you can add to the applications you develop. An application component can be a client-side library or a server runtime block. Typical libraries might handle basic functions such as login or payments. They can also contain various elements such as non-visual runtime objects, visual components, integration adapters, and user interface screen packages.
For more information please visit below two links
http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.dev.doc%2Fstudio_ext_assets%2Fc_application_components.html

Deploying .sar files used in jBoss to weblogic

We have ".sar"(Service Archive file) used in jboss. Currently we are planning to migrate the code to Weblogic.
Is there a way to deploy .sar files into weblogic.
If not directly possible, is there a work around where we can deploy the services on web logic.
In order to get the custom mbeans that are in the .sar you will need to repackage the contents as an .ear as a .sar is not standard Java EE deployment mechanism - that is a JBoss proprietary archive.
Here are some instructions on how to create, package and deploy your own service MBeans (JMX Beans) along with an example of how to use it.
https://blogs.oracle.com/WebLogicServer/entry/developing_custom_mbeans_to_ma
One thing you could do is to "substitute" or "emulate" the SAR Deployer, by creating, configuring and registering MBeans. That, AFAIK, could be done in two ways:
1) Using Standard Java EE components: that means on web tier you can use the init() method of a servlet (make sure that it is preloaded on startup) or, better, a ServletContextListener
2) Using WebLogic specific components. I'm talking about Startup classes. Simply register a startup class that creates, configures and registers your MBeans.
If you are using a web module, the first approach has the obvious advantage that you are using pure Java EE components. Although you are not using that, you can add a "dummy" web module only for doing that
Concerning what you have to do in those classes, you can choose a "from scratch" approach, by parsing the xml files that describe services and therefore manually create, configure and register MBeans or, if I remember well, the XMBeans from JBoss is something that can be reused outside JBoss but you need to check because I'm not sure

Eclipse plugin for spring

IDEA allow to find bean definition, declared in xml, right from Java code. For example if I've got interface SomeIntrfaceImpl IDEA allow me to find out instances of SomeIntrfaceImpl in .xml contextes files, pointing me to .xml file to line of code where bean is created
Is there any Eclipse plugin, that allow me to do the same ?
Yes there is different Eclipse provided by SpringFramework makers itself. They have extended the eclipse to provide easy development for Spring web application and other products like Spring ROO also.
Its is called SpringSourceToolSuit. You can download its latest version from here after providing some basic information about you asked in a form there.
Its the best IDE to develop Spring applications. I am currently using it.
Hope this helps you. Cheers.