Examples of VisualFormatter


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

       this.contentVO.setPublishDateTime(new VisualFormatter().parseDate(publishDateTime, "yyyy-MM-dd HH:mm"));
    }

    public void setExpireDateTime(String expireDateTime)
    {
         this.contentVO.setExpireDateTime(new VisualFormatter().parseDate(expireDateTime, "yyyy-MM-dd HH:mm"));
  }
View Full Code Here

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

  }

  public String getLastModifiedDateString(long lastModified)
  {
    Date date = new Date(lastModified);
    String lastModifiedDateString = new VisualFormatter().formatDate(date, "yy-MM-dd HH:ss");

    return lastModifiedDateString;
  }
View Full Code Here

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

                  String navigationTitle = ContentDeliveryController.getContentDeliveryController().getContentAttribute(db, contentId, languageId, "NavigationTitle", siteNodeId, true, deliveryContext, infoGluePrincipal, false, false);
                  if(navigationTitle == null || navigationTitle.equals(""))
                    navigationTitle = ContentDeliveryController.getContentDeliveryController().getContentAttribute(db, contentId, languageId, "Title", siteNodeId, true, deliveryContext, infoGluePrincipal, false, false);
                  if(navigationTitle != null && !navigationTitle.equals(""))
                  {
                    navigationTitle = new VisualFormatter().replaceNiceURINonAsciiWithSpecifiedChars(navigationTitle, CmsPropertyHandler.getNiceURIDefaultReplacementCharacterForContent());
                    sb.append("/" + navigationTitle + ".cid").append(String.valueOf(contentId));
                      addedContent = true;
            }
                  else
                  {
View Full Code Here

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

   * This method gets the formatter object that helps with formatting of data.
   */
 
  public VisualFormatter getVisualFormatter()
  {
    return new VisualFormatter();
  }
View Full Code Here

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

    String assetUrl = "";
   
    try
    {
      String uniqueFileName = "" + fileName + data.hashCode() + "." + suffix;
      VisualFormatter vf = new VisualFormatter();
      uniqueFileName = vf.replaceNonAscii(uniqueFileName, '_');
 
      int i = 0;
      String filePath = CmsPropertyHandler.getDigitalAssetPath0();
      while(filePath != null)
      {
View Full Code Here

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

  public String getInstancePublicationQueueManualClearTimestamp(String serverURL)
  {
    String timestamp = instancePublicationQueueMeta.get(serverURL + "_manualClearTimestamp");
    if(timestamp != null && !timestamp.equals(""))
    {
      VisualFormatter vf = new VisualFormatter();
      return vf.formatDate(Long.parseLong(timestamp), "yyyy-MM-dd HH:mm:ss");
    }
    else
      return "Never cleared";
  }
View Full Code Here

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

            if(n.getFirstChild() != null && n.getFirstChild().getNodeValue() != null)
            {
              value = n.getFirstChild().getNodeValue();
              logger.info("Getting value: " + value);
              if(value != null && escapeHTML)
                value = new VisualFormatter().escapeHTML(value);
              break;
            }
          }
        }             
      }
View Full Code Here

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

    return new ExportImportController();
  }
 
  public String exportContent(List contentIdList, String path, String fileNamePrefix, boolean includeContentTypes, boolean includeCategories) throws Exception
  {
    VisualFormatter vf = new VisualFormatter();
    fileNamePrefix = vf.replaceNonAscii(fileNamePrefix, '_');
   
    String fileName = null;
     
    Database db = CastorDatabaseService.getDatabase();
   
View Full Code Here

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

      List<Language> languages = LanguageController.getController().getLanguageList(db);
      List<SiteNodeTypeDefinition> siteNodeTypeDefinitions = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionList(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;
                 
      String encoding = "UTF-8";
      file = new File(fileSystemName);
View Full Code Here

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

  public void exportRepository(String[] repositories, int assetMaxSize, boolean onlyPublishedVersions, String exportFileName, ProcessBean processBean, boolean copy, String onlyLatestVersions, String standardReplacement, String replacements) throws Exception
  {
    Timer t = new Timer();
   
    VisualFormatter visualFormatter = new VisualFormatter();

    String exportId = "Export_" + visualFormatter.formatDate(new Date(), "yyyy-MM-dd_HHmm");
    processBean.setStatus(ProcessBean.RUNNING);
   
    String folderName = CmsPropertyHandler.getDigitalAssetPath() + File.separator + exportId + "Archive";
    File folder = new File(folderName);
    folder.mkdirs();

    Database db = null;
   
    try
    {
      db = CastorDatabaseService.getDatabase();
     
      Mapping map = new Mapping();
      logger.info("MappingFile:" + CastorDatabaseService.class.getResource("/xml_mapping_site_3.0.xml").toString());
      map.loadMapping(CastorDatabaseService.class.getResource("/xml_mapping_site_3.0.xml").toString());
     
      processBean.updateProcess("Export configuration initialized");
     
      // All ODMG database access requires a transaction
      db.begin();

      Hashtable<String,String> allRepositoryProperties = new Hashtable<String,String>();
      Hashtable<String,String> allSiteNodeProperties = new Hashtable<String,String>();
      Hashtable<String,String> allContentProperties = new Hashtable<String,String>();
      List<AccessRight> allAccessRights = new ArrayList<AccessRight>();
     
      Map args = new HashMap();
        args.put("globalKey", "infoglue");
        PropertySet ps = PropertySetManager.getInstance("jdbc", args);
        //END TEST
      Collection keys = ps.getKeys();
      logger.info("keys:" + keys.size());

      processBean.updateProcess("Propertyset fetched in " + (t.getElapsedTime() / 1000) + " seconds");

      String names = "";
     
      List<Content> allExportedContents = new ArrayList<Content>();
      List<SiteNode> allExportedSiteNodes = new ArrayList<SiteNode>();
     
      int exportedEntities = exportHeavyEntities(repositories, "Contents", folderName, assetMaxSize, onlyPublishedVersions, exportFileName, allExportedSiteNodes, allExportedContents);
      processBean.updateProcess("Contents exported: " + exportedEntities + " in " + (t.getElapsedTime() / 1000) + " seconds");

        exportedEntities = exportHeavyEntities(repositories, "ContentVersions", folderName, assetMaxSize, onlyPublishedVersions, exportFileName, allExportedSiteNodes, allExportedContents);
      processBean.updateProcess("Content versions exported: " + exportedEntities + " in " + (t.getElapsedTime() / 1000) + " seconds");

        exportedEntities = exportHeavyEntities(repositories, "SiteNodes", folderName, assetMaxSize, onlyPublishedVersions, exportFileName, allExportedSiteNodes, allExportedContents);
      processBean.updateProcess("Sitenodes exported: " + exportedEntities + " in " + (t.getElapsedTime() / 1000) + " seconds");
   
      exportedEntities = exportHeavyEntities(repositories, "SiteNodeVersions", folderName, assetMaxSize, onlyPublishedVersions, exportFileName, allExportedSiteNodes, allExportedContents);
      processBean.updateProcess("Sitenode versions exported: " + exportedEntities + " in " + (t.getElapsedTime() / 1000) + " seconds");
     
      exportedEntities = exportHeavyEntities(repositories, "DigitalAssets", folderName, assetMaxSize, onlyPublishedVersions, exportFileName, allExportedSiteNodes, allExportedContents);
      processBean.updateProcess("Assets exported: " + exportedEntities + " in " + (t.getElapsedTime() / 1000) + " seconds");
     
        List<Repository> repositoryList = new ArrayList<Repository>();

      for(int i=0; i<repositories.length; i++)
      {
        Integer repositoryId = new Integer(repositories[i]);
        Repository repository   = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
        logger.info("Read repo");
       
        /*
        SiteNode siteNode     = SiteNodeController.getController().getRootSiteNode(repositoryId, db);
        logger.info("Read siteNode");
        Content content     = ContentController.getContentController().getRootContent(repositoryId, db);
        logger.info("Read content");
        */

        InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName("Repository.Read", db);
          if(interceptionPointVO != null)
            allAccessRights.addAll(AccessRightController.getController().getAccessRightListOnlyReadOnly(interceptionPointVO.getId(), repository.getId().toString(), db));
          logger.info("Read allAccessRights 1");

          interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName("Repository.Write", db);
          if(interceptionPointVO != null)
            allAccessRights.addAll(AccessRightController.getController().getAccessRightListOnlyReadOnly(interceptionPointVO.getId(), repository.getId().toString(), db));
          logger.info("Read allAccessRights 2");

          interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName("Repository.ReadForBinding", db);
          if(interceptionPointVO != null)
            allAccessRights.addAll(AccessRightController.getController().getAccessRightListOnlyReadOnly(interceptionPointVO.getId(), repository.getId().toString(), db));
          logger.info("Read allAccessRights 3:" + allAccessRights.size());

          allAccessRights.addAll(AccessRightController.getController().getContentAccessRightListOnlyReadOnly(repository.getId(), db));
          logger.info("Read allAccessRights 4:" + allAccessRights.size());

          allAccessRights.addAll(AccessRightController.getController().getSiteNodeAccessRightListOnlyReadOnly(repository.getId(), db));
          logger.info("Read allAccessRights 5:" + allAccessRights.size());
       
        getContentProperties(ps, allContentProperties, allExportedContents, db);
        logger.info("getContentPropertiesAndAccessRights");
       
        getSiteNodeProperties(ps, allSiteNodeProperties, allExportedSiteNodes, db);
        logger.info("getSiteNodePropertiesAndAccessRights");
       
        //siteNodes.add(siteNode);
        //contents.add(content);
        names = names + "_" + repository.getName();
        allRepositoryProperties.putAll(getRepositoryProperties(ps, repositoryId));
       
        repositoryList.add(repository);
      }
      processBean.updateProcess("Access rights: " + allAccessRights.size() + " exported in " + (t.getElapsedTime() / 1000) + " seconds");

      List<Language> languages = LanguageController.getController().getLanguageList(db);
      List<ContentTypeDefinition> contentTypeDefinitions = ContentTypeDefinitionController.getController().getContentTypeDefinitionList(db);
      List<CategoryVO> categories = CategoryController.getController().getAllActiveCategories();
      List<SiteNodeTypeDefinition> siteNodeTypeDefinitions = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionList(db);
     
      processBean.updateProcess("Content type and categories exported in " + (t.getElapsedTime() / 1000) + " seconds");
     
      InfoGlueExportImpl infoGlueExportImpl = new InfoGlueExportImpl();
     
      names = new VisualFormatter().replaceNonAscii(names, '_');

      if(repositories.length > 2 || names.length() > 40)
        names = "" + repositories.length + "_repositories";
     
      String fileName = exportId;
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.