/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.marketplace.app.manager.web.internal.portlet.configuration.icon;
import com.liferay.marketplace.app.manager.web.internal.constants.MarketplaceAppManagerPortletKeys;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.portlet.configuration.icon.BaseJSPPortletConfigurationIcon;
import com.liferay.portal.kernel.portlet.configuration.icon.PortletConfigurationIcon;
import com.liferay.portal.kernel.util.ResourceBundleUtil;
import java.util.ResourceBundle;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
import javax.servlet.ServletContext;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
/**
* @author Douglas Wong
*/
@Component(
immediate = true,
property = {
"javax.portlet.name=" + MarketplaceAppManagerPortletKeys.MARKETPLACE_APP_MANAGER,
"path=/view.jsp"
},
service = PortletConfigurationIcon.class
)
public class InstallFromURLPortletConfigurationIcon
extends BaseJSPPortletConfigurationIcon {
@Override
public String getJspPath() {
return "/configuration/icon/install_from_url.jsp";
}
@Override
public String getMessage(PortletRequest portletRequest) {
ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
"content.Language", getLocale(portletRequest), getClass());
return LanguageUtil.get(resourceBundle, "install-from-url");
}
@Override
public String getURL(
PortletRequest portletRequest, PortletResponse portletResponse) {
return "javascript:;";
}
@Override
public double getWeight() {
return 102;
}
@Override
public boolean isShow(PortletRequest portletRequest) {
return true;
}
@Override
public boolean isToolTip() {
return false;
}
@Override
@Reference(
target = "(osgi.web.symbolicname=com.liferay.marketplace.app.manager.web)",
unbind = "-"
)
public void setServletContext(ServletContext servletContext) {
super.setServletContext(servletContext);
}
}