Class CopyThread
The copy thread is used to create a thread when during page copying. This class supports the EPiServer infrastructure and is not intended to be used directly from your code.
Inheritance
Inherited Members
Namespace: EPiServer.Core.Transfer
Assembly: EPiServer.dll
Version: 7.19.2Syntax
[Obsolete("Use class EPiServer.Enterprise.Transfer.PageCopyHandler, EPiServer.Enterprise", false)]
public class CopyThread
Constructors
CopyThread(IPrincipal, PageReference, IPageTransferContext, AccessLevel, AccessLevel, Boolean)
Initializes a new instance of the CopyThread class.
Declaration
public CopyThread(IPrincipal user, PageReference pageToCopy, IPageTransferContext context, AccessLevel requiredSourceAccess, AccessLevel requiredDestinationAccess, bool publishOnDestination)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IPrincipal | user | The user to use when copying the pages. |
PageReference | pageToCopy | The page to copy. |
IPageTransferContext | context | The tansfer context. |
AccessLevel | requiredSourceAccess | The required source access. |
AccessLevel | requiredDestinationAccess | The required destination access. |
System.Boolean | publishOnDestination | if set to |
CopyThread(IPrincipal, PageReference, IPageTransferContext, AccessLevel, AccessLevel, Boolean, IContentRepository, IPermanentLinkMapper)
Initializes a new instance of the CopyThread class.
Declaration
public CopyThread(IPrincipal user, PageReference pageToCopy, IPageTransferContext context, AccessLevel requiredSourceAccess, AccessLevel requiredDestinationAccess, bool publishOnDestination, IContentRepository contentRepository, IPermanentLinkMapper permanentLinkMapper)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IPrincipal | user | The user to use when copying the pages. |
PageReference | pageToCopy | The page to copy. |
IPageTransferContext | context | The tansfer context. |
AccessLevel | requiredSourceAccess | The required source access. |
AccessLevel | requiredDestinationAccess | The required destination access. |
System.Boolean | publishOnDestination | if set to |
IContentRepository | contentRepository | The IContentRepository instance to use |
IPermanentLinkMapper | permanentLinkMapper | The permanent link mapper to use |
Fields
CopiedPage
When a page is copied the CopiedPage thread event is set.
Declaration
public ManualResetEvent CopiedPage
Field Value
Type | Description |
---|---|
System.Threading.ManualResetEvent |
Methods
Copy()
The main page copy function.
Declaration
public PageReference Copy()
Returns
Type | Description |
---|---|
PageReference |
CreatePathForFile(VirtualPathUnifiedProvider, String)
Creates the physical path for file.
Declaration
public static UnifiedDirectory CreatePathForFile(VirtualPathUnifiedProvider provider, string providerRelativePath)
Parameters
Type | Name | Description |
---|---|---|
VirtualPathUnifiedProvider | provider | The provider to create path for. |
System.String | providerRelativePath | The provider relative path. |
Returns
Type | Description |
---|---|
UnifiedDirectory | The created directory. |
FillPageGuidMap(IList<PageReference>, IPageTransferContext)
This member supports the EPiServer infrastructure and is not intended to be used directly from your code.
Declaration
protected void FillPageGuidMap(IList<PageReference> pagesToCopy, IPageTransferContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<PageReference> | pagesToCopy | |
IPageTransferContext | context |
GetPagesToCopy(PageReference, AccessLevel)
Gets a list of pages to copy.
Declaration
public IList<PageReference> GetPagesToCopy(PageReference pageToCopy, AccessLevel requiredSourceAccess)
Parameters
Type | Name | Description |
---|---|---|
PageReference | pageToCopy | A reference to the root page to copy. |
AccessLevel | requiredSourceAccess | The required source access. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<PageReference> | A List of page references to copy. |
GetThreadsForUser(String)
Gets the threads transfer context for a user.
Declaration
public static Dictionary<DateTime, IPageTransferContext> GetThreadsForUser(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | Name of the user. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.DateTime, IPageTransferContext> | A list of IPageTransferContext. |
ThreadProc(Object)
The static function to attach a thread with QueueUserWorkItem function.
Declaration
public static void ThreadProc(object state)
Parameters
Type | Name | Description |
---|---|---|
System.Object | state | The CopyThread to work with. |
TryRemoveThread(String, DateTime)
Tries the remove a thread from a user.
Declaration
public static bool TryRemoveThread(string userName, DateTime timestamp)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | Name of the user. |
System.DateTime | timestamp | The timestamp for the thread. |
Returns
Type | Description |
---|---|
System.Boolean | True if a thread is removed for that user; else false |