Wednesday, September 30, 2015

WebCenter Customer Component Logging


1. Include import java.util.logging.Logger; in customer component class.

2. Create object of Logger class
 private final Logger logger = Logger.getLogger(ComponentManager.class.getName());

3. Add the logs similar to WebCenter Content.
logger.info("<" + new Date().toString()+ "> <Notice> EBSCheckIn Sql Query @ [ "+ selectSQL+" ] - JNDI @ ["+bean.getAxfDataSource()+"]");

Above will work else you need to add following statements in class.

1. Import the handler class - import java.util.logging.Handler;

2. Create object of handler class.
 private Handler consoleHandler = new ConsoleHandler();

3.  Map the handler with logger class.

                         logger.addHandler(consoleHandler);
consoleHandler.setLevel(Level.ALL);
logger.setLevel(Level.ALL);


Try Some Other Patter:-
___________________
1. Import log class

     import intradoc.common.Log;

2.  Add the log info message

Log.info("<" + new Date().toString()+ "> <Notice> EBSCheckIn Sql Query @ [ "+ selectSQL+" ] - JNDI @ ["+bean.getAxfDataSource()+"]");


Try Some thing else :-
___________________

import intradoc.common.Report;

Report.info(section, message, t);

Report.info("filestore", msg, null);

Report.info(null, msg, null);

Report.info("scheduledevents", msg, null);

Report.info("taskmanager", null, ignore);

------------------------------------------

Report.trace("publish", "waiting for publishing thread", ignore);

Report.trace("applet", "MainFrameListener: null command", null);

Report.trace("system", null, excep);

Report.trace("system", "counters or depends is empty", null);

Report.trace("filestore", "adding " + action + " operation to commit log", null);

Report.trace("schemainit", "adding Application target", null);

Report.trace("userstorage", "addAuthData userInfo=" + userInfo + " timeStamp=" + tAuthData.m_timeStamp, null);

  Report.trace("archiver", "Writing export file: " + this.m_archiveDir + "/exports.hda", null);
 
  Report.trace("componentloader", "adding " + dir + " (from " + key + "=" + val + ") to search list", null)
 
   Report.trace("search", "using executable '" + searchExe + "' for searching", null);

Thursday, September 17, 2015

Weblogic Application Authorization

1. Entries in weblogic.xml

   <wls:security-role-assignment>
        <wls:role-name>AUTHENTICATED_USER</wls:role-name>
    <wls:principal-name>ApplicationUser</wls:principal-name>
    </wls:security-role-assignment>
 
     <wls:security-role-assignment>
        <wls:role-name>Deployers</wls:role-name>
    <wls:principal-name>Deployers</wls:principal-name>
    </wls:security-role-assignment>
 
     <wls:security-role-assignment>
        <wls:role-name>WORKFLOW_AUTHENTICATED_USER</wls:role-name>
    <wls:principal-name>WORKFLOW_AUTHENTICATED_USER</wls:principal-name>
    </wls:security-role-assignment>
 

2. Entries in Web.xml
   
                <security-role>
 <role-name>AUTHENTICATED_USER</role-name>
</security-role>
<security-role>
 <role-name>Deployers</role-name>
</security-role>
<security-role>
 <role-name>WORKFLOW_AUTHENTICATED_USER</role-name>
</security-role>


3. <%if(request.isUserInRole("ROLE_WORKFLOW_AUTHENTICATED_USER")){%> WORKFLOW_AUTHENTICATED_USER <%} %>

Friday, September 11, 2015

Apache2 and Create Virtual Hosts


Install Apache2 and Create Virtual Hosts:-

sudo apt-get update
sudo apt-get install apache2

1. Create website directory structure:-

sudo mkdir -p /var/www/python.bh/public_html
sudo mkdir -p /var/www/openstack.python.bh/public_html

2. Grant Permission:-
sudo chown -R $USER:$USER /var/www/python.bh/public_html
sudo chown -R $USER:$USER /var/www/openstack.python.bh/public_html
sudo chmod -R 755 /var/www

3. Create a html index page for each website
vi /var/www/python.bh/public_html/index.html
vi /var/www/python.bh/public_html/index.html

4. Create Virtual Host File and add site entries
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/python.bh.conf
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/openstack.python.bh.conf


sudo vi /etc/apache2/sites-available/python.bh.conf

<VirtualHost *:80>
        ServerAdmin admin@python.bh
        ServerName python.bh
        ServerAlias python.bh
        DocumentRoot /var/www/python.bh/public_html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Copy the same conf file for other server and update.

5. Register and Enable New Virtual Hosts

sudo a2ensite python.bh.conf
sudo a2ensite openstack.python.bh.conf


6. Restart apache2 server

sudo service apache2 restart

7. Add virtual host entries in hosts file.

127.0.0.1       localhost
127.0.1.1       openstack
192.168.48.128  openstack.python.bh openstack
192.168.48.128  python.bh  python


8. Access the website http://python.bh & http://openstack.python.bh
Note: For windows user add these entries in C:\Windows\System32\drivers\etc\hosts file.

192.168.48.128 python.bh
192.168.48.128 openstack.python.bh

https://code.google.com/p/openbizcard/source/browse/trunk/integrated/Scanner/src/com/yov/lib/?r=103

http://www.gnome.sk/Twain/jtp_try&buy.html


AWS EC2 - SSH locked with UFW

Need to update the instance's user data: 1. Stop the instance 2. Right click (windows) or ctrl + click (Mac) on the instance to open a c...