本文整理汇总了Java中com.liferay.portal.model.Portlet类的典型用法代码示例。如果您正苦于以下问题:Java Portlet类的具体用法?Java Portlet怎么用?Java Portlet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Portlet类属于com.liferay.portal.model包,在下文中一共展示了Portlet类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: editactivity
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public void editactivity(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortalException, SystemException, Exception {
long actId = ParamUtil.getInteger(actionRequest, "resId");
// LearningActivity learnact =
// com.liferay.lms.service.LearningActivityServiceUtil.getLearningActivity(actId);
LearningActivityAssetRendererFactory laf = new LearningActivityAssetRendererFactory();
if (laf != null) {
AssetRenderer assetRenderer = laf.getAssetRenderer(actId, 0);
String urlEdit = assetRenderer.getURLEdit((LiferayPortletRequest) actionRequest, (LiferayPortletResponse) actionResponse).toString();
Portlet urlEditPortlet =PortletLocalServiceUtil.getPortletById(HttpUtil.getParameter(urlEdit, "p_p_id",false));
if(urlEditPortlet!=null) {
PublicRenderParameter actIdPublicParameter = urlEditPortlet.getPublicRenderParameter("actId");
if(actIdPublicParameter!=null) {
urlEdit=HttpUtil.removeParameter(urlEdit,PortletQNameUtil.getPublicRenderParameterName(actIdPublicParameter.getQName()));
}
urlEdit=HttpUtil.addParameter(urlEdit, StringPool.UNDERLINE+urlEditPortlet.getPortletId()+StringPool.UNDERLINE+"resId", actId);
urlEdit=HttpUtil.removeParameter(urlEdit, StringPool.UNDERLINE+urlEditPortlet.getPortletId()+StringPool.UNDERLINE+"actionEditingDetails");
urlEdit=HttpUtil.addParameter(urlEdit, StringPool.UNDERLINE+urlEditPortlet.getPortletId()+StringPool.UNDERLINE+"actionEditingDetails", true);
}
actionResponse.sendRedirect(urlEdit);
}
SessionMessages.add(actionRequest, "asset-renderer-not-defined");
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:27,代码来源:LmsActivitiesList.java
示例2: addPortletToPage
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public static String addPortletToPage(Layout layout, String portletId, E_ContextPath path, long userId) {
String result = null;
try {
LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) layout.getLayoutType();
// count all portlets currently registered for this column
List<Portlet> portlets = layoutTypePortlet.getAllPortlets(path.getColumnId());
int colSize = portlets != null ? portlets.size() : 0;
// add new portlet at the very end
result = layoutTypePortlet.addPortletId(userId, portletId, path.getColumnId(), colSize, false);
// update the layout
LayoutLocalServiceUtil.updateLayout(layout.getGroupId(),
layout.isPrivateLayout(),
layout.getLayoutId(),
layout.getTypeSettings());
} catch (Throwable t) {
m_objLog.warn(t);
}
return result;
}
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:23,代码来源:ParticityInitializer.java
示例3: isVisible
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public boolean isVisible(
Portlet portlet, String category, ThemeDisplay themeDisplay)
throws Exception {
Group group = themeDisplay.getScopeGroup();
if (category.equals(PortletCategoryKeys.CONTENT) && group.isUser()) {
return false;
}
// mas ainda restaram: páginas, enquetes, configuração de workflow, equidade social
// Extender (classe e liferay-portlet.xml ext):
// com.liferay.portlet.polls.PollsControlPanelEntry
// com.liferay.portal.workflow.WorkflowControlPanelEntry
// com.liferay.portlet.socialequityadmin.SocialEquityAdminControlPanelEntry
// com.liferay.portlet.grouppages.GroupPagesControlPanelEntry
return super.isVisible(portlet, category, themeDisplay);
}
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:18,代码来源:EDemocraciaControlPanelEntry.java
示例4: checkArticleOnLayout
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public static boolean checkArticleOnLayout(Layout layout, String articleId, String columnId, long companyId) {
boolean result = false;
try {
long ownerId = PortletKeys.PREFS_OWNER_ID_DEFAULT;
int ownerType = PortletKeys.PREFS_OWNER_TYPE_LAYOUT;
LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) layout.getLayoutType();
List<Portlet> portlets = layoutTypePortlet.getAllPortlets(columnId);
if (portlets != null) {
for (Portlet portlet: portlets) {
//m_objLog.debug("Found portlet "+portlet.getPortletId()+" =? "+PortletKeys.JOURNAL_CONTENT);
if (portlet.getPortletId().startsWith(PortletKeys.JOURNAL_CONTENT+"_INSTANCE")) {
PortletPreferences prefs = PortletPreferencesLocalServiceUtil.getPreferences(companyId,
ownerId,
ownerType,
layout.getPlid(),
portlet.getPortletId());
String jArticleId = prefs.getValue("articleId", "");
if (jArticleId.equals(articleId)) {
result = true;
break;
}
}
}
}
} catch (Throwable t) {
m_objLog.warn(t);
}
return result;
}
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:34,代码来源:ParticityInitializer.java
示例5: test
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public static void test() {
try {
if (globalCompanyId == -1)
initGlobals();
Layout layout = getLayout(globalGroupId, E_ContextPath.HOME.getPath());
LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) layout.getLayoutType();
List<Portlet> portlets = layoutTypePortlet.getAllPortlets();
if (portlets != null) {
for (Portlet portlet: portlets) {
m_objLog.debug("Found portlet "+portlet.getPortletId()+" =? "+PortletKeys.JOURNAL_CONTENT);
if (portlet.getPortletId().startsWith(E_SampleContent.FRONTEND_HEADER.getDataPath())) {
long ownerId = PortletKeys.PREFS_OWNER_ID_DEFAULT;
int ownerType = PortletKeys.PREFS_OWNER_TYPE_LAYOUT;
PortletPreferences prefs = PortletPreferencesLocalServiceUtil.getPreferences(globalCompanyId,
ownerId,
ownerType,
layout.getPlid(),
portlet.getPortletId());
if (prefs != null) {
Enumeration<String> names = prefs.getNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
m_objLog.debug("Got preference "+name+"="+prefs.getValue(name, "N/A"));
}
} else {
m_objLog.debug("Could not extract portlet prefs!");
}
}
}
}
} catch (Throwable t) {
m_objLog.error(t);
}
}
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:41,代码来源:ParticityInitializer.java
示例6: processAction
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public void processAction(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, ActionRequest actionRequest,ActionResponse actionResponse) throws Exception {
originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig, actionRequest, actionResponse);
Portlet portlet = getPortlet(actionRequest);
if (portlet.getPortletName().equals(PortletKeys.ASSET_PUBLISHER)) {
PortletPreferences preferences = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portlet.getPortletId());
preferences.setValue("moreInfoUrl", ParamUtil.getString(actionRequest, "moreInfoUrl"));
preferences.setValue("moreInfoUrlLabel", ParamUtil.getString(actionRequest, "moreInfoUrlLabel"));
preferences.store();
}
}
开发者ID:rivetlogic,项目名称:hr-portal,代码行数:14,代码来源:HRPortalCustomConfigurationActionImpl.java
示例7: run
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public void run(String[] ids)
throws ActionException {
for (Portlet portlet : PortletLocalServiceUtil.getPortlets()) {
String pollerProcessorClass = portlet.getPollerProcessorClass();
if (Validator.isNotNull(pollerProcessorClass)) {
_log.info("Poller detected: " + portlet.getPortletId() + " :: " + portlet.getPollerProcessorInstance());
_pollerProcessorInstances.put(portlet.getPortletId(), portlet.getPollerProcessorInstance());
}
}
}
开发者ID:saggiyogesh,项目名称:liferay-node-poller,代码行数:13,代码来源:PortletPollerInstance.java
示例8: getPortlet
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
protected Portlet getPortlet(PortletRequest portletRequest)
throws Exception {
long companyId = PortalUtil.getCompanyId(portletRequest);
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();
String portletId = ParamUtil.getString(portletRequest,"portletResource");
if (!PortletPermissionUtil.contains(permissionChecker,
themeDisplay.getLayout(), portletId, ActionKeys.CONFIGURATION)) {
throw new PrincipalException();
}
return PortletLocalServiceUtil.getPortletById(companyId, portletId);
}
开发者ID:rivetlogic,项目名称:hr-portal,代码行数:20,代码来源:HRPortalCustomConfigurationActionImpl.java
示例9: isVisible
import com.liferay.portal.model.Portlet; //导入依赖的package包/类
public boolean isVisible(PermissionChecker checker, Portlet portlet)
throws Exception {
// TODO Auto-generated method stub
return true;
}
开发者ID:technopolis,项目名称:role-access-lists,代码行数:7,代码来源:AdminAllowedIPsControlPanelEntry.java
注:本文中的com.liferay.portal.model.Portlet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论