本文整理汇总了Java中com.liferay.portal.kernel.workflow.WorkflowConstants类的典型用法代码示例。如果您正苦于以下问题:Java WorkflowConstants类的具体用法?Java WorkflowConstants怎么用?Java WorkflowConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WorkflowConstants类属于com.liferay.portal.kernel.workflow包,在下文中一共展示了WorkflowConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _getFolderNameIdPairs
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
private List<KeyValuePair> _getFolderNameIdPairs(long groupId)
throws SystemException {
List<DLFolder> dlFolderList =
DLFolderLocalServiceUtil.getFolders(
groupId, DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, WorkflowConstants.STATUS_APPROVED, false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
List<KeyValuePair> dlFolderNameIdList = new ArrayList<KeyValuePair>(
dlFolderList.size() + 1);
dlFolderNameIdList.add(
new KeyValuePair(
"HOME",
String.valueOf(DLFolderConstants.DEFAULT_PARENT_FOLDER_ID)));
for (DLFolder folder : dlFolderList) {
dlFolderNameIdList.add(
new KeyValuePair(
folder.getName(), String.valueOf(folder.getFolderId())));
}
return dlFolderNameIdList;
}
示例2: getTeachersFromCourse
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
public List<User> getTeachersFromCourse(Course course, long teacherRoleId) {
List<User> users = new ArrayList<User>();
try{
LinkedHashMap<String, Object> userParams = new LinkedHashMap<String, Object>();
userParams.put("usersGroups", course.getGroupCreatedId());
userParams.put("userGroupRole", new Long[]{course.getGroupCreatedId(), teacherRoleId});
users = UserLocalServiceUtil.search(course.getCompanyId(), "",
WorkflowConstants.STATUS_APPROVED, userParams,
QueryUtil.ALL_POS, QueryUtil.ALL_POS,(OrderByComparator)null);
}catch(Exception e){
e.printStackTrace();
}
return users;
}
示例3: getCourseStats
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
private CourseStatsView getCourseStats (Course course, long teamId, Locale locale, long[] userExcludedIds, long[] userIds) throws PortalException, SystemException{
log.debug("CourseStats::getCourseStats::Obtenemos las estadísticas del curso");
//Se construye la vista de las estadisticas del curso
CourseStatsView courseStats = new CourseStatsView(course.getCourseId(), course.getTitle(locale));
if(teamId > 0){
courseStats.setRegistered(userIds.length);
courseStats.setStarted(CourseResultLocalServiceUtil.countStudentsByCourseIdUserIdsStarted(course.getCourseId(), userIds));
courseStats.setFinished(CourseResultLocalServiceUtil.countStudentsByCourseIdUserIdsFinished(course.getCourseId(), userIds));
courseStats.setPassed(CourseResultLocalServiceUtil.countStudentsByCourseIdUserIdsPassed(course.getCourseId(), userIds));
courseStats.setFailed(CourseResultLocalServiceUtil.countStudentsByCourseIdUserIdsFailed(course.getCourseId(), userIds));
}else{
courseStats.setRegistered(CourseLocalServiceUtil.countStudentsStatus(course.getCourseId(), course.getCompanyId(), null, null, null, null, WorkflowConstants.STATUS_ANY, false));
courseStats.setStarted(CourseResultLocalServiceUtil.countStudentsByCourseIdUserExcludedIdsStarted(course.getCourseId(), userExcludedIds));
courseStats.setFinished(CourseResultLocalServiceUtil.countStudentsByCourseIdUserExcludedIdsFinished(course.getCourseId(), userExcludedIds));
courseStats.setPassed(CourseResultLocalServiceUtil.countStudentsByCourseIdUserExcludedIdsPassed(course.getCourseId(), userExcludedIds));
courseStats.setFailed(CourseResultLocalServiceUtil.countStudentsByCourseIdUserExcludedIdsFailed(course.getCourseId(), userExcludedIds));
}
log.debug("CourseStats::getCourseStats::Estadísticas del curso obtenidas");
return courseStats;
}
示例4: getDisplayMessage
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
/**
* @return
* @throws PortalException
* @throws SystemException
*/
private MBMessageDisplay getDisplayMessage() throws PortalException,
SystemException {
String className = Artigo.class.getName();
long idArtigo = ((ArtigoDisplay) getDefaultModelObject()).getId();
HttpServletRequest req = ((WebRequest) RequestCycle.get().getRequest())
.getHttpServletRequest();
ThemeDisplay td = (ThemeDisplay) req
.getAttribute(WebKeys.THEME_DISPLAY);
long userId = td.getUserId();
long groupId = td.getScopeGroupId();
MBMessageDisplay md = MBMessageLocalServiceUtil
.getDiscussionMessageDisplay(userId, groupId, className,
idArtigo, WorkflowConstants.STATUS_ANY);
return md;
}
示例5: getSubscribedThreadsList
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
/**
* Method that get list of subscribed threads by users
*/
public static List<MBThread> getSubscribedThreadsList(HttpServletRequest request) throws PortalException{
_log.debug("Entry: getSubscribedThreadsList");
List<MBThread> subscribedThreadList=new ArrayList<>();
ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
List<Long> categoryIds=new ArrayList<Long>();
PortletPreferences preference=(PortletPreferences)request.getAttribute(CustomConstants.PREFERENCE_REQUEST_ATTRIBUTE);
long preferenceCatId=GetterUtil.getLong(preference.getValue(CustomConstants.PREFERENCE_CATEGORYID, String.valueOf(QueryUtil.ALL_POS)));
List<MBThread> mbThreadList= MBThreadServiceUtil.getGroupThreads(themeDisplay.getScopeGroupId(), themeDisplay.getUserId(),WorkflowConstants.STATUS_APPROVED , true, QueryUtil.ALL_POS,QueryUtil.ALL_POS);
if(preferenceCatId != QueryUtil.ALL_POS){
categoryIds=getPreferenceCatChildList(preferenceCatId, request);
for(MBThread mbThread:mbThreadList){
for(Long categoryId:categoryIds){
if(mbThread.getCategoryId() == categoryId){
subscribedThreadList.add(mbThread);
}
}
}
}
else{
subscribedThreadList=mbThreadList;
}
_log.debug("List Size:=>"+subscribedThreadList.size());
return subscribedThreadList;
}
示例6: getMyPosts
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
/**
*Method that get list of posts by particular user
*/
public static List<MBThread> getMyPosts(HttpServletRequest request) throws PortalException{
_log.debug("Entry : getMyPosts");
List<MBThread> myThreadList=new ArrayList<>();
ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
List<Long> categoryIds=new ArrayList<Long>();
PortletPreferences preference=(PortletPreferences)request.getAttribute(CustomConstants.PREFERENCE_REQUEST_ATTRIBUTE);
long preferenceCatId=GetterUtil.getLong(preference.getValue(CustomConstants.PREFERENCE_CATEGORYID, String.valueOf(QueryUtil.ALL_POS)));
List<MBThread> mbThreadList=MBThreadServiceUtil.getGroupThreads(themeDisplay.getScopeGroupId(), themeDisplay.getUserId(), WorkflowConstants.STATUS_ANY, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
if(preferenceCatId != QueryUtil.ALL_POS){
categoryIds=getPreferenceCatChildList(preferenceCatId, request);
for(MBThread mbThread:mbThreadList){
for(Long categoryId:categoryIds){
if(mbThread.getCategoryId() == categoryId){
myThreadList.add(mbThread);
}
}
}
}
else{
myThreadList=mbThreadList;
}
_log.debug("List Size:=>"+myThreadList.size());
return myThreadList;
}
示例7: getThreadUser
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
public static List<MBStatsUser> getThreadUser(long groupID,List<Long> allChildCategoryList){
List<MBStatsUser> listOfMBStatsUser = new ArrayList<MBStatsUser>();
for(Long categoryID : allChildCategoryList){
_log.debug("categoryID :=>"+categoryID);
List<MBMessage> listOfMessage = MBMessageLocalServiceUtil.getCategoryMessages(groupID, categoryID, WorkflowConstants.STATUS_APPROVED, -1, -1);
for(MBMessage message : listOfMessage){
_log.debug("Message :=>"+message.getSubject()+ " : "+message.getUserId() + " : "+message.getUserName());
MBStatsUser mbStatsUser=MBStatsUserLocalServiceUtil.getStatsUser(groupID, message.getUserId());
if(!listOfMBStatsUser.contains(mbStatsUser)){
listOfMBStatsUser.add(mbStatsUser);
}
}
}
_log.debug("List of mb User :=>"+listOfMBStatsUser);
return listOfMBStatsUser;
}
示例8: getFileAttachVersions
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
@Override
public JSONObject getFileAttachVersions(long fileAttachId, ServiceContext serviceContext) {
JSONObject result = JSONFactoryUtil.createJSONObject();
FileAttach fileAttach = FileAttachLocalServiceUtil.fetchFileAttach(fileAttachId);
if (fileAttach != null && fileAttach.getFileEntryId() > 0) {
JSONArray versions = JSONFactoryUtil.createJSONArray();
List<DLFileVersion> fileVersions = DLFileVersionLocalServiceUtil
.getFileVersions(fileAttach.getFileEntryId(), WorkflowConstants.STATUS_APPROVED);
result.put("total", fileVersions.size());
for (DLFileVersion dlFileVersion : fileVersions) {
JSONObject version = JSONFactoryUtil.createJSONObject();
version.put("fileEntryId", dlFileVersion.getFileEntryId());
version.put("createdDate",
DateTimeUtils.convertDateToString(dlFileVersion.getCreateDate(), DateTimeUtils._TIMESTAMP));
version.put("userId", dlFileVersion.getUserId());
version.put("userName", dlFileVersion.getUserName());
version.put("version", dlFileVersion.getVersion());
versions.put(version);
}
result.put("versions", versions);
result.put("fileName", fileAttach.getFileName());
}
return result;
}
示例9: getCategoryList
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
/**
* Get Category list
*
* @param resourceRequest
* @param resourceResponse
* @return
* @throws PortalException
*/
private String getCategoryList(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws PortalException {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
String[] groupsStrIds = ParamUtil.getStringValues(resourceRequest, "groupIds",
new String[] { String.valueOf(themeDisplay.getScopeGroupId()) });
long[] groupIds = CommonUtil.convertStringToLongArray(groupsStrIds);
long siteGroupId = groupIds[0];
if(_log.isDebugEnabled()) {
_log.debug("SiteGroup Id <" + String.valueOf(siteGroupId) + ">");
}
List<MBCategory> categories = _mbCategoryLocalService.getCategories(
siteGroupId,
MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID,
WorkflowConstants.STATUS_APPROVED,
QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
for(MBCategory category : categories ) {
JSONObject curUserJSONObject = JSONFactoryUtil.createJSONObject();
if(_log.isDebugEnabled()) {
_log.debug("Category name <" + category.getName() + ">");
_log.debug(category.toString());
_log.debug("----------");
}
curUserJSONObject.put("categoryId" , category.getCategoryId());
curUserJSONObject.put("categoryName" , category.getName());
jsonArray.put(curUserJSONObject);
}
return jsonArray.toJSONString();
}
示例10: getThreadList
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
/**
* Get Thread list
*
* Depending on the passed site groupd id, fetch all pages in the site and return JSON object list.
*
* @param resourceRequest
* @param resourceResponse
* @return
* @throws PortalException
*/
protected String getThreadList(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
throws PortalException {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
long siteGroupId = ParamUtil.getLong(resourceRequest, "siteGroupId", themeDisplay.getSiteGroupId());
if(_log.isDebugEnabled()) {
_log.debug("SiteGroup Id <" + String.valueOf(siteGroupId) + ">");
}
List<MBThread> threads = _mbThreadLocalService.getThreads(
siteGroupId,
MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID,
WorkflowConstants.STATUS_APPROVED,
QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
for(MBThread thread : threads ) {
JSONObject curUserJSONObject = JSONFactoryUtil.createJSONObject();
MBMessage message = _mbMessageLocalService.getMessage(thread.getRootMessageId());
if(_log.isDebugEnabled()) {
_log.debug("Root message <" + message.getSubject() + ">");
_log.debug(thread.toString());
_log.debug("----------");
}
curUserJSONObject.put("rootMessageSubject" , message.getSubject());
curUserJSONObject.put("threadId" , thread.getThreadId());
curUserJSONObject.put("rootMessageId" , thread.getRootMessageId());
jsonArray.put(curUserJSONObject);
}
return jsonArray.toJSONString();
}
示例11: _getOnclick
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
private String _getOnclick()
{
PortletURL portletURL = PortletURLFactoryUtil.create(
request, "blade_document_action_portlet_BladeDocumentActionPortlet",
_themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
String fileName = fileVersion.getFileName();
String mimeType = fileVersion.getMimeType();
String version = fileVersion.getVersion();
String createdDate = fileVersion.getCreateDate().toString();
String createdUserName = fileVersion.getUserName();
String statusLabel = WorkflowConstants.getStatusLabel(
fileVersion.getStatus());
portletURL.setParameter("fileName", fileName);
portletURL.setParameter("mimeType", mimeType);
portletURL.setParameter("version", version);
portletURL.setParameter("statusLabel", statusLabel);
portletURL.setParameter("createdDate", createdDate);
portletURL.setParameter("createdUserName", createdUserName);
try {
portletURL.setWindowState(LiferayWindowState.POP_UP);
}
catch (WindowStateException wse) {
_log.error(wse);
}
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Liferay.Util.openWindow({");
stringBuilder.append("dialog: {cache: false,width:800,modal: true},");
stringBuilder.append("title: 'basic information',id: ");
stringBuilder.append("'testPopupIdUnique',uri: '");
stringBuilder.append(portletURL.toString() + "'});");
return stringBuilder.toString();
}
示例12: _getFolderNameIdPairs
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
private List<KeyValuePair> _getFolderNameIdPairs(long groupId)
throws SystemException {
List<BookmarksFolder> folders =
BookmarksFolderLocalServiceUtil.getFolders(
groupId, BookmarksFolderConstants.DEFAULT_PARENT_FOLDER_ID);
List<KeyValuePair> folderNameIdPairs = new ArrayList<KeyValuePair>();
folderNameIdPairs.add(
new KeyValuePair(
"",
String.valueOf(
BookmarksFolderConstants.DEFAULT_PARENT_FOLDER_ID)));
for (BookmarksFolder folder : folders) {
String folderId = String.valueOf(folder.getFolderId());
String folderName = folder.getName();
try {
Method method = BookmarksFolder.class.getMethod(
"getStatus", new Class<?>[0]);
Object status = method.invoke(
BookmarksFolder.class, new Object[0]);
if ((Integer)status != WorkflowConstants.STATUS_APPROVED) {
continue;
}
}
catch (Exception e) {
}
folderNameIdPairs.add(new KeyValuePair(folderName, folderId));
}
return folderNameIdPairs;
}
示例13: getLiferayData
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
@Override
public Map<Long, Data> getLiferayData(Model model, List<Long> groupIds)
throws Exception {
if (indexAllVersions) {
return super.getLiferayData(model, groupIds);
}
Criterion criterion = model.getAttributeCriterion("groupId", groupIds);
Collection<String> attributesToQuery =
ConfigurationUtil.getModelAttributesToQuery(model);
String[] attributesToQueryArr = attributesToQuery.toArray(
new String[0]);
Map<Long, Data> dataMap = new HashMap<Long, Data>();
Criterion criterionStatusApproved = ModelUtil.generateSQLCriterion(
"status=" + WorkflowConstants.STATUS_APPROVED + " or status=" +
WorkflowConstants.STATUS_IN_TRASH);
addMissingJournalArticles(
model, attributesToQueryArr, criterion, criterionStatusApproved,
dataMap);
Criterion criterionStatusNotApproved = ModelUtil.generateSQLCriterion(
"status<>" + WorkflowConstants.STATUS_APPROVED + " or status<>" +
WorkflowConstants.STATUS_IN_TRASH);
addMissingJournalArticles(
model, attributesToQueryArr, criterion, criterionStatusNotApproved,
dataMap);
return dataMap;
}
示例14: getArticleByArticleID
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
public static JournalArticle getArticleByArticleID(final String articleId, final long groupId)
throws SystemException {
JournalArticle article = null;
article = JournalArticleLocalServiceUtil.fetchLatestArticle(groupId, articleId,
WorkflowConstants.STATUS_APPROVED);
return article;
}
示例15: deactivateUser
import com.liferay.portal.kernel.workflow.WorkflowConstants; //导入依赖的package包/类
public void deactivateUser(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException {
long userId = ParamUtil.getLong(actionRequest, "userId");
try{
UserLocalServiceUtil.updateStatus(userId, WorkflowConstants.STATUS_INACTIVE);
SessionMessages.add(actionRequest, "org.oep.useractivity.success.deactive");
}catch(Exception e){
SessionErrors.add(actionRequest,"org.oep.useractivity.error.operation.fail");
}
actionResponse.sendRedirect(ParamUtil.getString(actionRequest, PortletKeys.REDIRECT_PAGE));
}