Recent research in AI Planning is focused on improving the quality of the generated plans. PDDL3 incorporates hard and soft constraints on goals and the plan trajectory. Plan trajectory constraints are conditions that need to be satisfied at various stages of the plan. Soft goals are goals, which need not necessarily be achieved but are desirable. An extension of Constraint Satisfaction Problem, called Optimal Constraint Satisfaction Problem (OCSP) has allowance for defining soft constraints and objective functions. Each soft constraint is associated with a penalty, which will be levied if the constraint is violated. The OCSP solver arrives at a solution that minimizes the total penalty (Objective function) and satisfies all hard constraints. In this paper, an OCSP encoding for the classical planning problems with plan trajectory constraints, soft and hard goals is proposed. Modal operators associated with hard goals and hard plan trajectory constraints are handled by preprocessing and imposing new constraints over the existing GP-CSP encoding. A new encoding for each of the modal operators associated with the soft goals and soft plan trajectory constraints is proposed. Also, a way of encoding conditional goal preference constraints into OCSP is discussed. Based on this research, we intend to submit a planner for the coming planning competition — IPC2006.