2012-06-03 90 views
2

我已經爲用戶生成的內容配置了Tridion,並使用默認/ demo模板創建了一個網頁,該模板使用文本輸入字段提供評論作者的名稱。評論被接受,但是當顯示時他們顯示用戶的名字爲「空」。我相信問題在於存儲名稱,而不是檢索它。如果我從Content Manager用戶界面中創建了評論,然後返回到我的測試網頁,則會顯示評論以及主持人的姓名。Tridion UGC評論顯示作者爲空

面向公衆的UGC Web服務配置了AllowAnonymousClaimProcessor。 (沒有這個,評論根本就沒有保存。)日誌顯示這顯然成功地將失蹤的taf:claim:contentdelivery:webservice:user轉換爲基於跟蹤ID的用戶。

當然,這個想法並不是用這個作爲評論的作者。在日誌記錄中,您還可以看到來自網頁文本輸入的字符串「測試用戶」,並且這似乎映射到[email protected],但是不久之後存儲層搜索ID爲null的用戶並找到一個。

我懷疑這是一個配置問題,但正如您所看到的那樣,它很複雜,而且我不太確定哪裏可以看得更遠。對於如何開展工作的解釋將會像對實驗進行更具體的建議一樣受歡迎。

記錄輸出如下。我已經削減了很多,但它仍然是相當長的,因爲我不知道該位可能被證明相關:

2012-06-03 13:00:10,662 WARN AmbientDataContext - There is no current ambient data context - the ambient data framework is not properly initialised 
2012-06-03 13:00:10,668 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext 
2012-06-03 13:00:10,903 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true 
2012-06-03 13:00:10,906 DEBUG WebContext - setCurrentClaimStore: [email protected], thread: Thread-1 
2012-06-03 13:00:10,922 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16) 
2012-06-03 13:00:10,923 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16) 
2012-06-03 13:00:10,936 DEBUG ClaimStore - put: uri=taf:request:headers, value={content-type=[Ljava.lang.String;@5a940f82, connection=[Ljava.lang.String;@2e864e43, host=[Ljava.lang.String;@737c2891, accept=[Ljava.lang.String;@5c4b82d2} 
2012-06-03 13:00:10,937 DEBUG ClaimStore - put: uri=taf:request:cookies, value={} 
2012-06-03 13:00:10,937 DEBUG ClaimStore - put: uri=taf:request:parameters, value={CONTENT_TYPE=[Ljava.lang.String;@6179d854, QUERY_STRING=[Ljava.lang.String;@669a4cb} 
2012-06-03 13:00:10,938 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=, PATH_TRANSLATED=C:\inetpub\LiveCDService\odata.svc, SERVER_PORT=80, SCRIPT_NAME=/odata.svc, REMOTE_ADDR=127.0.0.1, AUTH_TYPE=, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=GET, DOCUMENT_ROOT=C:\inetpub\LiveCDService, REMOTE_HOST=127.0.0.1, SERVER_NAME=cdweb.visitorsweb.local, SECURE=false} 
2012-06-03 13:00:10,943 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_1d6b8066-4b45-4047-bf63-521eaeadb439 
2012-06-03 13:00:10,944 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_52d4956c-ae40-4c97-8eea-62d8ef7daa4c 
2012-06-03 13:00:10,953 DEBUG ClaimStore - put: uri=taf:session:attributes, value={Tridion.ContentDelivery.AmbientData.ClaimStore=Tridion.ContentDelivery.AmbientData.ClaimStore} 
2012-06-03 13:00:10,954 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id. 
2012-06-03 13:00:10,954 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_52d4956c-ae40-4c97-8eea-62d8ef7daa4c 
2012-06-03 13:00:10,964 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=false 
2012-06-03 13:00:11,275 DEBUG ODataService - ODATA.NET: Resource retrieval: ItemStats(PublicationId=19,Id=320,Type=16) 
2012-06-03 13:00:11,276 DEBUG WebContext - setCurrentClaimStore: [email protected], thread: Thread-2 
2012-06-03 13:00:11,289 DEBUG ODataWebserviceHandler - Requested a OData feed/entry: ItemStats(PublicationId=19,Id=320,Type=16) with type: application/json 
2012-06-03 13:00:11,289 DEBUG ODataWebserviceHandler - Setting $top to 25 
2012-06-03 13:00:11,291 DEBUG ResolverBase - Requested specific OData Entry 
2012-06-03 13:00:13,774 DEBUG PooledDataSourceBeanConfigurer - Initializing Pooled data source 
... snip 
2012-06-03 13:00:13,774 DEBUG EntityManagerFactoryBeanConfigurer - Registering EntityManagerFactory to Spring Context 
2012-06-03 13:00:13,778 INFO SpringConfigurationLoader - Finished loading spring application context 
2012-06-03 13:00:13,778 INFO ConfigurationStepLoader - Executing configuration step: BundleLoader 
2012-06-03 13:00:13,787 INFO BundleConfigurationLoader - Custom storage bindings defined, loading ugc_dao_bundle.xml 
2012-06-03 13:00:13,971 INFO BundleConfigurationLoader - Added 'Comment' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPACommentDAO'. 
2012-06-03 13:00:13,978 INFO BundleConfigurationLoader - Added 'Rating' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPARatingDAO'. 
2012-06-03 13:00:13,989 INFO BundleConfigurationLoader - Added 'UGCUser' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPAUserDAO'. 
2012-06-03 13:00:13,995 INFO BundleConfigurationLoader - Added 'UGCItemStats' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPAItemStatsDAO'. 
2012-06-03 13:00:14,002 INFO ConfigurationStepLoader - Executing configuration step: FactoryLoader 
2012-06-03 13:00:25,550 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true 
2012-06-03 13:00:25,550 DEBUG WebContext - setCurrentClaimStore: [email protected], thread: Thread-1 
2012-06-03 13:00:25,550 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/Comments 
2012-06-03 13:00:25,551 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/Comments 
2012-06-03 13:00:25,551 DEBUG ClaimStore - put: uri=taf:request:headers, value={expect=[Ljava.lang.String;@717535b6, content-type=[Ljava.lang.String;@461979eb, connection=[Ljava.lang.String;@32935741, host=[Ljava.lang.String;@67458657, accept=[Ljava.lang.String;@576eeb9, content-length=[Ljava.lang.String;@4332b67c} 
2012-06-03 13:00:25,551 DEBUG ClaimStore - put: uri=taf:request:cookies, value={} 
2012-06-03 13:00:25,552 DEBUG ClaimStore - put: uri=taf:request:parameters, value={CONTENT_TYPE=[Ljava.lang.String;@366aa95b, QUERY_STRING=[Ljava.lang.String;@1494b146} 
2012-06-03 13:00:25,552 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=, PATH_TRANSLATED=C:\inetpub\LiveCDService\odata.svc, SERVER_PORT=80, SCRIPT_NAME=/odata.svc, REMOTE_ADDR=127.0.0.1, AUTH_TYPE=, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=POST, DOCUMENT_ROOT=C:\inetpub\LiveCDService, REMOTE_HOST=127.0.0.1, SERVER_NAME=cdweb.visitorsweb.local, SECURE=false} 
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_d56681a1-15aa-4eed-acdf-e6c82e6a9488 
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_79775c4b-54fe-4d5c-875d-bc0354ea77c3 
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:session:attributes, value={Tridion.ContentDelivery.AmbientData.ClaimStore=Tridion.ContentDelivery.AmbientData.ClaimStore} 
2012-06-03 13:00:25,553 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id. 
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_79775c4b-54fe-4d5c-875d-bc0354ea77c3 
2012-06-03 13:00:25,555 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=true 
2012-06-03 13:00:25,563 DEBUG ODataService - ODATA.NET: Inserting entity on path: Comments 
2012-06-03 13:00:25,563 DEBUG WebContext - setCurrentClaimStore: [email protected], thread: Thread-6 
2012-06-03 13:00:25,568 DEBUG WritableCommentEntryService - Parsing comment: {d:{"Id":0,"ItemPublicationId":19,"ItemId":320,"ItemType":16,"CreationDate":"\/Date(1338728425535+120)\/","LastModifiedDate":"\/Date(1338728425535+120)\/","User":{"Id":null,"Name":"Test Name","EmailAddress":"[email protected]","ExternalId":null},"Content":"This is a test comment, which will probably appear to be anonymous","Moderator":null,"ModeratedDate":null,"Score":0,"Status":0}}. 
2012-06-03 13:00:25,582 DEBUG UGCConfigurationLoader - Attempt loading default storage configuration file 
2012-06-03 13:00:25,671 DEBUG WritableCommentEntryService - Storing comment: Comment [commentId=0, content=This is a test comment, which will probably appear to be anonymous, itemPublicationId=19, itemId=320, itemType=16, [email protected], creationDate=Sun Jun 03 15:00:25 CEST 2012, lastModifiedDate=Sun Jun 03 15:00:25 CEST 2012, moderatedDate=null, moderator=null, score=0, status=0]. 
2012-06-03 13:00:31,952 DEBUG JPADAOFactory - Loaded BinaryDAO for storageId: defaultdb 
2012-06-03 13:00:31,971 DEBUG JPADAOFactory - Loaded BinaryMetaDAO for storageId: defaultdb 
2012-06-03 13:00:34,260 DEBUG JPADAOFactory - Loaded TrackedPageDAO for storageId: ugcdb 
...snip 
2012-06-03 13:00:34,260 DEBUG JPADAOFactory - Loaded XSLTDAO for storageId: ugcdb 
2012-06-03 13:00:34,260 DEBUG JPADAOFactory - Loaded CommentDAO for storageId: ugcdb 
2012-06-03 13:00:34,261 DEBUG JPADAOFactory - Loaded RatingDAO for storageId: ugcdb 
2012-06-03 13:00:34,261 DEBUG JPADAOFactory - Loaded UGCUserDAO for storageId: ugcdb 
2012-06-03 13:00:34,261 DEBUG JPADAOFactory - Loaded UGCItemStatsDAO for storageId: ugcdb 
2012-06-03 13:00:34,261 INFO ConfigurationStepLoader - Executing configuration step: TypeMappingCheckLoader 
2012-06-03 13:00:34,266 INFO ConfigurationStepLoader - Executing configuration step: ConfigurationItemTypeLoader 
2012-06-03 13:00:34,270 INFO ConfigurationItemTypeLoader - Loaded default storage: brokerdb 
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loading default global typeMappings 
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loaded mapping: page to storage: brokerdb 
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loaded mapping: comment to storage: ugcdb 
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loaded mapping: rating to storage: ugcdb 
2012-06-03 13:00:34,271 DEBUG ConfigurationItemTypeLoader - Loaded mapping: ugcuser to storage: ugcdb 
2012-06-03 13:00:34,271 DEBUG ConfigurationItemTypeLoader - Loaded mapping: ugcitemstats to storage: ugcdb 
2012-06-03 13:00:34,271 DEBUG ConfigurationItemTypeLoader - Loading publication storage mappings 
2012-06-03 13:00:34,271 INFO ConfigurationStepLoader - Executing configuration step: CacheLoader 
2012-06-03 13:00:34,272 INFO ConfigurationStepLoader - Executing configuration step: StorageWrapperLoader 
2012-06-03 13:00:34,283 DEBUG StorageManagerFactory - Default storage provider has caching set to: false 
2012-06-03 13:00:34,283 DEBUG StorageManagerFactory - Loaded following dao Properties[publication=0, typeMapping=UGCItemStats, storageId=ugcdb, cached=false] for publication/typeMapping/itemExtension: 0/UGCItemStats/null 
2012-06-03 13:00:34,283 DEBUG StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0/UGCItemStats/null 
2012-06-03 13:00:34,284 DEBUG StorageManagerFactory - Wrapping DAO's, currently 0 wrappers installed 
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Default storage provider has caching set to: false 
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Loaded following dao Properties[publication=0, typeMapping=Comment, storageId=ugcdb, cached=false] for publication/typeMapping/itemExtension: 0/Comment/null 
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0/Comment/null 
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Wrapping DAO's, currently 0 wrappers installed 
2012-06-03 13:00:34,291 DEBUG JPACommentDAO - Add comment to storage: Comment [commentId=0, content=This is a test comment, which will probably appear to be anonymous, itemPublicationId=19, itemId=320, itemType=16, [email protected], creationDate=Sun Jun 03 15:00:25 CEST 2012, lastModifiedDate=Sun Jun 03 15:00:25 CEST 2012, moderatedDate=null, moderator=null, score=0, status=0]. 
2012-06-03 13:00:34,295 INFO StorageManagerTransactionMonitor - Starting storage transaction monitoring 
2012-06-03 13:00:34,296 DEBUG StorageManagerFactory - Default storage provider has caching set to: false 
2012-06-03 13:00:34,296 DEBUG StorageManagerFactory - Loaded following dao Properties[publication=0, typeMapping=UGCUser, storageId=ugcdb, cached=false] for publication/typeMapping/itemExtension: 0/UGCUser/null 
2012-06-03 13:00:34,296 DEBUG StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0/UGCUser/null 
2012-06-03 13:00:34,297 DEBUG StorageManagerFactory - Wrapping DAO's, currently 0 wrappers installed 
2012-06-03 13:00:34,297 DEBUG JPAUserDAO - Searching for user with id null in storage. 
2012-06-03 13:00:34,847 DEBUG ResolverBase - Entry: [email protected]46 was selected, checking if expanding is needed 
2012-06-03 13:00:34,858 DEBUG JPAUserDAO - User already in storage. No need to create new one. 
2012-06-03 13:00:34,894 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-2 
2012-06-03 13:00:34,912 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-1 
2012-06-03 13:00:34,967 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-6 
2012-06-03 13:00:34,968 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-8 
2012-06-03 13:00:34,991 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true 
2012-06-03 13:00:34,991 DEBUG WebContext - setCurrentClaimStore: [email protected], thread: Thread-1 
2012-06-03 13:00:34,991 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/Comments 
2012-06-03 13:00:34,993 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/Comments 
2012-06-03 13:00:34,993 DEBUG ClaimStore - put: uri=taf:request:headers, value={content-type=[Ljava.lang.String;@5358aac4, host=[Ljava.lang.String;@6233549b, accept=[Ljava.lang.String;@17f7be7b} 
2012-06-03 13:00:34,993 DEBUG ClaimStore - put: uri=taf:request:cookies, value={ASP.NET_SessionId=e3kzwdajhvc3ickvtjavm0co} 
2012-06-03 13:00:34,994 DEBUG ClaimStore - put: uri=taf:request:parameters, value={CONTENT_TYPE=[Ljava.lang.String;@9fa8988, $orderby=[Ljava.lang.String;@1f5b44d6, QUERY_STRING=[Ljava.lang.String;@21044daf, $filter=[Ljava.lang.String;@21882d18, $expand=[Ljava.lang.String;@734893da, $top=[Ljava.lang.String;@21e30857, $skip=[Ljava.lang.String;@40389922} 
2012-06-03 13:00:34,994 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=, PATH_TRANSLATED=C:\inetpub\LiveCDService\odata.svc, SERVER_PORT=80, SCRIPT_NAME=/odata.svc, REMOTE_ADDR=127.0.0.1, AUTH_TYPE=, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=GET, DOCUMENT_ROOT=C:\inetpub\LiveCDService, REMOTE_HOST=127.0.0.1, SERVER_NAME=cdweb.visitorsweb.local, SECURE=false} 
2012-06-03 13:00:34,994 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_ee26e9d0-c82e-4731-8c62-2f6c324d256a 
2012-06-03 13:00:34,995 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_435315be-7eca-4bda-94c8-acefdd03b594 
2012-06-03 13:00:34,995 DEBUG ClaimStore - put: uri=taf:session:attributes, value={Tridion.ContentDelivery.AmbientData.ClaimStore=Tridion.ContentDelivery.AmbientData.ClaimStore} 
2012-06-03 13:00:34,996 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id. 
2012-06-03 13:00:34,996 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_435315be-7eca-4bda-94c8-acefdd03b594 
2012-06-03 13:00:34,996 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=false 
2012-06-03 13:00:34,997 DEBUG ODataService - ODATA.NET: Resource retrieval: Comments 
2012-06-03 13:00:34,997 DEBUG WebContext - setCurrentClaimStore: [email protected], thread: Thread-6 
2012-06-03 13:00:34,999 DEBUG ODataWebserviceHandler - Requested a OData feed/entry: Comments with type: application/json 
2012-06-03 13:00:35,000 DEBUG ResolverBase - Requested OData collection 
2012-06-03 13:00:35,003 DEBUG FilterValue - check if value: -1 is of Integer type 
2012-06-03 13:00:35,003 DEBUG FilterValue - value: -1 is Integer 

回答

13

經過幾天處理此問題,我剛剛意識到解決此問題的方法是在網站和訪問者Web服務的cd_ambient_conf中配置「ugc_ambient_cartridge.xml」。

這是因爲他們需要知道用戶聲明「taf:claim:contentdelivery:webservice:user」的定義。

+0

我在這段時間也一直在努力。昨天,有了Nuno的配置文件,我最終得出了同樣的結論。所以,的確,這顯然是正確的答案,儘管這不是文檔描述配置的方式。 –

+0

似乎是一個明確的文檔缺陷的情況下:( –

+0

什麼是確切的定義,或範圍屬性?我似乎已定義墨盒,但我仍然遇到空用戶的問題,然後默認爲第一個。 –

1

坦白說,我不知道你做錯了什麼......我的系統上它的工作如預期,我沒有得到任何空用戶 - 而不是我看到類似

2012-06-01 13:30:53,811 DEBUG UserManager - UserManager.checkUser: found user: USER: Id=125; PresentationId=1; Login= 

與裝入評論顯示正確的文本,當我創建的意見作爲輸入。

我也使用AllowAnonymousPostClaimProcessor,只是注意到我在網站和Odata(不知道是否需要,但不會改變某些工作)。

讓我知道我是否可以通過電子郵件發送任何日誌和/或配置文件。