package ${package_name};

import com.sap.mbs.core.api.BOList;
import com.sap.mbs.core.api.BOException;
import com.sap.mbs.core.api.Context;
import com.sap.mbs.core.api.Forward;
import com.sap.mbs.core.api.Forwards;
import com.sap.mbs.core.api.NamingService;
import com.sap.mbs.core.control.AbstractViewController;
import com.sap.ip.me.api.smartsync.FixedDecimal;
import java.util.Calendar;

public abstract class ${class_name} extends AbstractViewController {

    private static final NamingService	naming = NamingService.getInstance();
    private ${top_bo_name}Custom		custom;

    public ${class_name}() {
	super();
    }

    public Forward onHome(Forwards forwards) {
	return	forwards.findForward("default");
    }

    public Forward onBack(Forwards forwards) {
	return	forwards.findForward("default");
    }

    protected ${top_bo_name}Custom get${top_bo_name}Custom() {
	if (custom == null) {
	    ${top_bo_name}Component	component
	    = (${top_bo_name}Component)getComponent();
	    custom = component.get${top_bo_name}Custom();
	}

	return  custom;
    }

    static public String Calendar2String(Calendar calendar) {
	String date = null;

	try {
	    if(calendar == null) return "";

	    int y  = calendar.get(Calendar.YEAR);
	    int m = calendar.get(Calendar.MONTH) + 1;
	    int d = calendar.get(Calendar.DATE);

	    String month = "";
	    String year = "";
	    String day = "";

	    if(d<10) day = "0"+d;
	    else day = ""+d;
	    
	    if(m<10) month = "0"+m;
	    else month = ""+m;
	    
	    year = ""+y;

	    date = "" + year + "." + month + "." + day;

	} catch (Exception e) {
	}
	return date;
    }

    static public String CalendarTime2String(Calendar calendar) {
	String time = null;

	try {
	    if(calendar == null) return "";

	    int h  = calendar.get(Calendar.HOUR_OF_DAY);
	    int m = calendar.get(Calendar.MINUTE);
	    int s = calendar.get(Calendar.SECOND);

	    time = "" + h + ":" + m + ":" + s;

	} catch (Exception e) {
	}
	return time;
    }

    static public String Integer2String(Integer integer) { 
	String result = "";
	try {
	    result = "" + integer.intValue();

	} catch (Exception e) {
	}
	return result;
    }

    public static String FixedDecimal2String(FixedDecimal data) { 
	String result = "";
	try {
	    result = data.toString();
	} catch (Exception e) {
	}
	return result;
    }    

    static public String String2String(String str) { 
	try {
	    if(str == null) return "";

	} catch (Exception e) {
	}
	return str;
    }
}






