Package org.infoglue.deliver.util

Examples of org.infoglue.deliver.util.HttpHelper


    {
      Hashtable inHash = new Hashtable();
      inHash.put("fragment", markup);
      inHash.put("output", "json");
     
      HttpHelper httpHelper = new HttpHelper();
      String result = httpHelper.postToUrl(CmsPropertyHandler.getW3CValidationServiceUrl(), inHash, "utf-8");
      logger.info("result:" + result);
     
      this.getResponse().setContentType("text/json");
      this.getResponse().getWriter().print(result);
    }
View Full Code Here


  public List getToolbarButtons(String toolbarKey, String primaryKey, String extraParameters)
  {
    try
    {
      HttpHelper helper = new HttpHelper();
      Map extraParametersMap = helper.toMap(extraParameters, "iso-8859-1", "&");
      Iterator extraParametersMapIterator = extraParametersMap.keySet().iterator();
      while(extraParametersMapIterator.hasNext())
      {
        String key = (String)extraParametersMapIterator.next();
        String value = (String)extraParametersMap.get(key);
View Full Code Here

 
  public List getFooterToolbarButtons(String toolbarKey, String primaryKey, String extraParameters, boolean disableCloseButton)
  {
    try
    {
      HttpHelper helper = new HttpHelper();
      Map extraParametersMap = helper.toMap(extraParameters, "iso-8859-1", "&");
      Iterator extraParametersMapIterator = extraParametersMap.keySet().iterator();
      while(extraParametersMapIterator.hasNext())
      {
        String key = (String)extraParametersMapIterator.next();
        String value = (String)extraParametersMap.get(key);
View Full Code Here

                if(cookieAttributeEndIndex > -1)
                    cookieAttribute = pageKey.substring(cookieAttributeStartIndex + 8, cookieAttributeEndIndex);
                else
                    cookieAttribute = pageKey.substring(cookieAttributeStartIndex + 8);

                HttpHelper httpHelper = new HttpHelper();
                pageKey = pageKey.replaceAll("\\$cookie." + cookieAttribute, "" + httpHelper.getCookie(request, cookieAttribute));         
           
                cookieAttributeStartIndex = pageKey.indexOf("$cookie.");
            }

      }
View Full Code Here

              headers.put(headerName, headerValue);
            }
           
            headers.put("User-Agent", context.getHttpServletRequest().getHeader("User-Agent") + ";Java");
           
            HttpHelper helper = new HttpHelper();
            pageContent = helper.getUrlContent(pageUrl, headers, 3000);
            logger.info("pageContent:" + pageContent);
             
            int usedEntitiesIndex = pageContent.indexOf("<usedEntities>");
            if(usedEntitiesIndex > -1)
            {
View Full Code Here

        }
      }

      if(principal == null)
      {
        HttpHelper httpHelper = new HttpHelper();
      String encodedUserNameCookie = httpHelper.getCookie(this.getRequest(), "iguserid");
      logger.info("encodedUserNameCookie:" + encodedUserNameCookie);
      /*
      if(logger.isInfoEnabled())
      {
        Enumeration attributeNames = ActionContext.getServletContext().getAttributeNames();
View Full Code Here

        {
          String address = "" + internalDeliveryUrlsIterator.next() + "/UpdateCache!test.action";
         
          try
          {
              HttpHelper httpHelper = new HttpHelper();
            String response = httpHelper.getUrlContent(address, new HashMap(), null, 3000);
            if(response.indexOf("test ok") == -1)
                throw new Exception("Got wrong answer");
           
            addValidationItem(name, description, true, "Test succeeded on " + address + ": " + response);
          }
          catch(Exception e)
          {
            e.printStackTrace();
              addValidationItem(name, description, false, "Test failed on " + address + ":" + e.getMessage());
          }
        }
       
        List publicDeliveryUrls = CmsPropertyHandler.getPublicDeliveryUrls();
        Iterator publicDeliveryUrlsIterator = publicDeliveryUrls.iterator();
        while(publicDeliveryUrlsIterator.hasNext())
        {
          String address = "" + publicDeliveryUrlsIterator.next() + "/UpdateCache!test.action";
       
        try
        {
              HttpHelper httpHelper = new HttpHelper();
            String response = httpHelper.getUrlContent(address, new HashMap(), null, 3000);
            if(response.indexOf("test ok") == -1)
                throw new Exception("Got wrong answer");
           
            addValidationItem(name, description, true, "Test succeeded on " + address + ": " + response);
        }
View Full Code Here

   * This method gets the math utility.
   */
 
  public HttpHelper getHTTPHelper()
  {
    return new HttpHelper();
  }
View Full Code Here

    if(getProcessedTimestamp() > 0)
      status = "Processed";
   
    map.put("status", "" + status);
   
    HttpHelper helper = new HttpHelper();
    return helper.toEncodedString(map, "utf-8");
  }
View Full Code Here

          {
            publicationDetails.add(new String[]{"" + deliverUrl, "Error", "Server not available for status query"});         
          }
          else
          {
            HttpHelper httpHelper = new HttpHelper();
            String response = httpHelper.getUrlContent(address, 2000);
            logger.info("response:" + response);
            if(response != null && response.indexOf("status=Unknown;") > -1)
            {
              if(response.indexOf("serverStartDateTime:") > -1)
              {
                String applicationStartupDateTimeString = response.substring(response.indexOf("serverStartDateTime:") + 20).trim();
                logger.info("applicationStartupDateTimeString:" + applicationStartupDateTimeString);
                VisualFormatter visualFormatter = new VisualFormatter();
                Date serverStartupDate = visualFormatter.parseDate(applicationStartupDateTimeString, "yyyy-MM-dd HH:mm:ss");
                PublicationVO publicationVO = PublicationController.getController().getPublicationVO(publicationId);
                if(publicationVO.getPublicationDateTime().before(serverStartupDate))
                  publicationDetails.add(new String[]{"" + deliverUrl, "N/A", "Application restarted after the publication: " + applicationStartupDateTimeString});             
                else
                  publicationDetails.add(new String[]{"" + deliverUrl, "N/A", "No information found"});             
              }
              else
              {
                publicationDetails.add(new String[]{"" + deliverUrl, "N/A", "No information found"});             
              }
            }
            else
            {
              Map<String,String> responseMap = httpHelper.toMap(response.trim(), "utf-8");
              CacheEvictionBean bean = CacheEvictionBean.getCacheEvictionBean(responseMap);
              if(bean == null)
                throw new Exception("No information found");
             
              VisualFormatter visualFormatter = new VisualFormatter();
View Full Code Here

TOP

Related Classes of org.infoglue.deliver.util.HttpHelper

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.