Examples of VisualFormatter


Examples of org.infoglue.cms.applications.common.VisualFormatter

    return NONE;
    }

  public String doAssetWeight() throws Exception
    {
    VisualFormatter formatter = new VisualFormatter();

    Map<Integer,Long> sizes = ContentController.getContentController().getContentWeight(new Integer(getRequest().getParameter("contentId")), true);
    Long totalSize = 0L;
    StringBuffer sb = new StringBuffer();
   
    for(Integer id : sizes.keySet())
    {
      totalSize = totalSize + sizes.get(id);
      if(sizes.get(id) > 100000)
      {
        String contentPath = ContentController.getContentController().getContentPath(id, false, true);
        sb.append("<br/>" + contentPath + "=" + formatter.formatFileSize(sizes.get(id)));
      }
    }
   
    this.getResponse().setContentType("text/plain");
    this.getResponse().getWriter().print("" + formatter.formatFileSize(totalSize) + ":" + sb.toString());
   
    return NONE;
    }
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

    return NONE;
    }
 
  public String doHeaviestContents() throws Exception
    {
    VisualFormatter formatter = new VisualFormatter();

    Map<Integer,Long> sizes = ContentController.getContentController().getHeaviestContents();
    Long totalSize = 0L;
    StringBuffer sb = new StringBuffer();
   
    for(Integer id : sizes.keySet())
    {
      totalSize = totalSize + sizes.get(id);
      if(sizes.get(id) > 10000)
      {
        String contentPath = ContentController.getContentController().getContentPath(id, false, true);
        sb.append("<br/><a href='ViewArchiveTool!cleanOldVersionsForContent.action?contentId=" + id + "&recurse=true' target='_blank'>" + contentPath + " (" + formatter.formatFileSize(sizes.get(id)) + ")</a>");
      }
    }
   
    this.getResponse().setContentType("text/plain");
    this.getResponse().getWriter().print("" + formatter.formatFileSize(totalSize) + ":" + sb.toString());
   
    return NONE;
    }
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

    return NONE;
    }
 
  public String doContentsWithDeletableAssets() throws Exception
    {
    VisualFormatter formatter = new VisualFormatter();

    Map<Integer,Long> sizes = ContentController.getContentController().getContentsWithDeletableAssets();
    Long totalSize = 0L;
    StringBuffer sb = new StringBuffer();
   
    for(Integer id : sizes.keySet())
    {
      totalSize = totalSize + sizes.get(id);
      if(sizes.get(id) > 10000)
      {
        String contentPath = ContentController.getContentController().getContentPath(id, false, true);
        sb.append("<br/><a href='ViewArchiveTool!cleanOldVersionsForContent.action?contentId=" + id + "&recurse=true' target='_blank'>" + contentPath + " (" + formatter.formatFileSize(sizes.get(id)) + ")</a>");
      }
    }
   
    this.getResponse().setContentType("text/plain");
    this.getResponse().getWriter().print("" + formatter.formatFileSize(totalSize) + ":" + sb.toString());
   
    return NONE;
    }
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

 
  public String doReplaceNiceURINonAsciiWithSpecifiedChars() throws Exception
  {
    String text = getRequest().getParameter("text");
   
    VisualFormatter formatter = new VisualFormatter();
    text = formatter.replaceNiceURINonAsciiWithSpecifiedChars(text, CmsPropertyHandler.getNiceURIDefaultReplacementCharacter());
   
      this.getResponse().setContentType("text/plain");
    this.getResponse().getWriter().print(text);
   
    return NONE;
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

      List categories = CategoryController.getController().getAllActiveCategories();
      List languages = LanguageController.getController().getLanguageList(db);
     
      InfoGlueExportImpl infoGlueExportImpl = new InfoGlueExportImpl();
     
      VisualFormatter visualFormatter = new VisualFormatter();
      String fileName = "Export_contents_" + visualFormatter.formatDate(new Date(), "yyyy-MM-dd") + ".xml";
      String filePath = CmsPropertyHandler.getDigitalAssetPath();
      String fileSystemName =  filePath + File.separator + fileName;
           
      fileUrl = CmsPropertyHandler.getWebServerAddress() + "/" + CmsPropertyHandler.getDigitalAssetBaseUrl() + "/" + fileName;
      this.fileName = fileName;
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

        if(node != null)
        {
          value = node.getStringValue();
          logger.info("Getting value: " + value);
          if(value != null && escapeSpecialCharacters)
            value = new VisualFormatter().escapeHTML(value);
          break;
        }
      }
    }
   
    if(value.equals(""))
    { 
      List roles = infoGluePrincipal.getRoles();
      String largestValue = "-1";
      String prioValue = null;
      int latestPriority = 0;
      Iterator rolesIterator = roles.iterator();
      while(rolesIterator.hasNext())
      {
        InfoGlueRole role = (InfoGlueRole)rolesIterator.next();
       
        Collection rolePropertiesList = RolePropertiesController.getController().getRolePropertiesList(role.getName(), languageId, db, true);

        Iterator rolePropertiesListIterator = rolePropertiesList.iterator();
        while(rolePropertiesListIterator.hasNext())
        {
          RoleProperties roleProperties = (RoleProperties)rolePropertiesListIterator.next();
         
          if(roleProperties != null && roleProperties.getLanguage().getLanguageId().equals(languageId) && roleProperties.getValue() != null && propertyName != null)
          {
            String propertyXML = roleProperties.getValue();
            DOMBuilder domBuilder = new DOMBuilder();
            Document document = domBuilder.getDocument(propertyXML);
           
            Node propertyPriorityNode = document.getRootElement().selectSingleNode("attributes/PropertyPriority");
            int currentPriority = 0;
            if(propertyPriorityNode != null)
            {
              try
              {
                String propertyPriorityValue = propertyPriorityNode.getStringValue();
                logger.info("propertyPriorityValue:" + propertyPriorityValue);

                if(propertyPriorityValue != null && !propertyPriorityValue.equals(""))
                  currentPriority = new Integer(propertyPriorityValue);
              }
              catch (Exception e)
              {
                e.printStackTrace();
              }
            }
           
            Node node = document.getRootElement().selectSingleNode("attributes/" + propertyName);
            if(node != null)
            {
              value = node.getStringValue();
              logger.info("Getting value: " + value);
              if(value != null && escapeSpecialCharacters)
                value = new VisualFormatter().escapeHTML(value);
             
              if(value != null && !value.equals("") && findLargestValue && new Integer(largestValue).intValue() < new Integer(value).intValue())
                  largestValue = value;

              logger.info("" + findLargestValue + ":" + findPrioValue + ":" + currentPriority + "=" + latestPriority);
              if(value != null && !value.equals("") && !findLargestValue && findPrioValue && currentPriority > latestPriority)
              {
                logger.info("Using other value..");
                prioValue = value;
                latestPriority = currentPriority;
              }

              break;
            }
          }
        }
      }
     
      if(findLargestValue)
          value = largestValue;
     
      if(findPrioValue && prioValue != null)
      {
          value = prioValue;
          logger.info("Using prio value");
      }
     
      if(value.equals("") && useLanguageFallback)
      {
        LanguageVO masterLanguageVO = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId);
        if(!masterLanguageVO.getLanguageId().equals(languageId))
          value = getPrincipalPropertyValue(infoGluePrincipal, propertyName, masterLanguageVO.getLanguageId(), siteNodeId, useLanguageFallback, escapeSpecialCharacters, findLargestValue);
      }
    }
   
    if(value.equals(""))
    { 
      List groups = infoGluePrincipal.getGroups();
      String largestValue = "-1";
      String prioValue = null;
      int latestPriority = 0;
      Iterator groupsIterator = groups.iterator();
      while(groupsIterator.hasNext())
      {
        InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
       
        Collection groupPropertiesList = GroupPropertiesController.getController().getGroupPropertiesList(group.getName(), languageId, db, true);

        Iterator groupPropertiesListIterator = groupPropertiesList.iterator();
        while(groupPropertiesListIterator.hasNext())
        {
          GroupProperties groupProperties = (GroupProperties)groupPropertiesListIterator.next();
         
          if(groupProperties != null && groupProperties.getLanguage().getLanguageId().equals(languageId) && groupProperties.getValue() != null && propertyName != null)
          {
            String propertyXML = groupProperties.getValue();
            DOMBuilder domBuilder = new DOMBuilder();
            Document document = domBuilder.getDocument(propertyXML);
           
            Node propertyPriorityNode = document.getRootElement().selectSingleNode("attributes/PropertyPriority");
            int currentPriority = 0;
            if(propertyPriorityNode != null)
            {
              try
              {
                String propertyPriorityValue = propertyPriorityNode.getStringValue();
                logger.info("propertyPriorityValue:" + propertyPriorityValue);

                if(propertyPriorityValue != null && !propertyPriorityValue.equals(""))
                  currentPriority = new Integer(propertyPriorityValue);
              }
              catch (Exception e)
              {
                e.printStackTrace();
              }
            }

            Node node = document.getRootElement().selectSingleNode("attributes/" + propertyName);
            if(node != null)
            {
              value = node.getStringValue();
              logger.info("Getting value: " + value);
              if(value != null && escapeSpecialCharacters)
                value = new VisualFormatter().escapeHTML(value);
             
              if(value != null && !value.equals("") && findLargestValue && new Integer(largestValue).intValue() < new Integer(value).intValue())
                  largestValue = value;
             
              logger.info("" + findLargestValue + ":" + findPrioValue + ":" + currentPriority + "=" + latestPriority);
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

        if(node != null)
        {
          value = node.getStringValue();
          logger.info("Getting value: " + value);
          if(value != null)
            value = new VisualFormatter().escapeHTML(value);
        }
      }
    }
    catch(Exception e)
    {
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

        {
          context.put("ui", LabelController.getController(session.getLocale()));
        //context.put("ui", getStringManagerChain(session.getLocale()));
        }
       
    context.put("formatter", new VisualFormatter());
    context.put("converter", new ValueConverter());

    request.setCharacterEncoding("UTF-8");
    response.setContentType("text/html; charset=UTF-8");
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

          if(contentType == null || contentType.length() == 0)
              contentType = "text/html";

        if(contentType.equalsIgnoreCase("text/html"))
        {
          VisualFormatter ui = new VisualFormatter();
          message = ui.escapeHTMLforXMLService(message);
        message = "<div>" + message.replaceAll("\n", "<br/>\n") + "</div>";
        }
     
        MailServiceFactory.getService().sendEmail(contentType, from, from, recipients, null, null, null, subject, message, "utf-8");
      //MailServiceFactory.getService().sendEmail(from, from, recipients, subject, message, "utf-8");
View Full Code Here

Examples of org.infoglue.cms.applications.common.VisualFormatter

      return "inputCreateEmail";
    }
   
    public String doExecuteV3() throws Exception
    {
      VisualFormatter ui = new VisualFormatter();
      extraText   = getRequest().getParameter("extraText");
      extraTextProperty   = getRequest().getParameter("extraTextProperty");
     
      if(subject == null || subject.length() == 0 || message == null || message.length() == 0)
      {
        usersAddresses   = getRequest().getParameter("recipients");
        errorMessage   = getLocalizedString(getLocale(), "tool.managementtool.createEmailComposeEmail.validationError");
        return "inputCreateEmailV3";
      }
      else
      {
        String notificationPrefix = getLocalizedString(getLocale(), "tool.managementtool.createEmailComposeEmail.notificationPrefix");
        subject = notificationPrefix + " - " + subject;
      if(from == null  || from.length() == 0)
      {
          String systemEmailSender = CmsPropertyHandler.getSystemEmailSender();
          if(systemEmailSender == null || systemEmailSender.equalsIgnoreCase(""))
            systemEmailSender = "InfoGlueCMS@" + CmsPropertyHandler.getMailSmtpHost();

          from = systemEmailSender;
      }

          String contentType = CmsPropertyHandler.getMailContentType();
          if(contentType == null || contentType.length() == 0)
              contentType = "text/html";

          if(extraText != null && !extraText.equals(""))
          {
            message += "<br/>";
            message += extraText + "<br/>";           
          }

        if(contentType.equalsIgnoreCase("text/html"))
        {
          message = ui.escapeHTMLforXMLService(message);
        message = "<div>" + message.replaceAll("\n", "<br/>\n") + "</div>";
        }
         
        if(extraTextProperty != null && !extraTextProperty.equals(""))
          message += getLocalizedString(getLocale(), extraTextProperty, originalUrl);
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.