Tuesday 16 December 2014

increase VirtualBox Size

Hello fellas,
today I'm sharing my learning to how to increase the size of the vdi.

  • delete all the clones first.
  •  goto the vdi location from terminal of command prompt.
  •  VBoxManage modifyhd vdiname.vdi --resize NEW_SIZE_IN_MB



Monday 15 December 2014

Find Running Port Number and Processes

Hello fellas,
Today I'm sharing my learning to how to check the running port on the system,

just use the following command on the command prompt.

netstat -ano

thank you :)

Tuesday 9 December 2014

ViewLink in ADF

Hello Fellas,

Today I'm sharing my learning to how to create the viewLinks in ADF,

1. Create two ViewObjects with some cardinality, i.e. 1-1,1-M,M-M.
2. I've created a one-to-many cardinal



3. Use the Cardinality Like this.


from source to target



thank you :)


Populate Data to Select One Choice from Bean

Hello Fellas,
Today I'm Sharing my learning to how to populate data to select one choice Programitically

Steps Involded

1. In the managed bean create a property and make its accessor and mutators.
private ArrayList<SelectItem> al=new ArrayList<SelectItem>();
    public void setAl(ArrayList<SelectItem> al) {
        this.al = al;
    }
    public ArrayList<SelectItem> getAl() {
        return al;
    } 
             use javax.faces.model.SelectItem;

2.  put this code in the getter method.
    public ArrayList<SelectItem> getAl() {
        al.add(new SelectItem("x1","India"));
        al.add(new SelectItem("x2","China"));
        al.add(new SelectItem("x3","Sri Lanka"));
        al.add(new SelectItem("x4","Japan"));
        return al;
    }

3 select the component i.e. select one choice  on the page, use it's selectItems component,
   use its value field,  and put this code there.
 <f:selectItems  id="si2" value="#{XBean.al}"/>

Bean


jspx



thank you :)


Monday 1 December 2014

Email Validation in ADF

Hello Fellas,
Today I'm sharing my learning to how to make a custom validation in Oracle JDeveloper,
Create a java class,

Lets take an example to create a e-mail validation,



import java.io.Serializable;

import java.util.regex.Matcher;
import java.util.regex.Pattern;import javax.faces.application.FacesMessage;import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;

public class EmailValidator implements Serializable, Validator {

    public EmailValidator() {
        super();
    }
    public void validate(FacesContext facesContext, UIComponent uiComponent,
                         Object object) {
        String value = (String)object;
        if ((value == null) || value.length() == 0) {
            System.out.println("null value found");
            return;
            //System.out.println("null value found");
        }
        //String expression="^[\\\\w\\\\-]([\\\\.\\\\w])+[\\\\w]+@([\\\\w\\\\-]+\\\\.)+[A-Z]{2,4}$";
        String expression =
            "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
        CharSequence inputstr = value;
        Pattern pattern =
            Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
        Matcher matcher = pattern.matcher(inputstr);
        if (!matcher.matches()) {
            throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                                          "Enter the proper Email Id",
                                                          null));
        }
    }
}





Go to faces-config.xml and open validators tab give a meaningful Id like EmailValidator
& class name
in this case it should be EmailValidator(along with the package)

in the input file just write
<af:inputText label="Enter EmailID" id="it1">
<f:validator validatorid="EmailValidator"/>
</af:inputText>


thank you :)

A Guide to Installing Oracle HR Schema on an Existing Docker Container

  Hi Reader, Today I want to share my learning on how to install Oracle HR schema on a existing docker container. Step 1: Download the verif...