Advertisement
Guest User

Untitled

a guest
Jul 5th, 2011
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. using EPiServer.PlugIn;
  7. using Vitrolife.ContentImport.Entities;
  8. using System.Web;
  9. using EPiServer.Security;
  10. using System.Security.Principal;
  11.  
  12. namespace ClassName.ContentImport.EpiSchedulerPlugIns {
  13.     [ScheduledPlugIn(DisplayName = "Content Import", Description = "Import data, create epi-pages")]
  14.     public class ContentImportPlugIn {
  15.         public static string Execute() {
  16.  
  17.             if (HttpContext.Current == null)
  18.             {
  19.                 PrincipalInfo.CurrentPrincipal = new GenericPrincipal(
  20.                     new GenericIdentity("Content Import"),
  21.                     new[] { "Administrators" });
  22.             }
  23.  
  24.  
  25.             Manager man = new Manager();
  26.             man.CreateContent();
  27.  
  28.             StringBuilder sbResult = new StringBuilder();
  29.             foreach (Status stat in man.StatusMsg) {
  30.                 sbResult.AppendFormat("{0} {1}, Src:{2}, Type:{3}, EpiDestID:{4}, EpiDestLang:{5}; <br />"
  31.                     , stat.IsError ? "ERROR" : "OK"
  32.                     , stat.Msg
  33.                     , stat.ContentSetting.SrcUrl
  34.                     , stat.ContentSetting.SrcType
  35.                     , stat.ContentSetting.EpiDestID
  36.                     , stat.ContentSetting.EpiDestLang
  37.                     );
  38.             }
  39.            
  40.             man = null;
  41.  
  42.             return sbResult.ToString();
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement