From 805ffbd7cd336faaa67060dcea2cffc60d7e2beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Mon, 9 May 2011 15:43:40 +0200 Subject: [PATCH] Add missing metadata to entry points FEA: ItEr74S04BugFixing --- .../converters/OrderTemplateConverter.java | 60 +++++++++++++++++++ .../planner/tabs/IGlobalViewEntryPoints.java | 5 ++ 2 files changed, 65 insertions(+) create mode 100644 navalplanner-webapp/src/main/java/org/navalplanner/web/common/converters/OrderTemplateConverter.java diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/common/converters/OrderTemplateConverter.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/common/converters/OrderTemplateConverter.java new file mode 100644 index 000000000..1843e46fe --- /dev/null +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/common/converters/OrderTemplateConverter.java @@ -0,0 +1,60 @@ +/* + * This file is part of NavalPlan + * + * Copyright (C) 2011 Igalia, S.L. + * + * 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.common.converters; + +import org.navalplanner.business.common.exceptions.InstanceNotFoundException; +import org.navalplanner.business.templates.daos.IOrderElementTemplateDAO; +import org.navalplanner.business.templates.entities.OrderTemplate; +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; + +@Component +@Scope(BeanDefinition.SCOPE_SINGLETON) +public class OrderTemplateConverter implements IConverter { + + @Autowired + private IOrderElementTemplateDAO orderElementTemplateDAO; + + @Override + public OrderTemplate asObject(String stringRepresentation) { + try { + return (OrderTemplate) orderElementTemplateDAO.find(Long + .parseLong(stringRepresentation)); + } catch (InstanceNotFoundException e) { + throw new RuntimeException(e); + } + } + + @Override + public String asString(OrderTemplate entity) { + return entity.getId() + ""; + } + + @Override + public String asStringUngeneric(Object entity) { + return asString((OrderTemplate) entity); + } + + @Override + public Class getType() { + return OrderTemplate.class; + } +} diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/tabs/IGlobalViewEntryPoints.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/tabs/IGlobalViewEntryPoints.java index 623ae6bb4..b482e3ccf 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/tabs/IGlobalViewEntryPoints.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/tabs/IGlobalViewEntryPoints.java @@ -51,13 +51,18 @@ public interface IGlobalViewEntryPoints { @EntryPoint( { "orderElement", "order" }) public void goToOrderElementDetails(OrderElement orderElement, Order order); + @EntryPoint("limiting_resources") void goToCompanyLimitingResources(); + @EntryPoint("order_details") void goToOrderDetails(Order order); + @EntryPoint("order_load") void goToResourcesLoad(Order order); + @EntryPoint("order_advanced_allocation") void goToAdvancedAllocation(Order order); + @EntryPoint("create_order_from_template") void goToCreateotherOrderFromTemplate(OrderTemplate template); }