001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.test;
016    
017    import com.liferay.portal.kernel.search.IndexerRegistryUtil;
018    import com.liferay.portal.kernel.workflow.WorkflowHandlerRegistryUtil;
019    import com.liferay.portal.workflow.UserWorkflowHandler;
020    import com.liferay.portlet.asset.util.AssetEntryIndexer;
021    import com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer;
022    import com.liferay.portlet.documentlibrary.util.DLFolderIndexer;
023    import com.liferay.portlet.messageboards.util.MBMessageIndexer;
024    import com.liferay.portlet.trash.util.TrashIndexer;
025    import com.liferay.portlet.usersadmin.util.ContactIndexer;
026    import com.liferay.portlet.usersadmin.util.OrganizationIndexer;
027    import com.liferay.portlet.usersadmin.util.UserIndexer;
028    
029    /**
030     * @author Roberto D??az
031     */
032    public class PortalRegisterTestUtil {
033    
034            protected static void registerIndexers() {
035                    if (_indexersRegistered) {
036                            return;
037                    }
038    
039                    IndexerRegistryUtil.register(new AssetEntryIndexer());
040                    IndexerRegistryUtil.register(new ContactIndexer());
041                    IndexerRegistryUtil.register(new DLFileEntryIndexer());
042                    IndexerRegistryUtil.register(new DLFolderIndexer());
043                    IndexerRegistryUtil.register(new MBMessageIndexer());
044                    IndexerRegistryUtil.register(new OrganizationIndexer());
045                    IndexerRegistryUtil.register(new TrashIndexer());
046                    IndexerRegistryUtil.register(new UserIndexer());
047    
048                    _indexersRegistered = true;
049            }
050    
051            protected static void registerWorkflowHandlers() {
052                    if (_workflowHandlersRegistered) {
053                            return;
054                    }
055    
056                    WorkflowHandlerRegistryUtil.register(new UserWorkflowHandler());
057    
058                    _workflowHandlersRegistered = true;
059            }
060    
061            private static boolean _indexersRegistered;
062            private static boolean _workflowHandlersRegistered;
063    
064    }