本文整理汇总了Java中com.liferay.portal.theme.ThemeDisplay类的典型用法代码示例。如果您正苦于以下问题:Java ThemeDisplay类的具体用法?Java ThemeDisplay怎么用?Java ThemeDisplay使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ThemeDisplay类属于com.liferay.portal.theme包,在下文中一共展示了ThemeDisplay类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unlock
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
/**
* Unlock.
*
* @param request the request
* @param response the response
* @param model the model
*/
@ActionMapping(params = "action=unlock")
public void unlock(final ActionRequest request,
final ActionResponse response, final Model model) {
final Long offerId = this.getOfferId(request);
m_objLog.debug("unlock::start(" + offerId + ")");
if (offerId != null && offerId >= 0) {
final ThemeDisplay themeDisplay = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
CustomLockServiceHandler.unlock(AHOffer.class.getName(), offerId,
themeDisplay);
}
m_objLog.debug("unlock::end");
}
示例2: getRole
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
/**
* Gets the role.
*
* @param display the display
* @return the role
*/
protected E_Role getRole(final ThemeDisplay display) {
E_Role result = null;
final User user = display.getUser();
if (user != null && user.getEmailAddress() != null) {
List<Role> roles = null;
try {
roles = user.getRoles();
} catch (final SystemException e) {
}
if (roles != null) {
for (final Role role : roles) {
result = CustomPortalServiceHandler.matchesRole(role);
if (result != null) {
break;
}
}
}
}
return result;
}
示例3: application_EntitlementFromRequest
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
/**
* Creates a Application_Entitlement object out of fields from the request.
*
* @param request
* @return application_Entitlement
*/
public static Application_Entitlement application_EntitlementFromRequest(ActionRequest request) {
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
Application_Entitlement model = new Application_EntitlementImpl();
_log.debug("themeDisplay.getCompanyId(): " + themeDisplay.getCompanyId());
model.setApplicationEntitlementID(ParamUtil.getLong(request, "ApplicationEntitlementId"));
model.setCompanyId(themeDisplay.getCompanyId());
model.setUserId(themeDisplay.getUserId());
model.setApplicationId(ParamUtil.getLong(request, "applicationId"));
model.setEntitlementId(ParamUtil.getLong(request, "entitlementId"));
model.setName(ParamUtil.getString(request, "name").trim());
model.setMotivation(ParamUtil.getString(request, "motivation").trim());
return model;
}
示例4: legalDetailsFromRequest
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
/**
* Creates a LegalDetails object out of fields from the request.
*
* @param request
* @return legalDetails
*/
public static LegalDetails legalDetailsFromRequest(ActionRequest request) {
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
LegalDetails model = new LegalDetailsImpl();
model.setCompanyId(themeDisplay.getCompanyId());
model.setUserId(themeDisplay.getUserId());
model.setLegalDetailsId(ParamUtil.getLong(request, "legalDetailsId"));
model.setAddress(ParamUtil.getString(request, "address").trim());
model.setEmail(ParamUtil.getString(request, "email").trim());
model.setFax(ParamUtil.getString(request, "fax").trim());
model.setLegalForm(ParamUtil.getString(request, "legalForm").trim());
model.setName(ParamUtil.getString(request, "name").trim());
model.setRegistrationCourt(ParamUtil.getString(request, "registrationCourt").trim());
model.setTelephone(ParamUtil.getString(request, "telephone").trim());
model.setURL(ParamUtil.getString(request, "URL").trim());
model.setValueAddedTaxNo(ParamUtil.getString(request, "valueAddedTaxNo").trim());
return model;
}
示例5: getURLEdit
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
public PortletURL getURLEdit(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse) throws Exception
{
_log.debug("getURLEdit: entrada");
HttpServletRequest request = liferayPortletRequest.getHttpServletRequest();
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
PortletURL portletURL = liferayPortletResponse.createRenderURL("taskactivity_WAR_liferaylmsportlet");
portletURL.setParameter("mvcPath", "/html/taskactivity/admin/edit.jsp");
portletURL.setParameter("jspPage", "/html/taskactivity/admin/edit.jsp");
portletURL.setParameter("actId", Long.toString(_learningactivity.getActId()));
_log.debug("getURLEdit: "+portletURL.toString());
return portletURL;
}
示例6: getHtmlFeedback
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
public String getHtmlFeedback(Document document,long questionId, long actId, ThemeDisplay themeDisplay){
Object returnObj = null;
try {
Method method = QuestionType.class.getMethod("getHtmlFeedback", Document.class, long.class, long.class, ThemeDisplay.class);
returnObj = clp.invoke(new MethodHandler(method, document, questionId, actId, themeDisplay));
}
catch (Throwable t) {
t = ClpSerializer.translateThrowable(t);
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
else {
throw new RuntimeException(t.getClass().getName() +
" is not a valid exception");
}
}
return ((String)returnObj);
}
示例7: getURLViewInContext
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
@Override
public final String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) liferayPortletRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(_layout.getPlid(), _portletId, PortletRequest.RENDER_PHASE);
portletURL.setParameter("actId",Long.toString( _learningactivity.getActId()));
portletURL.setParameter("moduleId",Long.toString( _learningactivity.getModuleId()));
portletURL.setParameter("actionEditingActivity", StringPool.FALSE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("actionEditingModule", StringPool.FALSE);
portletURL.setParameter("actionCalifications", StringPool.FALSE);
portletURL.setParameter("activityStarted", StringPool.TRUE);
String mvcPath = getMvcPathView(themeDisplay.getUserId(),liferayPortletResponse,liferayPortletRequest.getWindowState());
if(Validator.isNotNull(mvcPath)){
portletURL.setParameter("mvcPath",mvcPath);
}
prepareRuntimePortlet(portletURL);
return portletURL.toString();
}
示例8: saveDeregister
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
public void saveDeregister(ActionRequest request,
ActionResponse response) throws IOException,
PortletException {
try{
ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
User user = themeDisplay.getUser();
boolean deregisterMail = ParamUtil.getBoolean(request, "deregister", false);
if(user.getExpandoBridge().getAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO)==null){
user.getExpandoBridge().addAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO, ExpandoColumnConstants.BOOLEAN);
}
user.getExpandoBridge().setAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO, deregisterMail);
UserLocalServiceUtil.updateUser(user);
log.debug("User updated!");
SessionMessages.add(request, "saveDeregisterOK");
}catch(Exception e){
e.printStackTrace();
SessionErrors.add(request, "saveDeregisterKO");
}
}
示例9: isLoggedInMgmt
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
/**
* Checks if is logged in mgmt.
*
* @param request the request
* @return true, if is logged in mgmt
*/
protected boolean isLoggedInMgmt(final PortletRequest request) {
boolean result = false;
final ThemeDisplay themeDisplay = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
if (themeDisplay.isSignedIn()) {
final User user = themeDisplay.getUser();
if (user != null) {
try {
final List<Role> roles = user.getRoles();
String mgmtRoleName = CustomPortalServiceHandler.getConfigValue(E_ConfigKey.ROLE_NAME_MGMT);
for (final Role role : roles) {
if (role.getName().equals(mgmtRoleName)) {
result = true;
break;
}
}
} catch (final Throwable t) {
}
}
}
return result;
}
示例10: doView
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
@Override
public void doView(RenderRequest renderRequest,
RenderResponse renderResponse) throws IOException, PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
Course course=null;
try{
course=CourseLocalServiceUtil.fetchByGroupCreatedId(themeDisplay.getScopeGroupId());
}
catch(SystemException e){}
if((course!=null)&&(course.getCourseEvalId()==1)) {
super.doView(renderRequest, renderResponse);
}
else {
renderRequest.setAttribute(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY, Boolean.FALSE);
}
}
示例11: getOrgIdByLiferayUser
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
/**
* Get the ID of the organisation bound to the current Liferay user
*
* @param tDisplay the theme display of the current session
* @return the organisation bound to the user, or null if none
*/
public static long getOrgIdByLiferayUser(final ThemeDisplay tDisplay) {
long result = -1L;
try {
final String ownerEmail = tDisplay.getUser().getEmailAddress();
AHOrg org = AHOrgLocalServiceUtil
.getOrganisationByOwnerMail(ownerEmail);
if (org == null) {
org = AHOrgLocalServiceUtil
.getOrganisationByUserMail(ownerEmail);
}
if (org != null) {
result = org.getOrgId();
}
} catch (final Throwable t) {
m_objLog.error(t);
}
return result;
}
示例12: downmodule
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
public void downmodule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
long moduleId = ParamUtil.getLong(actionRequest, "resId",0);
long userIdAction = themeDisplay.getUserId();
if(moduleId>0)
{
if(permissionChecker.hasPermission(
themeDisplay.getScopeGroupId(),
Module.class.getName(), moduleId,
ActionKeys.UPDATE))
{
ModuleLocalServiceUtil.goDownModule(moduleId,userIdAction);
}
}
}
示例13: deleteActivity
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
private void deleteActivity(LearningActivity larn, ThemeDisplay themeDisplay, ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, SystemException, DocumentException, IOException{
LearningActivityType learningActivityType=new LearningActivityTypeRegistry().
getLearningActivityType(larn.getTypeId());
learningActivityType.deleteResources(actionRequest, actionResponse, larn);
List<LearningActivity> precedences = LearningActivityLocalServiceUtil.getByPrecedence(larn.getActId());
if(precedences!=null && precedences.size()>0){
for(LearningActivity precedence : precedences){
precedence.setPrecedence(0);
LearningActivityLocalServiceUtil.updateLearningActivity(precedence);
}
}
LearningActivityServiceUtil.deleteLearningactivity(larn.getActId());
//auditing
AuditingLogFactory.audit(themeDisplay.getCompanyId(), themeDisplay.getScopeGroupId(), LearningActivity.class.getName(), larn.getActId(), themeDisplay.getUserId(), AuditConstants.DELETE, null);
}
示例14: moveActivity
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
public void moveActivity(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
long actId = ParamUtil.getLong(actionRequest, "pageId"),
prevActId = ParamUtil.getLong(actionRequest, "prevPageId"),
nextActId = ParamUtil.getLong(actionRequest, "nextPageId");
if(actId>0){
LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);
if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(), ActionKeys.UPDATE)||
permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(), ActionKeys.UPDATE)){
LearningActivityLocalServiceUtil.moveActivity(actId, prevActId, nextActId, themeDisplay.getUserId());
}
}
actionResponse.setRenderParameter("jsp", "/html/lmsactivitieslist/view.jsp");
}
示例15: upquestion
import com.liferay.portal.theme.ThemeDisplay; //导入依赖的package包/类
public void upquestion(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
long actId = ParamUtil.getLong(actionRequest, "actId",0);
long testQuestionId = ParamUtil.getLong(actionRequest, "questionId");
if(actId>0)
{
LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);
if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(),
ActionKeys.UPDATE)|| permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(),
ActionKeys.UPDATE))
{
TestQuestionLocalServiceUtil.goUpTestQuestion(testQuestionId);
}
}
}