Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.Menu


      // em.update(item);
    }
   
    Iterator<?> iterator = item.getMenus().iterator();
    while (iterator.hasNext()) {
      Menu menu = (Menu) iterator.next();
      CacheDAO.removeByKeyPrefix(site.getSiteId(), Constants.CACHE_MENU + "." + menu.getMenuSetName());
    }
   
    Indexer.getInstance(site.getSiteId()).updateItem(item);

    createAdditionalInfo(adminBean, form, item);
View Full Code Here


    item = ItemDAO.load(site.getSiteId(), Format.getLong(form.getItemId()));

    String menuIds[] = form.getRemoveMenus();
    if (menuIds != null) {
      for (int i = 0; i < menuIds.length; i++) {
        Menu menu = new Menu();
        menu = MenuDAO.load(site.getSiteId(), Format.getLong(menuIds[i]));
        menu.setItem(null);
        menu.setMenuUrl("");
        menu.setMenuType("");
        CacheDAO.removeByKeyPrefix(site.getSiteId(), Constants.CACHE_MENU + "." + menu.getMenuSetName());
      }
    }
    item.setRecUpdateBy(adminBean.getUser().getUserId());
    item.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    em.flush();
View Full Code Here

    item = ItemDAO.load(site.getSiteId(), Format.getLong(form.getItemId()));

    String menuIds[] = form.getAddMenus();
    if (menuIds != null) {
      for (int i = 0; i < menuIds.length; i++) {
        Menu menu = new Menu();
        menu = MenuDAO.load(site.getSiteId(), Format.getLong(menuIds[i]));
        menu.setItem(item);
        menu.setContent(null);
        menu.setCategory(null);
        menu.setMenuUrl("");
        menu.setMenuType(Constants.MENU_ITEM);
        menu.setMenuWindowMode(form.getMenuWindowMode());
        menu.setMenuWindowTarget(form.getMenuWindowTarget());
        CacheDAO.removeByKeyPrefix(site.getSiteId(), Constants.CACHE_MENU + "." + menu.getMenuSetName());
      }
    }
    item.setRecUpdateBy(adminBean.getUser().getUserId());
    item.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    em.flush();
View Full Code Here

  public JSONEscapeObject createJsonSelectedMenus(String siteId, Item item, Long siteProfileClassId) throws Exception {
    JSONEscapeObject jsonResult = new JSONEscapeObject();
    Iterator<?> iterator = item.getMenus().iterator();
    Vector<JSONEscapeObject> menus = new Vector<JSONEscapeObject>();
    while (iterator.hasNext()) {
      Menu menu = (Menu) iterator.next();
      JSONEscapeObject menuObject = new JSONEscapeObject();
      menuObject.put("menuId", menu.getMenuId());
      menuObject.put("menuLongDesc", Utility.formatMenuName(siteId, menu.getMenuId(), siteProfileClassId));
      menuObject.put("siteDomainName", menu.getSiteDomain().getSiteDomainLanguage().getSiteName());
      menus.add(menuObject);
    }
    jsonResult.put("menus", menus);
    jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
View Full Code Here

    form.setItemBookedQty(Format.getIntObj(item.getItemBookedQty()));
   
     Iterator<?> iterator = item.getMenus().iterator();
     Vector<ItemMenuDisplayForm> selectedMenuVector = new Vector<ItemMenuDisplayForm>();
    while (iterator.hasNext()) {
      Menu menu = (Menu) iterator.next();
      ItemMenuDisplayForm menuDisplayForm = new ItemMenuDisplayForm();
      menuDisplayForm.setMenuId(Format.getLong(menu.getMenuId()));
      menuDisplayForm.setMenuLongDesc(Utility.formatMenuName(site.getSiteId(), menu.getMenuId(), form.getSiteProfileClassId()));
      menuDisplayForm.setSiteDomainName(menu.getSiteDomain().getSiteDomainLanguage().getSiteName());
      selectedMenuVector.add(menuDisplayForm);
    }
    ItemMenuDisplayForm selectedMenuList[] = new ItemMenuDisplayForm[selectedMenuVector.size()];
    selectedMenuVector.copyInto(selectedMenuList);
    form.setSelectedMenus(selectedMenuList);
View Full Code Here

      CacheDAO.removeByKeyPrefix(siteId, Constants.CACHE_MENU + "." + menu.getMenuSetName());
    }
     
      iterator = parent.getMenus().iterator();
      while (iterator.hasNext()) {
        Menu menu = (Menu) iterator.next();
        menu.setCategory(null);
      }
      em.flush();
     
      for (CategoryLanguage categoryLanguage : parent.getCategoryLanguages()) {
        em.remove(categoryLanguage);
View Full Code Here

       Iterator<?> iterator = query.getResultList().iterator();
       Vector<DropDownMenu> menuVector = new Vector<DropDownMenu>();
       menuVector.add(makeMenuTree(siteDomainId, Constants.MENUSET_MAIN, siteProfileClassId));
       menuVector.add(makeMenuTree(siteDomainId, Constants.MENUSET_SECONDARY, siteProfileClassId));
      while (iterator.hasNext()) {
        Menu menu = (Menu) iterator.next();
        if (menu.getMenuSetName().equals(Constants.MENUSET_MAIN)) {
          continue;
        }
        if (menu.getMenuSetName().equals(Constants.MENUSET_SECONDARY)) {
          continue;
        }
        menuVector.add(makeMenuTree(siteDomainId, menu.getMenuSetName(), siteProfileClassId));
      }
      DropDownMenu ddmList[] = new DropDownMenu[menuVector.size()];
      menuVector.copyInto(ddmList);
      return ddmList;
    }
View Full Code Here

             "order   by menu.seqNum ";
      Query query = em.createQuery(sql);
      query.setParameter("siteDomainId", siteDomainId);
      query.setParameter("menuSetName", menuSetName);
      Iterator<?> iterator = query.getResultList().iterator();
      Menu menu = null;
      if (iterator.hasNext()) {
        menu = (Menu) iterator.next();
       }
        DropDownMenu menus[] = makeMenu(siteDomainId, menuSetName, menu.getMenuId(), siteProfileClassId, menu.getSiteDomain().getSite().getSiteProfileClassDefault().getSiteProfileClassId());
        DropDownMenu ddm = new DropDownMenu();
        ddm.setMenuName(menu.getMenuSetName());
        ddm.setMenuKey(Format.getLong(menu.getMenuId()));
        ddm.setMenuItems(menus);
       
      return ddm;
    }
View Full Code Here

    static public DropDownMenu[] makeMenu(Long siteDomainId, String menuSetName, Long menuParentId, Long siteProfileClassId, Long siteProfileClassDefaultId) throws Exception {
      DropDownMenu menus[] = null;
      Vector<DropDownMenu> menuList = new Vector<DropDownMenu>();
     
      SiteDomain siteDomain = SiteDomainDAO.load(siteDomainId);
      Menu parent = MenuDAO.load(siteDomain.getSite().getSiteId(), menuParentId);
      for (Menu menu : parent.getMenuChildren()) {
        MenuLanguage defaultMenuLanguage = null;
        for (MenuLanguage language : menu.getMenuLanguages()) {
          if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassDefaultId)) {
            defaultMenuLanguage = language;
          }
View Full Code Here

      Query query = em.createQuery(sql);
      query.setParameter("siteDomainId", siteDomainId);
      Iterator<?> iterator = query.getResultList().iterator();
      Vector<JSONEscapeObject> menuSetVector = new Vector<JSONEscapeObject>();
      while (iterator.hasNext()) {
        Menu menu = (Menu) iterator.next();
        JSONEscapeObject menuSetObject = makeJSONMenuTreeNode(siteDomainId, menu.getMenuId(), siteProfileClassId, siteProfileClassDefault);
        menuSetVector.add(menuSetObject);
      }
      object.put("menuSets", menuSetVector);
     
      return object;
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.Menu

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.