Example usage for com.liferay.portal.kernel.events SimpleAction run

List of usage examples for com.liferay.portal.kernel.events SimpleAction run

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.events SimpleAction run.

Prototype

public abstract void run(String[] ids) throws ActionException;

Source Link

Usage

From source file:com.liferay.portlet.documentlibrary.service.DLFileEntryTypeServiceTest.java

License:Open Source License

@Override
public void setUp() throws Exception {
    super.setUp();

    SimpleAction simpleAction = new AddDefaultDocumentLibraryStructuresAction();

    String companyIdString = String.valueOf(TestPropsValues.getCompanyId());

    simpleAction.run(new String[] { companyIdString });

    _folder = DLAppLocalServiceUtil.addFolder(TestPropsValues.getUserId(), TestPropsValues.getGroupId(),
            DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, "Folder A", "", getServiceContext());

    _subfolder = DLAppLocalServiceUtil.addFolder(TestPropsValues.getUserId(), TestPropsValues.getGroupId(),
            _folder.getFolderId(), "SubFolder AA", "", getServiceContext());

    _basicDocumentDLFileEntryType = DLFileEntryTypeLocalServiceUtil
            .getFileEntryType(DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT);

    _dlFileEntryTypes = DLFileEntryTypeLocalServiceUtil
            .getFileEntryTypes(DLUtil.getGroupIds(TestPropsValues.getGroupId()));

    for (DLFileEntryType dlFileEntryType : _dlFileEntryTypes) {
        String name = dlFileEntryType.getName();

        if (name.equals(DLFileEntryTypeConstants.NAME_CONTRACT)) {
            _contractDLFileEntryType = dlFileEntryType;
        } else if (name.equals(DLFileEntryTypeConstants.NAME_MARKETING_BANNER)) {

            _marketingBannerDLFileEntryType = dlFileEntryType;
        }//w  w  w.ja  va2 s. c o m
    }
}