set Simple view in document library

cancel
Showing results for 
Search instead for 
Did you mean: 
hardik_thakkar
Active Member II

set Simple view in document library

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
sanjaybandhniya
Intermediate

Re: set Simple view in document library

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);