Package no.ugland.utransprod.service

Examples of no.ugland.utransprod.service.ConstructionTypeManager


   */
  void initConstructionTypeList(PresentationModel presentationModel) {
    constructionTypeList.clear();
    if (presentationModel
        .getBufferedValue(OrderModel.PROPERTY_PRODUCT_AREA) != null) {
      ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
          .getBean("constructionTypeManager");
      List<ConstructionType> types = constructionTypeManager
          .findByProductArea((ProductArea) presentationModel
              .getBufferedValue(OrderModel.PROPERTY_PRODUCT_AREA));
      if (types != null) {
        constructionTypeList.addAll(types);
      }
View Full Code Here


   * Henter garasjetyper
   *
   * @return garasjetyper
   */
  public List<ConstructionType> getConstructionTypeList() {
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean("constructionTypeManager");
    return constructionTypeManager.findAll();
  }
View Full Code Here

  public void testSaveObjectExt() {
    ProductAreaManager productAreaManager = (ProductAreaManager) ModelUtil
        .getBean(ProductAreaManager.MANAGER_NAME);
    ProductArea productArea = productAreaManager
        .findByName("Garasje villa");
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean(ConstructionTypeManager.MANAGER_NAME);
    ConstructionType constructionType = constructionTypeManager
        .findByName("A1");
    OrderLine orderLine = new OrderLine();
    orderLine.setOrdNo(7);
    orderLine.setLnNo(13);
    Order order = new Order();
View Full Code Here

  /**
   *
   */
  public static void setGavlKledning() {
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean("constructionTypeManager");
    ConstructionTypeArticleManager constructionTypeArticleManager = (ConstructionTypeArticleManager) ModelUtil
    .getBean("constructionTypeArticleManager");
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
   

    List<ConstructionType> garasjer = constructionTypeManager.findAllIncludeMaster();

    Set<ConstructionTypeArticle> artikler;

    ConstructionTypeArticle gavl = null;
    ConstructionTypeArticle kledning = null;

    for (ConstructionType garasje : garasjer) {
      constructionTypeManager
          .lazyLoad(
              garasje,
              new LazyLoadConstructionTypeEnum[] { LazyLoadConstructionTypeEnum.CONSTRUCTION_TYPE_ARTICLE });
      artikler = garasje.getConstructionTypeArticles();


      for (ConstructionTypeArticle artikkel : artikler) {
       
        if (artikkel.getArticleName().equalsIgnoreCase("Gavl")) {
          gavl = artikkel;
          break;

        }
      }
     
     

      ConstructionTypeArticle gavlkledning = null;

      for (ConstructionTypeArticle artikkel : artikler) {
        Set<ConstructionTypeArticle> gavlkledningArtikler;
        if (artikkel.getArticleName().equalsIgnoreCase("Gavlkledning")) {
          gavlkledning = artikkel;
          constructionTypeManager
              .lazyLoadArticle(
                  artikkel,
                  new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.CONSTRUCTION_TYPE_ARTICLES });
          gavlkledningArtikler = artikkel
              .getConstructionTypeArticles();

          for (ConstructionTypeArticle gavlkledningArtikkel : gavlkledningArtikler) {
            if (gavlkledningArtikkel.getArticleName()
                .equalsIgnoreCase("Kledning")) {
              gavlkledningArtikkel
                  .setConstructionTypeArticleRef(gavl);
              kledning=gavlkledningArtikkel;
            }

          }
         
          if(kledning!=null){
          constructionTypeArticleManager.saveConstructionTypeArticle(kledning);
          }

          constructionTypeManager
              .lazyLoadArticle(
                  gavlkledning,
                  new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ORDER_LINE });
          Set<OrderLine> orderLines = gavlkledning.getOrderLines();
          Order order = null;
          Set<OrderLine> orderOrderLines;
          OrderLine gavlOrderLine = null;

          for (OrderLine orderLine : orderLines) {
            order = orderLine.getOrder();
            orderLineManager
                .lazyLoadOrder(
                    order,
                    new LazyLoadOrderEnum[] { LazyLoadOrderEnum.ORDER_LINES });

            orderOrderLines = order.getOrderLines();

            gavlOrderLine=null;
            for (OrderLine orderOrderLine : orderOrderLines) {
              if (orderOrderLine.getArticleName()
                  .equalsIgnoreCase("Gavl")) {
                gavlOrderLine = orderOrderLine;
              }
            }

            //if(gavlOrderLine!=null){
           
            for (OrderLine orderOrderLine : orderOrderLines) {
              if (orderOrderLine.getArticlePath()
                  .equalsIgnoreCase("Gavlkledning$Kledning")) {
                if(gavlOrderLine==null){
                  gavlOrderLine=new OrderLine(null,orderOrderLine.getOrder(),gavl,null,null,null,null,null,null,null,"Gavl",null,1,null,null,null,null,null,null,null,null,null);
                  orderLineManager.saveOrderLine(gavlOrderLine);
                }
                orderOrderLine.setOrderLineRef(gavlOrderLine);
                orderOrderLine.setArticlePath("Gavl$Kledning");
                orderLineManager.saveOrderLine(orderOrderLine);
                orderLineManager.lazyLoadTree(gavlOrderLine);
                gavlOrderLine.setAttributeInfo(gavlOrderLine.getAttributesAsString());
                orderLineManager.saveOrderLine(gavlOrderLine);
              }
            }
            //}

            // gavlkledning.removeOrderLine(orderLine);

          }

          // garasje.removeConstructionArticle(gavlkledning);
          constructionTypeManager.saveConstructionType(garasje);

        }
      }
      constructionTypeArticleManager.saveConstructionTypeArticle(gavl);
    }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  void changeConstructionType(ConstructionType newConstructionType,
      WindowInterface window) {
    if (newConstructionType != null) {
      ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
          .getBean(ConstructionTypeManager.MANAGER_NAME);
      OrderWrapper<T, E> rootOrderWrapper = (OrderWrapper<T, E>) ((OrderLineTreeNode) orderLineTreeTableModel
          .getRoot()).getObject();
      List<OrderLine> rootOrderOrderLines = new ArrayList<OrderLine>(
          rootOrderWrapper.getOrderLines());
      rootOrderWrapper.getOrderLines().clear();
      Set<OrderLine> orderLines = constructionTypeManager
          .getOrderLinesForNewConstructionType(
              rootOrderOrderLines,
              newConstructionType,
              (Order) presentationModel
                  .getBufferedValue(ICostableModel.PROPERTY_ORDER),
View Full Code Here

   * @param constructionArticle
   * @param orderLineMain
   */
  private void setOrderLineConstructionRefs(
      ConstructionTypeArticle constructionArticle, OrderLine orderLineMain) {
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean("constructionTypeManager");
    constructionTypeManager
        .lazyLoadArticle(
            constructionArticle,
            new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.CONSTRUCTION_TYPE_ARTICLES });
    Set<ConstructionTypeArticle> articleRefs = constructionArticle
        .getConstructionTypeArticles();
    OrderLine orderLine;
    Set<OrderLineAttribute> orderLineAttributes;
    Set<OrderLine> orderLineRefs = new LinkedHashSet<OrderLine>();
    if (articleRefs != null) {
      for (ConstructionTypeArticle articleRef : articleRefs) {
        orderLine = OrderLine
            .getInstance(
                (Order) presentationModel
                    .getBufferedValue(ICostableModel.PROPERTY_ORDER),
                articleRef,
                orderLineMain,
                articleRef.getNumberOfItems(),
                articleRef.getDialogOrder(),
                (Deviation) presentationModel
                    .getBufferedValue(ICostableModel.PROPERTY_DEVIATION));

        constructionTypeManager
            .lazyLoadArticle(
                articleRef,
                new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ATTRIBUTES });
        Set<ConstructionTypeArticleAttribute> attributes = articleRef
            .getAttributes();
View Full Code Here

  }

  final ConstructionType lazyLoadConstructionType(
      final PropertyChangeEvent evt) {
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean("constructionTypeManager");
    ConstructionType constructionType = (ConstructionType) evt
        .getNewValue();
    constructionTypeManager
        .lazyLoad(
            constructionType,
            new LazyLoadConstructionTypeEnum[] {
                LazyLoadConstructionTypeEnum.CONSTRUCTION_TYPE_ARTICLE,
                LazyLoadConstructionTypeEnum.CONSTRUCTION_TYPE_ATTRIBUTE });
View Full Code Here

  }

  @After
  public void tearDown() throws Exception {
    dialogFixture.cleanUp();
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean("constructionTypeManager");
    ConstructionType constructionType = constructionTypeManager
        .findByName("test");
    if (constructionType != null) {
      constructionTypeManager.removeConstructionType(constructionType);
    }
  }
View Full Code Here

    FailOnThreadViolationRepaintManager.install();
    MockitoAnnotations.initMocks(this);

    ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean("applicationUserManager");
    final ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean(ConstructionTypeManager.MANAGER_NAME);
    when(managerRepository.getConstructionTypeManager()).thenReturn(
        constructionTypeManager);

    ApplicationUser user;
View Full Code Here

   * @see junit.framework.TestCase#tearDown()
   */
  @After
  public void tearDown() throws Exception {
    dialogFixture.cleanUp();
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean("constructionTypeManager");
    ConstructionType constructionType = constructionTypeManager
        .findByName("test");
    if (constructionType != null) {
      constructionTypeManager.removeConstructionType(constructionType);
    }
  }
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.service.ConstructionTypeManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.