GetImageFieldData() public method

public GetImageFieldData ( ) : SenseNet.ContentRepository.Fields.ImageField.ImageFieldData
return SenseNet.ContentRepository.Fields.ImageField.ImageFieldData
Ejemplo n.º 1
0
        public static void ImportPortlet(PortletInventoryItem portlet, IEnumerable <Node> repoPortlets)
        {
            var nameText    = SenseNetResourceManager.Current.GetString(portlet.Portlet.Name);
            var portletName = GetValidName(nameText, false);

            // check if already exists
            if (repoPortlets.Any(c => c.Name == portletName))
            {
                return;
            }

            // create portlet node
            var categoryNode = Node.LoadNode(RepositoryPath.Combine(PortletsFolderPath, GetValidName(portlet.Portlet.Category.Title)));

            if (categoryNode == null)
            {
                return;
            }

            var portletNode = Content.CreateNew("Portlet", categoryNode, portlet.Portlet.GetType().Name);

            portletNode["DisplayName"] = portlet.Portlet.Name;
            portletNode["Description"] = portlet.Portlet.Description;
            portletNode["TypeName"]    = GetPortletTypeName(portlet.Portlet.GetType());
            var imageData = portlet.GetImageFieldData(portletNode.Fields["PortletImage"]);

            if (imageData != null)
            {
                portletNode["PortletImage"] = imageData;
            }
            portletNode.Save();
        }
Ejemplo n.º 2
0
        public static void ImportPortlet(PortletInventoryItem portlet, IEnumerable<Node> repoPortlets)
        {
            var portletName = GetValidName(portlet.Portlet.Name);
            
            // check if already exists
            if (repoPortlets.Any(c => c.Name == portletName))
                return;

            // create portlet node
            var categoryNode = Node.LoadNode(RepositoryPath.Combine(PortletsFolderPath, GetValidName(portlet.Portlet.Category.Title)));
            if (categoryNode == null)
                return;

            var portletNode = Content.CreateNew("Portlet", categoryNode, portletName);
            portletNode["DisplayName"] = portlet.Portlet.Name;
            portletNode["Description"] = portlet.Portlet.Description;
            portletNode["TypeName"] = GetPortletTypeName(portlet.Portlet.GetType());
            var imageData = portlet.GetImageFieldData();
            if (imageData != null)
                portletNode["PortletImage"] = imageData;
            portletNode.Save();
        }