wcm

New line character in JSON

本小妞迷上赌 提交于 2019-12-22 18:27:39
问题 We are using a WCM tool for content entry and content editors will enter content having text and html in the tool. To convert the content into JSON we are using newton JSON as below where we are passing simple dictionary of keys and values: string output = JsonConvert.SerializeObject(nonJsonResult); Whenever editor gives content with new lines then we are getting the serailized JSON output with \r\n . Example input text: first line second line third line Output: { "test": "first line\r

Unit test WCMUsePOJO class

点点圈 提交于 2019-12-11 17:18:41
问题 I am writing unit test cases for following class which extends WCMUsePOJO. Now, this class is using a getSlingScriptHelper method shown below. public class ConstantsServiceProvider extends WCMUsePojo { private static final Logger logger = LoggerFactory.getLogger(ConstantsServiceProvider.class); private String var1; @Override public void activate() throws Exception { ConstantsService constantsService = getSlingScriptHelper().getService(ConstantsService.class); if(constantsService != null) {

Best way to include Dynamic Data List Records in search in Liferay 6.1

百般思念 提交于 2019-12-08 09:31:46
问题 In Liferay 6.2 it is possible to set the Indexable option on fields of Dynamic Data List Definitions, thereby making them searchable (as explained in the Documentation for Liferay 6.2) I want to include DDL records in my search and have to use Liferay 6.1. I am wondering, what would be the best way to go about this. Right now I have looked into customizing the search, but Dynamic Data Lists are not being mentioned there as an option. I also looked at Creating an Indexer Post-Processor hook,

How to dynamically switch PageLayout and MasterPage of SharePoint Publishing page?

此生再无相见时 提交于 2019-12-02 10:19:17
问题 To improve both the editing and displaying experience of SharePoint WCM Publishing pages I would like to be able to switch to a special set of Masterpage/PageLayout when in edit mode. So in /_catalogs/masterpage I want to have: MyMasterpage.master - masterpage for display mode MyMasterpage-edit.master - masterpage for edit mode, only use if available MyPageLayout.aspx - pagelayout for display mode MyPageLayout-edit.aspx - pagelayout for edit mode, only use if available When I create a new

How to dynamically switch PageLayout and MasterPage of SharePoint Publishing page?

两盒软妹~` 提交于 2019-12-02 07:38:42
To improve both the editing and displaying experience of SharePoint WCM Publishing pages I would like to be able to switch to a special set of Masterpage/PageLayout when in edit mode. So in /_catalogs/masterpage I want to have: MyMasterpage.master - masterpage for display mode MyMasterpage-edit.master - masterpage for edit mode, only use if available MyPageLayout.aspx - pagelayout for display mode MyPageLayout-edit.aspx - pagelayout for edit mode, only use if available When I create a new publishing page in the Pages library, I select the MyPageLayout page layout. When rendering the page I