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.convert.documentlibrary;
016    
017    import com.liferay.portal.convert.BaseConvertProcess;
018    import com.liferay.portal.kernel.log.Log;
019    import com.liferay.portal.kernel.log.LogFactoryUtil;
020    import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
021    
022    /**
023     * @author Alexander Chow
024     */
025    public class DocumentLibraryExtraSettingsConvertProcess
026            extends BaseConvertProcess {
027    
028            @Override
029            public String getDescription() {
030                    return "convert-extra-settings-from-document-library-files";
031            }
032    
033            @Override
034            public String getPath() {
035                    return "/admin_server/edit_document_library_extra_settings";
036            }
037    
038            @Override
039            public boolean isEnabled() {
040                    try {
041                            return DLFileEntryLocalServiceUtil.hasExtraSettings();
042                    }
043                    catch (Exception e) {
044                            _log.error(e, e);
045    
046                            return false;
047                    }
048            }
049    
050            @Override
051            protected void doConvert() throws Exception {
052            }
053    
054            private static final Log _log = LogFactoryUtil.getLog(
055                    DocumentLibraryExtraSettingsConvertProcess.class);
056    
057    }