cancel
Showing results for 
Search instead for 
Did you mean: 

set Simple view in document library

hardik_thakkar
Star Contributor
Star Contributor

Hi Team,

I want to set Simple View as by default view in document library on site creation.

For that i have made changes in documentlist.js like below:
viewRendererName: "simple",    but that didn't worked.

Can anyone please suggest what are the other changes are required ?

Thanks,
Hardik

1 REPLY 1

sanjaybandhaniya
Elite Collaborator
Elite Collaborator

Hi Hardik,

You need to set "defaultViewId" as simple which is property of "defaultViewConfig" aspect.

You can create rule on Sites folder and capture event of site-creation and add aspect.

You can create policy which capture site creation event and in that policy you can set default view.

Ex.

Map<QName, Serializable> viewProp = new HashMap<QName, Serializable>();
viewProp.put(ApplicationModel.PROP_DEFAULT_VIEW_ID, "simple");
nodeService.addAspect(folderNodeRef, ApplicationModel.ASPECT_DEFAULT_VIEW_CONFIG, viewProp);