Example usage for com.liferay.portal.kernel.service LayoutSetBranchLocalServiceUtil deleteLayoutSetBranches

List of usage examples for com.liferay.portal.kernel.service LayoutSetBranchLocalServiceUtil deleteLayoutSetBranches

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service LayoutSetBranchLocalServiceUtil deleteLayoutSetBranches.

Prototype

public static void deleteLayoutSetBranches(long groupId, boolean privateLayout, boolean includeMaster)
            throws com.liferay.portal.kernel.exception.PortalException 

Source Link

Usage

From source file:com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor.java

License:Open Source License

protected void initLayoutSetBranches(long userId, long sourceGroupId, long targetGroupId)
        throws PortalException {

    Group sourceGroup = GroupLocalServiceUtil.getGroup(sourceGroupId);

    if (!sourceGroup.hasStagingGroup()) {
        return;//from   www .j  a v a 2 s.  co m
    }

    LayoutSetBranchLocalServiceUtil.deleteLayoutSetBranches(targetGroupId, false, true);
    LayoutSetBranchLocalServiceUtil.deleteLayoutSetBranches(targetGroupId, true, true);

    UnicodeProperties typeSettingsProperties = sourceGroup.getTypeSettingsProperties();

    boolean branchingPrivate = GetterUtil.getBoolean(typeSettingsProperties.getProperty("branchingPrivate"));
    boolean branchingPublic = GetterUtil.getBoolean(typeSettingsProperties.getProperty("branchingPublic"));

    ServiceContext serviceContext = new ServiceContext();

    serviceContext.setUserId(userId);

    StagingLocalServiceUtil.checkDefaultLayoutSetBranches(userId, sourceGroup, branchingPublic,
            branchingPrivate, false, serviceContext);
}