| sheetal.mahajan@wipro.com 2007-11-28, 1:46 am |
| If the content are in published stage then findContentByAuthoringTemplate returns content Id as null.<br />
<br />
If the content are in Draft stage then findContentByAuthoringTemplate returns content Id is not null.<br />
<p />
Workspace workspace = WCM_API.getRepository().getWorkspace(ShiftSwapperConstants.WPSName,ShiftSwapperConstants.WPSPASSWORD);<br />
workspace.setCurrentDocumentLibrary(workspace. getDocumentLibrary(ShiftSwapperConstants
.LIBRARY_NAME));<br />
DocumentIdIterator authoringTemplates = workspace.findByNameDocumentTypes.AuthoringTemplate,ShiftSwapperConstants.AUTHORING_TEMPLATE);<br />
if(authoringTemplates.hasNext()){<br />
DocumentId authId=(DocumentId)authoringTemplates.next();<br />
DocumentIdIterator contIter=workspace.findContentByAuthoringTemplate(authId);<br />
while(contIter.hasNext()){<br />
DocumentId contentId=(DocumentId)contIter.next();<br />
Content content=(Content)workspace.getById(contentId);<br />
}<br />
<br />
what is reason for this?<br />
<br />
how to get published content Id's using findContentByAuthoringTemplate();
|