Package org.infoglue.deliver.applications.databeans

Examples of org.infoglue.deliver.applications.databeans.ComponentBinding


            String entity = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "entity");
            String entityId = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "entityId");
            String assetKey = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "assetKey");
            //logger.info("Binding found:" + entity + ":" + entityId);

            ComponentBinding componentBinding = new ComponentBinding();
            //componentBinding.setId(new Integer(id));
            //componentBinding.setComponentId(componentId);
            componentBinding.setEntityClass(entity);
            componentBinding.setEntityId(new Integer(entityId));
            componentBinding.setAssetKey(assetKey);
            componentBinding.setBindingPath(path);
           
            bindings.add(componentBinding);
          }
 
          property.put("bindings", bindings);
View Full Code Here


            String entity = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "entity");
            String entityId = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "entityId");
            String assetKey = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "assetKey");
            ////logger.info("Binding found:" + entity + ":" + entityId);
           
            ComponentBinding componentBinding = new ComponentBinding();
            //componentBinding.setId(new Integer(id));
            //componentBinding.setComponentId(componentId);
            componentBinding.setEntityClass(entity);
            componentBinding.setEntityId(new Integer(entityId));
            componentBinding.setAssetKey(assetKey);
            componentBinding.setBindingPath(path);
           
            bindings.add(componentBinding);
          }
 
          property.put("bindings", bindings);
View Full Code Here

                String entity = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "entity");
                String entityId = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "entityId");
                String assetKey = bindingElement.getAttributeValue(bindingElement.getNamespaceName(), "assetKey");
                XmlElement supplementingBindingElement = bindingElement.element(bindingElement.getNamespace(), "supplementing-binding");

                ComponentBinding componentBinding;
                if (supplementingBindingElement == null)
                {
                  componentBinding = new ComponentBinding();
                }
                else
                {
                  String supplementingEntityIdString = null;
                  try
                  {
                    supplementingEntityIdString = supplementingBindingElement.getAttributeValue(supplementingBindingElement.getNamespaceName(), "entityId");
                    Integer supplementingEntityId = null;
                    if (supplementingEntityIdString != null && !supplementingEntityIdString.equals(""))
                    {
                      supplementingEntityId = new Integer(supplementingEntityIdString);
                    }
                    String supplementingAssetKey = supplementingBindingElement.getAttributeValue(supplementingBindingElement.getNamespaceName(), "assetKey");
                    supplementingAssetKey = StringEscapeUtils.unescapeXml(supplementingAssetKey);
                    componentBinding = new SupplementedComponentBinding(supplementingEntityId, supplementingAssetKey);
                  }
                  catch (NumberFormatException ex)
                  {
                    logger.error("Could not make Integer from supplementing entity id [id: " + supplementingEntityIdString + "]. Will ignore it!. Property name: " + propertyName);
                    componentBinding = new ComponentBinding();
                  }
                }
                //componentBinding.setId(new Integer(id));
                //componentBinding.setComponentId(componentId);
                componentBinding.setEntityClass(entity);
                componentBinding.setEntityId(new Integer(entityId));
                componentBinding.setAssetKey(assetKey);
                componentBinding.setBindingPath(path);
               
                bindings.add(componentBinding);
              }
     
              property.put("bindings", bindings);
View Full Code Here

            {
              String assignedParameters = "";
              Iterator<ComponentBinding> bindingsIterator = property.getBindings().iterator();
              while(bindingsIterator.hasNext())
              {
                ComponentBinding componentBinding = bindingsIterator.next();
                assignedParameters = "&assignedContentId=" + componentBinding.getEntityId() + "&assignedAssetKey=" + componentBinding.getAssetKey() + "&assignedPath=" + getVisualFormatter().encodeURI(property.getValue());
              }
             
              if(CmsPropertyHandler.getComponentBindningAssetBrowser().equalsIgnoreCase("classic"))
                assignUrl = componentEditorUrl + "ViewContentVersion!viewAssetsForComponentBinding.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + property.getName() + allowedContentTypeIdParameters + "&showSimple=" + getDeliveryContext().getShowSimple() + "&showDecorated=" + showDecorated + assignedParameters + "&hideComponentPropertiesOnLoad=" +hideComponentPropertiesOnLoad + "&keepExisting=" +keepExisting;
              else
View Full Code Here

                else
                  assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showContentTreeForMultipleBindingV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple();
             
                if(componentProperty.getBindings().size() > 0)
                {
                  ComponentBinding firstBinding = componentProperty.getBindings().get(0);
                  title = templateController.getContentPath(firstBinding.getEntityId(), true, true);
                }
              }
              else
              {
                if(componentProperty.getIsAssetBinding())
                {
                  String assignedParameters = "";
                  Iterator<ComponentBinding> bindingsIterator = componentProperty.getBindings().iterator();
                  while(bindingsIterator.hasNext())
                  {
                    ComponentBinding componentBinding = bindingsIterator.next();
                    assignedParameters = "&assignedContentId=" + componentBinding.getEntityId() + "&assignedAssetKey=" + formatter.encodeURI(componentBinding.getAssetKey()) + "&assignedPath=" + formatter.encodeURI(componentProperty.getValue());
                  }
                 
                  if(CmsPropertyHandler.getComponentBindningAssetBrowser().equalsIgnoreCase("classic"))
                    assignUrl = componentEditorUrl + "ViewContentVersion!viewAssetsForComponentBinding.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple() + assignedParameters;
                  else
                    assignUrl = componentEditorUrl + "ViewContentVersion!viewAssetBrowserForComponentBindingV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&assetTypeFilter=" + componentProperty.getAssetMask() + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple() + assignedParameters;
                }
                else
                  assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showContentTreeV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple();

                if(componentProperty.getBindings().size() > 0)
                {
                  ComponentBinding firstBinding = componentProperty.getBindings().get(0);
                  title = templateController.getContentPath(firstBinding.getEntityId(), true, true);
                }
              }
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("SiteNode"))
            {
              if(componentProperty.getIsMultipleBinding())
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showStructureTreeForMultipleBindingV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple();
              else
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showStructureTreeV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple();

              if(componentProperty.getBindings().size() > 0)
              {
                ComponentBinding firstBinding = componentProperty.getBindings().get(0);
                title = templateController.getPagePath(firstBinding.getEntityId(), languageId); // .getContentPath(firstBinding.getEntityId(), true, true);
              }
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("Category"))
            {
              if(componentProperty.getIsMultipleBinding())
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showCategoryTreeForMultipleBinding.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple();
              else
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showCategoryTree.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple();
            }
          }
           
          if(componentProperty.getCreateAction() != null && !componentProperty.getCreateAction().equals(""))
          {
            createUrl = componentEditorUrl + componentProperty.getCreateAction() + "?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + getTemplateController().getDeliveryContext().getShowSimple();
          }
          else
         
            if(componentProperty.getVisualizingAction() != null && !componentProperty.getVisualizingAction().equals(""))
            {
              createUrl = assignUrl;
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("Content"))
            {
                String allowedContentTypeIdParameters = "";
 
                if(componentProperty.getAllowedContentTypeNamesArray() != null && componentProperty.getAllowedContentTypeNamesArray().length > 0)
                {
                    allowedContentTypeIdParameters = "&" + componentProperty.getAllowedContentTypeIdAsUrlEncodedString(templateController.getDatabase());
                    logger.info("allowedContentTypeIdParameters:" + allowedContentTypeIdParameters);
                }
 
                String returnAddress = URLEncoder.encode("ViewSiteNodePageComponents!addComponentPropertyBinding.action?siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=-1&entity=Content&entityId=#entityId&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&path=#path&showSimple=" + this.getTemplateController().getDeliveryContext().getShowSimple() + "", "UTF-8");
             
                  String cancelKey = templateController.getOriginalFullURL();
                  String cancelAddress = (String)CacheController.getCachedObjectFromAdvancedCache("encodedStringsCache", cancelKey);
                  if(cancelAddress == null)
                  {
                    cancelAddress = URLEncoder.encode(cancelKey, "UTF-8");
                    CacheController.cacheObjectInAdvancedCache("encodedStringsCache", cancelKey, cancelAddress);
                  }
 
              if(componentProperty.getIsMultipleBinding())
                createUrl = componentEditorUrl + "CreateContentWizardFinish!V3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + this.getTemplateController().getDeliveryContext().getShowSimple();
              else
                createUrl = componentEditorUrl + "CreateContentWizardFinish!V3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + this.getTemplateController().getDeliveryContext().getShowSimple();
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("SiteNode"))
            {
              //createUrl = null;
 
                String returnAddress = URLEncoder.encode("ViewSiteNodePageComponents!addComponentPropertyBinding.action?siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=-1&entity=Content&entityId=#entityId&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&path=#path&showSimple=" + this.getTemplateController().getDeliveryContext().getShowSimple() + "", "UTF-8");
             
                  String cancelKey = templateController.getOriginalFullURL();
                  String cancelAddress = (String)CacheController.getCachedObjectFromAdvancedCache("encodedStringsCache", cancelKey);
                  if(cancelAddress == null)
                  {
                    cancelAddress = URLEncoder.encode(cancelKey, "UTF-8");
                    CacheController.cacheObjectInAdvancedCache("encodedStringsCache", cancelKey, cancelAddress);
                  }
 
              if(componentProperty.getIsMultipleBinding())
                createUrl = componentEditorUrl + "CreateSiteNodeWizardFinish.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + this.getTemplateController().getDeliveryContext().getShowSimple();
              else
                createUrl = componentEditorUrl + "CreateSiteNodeWizardFinish.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + this.getTemplateController().getDeliveryContext().getShowSimple();
            }
          }
                 
          boolean isPuffContentForPage = false;
          if(componentProperty.getType().equalsIgnoreCase(ComponentProperty.BINDING) && componentProperty.getEntityClass().equalsIgnoreCase("Content") && componentProperty.getIsPuffContentForPage())
            isPuffContentForPage = true;
         
          String dividerClass = "igpropertyDivider";
          if(isPuffContentForPage)
            dividerClass = "";
         
          if(isAdvancedProperties)
            sb.append("    <tr class=\"igtr advancedProperty" + componentId + "\" style='display:none;'>");
          else
            sb.append("    <tr class=\"igtr\">");
         
          sb.append("        <td class=\"igpropertylabel " + dividerClass + "\" valign=\"top\" align=\"left\">" + componentProperty.getDisplayName() + "</td>");
          sb.append("        <td class=\"igpropertyvalue " + dividerClass + "\" align=\"left\">");
 
          if(hasAccessToProperty)
          {
            String warningText = getLocalizedString(locale, "deliver.editOnSight.dirtyWarning");
            sb.append("<a title=\"" + title + "\" class=\"componentEditorLink\" href=\"#\" onclick=\"if(checkDirty('" + warningText + "')){openInlineDivImpl('" + assignUrl + "', 900, 850, true, true);} return false;\">");
          }
 
          String additionalInformation = "";
          if(componentProperty.getIsAssetBinding())
          {
            additionalInformation += " (" + componentProperty.getAssetKey() + ")";
          }
          if(componentProperty.getIsSupplementingEntity())
          {
            additionalInformation += " (" + "*" + ")";
          }
 
          sb.append("" + (componentProperty.getValue() == null || componentProperty.getValue().equalsIgnoreCase("") ? "Undefined" : componentProperty.getValue()) + additionalInformation);
         
          if(hasAccessToProperty)
            sb.append("</a>");
         
          sb.append("</td>");
         
          if(componentProperty.getValue() != null && componentProperty.getValue().equalsIgnoreCase("Undefined"))
          { 
            if(hasAccessToProperty && createUrl != null)
              sb.append("      <td class=\"igtd " + dividerClass + "\" width=\"16\"><a class=\"componentEditorLink\" href=\"#\" onclick=\"openInlineDivImpl('" + createUrl + "', 900, 850, true, true); return false;\"><img src=\"" + componentEditorUrl + "/css/images/createContent.gif\" border=\"0\" alt=\"Create new content to show\"/></a></td>");
            else
              sb.append("      <td class=\"igtd " + dividerClass + "\" width=\"16\">&nbsp;</td>");
          }
          else
          {
            if(hasAccessToProperty)
              sb.append("      <td class=\"igtd " + dividerClass + "\" width=\"16\"><a class=\"componentEditorLink\" href=\"" + componentEditorUrl + "ViewSiteNodePageComponents!deleteComponentPropertyValue.action?siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + this.getTemplateController().getDeliveryContext().getShowSimple() + "\"><img src=\"" + componentEditorUrl + "/css/images/delete.gif\" border=\"0\" style='padding-top: 2px;' alt=\"delete\"/></a></td>");
          }
          sb.append("      <td class=\"igtd " + dividerClass + "\" width=\"16\"><img class=\"questionMark\" src=\"" + componentEditorUrl + "/css/images/questionMarkGrad.gif\" onmouseover=\"javascript:showDiv('helpLayer" + componentProperty.getComponentId() + "_" + formatter.replaceNonAscii(componentProperty.getName(), "_") + "');\" onmouseout=\"javascript:hideDiv('helpLayer" + componentProperty.getComponentId() + "_" + formatter.replaceNonAscii(componentProperty.getName(), "_") + "');\" alt=\"question\"/>" + helpSB + "</td>");
         
          sb.append("    </tr>");
         
          if(isPuffContentForPage && componentProperty.getBindings() != null && componentProperty.getBindings().size() > 0)
          {
            sb.append("  <tr>");

            ComponentBinding binding = componentProperty.getBindings().get(0);
            List referencingPages = templateController.getReferencingPages(binding.getEntityId(), 50, new Boolean(true));
           
            if(referencingPages.size() == 0)
            {
              sb.append("      <td class=\"igpropertylabel igpropertyDivider\" valign=\"top\" align=\"left\">&nbsp;</td><td class=\"igpropertyvalue igpropertyDivider\" valign=\"top\" align=\"left\">");
              sb.append("      " + getLocalizedString(locale, "deliver.editOnSight.noDetailPageWithContentBinding.label"));
View Full Code Here

     
      String entity   = property.attributeValue("entity");
      String entityId = property.attributeValue("entityId");
      String assetKey = property.attributeValue("assetKey");
     
      ComponentBinding componentBinding = new ComponentBinding();
      componentBinding.setEntityClass(entity);
      componentBinding.setEntityId(new Integer(entityId));
      componentBinding.setAssetKey(assetKey);

      componentBindings.add(componentBinding);
    }
   
    return componentBindings;
View Full Code Here

      //logger.info("entityId:" + entityId);
     
      if(entityClass.equalsIgnoreCase("Content"))
      {
        ContentVO contentVO = ContentDeliveryController.getContentDeliveryController().getContentVO(getDatabase(), new Integer(entityId), getDeliveryContext());
        ComponentBinding componentBinding = new ComponentBinding();
        componentBinding.setId(new Integer(id));
        componentBinding.setComponentId(componentId);
        componentBinding.setEntityClass(entityClass);
        componentBinding.setEntityId(new Integer(entityId));
        componentBinding.setAssetKey(assetKey);
        componentBinding.setBindingPath(contentVO.getName());
       
        contentBindings.add(componentBinding);
      }
    }
     
View Full Code Here

                {
                  String assignedParameters = "";
                  Iterator<ComponentBinding> bindingsIterator = componentProperty.getBindings().iterator();
                  while(bindingsIterator.hasNext())
                  {
                    ComponentBinding componentBinding = bindingsIterator.next();
                    assignedParameters = "&assignedContentId=" + componentBinding.getEntityId() + "&assignedAssetKey=" + componentBinding.getAssetKey() + "&assignedPath=" + formatter.encodeURI(componentProperty.getValue());
                  }
                 
                  if(CmsPropertyHandler.getComponentBindningAssetBrowser().equalsIgnoreCase("classic"))
                    assignUrl = componentEditorUrl + "ViewContentVersion!viewAssetsForComponentBindingV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&showSimple=" + showSimple + assignedParameters;
                  else
                    assignUrl = componentEditorUrl + "ViewContentVersion!viewAssetBrowserForComponentBindingV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&assetTypeFilter=" + componentProperty.getAssetMask() + "&showSimple=" + showSimple + assignedParameters;
                }
                else
                  assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showContentTreeV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&showSimple=" + showSimple;
              }
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("SiteNode"))
            {
              if(componentProperty.getIsMultipleBinding())
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showStructureTreeForMultipleBindingV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + showSimple;
              else
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showStructureTreeV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + showSimple;
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("Category"))
            {
              if(componentProperty.getIsMultipleBinding())
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showCategoryTreeForMultipleBindingV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + showSimple;
              else
                assignUrl = componentEditorUrl + "ViewSiteNodePageComponents!showCategoryTreeV3.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + showSimple;
            }
          }
           
          if(componentProperty.getCreateAction() != null && !componentProperty.getCreateAction().equals(""))
          {
            createUrl = componentEditorUrl + componentProperty.getCreateAction() + "?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + showSimple;
          }
          else
         
            if(componentProperty.getVisualizingAction() != null && !componentProperty.getVisualizingAction().equals(""))
            {
              createUrl = assignUrl;
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("Content"))
            {
                String allowedContentTypeIdParameters = "";
 
                if(componentProperty.getAllowedContentTypeNamesArray() != null && componentProperty.getAllowedContentTypeNamesArray().length > 0)
                {
                    allowedContentTypeIdParameters = "&" + componentProperty.getAllowedContentTypeIdAsUrlEncodedString(db);
                }
 
                String returnAddress = URLEncoder.encode("ViewSiteNodePageComponents!addComponentPropertyBinding.action?siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=-1&entity=Content&entityId=#entityId&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&path=#path&showSimple=" + showSimple + "", "UTF-8");
             
                  String cancelKey = originalFullURL;
                  String cancelAddress = (String)CacheController.getCachedObjectFromAdvancedCache("encodedStringsCache", cancelKey);
                  if(cancelAddress == null)
                  {
                    cancelAddress = URLEncoder.encode(cancelKey, "UTF-8");
                    CacheController.cacheObjectInAdvancedCache("encodedStringsCache", cancelKey, cancelAddress);
                  }
 
              if(componentProperty.getIsMultipleBinding())
                createUrl = componentEditorUrl + "CreateContentWizardFinish.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + showSimple;
              else
                createUrl = componentEditorUrl + "CreateContentWizardFinish.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + allowedContentTypeIdParameters + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + showSimple;
            }
            else if(componentProperty.getEntityClass().equalsIgnoreCase("SiteNode"))
            {
                String returnAddress = URLEncoder.encode("ViewSiteNodePageComponents!addComponentPropertyBinding.action?siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=-1&entity=Content&entityId=#entityId&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&path=#path&showSimple=" + showSimple + "", "UTF-8");
             
                  String cancelKey = originalFullURL;
                  String cancelAddress = (String)CacheController.getCachedObjectFromAdvancedCache("encodedStringsCache", cancelKey);
                  if(cancelAddress == null)
                  {
                    cancelAddress = URLEncoder.encode(cancelKey, "UTF-8");
                    CacheController.cacheObjectInAdvancedCache("encodedStringsCache", cancelKey, cancelAddress);
                  }
 
              if(componentProperty.getIsMultipleBinding())
                createUrl = componentEditorUrl + "CreateSiteNodeWizardFinish.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + showSimple;
              else
                createUrl = componentEditorUrl + "CreateSiteNodeWizardFinish.action?repositoryId=" + repositoryId + "&siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&refreshAddress=" + returnAddress + "&cancelAddress=" + cancelAddress + "&showSimple=" + showSimple;
            }
          }
         
          boolean isPuffContentForPage = false;
          if(componentProperty.getType().equalsIgnoreCase(ComponentProperty.BINDING) && componentProperty.getEntityClass().equalsIgnoreCase("Content") && componentProperty.getIsPuffContentForPage())
            isPuffContentForPage = true;

          if(isAdvancedProperties)
            sb.append("  <div class=\"propertyRow advancedProperty" + componentId + "\" style='display:none;'>");
          else
            sb.append("  <div class=\"propertyRow\"" + (isPuffContentForPage ? " style='border-bottom: 0px;'" : "") + ">");
         
          sb.append("      <div class=\"propertyRowLeft\">");
          sb.append("        <label for=\"" + componentProperty.getName() + "\">" + componentProperty.getDisplayName() + "</label>");
          sb.append("      </div>");
 
          sb.append("      <div class=\"propertyRowRight\">");
         
          if(hasAccessToProperty)
          {
            String warningText = getLocalizedString(locale, "deliver.editOnSight.dirtyWarning");
            sb.append("      <div class=\"fieldGroup\">");                 
            sb.append("        <a name=\"" + componentProperty.getName() + "\" class=\"componentEditorLink\" href=\"javascript:openAssignDialog('" + warningText + "', '" + assignUrl +"');\">");
          }
         
          sb.append("          " + (componentProperty.getValue() == null || componentProperty.getValue().equalsIgnoreCase("") ? componentProperty.getDefaultValue() : componentProperty.getValue()) + (componentProperty.getIsAssetBinding() ? " (" + componentProperty.getAssetKey() + ")" : ""));
         
          if(hasAccessToProperty)
          {
            sb.append("        </a>");
            sb.append("      </div>");
          }       
         
          sb.append("        <div class=\"actionGroup\">");
          if(componentProperty.getValue() != null && componentProperty.getValue().equalsIgnoreCase("Undefined"))
          { 
            if(hasAccessToProperty && createUrl != null)
            {
              sb.append("      <a class=\"componentEditorLink\" href=\"" + createUrl + "\"><img src=\"" + componentEditorUrl + "/css/images/createContent.gif\" border=\"0\" alt=\"Create new content to show\"></a>");
            }
          }
          else
          {
            if(hasAccessToProperty)
            {
              sb.append("      <a class=\"componentEditorLink\" href=\"" + componentEditorUrl + "ViewSiteNodePageComponents!deleteComponentPropertyValue.action?siteNodeId=" + siteNodeId + "&languageId=" + languageId + "&contentId=" + contentId + "&componentId=" + componentId + "&propertyName=" + componentProperty.getName() + "&showSimple=" + showSimple + "\"><img src=\"" + componentEditorUrl + "/css/images/delete.gif\" border=\"0\"/></a>");
            }
          }
          sb.append("      </div>");
          sb.append("      </div>");
 
          sb.append("    </div>");
         
          if(isPuffContentForPage && componentProperty.getBindings() != null && componentProperty.getBindings().size() > 0)
          {
            sb.append("  <div class=\"propertyRow\">");
           
            ComponentBinding binding = componentProperty.getBindings().get(0);
            List referencingPages = getReferencingPages(binding.getEntityId(), siteNodeId, 50, new Boolean(true), db);
           
            if(referencingPages.size() == 0)
            {
              sb.append("  <div class=\"propertyRowLeft\">");
              sb.append("    <label>" + getLocalizedString(locale, "deliver.editOnSight.noDetailPageWithContentBinding.label") + "</label>");
View Full Code Here

     
      String entity   = property.attributeValue("entity");
      String entityId = property.attributeValue("entityId");
      String assetKey = property.attributeValue("assetKey");
     
      ComponentBinding componentBinding = new ComponentBinding();
      componentBinding.setEntityClass(entity);
      componentBinding.setEntityId(new Integer(entityId));
      componentBinding.setAssetKey(assetKey);

      componentBindings.add(componentBinding);
    }
   
    return componentBindings;
View Full Code Here

                Element bindingElement = (Element)bindingNodeListIterator.next();
                String entity = bindingElement.attributeValue("entity");
                String entityId = bindingElement.attributeValue("entityId");
                String assetKey = bindingElement.attributeValue("assetKey");

                ComponentBinding componentBinding = new ComponentBinding();
                //componentBinding.setId(new Integer(id));
                //componentBinding.setComponentId(componentId);
                componentBinding.setEntityClass(entity);
                componentBinding.setEntityId(new Integer(entityId));
                componentBinding.setAssetKey(assetKey);
                componentBinding.setBindingPath(path);
               
                bindings.add(componentBinding);
              }
     
              property.put("bindings", bindings);
View Full Code Here

TOP

Related Classes of org.infoglue.deliver.applications.databeans.ComponentBinding

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.