Define CompanyPlanningModel using annotations
Initially CompanyPlanningModel was defined in XML file because method-lookups were needed. Since currently the scope of CompanyPlanningModel is prototype, this is no longer needed. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
fb7d05ab0e
commit
c80d329c2a
3 changed files with 9 additions and 24 deletions
|
|
@ -79,6 +79,9 @@ import org.navalplanner.web.planner.tabs.MultipleTabsPlannerController;
|
|||
import org.navalplanner.web.print.CutyPrint;
|
||||
import org.navalplanner.web.security.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.zkforge.timeplot.Plotinfo;
|
||||
import org.zkforge.timeplot.Timeplot;
|
||||
|
|
@ -123,8 +126,9 @@ import org.zkoss.zul.Vbox;
|
|||
*
|
||||
* @author Manuel Rego Casasnovas <mrego@igalia.com>
|
||||
*/
|
||||
// This bean is defined at navalplanner-webapp-spring-config.xml
|
||||
public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
||||
@Component
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
public class CompanyPlanningModel implements ICompanyPlanningModel {
|
||||
|
||||
public static final String COLOR_CAPABILITY_LINE = "#000000"; // Black
|
||||
public static final String COLOR_ASSIGNED_LOAD_GLOBAL = "#98D471"; // Green
|
||||
|
|
@ -153,6 +157,9 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
@Autowired
|
||||
private IScenarioManager scenarioManager;
|
||||
|
||||
@Autowired
|
||||
private ITaskElementAdapter taskElementAdapter;
|
||||
|
||||
private Scenario currentScenario;
|
||||
|
||||
@Autowired
|
||||
|
|
@ -192,13 +199,6 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void setConfigurationToPlanner(Planner planner,
|
||||
Collection<ICommandOnTask<TaskElement>> additional) {
|
||||
setConfigurationToPlanner(planner, additional, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTabsController(MultipleTabsPlannerController tabsController) {
|
||||
this.tabs = tabsController;
|
||||
|
|
@ -713,7 +713,6 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
|
||||
private PlannerConfiguration<TaskElement> createConfiguration(
|
||||
IPredicate predicate) {
|
||||
ITaskElementAdapter taskElementAdapter = getTaskElementAdapter();
|
||||
taskElementAdapter.setPreventCalculateResourcesText(true);
|
||||
taskElementAdapter.useScenario(currentScenario);
|
||||
List<TaskElement> toShow;
|
||||
|
|
@ -786,9 +785,6 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
return result;
|
||||
}
|
||||
|
||||
// spring method injection
|
||||
protected abstract ITaskElementAdapter getTaskElementAdapter();
|
||||
|
||||
@Override
|
||||
public LocalDate getFilterStartDate() {
|
||||
return filterStartDate;
|
||||
|
|
|
|||
|
|
@ -39,13 +39,6 @@ import org.zkoss.ganttz.extensions.ICommandOnTask;
|
|||
*/
|
||||
public interface ICompanyPlanningModel {
|
||||
|
||||
void setConfigurationToPlanner(final Planner planner,
|
||||
Collection<ICommandOnTask<TaskElement>> additional);
|
||||
|
||||
public void setConfigurationToPlanner(Planner planner,
|
||||
Collection<ICommandOnTask<TaskElement>> additional,
|
||||
ICommandOnTask<TaskElement> doubleClickCommand);
|
||||
|
||||
public void setConfigurationToPlanner(Planner planner,
|
||||
Collection<ICommandOnTask<TaskElement>> additional,
|
||||
ICommandOnTask<TaskElement> doubleClickCommand, IPredicate predicate);
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@
|
|||
|
||||
<bean class="org.navalplanner.web.common.entrypoints.RedirectorSynthetiser"></bean>
|
||||
|
||||
<bean class="org.navalplanner.web.planner.company.CompanyPlanningModel" scope="prototype">
|
||||
<lookup-method name="getTaskElementAdapter" bean="taskElementAdapter"/>
|
||||
</bean>
|
||||
|
||||
<bean id="ordersMultipleFiltersFinder" class="org.navalplanner.web.common.components.finders.OrdersMultipleFiltersFinder" scope="singleton" />
|
||||
|
||||
<bean id="orderElementsMultipleFiltersFinder" class="org.navalplanner.web.common.components.finders.OrderElementsMultipleFiltersFinder" scope="singleton"/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue