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