本文整理汇总了Java中com.liferay.counter.service.CounterLocalServiceUtil.increment方法的典型用法代码示例。如果您正苦于以下问题:Java CounterLocalServiceUtil.increment方法的具体用法?Java CounterLocalServiceUtil.increment怎么用?Java CounterLocalServiceUtil.increment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.counter.service.CounterLocalServiceUtil
的用法示例。
在下文中一共展示了CounterLocalServiceUtil.increment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRegion
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
@Override
public Region addRegion(Region region) throws SystemException {
_log.debug("addRegion");
long regionId = CounterLocalServiceUtil.increment(Region.class.getName());
Region model = regionPersistence.create(regionId);
model.setUserId(region.getUserId());
model.setCompanyId(region.getCompanyId());
model.setCreateDate(new Date());
model.setModifiedDate(new Date());
model.setAgs(region.getAgs());
model.setName(region.getName());
model.setCoordniates_x(region.getCoordniates_x());
model.setCoordniates_y(region.getCoordniates_y());
model.setParentRegion(region.getParentRegion());
return regionPersistence.update(model, true);
}
示例2: createRelatedApplications
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public RelatedApplications createRelatedApplications(long appId1, long appId2) {
long newRelatedApplicationsId;
RelatedApplications _relatedApplications = null;
try {
if (! alreadyAreRelated(appId1, appId2)) {
newRelatedApplicationsId = CounterLocalServiceUtil.increment(RelatedApplications.class.getName());
_relatedApplications = relatedApplicationsPersistence.create(newRelatedApplicationsId);
_relatedApplications.setApplicationId(appId1);
_relatedApplications.setApplicationId2(appId2);
relatedApplicationsPersistence.update(_relatedApplications, true);
}
} catch (SystemException e) {
e.printStackTrace();
}
return _relatedApplications;
}
示例3: addMultiMedia
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public MultiMedia addMultiMedia(MultiMedia multiMedia) throws SystemException {
try {
_log.debug(multiMedia.getUserId());
_log.debug(multiMedia.getImageId());
long multiMediaId = CounterLocalServiceUtil.increment(MultiMedia.class.getName());
MultiMedia model = multiMediaPersistence.create(multiMediaId);
model.setUserId(multiMedia.getUserId());
model.setCompanyId(multiMedia.getCompanyId());
model.setCreateDate(new Date());
model.setModifiedDate(new Date());
model.setApplicationId(multiMedia.getApplicationId());
model.setName(multiMedia.getName());
model.setType(multiMedia.getType());
model.setImageId(multiMedia.getImageId());
return multiMediaPersistence.update(model, true);
} catch (Exception e) {
_log.info(e.toString());
}
return null;
}
示例4: addCheckP2pMailing
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
@Override
public CheckP2pMailing addCheckP2pMailing(CheckP2pMailing newCheckP2pMail)
throws SystemException {
try{
long CheckP2pMailingId = CounterLocalServiceUtil.increment(CheckP2pMailing.class.getName());
CheckP2pMailing fileobj = checkP2pMailingPersistence.create(CheckP2pMailingId);
fileobj.setActId(newCheckP2pMail.getActId());
fileobj.setDate(new java.util.Date(System.currentTimeMillis()));
return checkP2pMailingPersistence.update(fileobj, false);
}
catch(Exception e){
if (_log.isErrorEnabled()) {
_log.error("Error getting CheckP2pMailingLocalService.addCheckP2pMailing");
_log.error(e.getMessage());
}
return null;
}
}
示例5: saveChatRoomVideo
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
private ChatRoomVideo saveChatRoomVideo(ChatRoomVideo video) {
try {
if (video.getVideoId() == 0) {
if (video.isVideoEnabled()) {
long videoId = CounterLocalServiceUtil.increment(ChatRoomVideo.class.getName());
ChatRoomVideo chatRoomVideo = ChatRoomVideoLocalServiceUtil.createChatRoomVideo(videoId);
chatRoomVideo.setVideoDescription(video.getVideoDescription());
chatRoomVideo.setVideoEnabled(video.isVideoEnabled());
chatRoomVideo.setVideoSubtitle(video.getVideoSubtitle());
chatRoomVideo.setVideoTitle(video.getVideoTitle());
chatRoomVideo.setVideoType(video.getVideoType());
chatRoomVideo.setVideoUrl(video.getVideoUrl());
return ChatRoomVideoLocalServiceUtil.addChatRoomVideo(chatRoomVideo);
} else {
return null;
}
} else {
return ChatRoomVideoLocalServiceUtil.updateChatRoomVideo(video, true);
}
} catch (SystemException e) {
throw new RuntimeException(e);
}
}
示例6: createMicroSite
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public static void createMicroSite(ActionRequest request) throws Exception{
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
String cmd = ParamUtil.getString(request, Constants.CMD);
try {
if (cmd.equals(Constants.ADD)) {
Group group = updateGroup(request);
long microSiteId = CounterLocalServiceUtil.increment(MicroSite.class.getName());
MicroSite microSite = MicroSiteLocalServiceUtil.createMicroSite(microSiteId);
microSite.setCompanyId(themeDisplay.getCompanyId());
microSite.setUserId(themeDisplay.getUserId());
microSite.setUserName(themeDisplay.getUser().getScreenName());
microSite.setCreateDate(new Date());
microSite.setModifiedDate(new Date());
microSite.setGroupId(group.getGroupId());
MicroSiteLocalServiceUtil.updateMicroSite(microSite);
}
}
catch (Exception e) {
SessionErrors.add(request, e.getClass());
throw e;
}
}
示例7: addShortUrl
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public ShortUrl addShortUrl(ShortUrl newShortUrl) throws SystemException {
long shortUrlId = CounterLocalServiceUtil.increment(ShortUrl.class.getName());
ShortUrl shortUrl = shortUrlPersistence.create(shortUrlId);
shortUrl.setIdentifier(newShortUrl.getIdentifier());
shortUrl.setOriginalUrl(newShortUrl.getOriginalUrl());
shortUrl.setCompanyId(newShortUrl.getCompanyId());
shortUrl.setGroupId(newShortUrl.getGroupId());
shortUrl.setUserId(newShortUrl.getUserId());
Date now = new Date();
shortUrl.setCreateDate(now);
shortUrl.setModifiedDate(now);
shortUrlPersistence.update(shortUrl);
try {
resourceLocalService.addResources(shortUrl.getCompanyId(), shortUrl.getGroupId(), shortUrl.getUserId(), ShortUrl.class.getName(), shortUrlId, false, true, true);
} catch (PortalException e) {
log.error(e);
}
return shortUrl;
}
示例8: init
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
@Override
public void init()
throws PortletException {
try {
AdminIPConfiguration config = AdminIPConfigurationLocalServiceUtil.getAdminIPConfiguration();
if (config == null) {
long configId = CounterLocalServiceUtil.increment(AdminIPConfiguration.class.getName());
config = AdminIPConfigurationLocalServiceUtil.createAdminIPConfiguration(configId);
config.setDebug(false);
config.setMode(MODE_BOTH);
config.setRedirectUrl(defaultRedirectUrl);
AdminIPConfigurationLocalServiceUtil.addAdminIPConfiguration(config);
}
}
catch (SystemException e) {
logger.error(e.getMessage(), e);
}
super.init();
}
示例9: addEntitlement
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public Entitlement addEntitlement(long userId, long companyId, String entitlementName, String explanation) throws SystemException {
long entitlementId = CounterLocalServiceUtil.increment(Entitlement.class.getName());
_log.debug("addEntitlement: " + entitlementId);
Entitlement model = entitlementPersistence.create(entitlementId);
model.setEntitlementName(entitlementName);
model.setExplanation(explanation);
model.setUserId(userId);
model.setCompanyId(companyId);
model.setCreateDate(new Date());
return entitlementPersistence.update(model, true);
}
示例10: addApplication_Entitlement
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
@Override
public Application_Entitlement addApplication_Entitlement(Application_Entitlement application_Entitlement) throws SystemException {
long application_EntitlementID = CounterLocalServiceUtil.increment(Application_Entitlement.class.getName());
_log.debug("addApplication_Entitlement:application_EntitlementID: " + application_EntitlementID);
Application_Entitlement model = application_EntitlementPersistence.create(application_EntitlementID);
model.setApplicationId(application_Entitlement.getApplicationId());
model.setEntitlementId(application_Entitlement.getEntitlementId());
model.setName(application_Entitlement.getName());
model.setMotivation(application_Entitlement.getMotivation());
model.setCompanyId(application_Entitlement.getCompanyId());
model.setCreateDate(new Date());
model.setModifiedDate(new Date());
model.setUserId(application_Entitlement.getUserId());
return application_EntitlementPersistence.update(model, true);
}
示例11: addLegalDetails
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public LegalDetails addLegalDetails(LegalDetails legalDetails) throws SystemException {
_log.debug("addLegalDetails");
long legalDetailsId = CounterLocalServiceUtil.increment(LegalDetails.class.getName());
LegalDetails model = legalDetailsPersistence.create(legalDetailsId);
model.setAddress(legalDetails.getAddress());
model.setEmail(legalDetails.getEmail());
model.setUserId(legalDetails.getUserId());
model.setCompanyId(legalDetails.getCompanyId());
model.setCreateDate(new Date());
model.setFax(legalDetails.getFax());
model.setTelephone(legalDetails.getTelephone());
model.setURL(legalDetails.getURL());
model.setValueAddedTaxNo(legalDetails.getValueAddedTaxNo());
return legalDetailsPersistence.update(model, true);
}
示例12: addLink
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public Link addLink(Link link) throws SystemException {
_log.debug("addLink");
long linkId = CounterLocalServiceUtil.increment(Link.class.getName());
Link model = linkPersistence.create(linkId);
model.setUserId(link.getUserId());
model.setCompanyId(link.getCompanyId());
model.setCreateDate(new Date());
model.setModifiedDate(new Date());
model.setApplicationId(link.getApplicationId());
model.setDisplayName(link.getDisplayName());
model.setType(link.getType());
model.setUrl(link.getUrl());
return linkPersistence.update(model, true);
}
示例13: addCategory
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public Category addCategory(long userId, long companyId, String categoryName, long parentCategory) throws SystemException {
long categoryId = CounterLocalServiceUtil.increment(Category.class.getName());
_log.debug("addCategory: " + categoryId);
Category category = categoryPersistence.create(categoryId);
category.setCategoryName(categoryName);
category.setParentCategory(parentCategory);
category.setUserId(userId);
category.setCompanyId(companyId);
category.setCreateDate(new Date());
category.setModifiedDate((new Date()));
return categoryPersistence.update(category, true);
}
示例14: addLanguage
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
public Language addLanguage(Language language) throws SystemException {
_log.debug("addLanguage");
long languageId = CounterLocalServiceUtil.increment(Language.class.getName());
Language model = languagePersistence.create(languageId);
model.setLanguageAbbreviation(language.getLanguageAbbreviation());
model.setLanguageName(language.getLanguageName());
model.setUserId(language.getUserId());
model.setCompanyId(language.getCompanyId());
model.setCreateDate(new Date());
model.setModifiedDate(new Date());
return languagePersistence.update(model, true);
}
示例15: activateCompetence
import com.liferay.counter.service.CounterLocalServiceUtil; //导入方法依赖的package包/类
@ProcessAction(name="activateCompetence")
public void activateCompetence(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
Long courseId = ParamUtil.getLong(actionRequest, "courseId");
Long competenceId = ParamUtil.getLong(actionRequest, "competenceId");
Boolean condition = ParamUtil.getBoolean(actionRequest, "condition");
String tab = ParamUtil.getString(actionRequest, "tab");
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
CourseCompetence cc = CourseCompetenceLocalServiceUtil.fetchByCourseCompetenceCondition(courseId, competenceId, condition);
if(cc==null){
long courseCompetenceId = CounterLocalServiceUtil.increment(CourseCompetence.class.getName());
cc = CourseCompetenceLocalServiceUtil.createCourseCompetence(courseCompetenceId);
cc.setCourseId(courseId);
cc.setCompetenceId(competenceId);
cc.setCachedModel(condition);
cc.setCondition(condition);
CourseCompetenceLocalServiceUtil.updateCourseCompetence(cc, true);
}
actionResponse.setRenderParameter("jspPage","/html/courseadmin/competencetab.jsp");
actionResponse.setRenderParameter("courseId", String.valueOf(courseId));
actionResponse.setRenderParameter("competenceId", String.valueOf(competenceId));
if(log.isDebugEnabled())log.debug("tab::"+tab);
if(tab.equals("1")){
actionResponse.setRenderParameter("tabs1", LanguageUtil.get(themeDisplay.getLocale(),"competences.necessary"));
}else{
actionResponse.setRenderParameter("tabs1", LanguageUtil.get(themeDisplay.getLocale(),"competences.assigned"));
}
}