2012-06-01 24 views
5

我正在爲Tridion 2009 SP 1編寫一個自定義頁面,該頁面基於查詢字符串發佈頁面,該頁面將從計劃任務調用。Tridion 2009 SP1:使用TDSE的自定義頁面。發佈頁面停留在發佈隊列中

我使用下面的代碼:

string pageId = Request.QueryString["page_id"]; 
string targetId = Request.QueryString["publication_target_id"]; 

if (string.IsNullOrEmpty(pageId)) 
{ 
    Response.Write("This page is intended to be called automatically with a " + 
       + "page id and publication target id"); 
    return; 
} 

TDSE tdse = new TDSE(); 
string publicationId = pageId.Split('-')[0].Substring(4); 
var publication = tdse.GetPublication("tcm:0-" + publicationId + "-1"); 
var page = tdse.GetPage(pageId, publication); 
var target = tdse.GetPublicationTarget(targetId); 
page.Publish(target, true, false, true); 

Response.Write("Successfully published " + page.Title + " to " + target.Title); 

這似乎是工作,我可以看到在隊列中的頁面(S),但他們仍然在「進行中」狀態。

我仍然可以手動發佈網頁,不存在任何問題。

部署者日誌顯示它沒有收到工作,但是我可以看到c:\ tridion \ work文件夾中的項目(我正在使用本地文件系統pub目標)。

任何想法?

更新:這裏是當出版商是運行像TcmPublisher /調試

01/06/2012 14:34:17 <5440> [Publisher]    Queue message [769571] is retrieved from Queue consumer handler for PublishQueue 
01/06/2012 14:34:17 <4896> [Publisher]    Queue message handler for PublishQueue [0] working on queue message 769571 
01/06/2012 14:34:17 <4896> [DefaultPublishTransactionHandler] Handling publish transaction [tcm:0-93950-66560] 
01/06/2012 14:34:17 <4896> [DefaultPublishTransactionHandler] Publishing item [tcm:32-206093-64] from publication [tcm:0-32-1] to target [tcm:0-1-65537] 
01/06/2012 14:34:17 <4896> [Transporting]   Storage location: c:\tridion\incoming\tcm_0-93950-66560.Content\ 
01/06/2012 14:34:17 <4896> [Resolve engine]    Getting resolver(s) for item type Tridion.ContentManager.CommunicationManagement.Page 
01/06/2012 14:34:17 <4896> [Resolve engine]    Using resolver [Tridion.ContentManager.Publishing.Legacy.Resolving.PageResolver] 
01/06/2012 14:34:17 <4896> [Legacy resolving]   Resolving the page [tcm:32-206093-64] took 00:00:00.0136441 
01/06/2012 14:34:17 <4896> [Legacy resolving]   Resolved page [tcm:32-206093-64] with title 'Website Redirects' 
01/06/2012 14:34:17 <4896> [DefaultPublishTransactionHandler] Resolving took: 00:00:00.0468768 
01/06/2012 14:34:17 <4896> [Render engine]    Getting renderer(s) for item type Tridion.ContentManager.CommunicationManagement.Page and template type CompoundTemplate 
01/06/2012 14:34:17 <4896> [Render engine]    Using renderer [Tridion.ContentManager.Templating.TemplatingRenderer] 
01/06/2012 14:34:17 <4896> [Render engine]    Getting renderer(s) for item type Tridion.ContentManager.ContentManagement.Component and template type CompoundTemplate 
01/06/2012 14:34:17 <4896> [Render engine]    Using renderer [Tridion.ContentManager.Templating.TemplatingRenderer] 
01/06/2012 14:34:17 <4896> [Render engine]    Rendering took: 00:00:00.2469570 
01/06/2012 14:34:17 <4896> [Render engine]    Emmbed the result of this rendered component presentation with a tcdl:ComponentPresentation link for component [tcm:32-206079] with template [tcm:32-206080-32] 
01/06/2012 14:34:17 <4896> [Render engine]    Rendering took: 00:00:00.3473678 
01/06/2012 14:34:17 <4896> [Transporting]   Adding rendered item to the transport package: item [tcm:32-206093-64] 'Website Redirects' with template [tcm:32-206092-128] 'z_Htaccess Template' 
01/06/2012 14:34:17 <4896> [Transporting]   Using transport package handler: Tridion.ContentManager.Publishing.Transporting.DefaultPageHandler 
01/06/2012 14:34:17 <4896> [Transporting]   Adding Page tcm:32-206093-64 to the transport package for publishing 
01/06/2012 14:34:17 <4896> [Transporting]   Writing file: c:\tridion\incoming\tcm_0-93950-66560.Content\Pages\site\us\redirects.htaccess 
01/06/2012 14:34:18 <4896> [Transporting]   Adding rendered item to the transport package: item [tcm:32-206079] 'Redirects' with template [tcm:32-206080-32] 'HtAccess Url Redirects' 
01/06/2012 14:34:18 <4896> [Transporting]   Using transport package handler: Tridion.ContentManager.Publishing.Transporting.DefaultComponentHandler 
01/06/2012 14:34:18 <4896> [Transporting]   Add component [tcm:32-206079] with template [tcm:32-206080-32] to the transport package for publishing 
01/06/2012 14:34:18 <4896> [Transporting]   Add schema [tcm:32-190-8] to the transport package for publishing 
01/06/2012 14:34:18 <4896> [Transporting]   Building path for No (tcm:3-64-1024) 
01/06/2012 14:34:18 <4896> [Transporting]   Building path for Yes (tcm:3-63-1024) 
01/06/2012 14:34:18 <4896> [Transporting]   Add binary [tcm:0-0-0] with filename '.htaccess' and path '\site\us\.htaccess' to the transport package for publishing 
01/06/2012 14:34:18 <4896> [DefaultPublishTransactionHandler] Updating the publish transaction with the list of processed items 
01/06/2012 14:34:18 <4896> [Transporting]   Saving the transport package 
01/06/2012 14:34:18 <4896> Sending deploy control [Commit] for transaction [tcm:0-93950-66560] to deployer. 
01/06/2012 14:34:18 <4896> [DefaultPublishTransactionHandler] Publish transaction took 00:00:00.6889970 
01/06/2012 14:34:18 <4896> [Publisher]    Cache statistics: SimpleCache: 14 Regions, 17 Objects, 20 Hits, 17 Misses 
01/06/2012 14:34:18 <4896> Region 'Component': 1 Objects, 6 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'PublishTransaction': 1 Objects, 1 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'PublicationTarget': 1 Objects, 0 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'Page': 1 Objects, 3 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'Publication': 1 Objects, 0 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'Tdse': 1 Objects, 0 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'User': 1 Objects, 0 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'PageTemplate': 1 Objects, 2 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'TemplateBuildingBlock': 3 Objects, 5 Hits, 3 Misses. 
01/06/2012 14:34:18 <4896> Region 'ComponentTemplate': 1 Objects, 2 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'StructureGroup': 1 Objects, 0 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'Schema': 1 Objects, 0 Hits, 1 Misses. 
01/06/2012 14:34:18 <4896> Region 'Keyword': 2 Objects, 0 Hits, 2 Misses. 
01/06/2012 14:34:18 <4896> Region 'Category': 1 Objects, 1 Hits, 1 Misses. 
01/06/2012 14:34:18 <5440> [Publisher]    Deleting queue message: 769571 from Queue consumer handler for PublishQueue 
+0

因此,它正常呈現,將其發送給部署者,而部署者對此無能爲力?這真的很奇怪。 它與.htaccess文件名有什麼關係?我想知道部署人員在那裏試圖做什麼,你可以嘗試發佈具有不同名稱的東西,看看它是不同的嗎? –

+0

嗨Nuno,這就是它的樣子。我用我的站點地圖文件嘗試了相同的結果,所以不要認爲它是.htaccess。正如我所說,我可以從CME發佈兩個罰款。感覺我在代碼中丟失了一個參數或者什麼? –

+0

您可以嘗試指定發佈和部署時間,沿着這些行: Page.Publish(target,true,false,true,DateTime。現在,DateTime.MinValue,DateTime.Now); –

回答

4

這是非常奇怪的發佈日誌,我無法理解的區別是什麼。

您是否嘗試過啓用發佈者日誌?或者甚至更好,以調試模式運行發佈器(tcmpublisher/debug)並嘗試弄清楚發生了什麼。由於它被卡住「進行中」,發佈商有可能對此負責。

+0

Hi Nuno,不確定發生了什麼變化,但現在它在服務器重啓後正在工作。 –

1

「我可以看到c:\ tridion \ work文件夾中的項目」 - 您看到解壓縮的傳輸包或其他內容嗎?

你有部署者在DEBUG中登錄嗎?

+0

我可以看到我認爲的解壓縮運輸包。部署者正在登錄調試。 –

+0

如果您發佈一個基本的html頁面,沒有二進制文件,您的自定義頁面是否可以正常發佈? 我的問題將在二進制'.htaccess'。雖然我會期待和錯誤,但這有點不尋常。 – JRW

+0

不,與其他頁面的結果相同。 –

2

我的直接懷疑是你在CM方面做了一些不同的事情。否則,很難說明手動發佈的成功。

你說你可以手動發佈頁面沒有問題。你能確認它是否適用於相同的通過自定義頁面失敗的頁面?

當然下一個問題是出版物的目標是否相同。當您手動發佈時,您當然選擇了目標類型,但是在使用API​​時,您可以選擇目標類型或發佈目標。文字說你應該使用發佈目標。你是?是否與您手動使用的目標類型相同的發佈目標? (當然,到達部署者日誌時,只有一個發佈目標。)

您已指定ActivateBlueprinting和RollbackOnFailure。這些設置是否反映了您在手動測試中所做的工作? (出版物32是你發佈的還是孩子?)

+0

是的,相同的頁面發佈的很好。我嘗試過使用自定義頁面沒有成功的其他頁面,所以我相當確定你是對的,只是不知道在哪裏!我會仔細檢查所有的設置。 –

相關問題