Examples of ApplicationMessage


Examples of org.exoplatform.web.application.ApplicationMessage

      }
      String s = (String)uiInput.getValue();
      if (Character.isDigit(s.charAt(0)) || s.charAt(0) == '-')
      {
         Object[] args = {label, uiInput.getBindingField()};
         throw new MessageException(new ApplicationMessage("FirstAndSpecialCharacterNameValidator.msg", args,
            ApplicationMessage.WARNING));
      }
      for (int i = 0; i < s.length(); i++)
      {
         char c = s.charAt(i);
         if (Character.isLetter(c) || Character.isDigit(c) || c == '_' || c == '-')
         {
            continue;
         }
         Object[] args = {label};
         throw new MessageException(new ApplicationMessage("IdentifierValidator.msg.Invalid-char", args,
            ApplicationMessage.WARNING));
      }
   }
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

         Date stDate = sdf.parse(s);
         s = stFormat.format(stDate);
      }
      catch (Exception e)
      {
         throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args));
      }
      if (s.matches(DATETIME_REGEX) && isValidDateTime(s))
         return;

      throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args));
   }
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

      catch (Exception e)
      {
         label = uiInput.getName();
      }
      Object[] args = {label};
      throw new MessageException(new ApplicationMessage(key_, args, ApplicationMessage.WARNING));
   }
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

         UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
         UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
         if (portalName != null
            && service.getUserPortalConfig(portalName, event.getRequestContext().getRemoteUser()) == null)
         {
            uiApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist", new String[]{portalName}));
            return;
         }

         UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
         UIPortalForm portalForm = uiMaskWS.createUIComponent(UIPortalForm.class, null, "UIPortalForm");
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

         PageNode targetNode = PageNavigationUtils.searchPageNodeByUri(targetNav, targetUri);

         if (targetNode != null && newNode.getUri().equals(targetNode.getUri()))
         {
            UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIPageNodeSelector.msg.paste.sameSrcAndDes", null));
            return;
         }

         if (isExistChild(targetNode, newNode) || (targetNode == null && isExitChild(targetNav, newNode)))
         {
            UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIPageNodeSelector.msg.paste.sameName", null));
            return;
         }
         if (selectedNode.isDeleteNode())
         {
            if (selectedNode.getParentNode() != null)
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

         PageNode parentNode = parentChildPair.getParentNode();
         PageNode childNode = parentChildPair.getChildNode();
        
         if(childNode.isSystem()) {
            uiApp.addMessage(new ApplicationMessage("UINavigationNodeSelector.msg.systemnode-delete", null));
            return;
          }
         
         if(parentNode == null)
         {
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

           
            // Case 1: current date after start date
            if (currentDate.after(startDate))
            {
               Object[] args = {};
               uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.currentDateBeforeStartDate", args, ApplicationMessage.WARNING));
               return;
            }
            // Case 2: start date after end date
            else if ((endCalendar != null) && (startCalendar != null) && (startDate.after(endDate)))
            {
               Object[] args = {};
               uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.startDateBeforeEndDate", args, ApplicationMessage.WARNING));
               return;
            }
            // Case 3: start date is null and current date after end date
            else if((endCalendar != null) && (currentDate.after(endDate)))
            {
               Object[] args = {};
               uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.currentDateBeforeEndDate", args, ApplicationMessage.WARNING));
               return;
            }
           
         }

         PageNode pageNode = uiPageNodeForm.getPageNode();
         if (pageNode == null)
            pageNode = new PageNode();
         uiPageNodeForm.invokeSetBindingBean(pageNode);
         UIPageSelector2 pageSelector = uiPageNodeForm.getChild(UIPageSelector2.class);
         if (pageSelector.getPage() == null)
            pageNode.setPageReference(null);
         UIFormInputIconSelector uiIconSelector = uiPageNodeForm.getChild(UIFormInputIconSelector.class);
         if (uiIconSelector.getSelectedIcon().equals("Default"))
            pageNode.setIcon(null);
         else
            pageNode.setIcon(uiIconSelector.getSelectedIcon());
         if (pageNode.getLabel() == null)
            pageNode.setLabel(pageNode.getName());

         Object selectedParent = uiPageNodeForm.getSelectedParent();
         PageNavigation pageNav = null;

         if (selectedParent instanceof PageNavigation)
         {
            pageNav = (PageNavigation)selectedParent;
            pageNode.setUri(pageNode.getName());
            if (!pageNav.getNodes().contains(pageNode))
            {
               if (PageNavigationUtils.searchPageNodeByUri(pageNav, pageNode.getUri()) != null)
               {
                  uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.SameName", null));
                  return;
               }
               pageNav.addNode(pageNode);
            }
         }
         else if (selectedParent instanceof PageNode)
         {
            PageNode parentNode = (PageNode)selectedParent;
            List<PageNode> children = parentNode.getChildren();
            if (children == null)
            {
               children = new ArrayList<PageNode>();
               parentNode.setChildren((ArrayList<PageNode>)children);
            }
            pageNode.setUri(parentNode.getUri() + "/" + pageNode.getName());
            if (!children.contains(pageNode))
            {
               if (PageNavigationUtils.searchPageNodeByUri(parentNode, pageNode.getUri()) != null)
               {
                  uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.SameName", null));
                  return;
               }
               children.add(pageNode);
            }
         }
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

                  return;
               }
               catch (Exception ex)
               {
                  //TODO:  This is a  critical exception and should be handle  in the UIApplication
                  uiPortalApp.addMessage(new ApplicationMessage(ex.getMessage(), null));
                  return;
               }
            }
         }

         UserACL userACL = uiForm.getApplicationComponent(UserACL.class);

         String ownerId = uiForm.getOwner();
         String[] accessPermission = new String[1];
         accessPermission[0] = "*:" + ownerId;
         String editPermission = userACL.getMakableMT() + ":" + ownerId;
        
         if (PortalConfig.PORTAL_TYPE.equals(uiForm.getOwnerType()))
         {
            UIPortal uiPortal = Util.getUIPortal();
            accessPermission = uiPortal.getAccessPermissions();
            editPermission = uiPortal.getEditPermission();
         }
        
        
         UIFormStringInput uiPageName = uiInputSet.getChildById("pageName");
         UIFormStringInput uiPageTitle = uiInputSet.getChildById("pageTitle");

         Page page = new Page();
         page.setOwnerType(uiForm.getOwnerType());
         page.setOwnerId(ownerId);
         page.setName(uiPageName.getValue());
         String title = uiPageTitle.getValue();;
         if (title == null || title.trim().length() < 1)
            title = page.getName();
         page.setTitle(title);

         page.setShowMaxWindow(false);

         page.setAccessPermissions(accessPermission);
         page.setEditPermission(editPermission);

         userACL.hasPermission(page);

         page.setModifiable(true);
         if (page.getChildren() == null)
            page.setChildren(new ArrayList<ModelObject>());

         // check page is exist
         DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
         Page existPage = dataService.getPage(page.getPageId());
         if (existPage != null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
            pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
            return;
         }

         // save page to database
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

            error = true;
            continue;
         }
         error = false;
         Object[] args = {label, uiInput.getBindingField()};
         throw new MessageException(new ApplicationMessage("NumberFormatValidator.msg.Invalid-number", args));
      }
      if (error == true && s.charAt(0) == '-')
      {
         Object[] args = {label};
         throw new MessageException(new ApplicationMessage("PositiveNumberFormatValidator.msg.Invalid-number", args));
      }
   }
View Full Code Here

Examples of org.exoplatform.web.application.ApplicationMessage

      uiVirtualList.setUIComponent(uiRepeater);     
   }

   public void showPopupMessage(String msg) {
      WebuiRequestContext rcontext = WebuiRequestContext.getCurrentInstance();
      rcontext.getUIApplication().addMessage(new ApplicationMessage(msg, null));  
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.