From db4fbe48e57fdb16915c40748d532cb9371dd91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Tue, 12 Jan 2010 20:13:33 +0100 Subject: [PATCH] ItEr43S12CUGravacionModelosUnidadesTraballoItEr42S17: Implementing assigned labels controller for order element template --- .../AssignedLabelsToTemplateController.java | 54 +++++++++++++++++++ .../LabelsAssignmentToTemplateComponent.java | 38 +++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/AssignedLabelsToTemplateController.java create mode 100644 navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/LabelsAssignmentToTemplateComponent.java diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/AssignedLabelsToTemplateController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/AssignedLabelsToTemplateController.java new file mode 100644 index 000000000..4e186d306 --- /dev/null +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/AssignedLabelsToTemplateController.java @@ -0,0 +1,54 @@ +/* + * This file is part of ###PROJECT_NAME### + * + * Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e + * Desenvolvemento Tecnolóxico de Galicia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.navalplanner.web.templates.labels; + +import org.navalplanner.business.templates.entities.OrderElementTemplate; +import org.navalplanner.web.orders.labels.AssignedLabelsController; +import org.navalplanner.web.templates.IOrderTemplatesModel; + +/** + * @author Óscar González Fernández + * + */ +public class AssignedLabelsToTemplateController extends + AssignedLabelsController { + + private IAssignedLabelsToTemplateModel assignedLabelsToTemplateModel; + + private IOrderTemplatesModel templatesModel; + + @Override + protected OrderElementTemplate getElement() { + return templatesModel.getTemplate(); + } + + @Override + protected IAssignedLabelsToTemplateModel getModel() { + return assignedLabelsToTemplateModel; + } + + @Override + protected void setOuterModel(IOrderTemplatesModel templatesModel) { + this.templatesModel = templatesModel; + this.assignedLabelsToTemplateModel.setTemplatesModel(templatesModel); + } + + +} diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/LabelsAssignmentToTemplateComponent.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/LabelsAssignmentToTemplateComponent.java new file mode 100644 index 000000000..762717cbd --- /dev/null +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/templates/labels/LabelsAssignmentToTemplateComponent.java @@ -0,0 +1,38 @@ +/* + * This file is part of ###PROJECT_NAME### + * + * Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e + * Desenvolvemento Tecnolóxico de Galicia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.navalplanner.web.templates.labels; + +import org.navalplanner.web.orders.labels.LabelsAssignmentComponent; + +/** + * @author Óscar González Fernández + * + */ +public class LabelsAssignmentToTemplateComponent extends + LabelsAssignmentComponent { + + private AssignedLabelsToTemplateController controller = new AssignedLabelsToTemplateController(); + + @Override + public AssignedLabelsToTemplateController getController() { + return controller; + } + +}