コード例 #1
0
 /// <summary>
 /// Maps the current <see cref="TcmUri" /> instance to the given publication <see cref="TcmUri" />.
 /// </summary>
 /// <param name="publicationUri">The publication URI.</param>
 /// <returns></returns>
 public void MapUri(TcmUri publicationUri)
 {
     if (this.IsNull || (publicationUri == null || publicationUri.IsNull))
         return;
     else
         this.PublicationId = publicationUri.ItemId;
 }
コード例 #2
0
ファイル: Group.cs プロジェクト: TcmExtensions/TcmCoreService
 /// <summary>
 /// Initializes a new instance of the <see cref="Group"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Group(Client client, TcmUri uri)
     : this(client, client.Read<GroupData>(uri))
 {
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Activity"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Activity(Client client, TcmUri uri)
     : this(client, client.Read<ActivityData>(uri))
 {
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Process"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Process(Client client, TcmUri uri)
     : this(client, client.Read<ProcessData>(uri))
 {
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PublishingTarget"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal PublishingTarget(Client client, TcmUri uri)
     : this(client, client.Read<PublishingTargetData>(uri))
 {
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IdentifiableObject"/> class.
 /// </summary>
 /// <param name="session"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal IdentifiableObject(Client client, TcmUri uri)
     : this(client, client.Read<IdentifiableObjectData>(uri))
 {
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TargetType"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal TargetType(Client client, TcmUri uri)
     : this(client, client.Read<TargetTypeData>(uri))
 {
 }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VersionedItem" /> class.
 /// </summary>
 /// <param name="session"><see cref="T:TcmCoreService.Session" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal VersionedItem(Session session, TcmUri uri)
     : this(session, session.Read<VersionedItemData>(uri))
 {
 }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Template"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Template(Client client, TcmUri uri)
     : this(client, client.Read<TemplateData>(uri))
 {
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Schema"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Schema(Client client, TcmUri uri)
     : this(client, client.Read<SchemaData>(uri))
 {
 }
コード例 #11
0
ファイル: User.cs プロジェクト: TcmExtensions/TcmCoreService
 /// <summary>
 /// Initializes a new instance of the <see cref="User"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal User(Client client, TcmUri uri)
     : this(client, client.Read<UserData>(uri))
 {
 }
コード例 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApprovalStatus"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal ApprovalStatus(Client client, TcmUri uri)
     : this(client, client.Read<ApprovalStatusData>(uri))
 {
 }
コード例 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BluePrintNode"/> class.
 /// </summary>
 /// <param name="session"><see cref="T:TcmCoreService.Session" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal BluePrintNode(Session session, TcmUri uri)
     : this(session, session.Read<BluePrintNodeData>(uri))
 {
 }
コード例 #14
0
        /// <summary>
        /// Maps the current <see cref="TcmUri" /> instance to the given publication URI.
        /// </summary>
        /// <param name="publicationUri">The publication URI.</param>
        /// <returns></returns>
        public void MapUri(String publicationUri)
        {
            if (this.IsNull)
                return;

            if (String.IsNullOrEmpty(publicationUri))
                return;
            else
            {
                TcmUri pub = new TcmUri(publicationUri);
                MapUri(pub);
            }
        }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Repository"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Repository(Client client, TcmUri uri)
     : this(client, client.Read<RepositoryData>(uri))
 {
 }
コード例 #16
0
        /// <summary>
        /// Upload a file to Tridion from a Tridion multimedia component or binary TBB
        /// </summary>
        /// <param name="item"><see cref="T:EGIT.CCIT.Tridion.CoreService.TcmUri"/> of the binary Tridion item.</param>
        /// <returns><see cref="T:System.IO.Stream" /> containing the binary data from Tridion</returns>
        public Stream DownloadFile(TcmUri item)
        {
            StreamDownloadClient client = null;

            try
            {
                client = DownloadClient;
                return client.DownloadBinaryContent(item);
            }
            finally
            {
                if (client != null)
                    if (client.State == CommunicationState.Faulted)
                        client.Abort();
                    else
                        client.Close();
            }
        }
コード例 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Component"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Component(Client client, TcmUri uri)
     : this(client, client.Read<ComponentData>(uri))
 {
 }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualFolder"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal VirtualFolder(Client client, TcmUri uri)
     : this(client, client.Read<VirtualFolderData>(uri))
 {
 }
コード例 #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SystemWideObject"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal SystemWideObject(Client client, TcmUri uri)
     : this(client, client.Read<SystemWideObjectData>(uri))
 {
 }
コード例 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityDefinition"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal ActivityDefinition(Client client, TcmUri uri)
     : this(client, client.Read<ActivityDefinitionData>(uri))
 {
 }
コード例 #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Publication"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Publication(Client client, TcmUri uri)
     : this(client, client.Read<PublicationData>(uri))
 {
 }
コード例 #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessDefinitionAssociation"/> class.
 /// </summary>
 /// <param name="session"><see cref="T:TcmCoreService.Session" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal ProcessDefinitionAssociation(Session session, TcmUri uri)
     : this(session, session.Read<ProcessDefinitionAssociationData>(uri))
 {
 }
コード例 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkItem"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal WorkItem(Client client, TcmUri uri)
     : this(client, client.Read<WorkItemData>(uri))
 {
 }
コード例 #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrganizationalItem" /> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal OrganizationalItem(Client client, TcmUri uri)
     : this(client, client.Read<OrganizationalItemData>(uri))
 {
 }
コード例 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Trustee"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal Trustee(Client client, TcmUri uri)
     : this(client, client.Read<TrusteeData>(uri))
 {
 }
コード例 #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RepositoryLocalObject"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal RepositoryLocalObject(Client client, TcmUri uri)
     : this(client, client.Read<RepositoryLocalObjectData>(uri))
 {
 }
コード例 #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ComponentTemplate"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal ComponentTemplate(Client client, TcmUri uri)
     : this(client, client.Read<ComponentTemplateData>(uri))
 {
 }
コード例 #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessDefinition"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal ProcessDefinition(Client client, TcmUri uri)
     : this(client, client.Read<ProcessDefinitionData>(uri))
 {
 }
コード例 #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultimediaType"/> class.
 /// </summary>
 /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
 /// <param name="uri"><see cref="T:TcmCoreService.Misc.TcmUri" /></param>
 internal MultimediaType(Client client, TcmUri uri)
     : this(client, client.Read<MultimediaTypeData>(uri))
 {
 }
コード例 #30
0
        /// <summary>
        /// Maps the given item uri to the passed publication uri
        /// </summary>
        /// <param name="uri">The URI.</param>
        /// <param name="publicationUri">The publication URI.</param>
        /// <returns></returns>
        public static String MapUri(String uri, String publicationUri)
        {
            if (String.IsNullOrEmpty(publicationUri))
                return uri;
            else
            {
                TcmUri res = new TcmUri(uri);

                if (res.IsNull)
                    return uri;

                res.MapUri(publicationUri);
                return res.ToString();
            }
        }