Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TargetType"/> class.
        /// </summary>
        /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
        /// <param name="targetTypeData"><see cref="T:Tridion.ContentManager.CoreService.Client.TargetTypeData" /></param>
        protected TargetType(Client client, TargetTypeData targetTypeData)
            : base(client, targetTypeData)
        {
            if (targetTypeData == null)
                throw new ArgumentNullException("targetTypeData");

            mTargetTypeData = targetTypeData;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TargetType"/> class.
        /// </summary>
        /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
        /// <param name="targetTypeData"><see cref="T:Tridion.ContentManager.CoreService.Client.TargetTypeData" /></param>
        protected TargetType(Client client, TargetTypeData targetTypeData) : base(client, targetTypeData)
        {
            if (targetTypeData == null)
            {
                throw new ArgumentNullException("targetTypeData");
            }

            mTargetTypeData = targetTypeData;
        }
        public static TargetTypeResult From(TargetTypeData item)
        {
            var result = new TargetTypeResult
            {
                Description = TextEntry.From(item.Description, Resources.LabelDescription)
            };

            AddCommonProperties(item, result);
            return(result);
        }
Esempio n. 4
0
        public static TargetTypeResult From(TargetTypeData item)
        {
            var result = new TargetTypeResult
            {
                Description = TextEntry.From(item.Description, Resources.LabelDescription)
            };

            AddCommonProperties(item, result);
            return result;
        }
Esempio n. 5
0
        /// <summary>
        /// Reload the <see cref="TargetType" /> with the specified <see cref="T:Tridion.ContentManager.CoreService.Client.TargetTypeData" />
        /// </summary>
        /// <param name="targetTypeData"><see cref="T:Tridion.ContentManager.CoreService.Client.TargetTypeData" /></param>
        protected void Reload(TargetTypeData targetTypeData)
        {
            if (targetTypeData == null)
            {
                throw new ArgumentNullException("targetTypeData");
            }

            mTargetTypeData = targetTypeData;
            base.Reload(targetTypeData);

            mAccessControlList = null;
        }
        internal void CreatePublicationTarget(XElement site, WebsiteHelper.TargetLanguage language)
        {
            string targetName   = site.Element("Name").Value;
            string targetTypeId = TcmUri.UriNull;
            string url          = string.Empty;

            if (language == WebsiteHelper.TargetLanguage.Aspnet || language == WebsiteHelper.TargetLanguage.REL)
            {
                url = "http://localhost:" + site.Element("Port").Value + "/httpupload.aspx";
            }
            else if (language == WebsiteHelper.TargetLanguage.Jsp)
            {
                url = "http://localhost:" + site.Element("Port").Value + "/" + site.Element("ContextRoot").Value + "/httpupload";
            }


            TargetTypesFilterData filter = new TargetTypesFilterData();

            //filter.ForRepository.IdRef = Configuration.WebsitePublicationId;
            foreach (XElement node in _client.GetSystemWideListXml(filter).Nodes())
            {
                if (node.Attribute("Title").Value.Equals(targetName))
                {
                    targetTypeId = node.Attribute("ID").Value;
                    break;
                }
            }
            if (targetTypeId.Equals(TcmUri.UriNull))
            {
                TargetTypeData targetType =
                    (TargetTypeData)_client.GetDefaultData(ItemType.TargetType, null);
                targetType.Title       = targetName;
                targetType.Description = targetName;
                targetType             = (TargetTypeData)_client.Save(targetType, _readOptions);
                targetTypeId           = targetType.Id;
            }

            PublicationTargetsFilterData pFilter = new PublicationTargetsFilterData();
            string pTargetId = TcmUri.UriNull;

            foreach (XElement node in _client.GetSystemWideListXml(pFilter).Nodes())
            {
                if (node.Attribute("Title").Value.Equals(targetName))
                {
                    pTargetId = node.Attribute("ID").Value;
                    break;
                }
            }
            if (pTargetId.Equals(TcmUri.UriNull))
            {
                PublicationTargetData pt =
                    (PublicationTargetData)_client.GetDefaultData(ItemType.PublicationTarget, null);
                pt.Title        = targetName;
                pt.Description  = targetName;
                pt.Publications = new[] { new LinkToPublicationData {
                                              IdRef = Configuration.WebsitePublicationId
                                          } };
                pt.TargetTypes = new[] { new LinkToTargetTypeData {
                                             IdRef = targetTypeId
                                         } };

                SchemaData protocolSchema = (SchemaData)_client.Read("/webdav//HTTPS.xsd", _readOptions);

                //_client.GetSystemWideListXml()

                TargetDestinationData destination = new TargetDestinationData
                {
                    ProtocolSchema = new LinkToSchemaData {
                        IdRef = protocolSchema.Id
                    },
                    Title        = targetName,
                    ProtocolData =
                        "<HTTPS xmlns=\"" + protocolSchema.NamespaceUri + "\"><UserName>notused</UserName><Password>notused</Password><URL>" +
                        url + "</URL></HTTPS>"
                };
                pt.Destinations = new[] { destination };
                if (language == WebsiteHelper.TargetLanguage.Aspnet)
                {
                    pt.TargetLanguage = "ASP.NET";
                }
                else
                {
                    pt.TargetLanguage = "JSP";
                }

                _client.Save(pt, null);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Reload the <see cref="TargetType" /> with the specified <see cref="T:Tridion.ContentManager.CoreService.Client.TargetTypeData" />
        /// </summary>
        /// <param name="targetTypeData"><see cref="T:Tridion.ContentManager.CoreService.Client.TargetTypeData" /></param>
        protected void Reload(TargetTypeData targetTypeData)
        {
            if (targetTypeData == null)
                throw new ArgumentNullException("targetTypeData");

            mTargetTypeData = targetTypeData;
            base.Reload(targetTypeData);

            mAccessControlList = null;
        }