rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
setModified(true);
public void setOrganizationId(String organizationId) { if (((organizationId == null) && (_organizationId != null)) || ((organizationId != null) && (_organizationId == null)) || ((organizationId != null) && (_organizationId != null) && !organizationId.equals(_organizationId))) { if (!XSS_ALLOW_ORGANIZATIONI...
setModified(true);
public void setRecursable(boolean recursable) { if (recursable != _recursable) { _recursable = recursable; setModified(true); } }
public void init(FilterConfig filterConfig) { _filterConfig = filterConfig;
public void init(FilterConfig config) { _config = config;
public void init(FilterConfig filterConfig) { _filterConfig = filterConfig; }
public static void check(PortletRequest req) throws CaptchaException { if (GetterUtil.getBoolean(PropsUtil.get(PropsUtil.CAPTCHA_CHALLENGE))) {
public static void check(PortletRequest req) throws CaptchaTextException { if (isEnabled(req)) {
public static void check(PortletRequest req) throws CaptchaException { if (GetterUtil.getBoolean(PropsUtil.get(PropsUtil.CAPTCHA_CHALLENGE))) { PortletSession ses = req.getPortletSession(); String captcha = (String)ses.getAttribute(WebKeys.CAPTCHA); // Captcha should never be null, but on the rare occasion it i...
String captcha = (String)ses.getAttribute(WebKeys.CAPTCHA);
String captchaText = (String)ses.getAttribute(WebKeys.CAPTCHA_TEXT);
public static void check(PortletRequest req) throws CaptchaException { if (GetterUtil.getBoolean(PropsUtil.get(PropsUtil.CAPTCHA_CHALLENGE))) { PortletSession ses = req.getPortletSession(); String captcha = (String)ses.getAttribute(WebKeys.CAPTCHA); // Captcha should never be null, but on the rare occasion it i...
if (captcha != null) { if (!captcha.equals(ParamUtil.getString(req, "captcha"))) { throw new CaptchaException();
if (captchaText != null) { if (!captchaText.equals( ParamUtil.getString(req, "captchaText"))) { throw new CaptchaTextException(); } else { if (_log.isDebugEnabled()) { _log.debug("Captcha text is valid"); } int captchaMaxChallenges = GetterUtil.getInteger( PropsUtil.get(PropsUtil.CAPTCHA_MAX_CHALLENGES)); if (captch...
public static void check(PortletRequest req) throws CaptchaException { if (GetterUtil.getBoolean(PropsUtil.get(PropsUtil.CAPTCHA_CHALLENGE))) { PortletSession ses = req.getPortletSession(); String captcha = (String)ses.getAttribute(WebKeys.CAPTCHA); // Captcha should never be null, but on the rare occasion it i...
_log.error("Captcha is null");
_log.error("Captcha text is null");
public static void check(PortletRequest req) throws CaptchaException { if (GetterUtil.getBoolean(PropsUtil.get(PropsUtil.CAPTCHA_CHALLENGE))) { PortletSession ses = req.getPortletSession(); String captcha = (String)ses.getAttribute(WebKeys.CAPTCHA); // Captcha should never be null, but on the rare occasion it i...
int msgList[] = StringUtil.split(messages, ",", -1);
long msgList[] = StringUtil.split(messages, ",", -1L);
private String _deleteMessages(HttpServletRequest req) { try { String messages = ParamUtil.getString(req, "messages"); int msgList[] = StringUtil.split(messages, ",", -1); String userId = PortalUtil.getUserId(req); String password = PortalUtil.getUserPassword(req); MailUtil.deleteMessages(userId, pass...
jMe.put("id", me.getMsgNum());
jMe.put("id", me.getMsgUID());
private String _getPreviewHeaders(HttpServletRequest req) { JSONObject jsonObj = new JSONObject(); try { String userId = PortalUtil.getUserId(req); String password = PortalUtil.getUserPassword(req); String folderId = ParamUtil.getString(req, "folderId"); MailUtil.setCurrentFolder(userId, password, fold...
int msgList[] = StringUtil.split(messages, ",", -1);
long msgList[] = StringUtil.split(messages, ",", -1L);
private String _moveMessages(HttpServletRequest req) { try { String userId = PortalUtil.getUserId(req); String password = PortalUtil.getUserPassword(req); String messages = ParamUtil.getString(req, "messages"); String toFolder = ParamUtil.getString(req, "folderId"); int msgList[] = StringUtil.split(messages...
if (userIdMapper.isNew() || userIdMapper.isModified()) { session = openSession(); if (userIdMapper.isNew()) { UserIdMapper userIdMapperModel = new UserIdMapper(); userIdMapperModel.setUserId(userIdMapper.getUserId()); userIdMapperModel.setType(userIdMapper.getType()); userIdMapperModel.setDescription(userIdMapper.getD...
session = openSession(); session.saveOrUpdate(userIdMapper); session.flush(); userIdMapper.setNew(false);
public com.liferay.portal.model.UserIdMapper update( com.liferay.portal.model.UserIdMapper userIdMapper) throws SystemException { Session session = null; try { if (userIdMapper.isNew() || userIdMapper.isModified()) { session = openSession(); if (userIdMapper.isNew()) { UserIdMapper userIdMapperModel = ...
int value = message1.getCreateDate().compareTo( message2.getCreateDate());
int value = DateUtil.compareTo( message1.getCreateDate(), message2.getCreateDate());
public int compare(Object obj1, Object obj2) { MBMessage message1 = (MBMessage)obj1; MBMessage message2 = (MBMessage)obj2; int value = message1.getCreateDate().compareTo( message2.getCreateDate()); if (_asc) { return value; } else { return -value; } }
throws RemoteException, SystemException;
throws SystemException;
public Hits search( String companyId, String portletId, String groupId, String[] repositoryIds, String keywords) throws RemoteException, SystemException;
baseDir = OmniadminUtil.getAutoDeployDeployDir(); destDir = OmniadminUtil.getAutoDeployDestDir();
baseDir = PrefsPropsUtil.getString( PropsUtil.AUTO_DEPLOY_DEPLOY_DIR); destDir = PrefsPropsUtil.getString(PropsUtil.AUTO_DEPLOY_DEST_DIR);
public AutoThemeDeployer() { try { baseDir = OmniadminUtil.getAutoDeployDeployDir(); destDir = OmniadminUtil.getAutoDeployDestDir(); appServerType = ServerDetector.getServerId(); themeTaglibDTD = DeployUtil.getResourcePath("liferay-theme.tld"); utilTaglibDTD = DeployUtil.getResourcePath("liferay-util.tld");...
unpackWar = OmniadminUtil.getAutoDeployUnpackWar(); tomcatLibDir = OmniadminUtil.getAutoDeployTomcatLibDir();
unpackWar = PrefsPropsUtil.getBoolean( PropsUtil.AUTO_DEPLOY_UNPACK_WAR); tomcatLibDir = PrefsPropsUtil.getString( PropsUtil.AUTO_DEPLOY_TOMCAT_LIB_DIR);
public AutoThemeDeployer() { try { baseDir = OmniadminUtil.getAutoDeployDeployDir(); destDir = OmniadminUtil.getAutoDeployDestDir(); appServerType = ServerDetector.getServerId(); themeTaglibDTD = DeployUtil.getResourcePath("liferay-theme.tld"); utilTaglibDTD = DeployUtil.getResourcePath("liferay-util.tld");...
request.setCharacterEncoding(ENCODING);
public void doFilter( ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { if (USE_LAYOUT_CACHE_FILTER) { _log.debug("Layout cache is enabled"); } else { _log.debug("Layout cache is disabled"); } HttpServletRequest request = (HttpServletRequest)req; HttpServle...
portletTaglibDTD = getResourcePath("liferay-portlet.tld");
portletTaglibDTD = DeployUtil.getResourcePath( "liferay-portlet.tld");
public AutoPortletDeployer() { try { baseDir = OmniadminUtil.getAutoDeployDeployDir(); destDir = OmniadminUtil.getAutoDeployDestDir(); appServerType = ServerDetector.getServerId(); portletTaglibDTD = getResourcePath("liferay-portlet.tld"); unpackWar = OmniadminUtil.getAutoDeployUnpackWar(); jbossPrefix = ...
jars.add(getResourcePath("util-java.jar")); jars.add(getResourcePath("util-taglib.jar"));
jars.add(DeployUtil.getResourcePath("util-java.jar")); jars.add(DeployUtil.getResourcePath("util-jsf.jar")); jars.add(DeployUtil.getResourcePath("util-taglib.jar"));
public AutoPortletDeployer() { try { baseDir = OmniadminUtil.getAutoDeployDeployDir(); destDir = OmniadminUtil.getAutoDeployDestDir(); appServerType = ServerDetector.getServerId(); portletTaglibDTD = getResourcePath("liferay-portlet.tld"); unpackWar = OmniadminUtil.getAutoDeployUnpackWar(); jbossPrefix = ...
RenderRequest renderRequest, String pathInfo,
PortletRequest portletRequest, String pathInfo,
public PortletServletRequest(HttpServletRequest req, RenderRequest renderRequest, String pathInfo, String queryString, String requestURI, String servletPath, Map sharedHttpSessionAttributes) { super(req); _req = req; _renderRequest = renderRequest; _pathInfo = pathInfo; _queryStrin...
_renderRequest = renderRequest;
_portletRequest = portletRequest;
public PortletServletRequest(HttpServletRequest req, RenderRequest renderRequest, String pathInfo, String queryString, String requestURI, String servletPath, Map sharedHttpSessionAttributes) { super(req); _req = req; _renderRequest = renderRequest; _pathInfo = pathInfo; _queryStrin...
return super.getAttribute(name);
return retVal;
public Object getAttribute(String name) { if (name == null) { return super.getAttribute(name); } /*if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_CONTEXT_PATH)) { return getContextPath(); } else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_PATH_INFO)) { return getPathInfo(); } else if (name.equals(WebKeys...
/*if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_CONTEXT_PATH)) { return getContextPath();
if (ServerDetector.isWebSphere() && reqImpl.getPortlet().isWARFile()) { if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_CONTEXT_PATH)) { retVal = _portletRequest.getContextPath(); } else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_PATH_INFO)) { retVal = _pathInfo; } else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_QU...
public Object getAttribute(String name) { if (name == null) { return super.getAttribute(name); } /*if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_CONTEXT_PATH)) { return getContextPath(); } else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_PATH_INFO)) { return getPathInfo(); } else if (name.equals(WebKeys...
else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_PATH_INFO)) { return getPathInfo(); } else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_QUERY_STRING)) { return getQueryString(); } else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_REQUEST_URI)) { return getRequestURI(); } else if (name.equals(WebKeys.JAVAX_SERVLET_...
return retVal;
public Object getAttribute(String name) { if (name == null) { return super.getAttribute(name); } /*if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_CONTEXT_PATH)) { return getContextPath(); } else if (name.equals(WebKeys.JAVAX_SERVLET_INCLUDE_PATH_INFO)) { return getPathInfo(); } else if (name.equals(WebKeys...
return _renderRequest.getContextPath();
return _portletRequest.getContextPath();
public String getContextPath() { return _renderRequest.getContextPath(); }
return _renderRequest.getLocale();
return _portletRequest.getLocale();
public Locale getLocale() { return _renderRequest.getLocale(); }
return _renderRequest.getLocales();
return _portletRequest.getLocales();
public Enumeration getLocales() { return _renderRequest.getLocales(); }
else if (strutsAction.equals("/message_boards/view_topic")) { String topicId = getParameter("topicId"); if (Validator.isNotNull(topicId)) { friendlyURL = "/message_boards/topic/" + topicId; } }
protected String generateToString() { String toString = super.generateToString(); String layoutFriendlyURL = getLayoutFriendlyURL(); String tabs2 = getParameter("tabs2"); if (Validator.isNull(layoutFriendlyURL) || Validator.isNotNull(tabs2)) { return toString; } String friendlyURL = null; String strutsAction ...
String mainPath = null; if (_portletReq != null) { PortletContext portletCtx = _portletReq.getPortletSession().getPortletContext(); mainPath = (String)portletCtx.getAttribute(WebKeys.MAIN_PATH); } else { mainPath = (String)_req.getAttribute(WebKeys.MAIN_PATH); } sb.append(mainPath);
sb.append(themeDisplay.getPathMain());
public String toString() { if (_toString != null) { return _toString; } StringBuffer sb = new StringBuffer(); ThemeDisplay themeDisplay = (ThemeDisplay)_req.getAttribute(WebKeys.THEME_DISPLAY); PortletDisplay portletDisplay = themeDisplay.getPortletDisplay(); sb.append(PortalUtil.getPortalURL(_req, _secure))...
jo.put("status", "success");
public String getJSON(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception { String cmd = ParamUtil.getString(req, Constants.CMD); JSONObject jo = new JSONObject(); if ("getChats".equals(cmd)) { jo = getUpdates(req); } else if ("getRosterChats".equals(cmd)) ...
if (msgWait != null) {
if (msgWait == null) { jo.put("status", "failure"); } else {
protected JSONObject getUpdates(HttpServletRequest req) { HttpSession ses = req.getSession(); JabberSession jabberSes = (JabberSession) ses.getAttribute(WebKeys.JABBER_XMPP_SESSION); JSONObject jo = new JSONObject(); String waitCmd = ""; try { MessageWait msgWait = jabberSes.getMessageWait(); if (msgWait...
jo.put("status", "success");
protected JSONObject getUpdates(HttpServletRequest req) { HttpSession ses = req.getSession(); JabberSession jabberSes = (JabberSession) ses.getAttribute(WebKeys.JABBER_XMPP_SESSION); JSONObject jo = new JSONObject(); String waitCmd = ""; try { MessageWait msgWait = jabberSes.getMessageWait(); if (msgWait...
.get(PropsUtil.JABBER_XMPP_HEARTBEAT_MILLISEC), 12000);
.get(PropsUtil.JABBER_XMPP_HEARTBEAT_MILLISEC), 120000);
public synchronized void waitForMessages() throws InterruptedException { int heartbeatCycle = GetterUtil.getInteger(PropsUtil .get(PropsUtil.JABBER_XMPP_HEARTBEAT_MILLISEC), 12000); wait(heartbeatCycle); }
public String getFullName() { return getContact().getFullName();
public static String getFullName( String firstName, String middleName, String lastName) { return Contact.getFullName(firstName, middleName, lastName);
public String getFullName() { return getContact().getFullName(); }
return names[new Random().nextInt(3)];
return names[Randomizer.getInstance().nextInt(3)];
public String getValue(String name, Map userInfo) { if (name == null) { return null; } String companyId = (String)userInfo.get( UserAttributes.LIFERAY_COMPANY_ID); String userId = (String)userInfo.get(UserAttributes.LIFERAY_USER_ID); if (name.equals("user.name.random")) { String[] names = new String[] {"Aaa...
Iterator itr = ImageServiceUtil.getImageById(
Iterator itr = ImageLocalServiceUtil.search(
protected void insertDataImage(ZipWriter zipWriter) throws Exception { StringBuffer sb = new StringBuffer(); Iterator itr = ImageServiceUtil.getImageById( COMPANY_ID + "%").iterator(); while (itr.hasNext()) { Image image = (Image)itr.next(); String imageId = image.getImageId(); boolean insert = true; if (...
validate(null, companyId, name); String roleId = Long.toString(CounterServiceUtil.increment( Role.class.getName())); Role role = RoleUtil.create(roleId); role.setCompanyId(companyId); role.setName(name); RoleUtil.update(role); return role;
return addRole(companyId, name, null, null);
public Role addRole(String companyId, String name) throws PortalException, SystemException { validate(null, companyId, name); String roleId = Long.toString(CounterServiceUtil.increment( Role.class.getName())); Role role = RoleUtil.create(roleId); role.setCompanyId(companyId); role.setName(name); RoleUtil.upda...
java.lang.String folderId, java.lang.String name, java.lang.String title, java.lang.String description)
java.lang.String folderId, java.lang.String newFolderId, java.lang.String name, java.lang.String sourceFileName, java.lang.String title, java.lang.String description, byte[] byteArray)
public static com.liferay.portlet.documentlibrary.model.DLFileEntryModel updateFileEntry( java.lang.String folderId, java.lang.String name, java.lang.String title, java.lang.String description) throws RemoteException { try { com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUt...
name, title, description);
newFolderId, name, sourceFileName, title, description, byteArray);
public static com.liferay.portlet.documentlibrary.model.DLFileEntryModel updateFileEntry( java.lang.String folderId, java.lang.String name, java.lang.String title, java.lang.String description) throws RemoteException { try { com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUt...
doc.add(new Field(LuceneFields.TITLE, title, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(new Field(LuceneFields.CONTENT, content, Field.Store.YES, Field.Index.TOKENIZED));
doc.add(LuceneFields.getText(LuceneFields.TITLE, title)); doc.add(LuceneFields.getText(LuceneFields.CONTENT, content));
public static void addPage( String companyId, String groupId, String nodeId, String title, String content) throws IOException { synchronized (IndexWriter.class) { content = Html.stripHtml(content); deletePage(companyId, nodeId, title); IndexWriter writer = LuceneUtil.getWriter(companyId); Document doc = ...
QueryParser queryParser = new QueryParser(LuceneFields.CONTENT, LuceneUtil.getAnalyzer()); Query query = queryParser.parse(booleanQuery.toString()); Hits hits = searcher.search(query);
Hits hits = searcher.search(booleanQuery);
public static void deletePages(String companyId, String nodeId) throws IOException, ParseException { synchronized (IndexWriter.class) { BooleanQuery booleanQuery = new BooleanQuery(); LuceneUtil.addRequiredTerm( booleanQuery, LuceneFields.PORTLET_ID, PORTLET_ID); LuceneUtil.addRequiredTerm(booleanQuery, "no...
PortletPreferences prefs = OmniadminUtil.getPreferences();
PortletPreferences prefs = PrefsPropsUtil.getPreferences();
protected void autoDeploy(ActionRequest req) throws Exception { String deployDir = ParamUtil.getString(req, "deployDir"); String destDir = ParamUtil.getString(req, "destDir"); long interval = ParamUtil.getLong(req, "interval"); boolean unpackWar = ParamUtil.getBoolean(req, "unpackWar"); String tomcatLibDir = Para...
java.lang.String folderId, java.lang.String name, java.lang.String title, java.lang.String description)
java.lang.String userId, java.lang.String folderId, java.lang.String newFolderId, java.lang.String name, java.lang.String sourceFileName, java.lang.String title, java.lang.String description, byte[] byteArray)
public com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry( java.lang.String folderId, java.lang.String name, java.lang.String title, java.lang.String description) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException;
if (dlFileRank.isNew() || dlFileRank.isModified()) { session = openSession(); if (dlFileRank.isNew()) { DLFileRank dlFileRankModel = new DLFileRank(); dlFileRankModel.setCompanyId(dlFileRank.getCompanyId()); dlFileRankModel.setUserId(dlFileRank.getUserId()); dlFileRankModel.setFolderId(dlFileRank.getFolderId()); dlFil...
session = openSession(); session.saveOrUpdate(dlFileRank); session.flush(); dlFileRank.setNew(false);
public com.liferay.portlet.documentlibrary.model.DLFileRank update( com.liferay.portlet.documentlibrary.model.DLFileRank dlFileRank) throws SystemException { Session session = null; try { if (dlFileRank.isNew() || dlFileRank.isModified()) { session = openSession(); if (dlFileRank.isNew()) { DLFileRank ...
public void setScores(Float[] scores) { float[] primScores = new float[scores.length]; for (int i = 0; i < scores.length; i++) { primScores[i] = scores[i].floatValue(); } setScores(primScores);
public void setScores(float[] scores) { _scores = scores;
public void setScores(Float[] scores) { float[] primScores = new float[scores.length]; for (int i = 0; i < scores.length; i++) { primScores[i] = scores[i].floatValue(); } setScores(primScores); }
java.lang.String className, java.lang.String classPK,
public static com.liferay.portal.model.Group addGroup( java.lang.String className, java.lang.String classPK, java.lang.String name, java.lang.String friendlyURL) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { GroupService groupService = GroupServiceFactory.getService(); ...
return groupService.addGroup(className, classPK, name, friendlyURL);
return groupService.addGroup(name, friendlyURL);
public static com.liferay.portal.model.Group addGroup( java.lang.String className, java.lang.String classPK, java.lang.String name, java.lang.String friendlyURL) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { GroupService groupService = GroupServiceFactory.getService(); ...
public com.liferay.portal.model.Group getGroup(java.lang.String companyId, java.lang.String name)
public com.liferay.portal.model.Group getGroup(java.lang.String groupId)
public com.liferay.portal.model.Group getGroup(java.lang.String companyId, java.lang.String name) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException, java.rmi.RemoteException;
_closeFolder(ses); setFolder(ses, lastFolderName);
public static void completeMessage( HttpServletRequest req, MailMessage mailMessage, boolean send, long draftId) throws ContentException, ContentPathException, FolderException, RecipientException, StoreException { HttpSession ses = req.getSession(); try { if (send && Validator.isNull(mailMessage.getTo())...
for (int i = messages.length - 1; i >= 0; i--) {
for (int i = 0; i < messages.length; i++) {
public static Set getEnvelopes(HttpSession ses, Comparator comparator) throws FolderException { Set envelopes = new TreeSet(comparator); try { MailSessionLock.getInstance().lock(ses.getId()); IMAPFolder folder = _getFolder(ses); Message[] messages = folder.getMessages(); FetchProfile fetchProfile = new Fetc...
public MailFolder(String name, long messageCount, long newMessageCount) {
public MailFolder(String name, long messageCount, long unreadMessageCount) {
public MailFolder(String name, long messageCount, long newMessageCount) { _name = name; _messageCount = messageCount; _newMessageCount = newMessageCount; }
_newMessageCount = newMessageCount;
_unreadMessageCount = unreadMessageCount;
public MailFolder(String name, long messageCount, long newMessageCount) { _name = name; _messageCount = messageCount; _newMessageCount = newMessageCount; }
order.setCcName(user.getFullName());
public ShoppingOrder getLatestOrder(String userId, String groupId) throws PortalException, SystemException { List orders = ShoppingOrderUtil.findByG_U_PPPS( groupId, userId, ShoppingOrder.STATUS_LATEST, 0, 1); ShoppingOrder order = null; if (orders.size() == 1) { order = (ShoppingOrder)orders.get(0); } else ...
public static double calculateActualPrice(ShoppingItem item, int count) throws PortalException, SystemException { return calculatePrice(item, count) - calculateDiscountPrice(item, count);
public static double calculateActualPrice(ShoppingItem item) { return item.getPrice() - calculateDiscountPrice(item);
public static double calculateActualPrice(ShoppingItem item, int count) throws PortalException, SystemException { return calculatePrice(item, count) - calculateDiscountPrice(item, count); }
Map items, String stateId, ShoppingCoupon coupon)
Map items, ShoppingCoupon coupon)
public static double calculateCouponDiscount( Map items, String stateId, ShoppingCoupon coupon) throws PortalException, SystemException { double discount = 0.0; if ((coupon == null) || !coupon.isActive() || !coupon.hasValidDateRange()) { return discount; } String[] categoryIds = StringUtil.split(coupon.getL...
double discount = 0.0; if ((coupon == null) || !coupon.isActive() || !coupon.hasValidDateRange()) { return discount; } String[] categoryIds = StringUtil.split(coupon.getLimitCategories()); String[] skus = StringUtil.split(coupon.getLimitSkus()); if ((categoryIds.length > 0) || (skus.length > 0)) { Set categoryIdsSe...
return calculateCouponDiscount(items, null, coupon);
public static double calculateCouponDiscount( Map items, String stateId, ShoppingCoupon coupon) throws PortalException, SystemException { double discount = 0.0; if ((coupon == null) || !coupon.isActive() || !coupon.hasValidDateRange()) { return discount; } String[] categoryIds = StringUtil.split(coupon.getL...
public OrderDateComparator(boolean asc) { _asc = asc;
public OrderDateComparator() { this(false);
public OrderDateComparator(boolean asc) { _asc = asc; }
if (Validator.isNull(ppPaymentStatus)) { sql = StringUtil.replace( sql, "ppPaymentStatus = ?", "ppPaymentStatus != ?"); ppPaymentStatus = ShoppingOrder.STATUS_LATEST; }
public static List findByO_G_C_U_PPPS( String orderId, String groupId, String companyId, String userId, String billingFirstName, String billingLastName, String billingEmailAddress, String shippingFirstName, String shippingLastName, String shippingEmailAddress, String ppPaymentStatus, boolean andOperator, int...
if (Validator.isNull(ppPaymentStatus)) { sql = StringUtil.replace( sql, "ppPaymentStatus = ?", "ppPaymentStatus != ?"); ppPaymentStatus = ShoppingOrder.STATUS_LATEST; }
public static int countByO_G_C_U_PPPS( String orderId, String groupId, String companyId, String userId, String billingFirstName, String billingLastName, String billingEmailAddress, String shippingFirstName, String shippingLastName, String shippingEmailAddress, String ppPaymentStatus, boolean andOperator) th...
public static double calculateTotal(ShoppingOrder order)
public static double calculateTotal( Map items, String stateId, ShoppingCoupon coupon, int altShipping, boolean insure)
public static double calculateTotal(ShoppingOrder order) throws PortalException, SystemException { List orderItems = ShoppingOrderItemLocalServiceUtil.getOrderItems( order.getOrderId()); double total = calculateActualSubtotal(orderItems) + order.getTax() + order.getShipping() + order.getInsurance() - ord...
List orderItems = ShoppingOrderItemLocalServiceUtil.getOrderItems( order.getOrderId());
double actualSubtotal = calculateActualSubtotal(items); double tax = calculateTax(items, stateId); double shipping = calculateAlternativeShipping(items, altShipping); double insurance = 0.0; if (insure) { insurance = calculateInsurance(items); } double couponDiscount = calculateCouponDiscount(items, stateId, coupon);
public static double calculateTotal(ShoppingOrder order) throws PortalException, SystemException { List orderItems = ShoppingOrderItemLocalServiceUtil.getOrderItems( order.getOrderId()); double total = calculateActualSubtotal(orderItems) + order.getTax() + order.getShipping() + order.getInsurance() - ord...
calculateActualSubtotal(orderItems) + order.getTax() + order.getShipping() + order.getInsurance() - order.getCouponDiscount();
actualSubtotal + tax + shipping + insurance - couponDiscount;
public static double calculateTotal(ShoppingOrder order) throws PortalException, SystemException { List orderItems = ShoppingOrderItemLocalServiceUtil.getOrderItems( order.getOrderId()); double total = calculateActualSubtotal(orderItems) + order.getTax() + order.getShipping() + order.getInsurance() - ord...
java.lang.String companyId, java.lang.String parentOrganizationId,
java.lang.String userId, java.lang.String parentOrganizationId,
public com.liferay.portal.model.Organization addOrganization( java.lang.String companyId, java.lang.String parentOrganizationId, java.lang.String name, java.lang.String regionId, java.lang.String countryId, java.lang.String statusId, boolean location) throws com.liferay.portal.PortalException, com.liferay.porta...
return getService().addOrganization(companyId, parentOrganizationId, name, regionId, countryId, statusId, location);
return getService().addOrganization(userId, parentOrganizationId, name, regionId, countryId, statusId, location);
public com.liferay.portal.model.Organization addOrganization( java.lang.String companyId, java.lang.String parentOrganizationId, java.lang.String name, java.lang.String regionId, java.lang.String countryId, java.lang.String statusId, boolean location) throws com.liferay.portal.PortalException, com.liferay.porta...
java.lang.String companyId, java.lang.String parentOrganizationId,
java.lang.String userId, java.lang.String parentOrganizationId,
public com.liferay.portal.model.Organization addOrganization( java.lang.String companyId, java.lang.String parentOrganizationId, java.lang.String name, java.lang.String regionId, java.lang.String countryId, java.lang.String statusId, boolean location) throws com.liferay.portal.PortalException, com.liferay.porta...
throws PortalException, SystemException {
throws SystemException {
public static Hits search( String companyId, String portletId, String groupId, String[] repositoryIds, String keywords) throws PortalException, SystemException { try { DLLocalService dlLocalService = DLLocalServiceFactory.getService(); return dlLocalService.search( companyId, portletId, groupId, repositor...
doc.add(new Field(LuceneFields.TITLE, title, Field.Store.YES, Field.Index.TOKENIZED)); doc.add(new Field(LuceneFields.CONTENT, content, Field.Store.YES, Field.Index.TOKENIZED));
doc.add(LuceneFields.getText(LuceneFields.TITLE, title)); doc.add(LuceneFields.getText(LuceneFields.CONTENT, content));
public static void addArticle( String companyId, String groupId, String articleId, double version, String title, String content, String type, Date displayDate) throws IOException { synchronized (IndexWriter.class) { if ((content != null) && (content.indexOf("<root>") != -1) && (content.indexOf("<dynamic-con...
final IWorkbenchWindow window, final boolean throwError )
final IWorkbenchWindow window )
public RunMonkeyScript( final IFile file, final IWorkbenchWindow window, final boolean throwError ) { this( file, window, null, throwError ); }
this( file, window, null, throwError ); }
this( file, window, false ); }
public RunMonkeyScript( final IFile file, final IWorkbenchWindow window, final boolean throwError ) { this( file, window, null, throwError ); }
if (company.isNew() || company.isModified()) { session = openSession(); if (company.isNew()) { Company companyModel = new Company(); companyModel.setCompanyId(company.getCompanyId()); companyModel.setKey(company.getKey()); companyModel.setPortalURL(company.getPortalURL()); companyModel.setHomeURL(company.getHomeURL())...
session = openSession(); session.saveOrUpdate(company); session.flush(); company.setNew(false);
public com.liferay.portal.model.Company update( com.liferay.portal.model.Company company) throws SystemException { Session session = null; try { if (company.isNew() || company.isModified()) { session = openSession(); if (company.isNew()) { Company companyModel = new Company(); companyModel.setCompan...
java.lang.String companyId, java.lang.String name, java.lang.String typeId, java.lang.String scope, java.lang.String primKey)
java.lang.String resourceId)
public com.liferay.portal.model.Resource getResource( java.lang.String companyId, java.lang.String name, java.lang.String typeId, java.lang.String scope, java.lang.String primKey) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException;
java.lang.String companyId, java.lang.String name, java.lang.String typeId, java.lang.String scope, java.lang.String primKey)
java.lang.String resourceId)
public com.liferay.portal.model.Resource getResource( java.lang.String companyId, java.lang.String name, java.lang.String typeId, java.lang.String scope, java.lang.String primKey) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { return getService().getResource(companyId, name, ty...
return getService().getResource(companyId, name, typeId, scope, primKey);
return getService().getResource(resourceId);
public com.liferay.portal.model.Resource getResource( java.lang.String companyId, java.lang.String name, java.lang.String typeId, java.lang.String scope, java.lang.String primKey) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { return getService().getResource(companyId, name, ty...
String articleId, double version, boolean incrementVersion, String title, String content, String type, String structureId, String templateId, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int expirationDateYear,...
String companyId, String articleId, double version, boolean incrementVersion, String title, String content, String type, String structureId, String templateId, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay, int e...
public JournalArticle updateArticle( String articleId, double version, boolean incrementVersion, String title, String content, String type, String structureId, String templateId, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth...
User user = getUser();
public JournalArticle updateArticle( String articleId, double version, boolean incrementVersion, String title, String content, String type, String structureId, String templateId, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth...
getPermissionChecker(), user.getCompanyId(), articleId, ActionKeys.UPDATE);
getPermissionChecker(), companyId, articleId, ActionKeys.UPDATE);
public JournalArticle updateArticle( String articleId, double version, boolean incrementVersion, String title, String content, String type, String structureId, String templateId, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth...
user.getUserId(), articleId, version, incrementVersion, title, content, type, structureId, templateId, displayDateMonth, displayDateDay, displayDateYear, displayDateHour, displayDateMinute,
getUserId(), articleId, version, incrementVersion, title, content, type, structureId, templateId, displayDateMonth, displayDateDay, displayDateYear, displayDateHour, displayDateMinute,
public JournalArticle updateArticle( String articleId, double version, boolean incrementVersion, String title, String content, String type, String structureId, String templateId, int displayDateMonth, int displayDateDay, int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth...
java.lang.String companyId, java.lang.String articleId, double version)
java.lang.String companyId, java.lang.String articleId)
public static com.liferay.portlet.journal.model.JournalArticle getArticle( java.lang.String companyId, java.lang.String articleId, double version) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { JournalArticleLocalService journalArticleLocalService = JournalArticleLocalSer...
return journalArticleLocalService.getArticle(companyId, articleId, version);
return journalArticleLocalService.getArticle(companyId, articleId);
public static com.liferay.portlet.journal.model.JournalArticle getArticle( java.lang.String companyId, java.lang.String articleId, double version) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { JournalArticleLocalService journalArticleLocalService = JournalArticleLocalSer...
String ownerId = Layout.getOwnerId(themeDisplay.getPlid()); String groupId = Layout.getGroupId(ownerId);
String portletId = ParamUtil.getString(req, "portletResource"); String rootPortletId = Portlet.getRootPortletId(portletId);
protected void checkPermissions(PortletRequest req) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); PermissionChecker permissionChecker = themeDisplay.getPermissionChecker(); String ownerId = Layout.getOwnerId(themeDisplay.getPlid()); String groupId = Layou...
String portletResource = ParamUtil.getString(req, "portletResource"); String resourcePrimKey = themeDisplay.getPlid() + Portlet.LAYOUT_SEPARATOR + portletResource; if (!permissionChecker.hasPermission( groupId, portletResource, resourcePrimKey, ActionKeys.CONFIGURATION) && !GroupPermission.contains( permissionChecker,...
if (!GroupPermission.contains( permissionChecker, themeDisplay.getPortletGroupId(), ActionKeys.MANAGE_LAYOUTS) && !LayoutPermission.contains( permissionChecker, themeDisplay.getLayout(), ActionKeys.UPDATE) && !PortletPermission.contains( permissionChecker, themeDisplay.getPlid(), rootPortletId, ActionKeys.CONFIGURATION...
protected void checkPermissions(PortletRequest req) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); PermissionChecker permissionChecker = themeDisplay.getPermissionChecker(); String ownerId = Layout.getOwnerId(themeDisplay.getPlid()); String groupId = Layou...
if (igFolder.isNew() || igFolder.isModified()) { session = openSession(); if (igFolder.isNew()) { IGFolder igFolderModel = new IGFolder(); igFolderModel.setFolderId(igFolder.getFolderId()); igFolderModel.setGroupId(igFolder.getGroupId()); igFolderModel.setCompanyId(igFolder.getCompanyId()); igFolderModel.setUserId(igF...
session = openSession(); session.saveOrUpdate(igFolder); session.flush(); igFolder.setNew(false);
public com.liferay.portlet.imagegallery.model.IGFolder update( com.liferay.portlet.imagegallery.model.IGFolder igFolder) throws SystemException { Session session = null; try { if (igFolder.isNew() || igFolder.isModified()) { session = openSession(); if (igFolder.isNew()) { IGFolder igFolderModel = new ...
jbossPrefix = OmniadminUtil.getAutoDeployJbossPrefix(); tomcatLibDir = OmniadminUtil.getAutoDeployTomcatLibDir();
public AutoLayoutTemplateDeployer() { try { baseDir = OmniadminUtil.getAutoDeployDeployDir(); destDir = OmniadminUtil.getAutoDeployDestDir(); appServerType = ServerDetector.getServerId(); unpackWar = OmniadminUtil.getAutoDeployUnpackWar(); jbossPrefix = OmniadminUtil.getAutoDeployJbossPrefix(); tomcatLibD...
if (!AdminUtil.getEmailUserAddedEnabled(user.getCompanyId())) {
if (!PrefsPropsUtil.getBoolean( user.getCompanyId(), PropsUtil.ADMIN_EMAIL_USER_ADDED_ENABLED)) {
protected void sendEmail(User user, String password) throws PortalException, SystemException { if (!AdminUtil.getEmailUserAddedEnabled(user.getCompanyId())) { return; } try { String companyId = user.getCompanyId(); Company company = CompanyUtil.findByPrimaryKey(companyId); String fromName = AdminUtil.getEm...
String fromName = AdminUtil.getEmailFromName(companyId); String fromAddress = AdminUtil.getEmailFromAddress(companyId);
String fromName = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_FROM_NAME); String fromAddress = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_FROM_ADDRESS);
protected void sendEmail(User user, String password) throws PortalException, SystemException { if (!AdminUtil.getEmailUserAddedEnabled(user.getCompanyId())) { return; } try { String companyId = user.getCompanyId(); Company company = CompanyUtil.findByPrimaryKey(companyId); String fromName = AdminUtil.getEm...
String subject = AdminUtil.getEmailUserAddedSubject(companyId); String body = AdminUtil.getEmailUserAddedBody(companyId);
String subject = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_USER_ADDED_SUBJECT); String body = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_USER_ADDED_BODY);
protected void sendEmail(User user, String password) throws PortalException, SystemException { if (!AdminUtil.getEmailUserAddedEnabled(user.getCompanyId())) { return; } try { String companyId = user.getCompanyId(); Company company = CompanyUtil.findByPrimaryKey(companyId); String fromName = AdminUtil.getEm...
if (!AdminUtil.getEmailPasswordSentEnabled(companyId)) {
if (!PrefsPropsUtil.getBoolean( companyId, PropsUtil.ADMIN_EMAIL_PASSWORD_SENT_ENABLED)) {
public void sendPassword( String companyId, String emailAddress, String remoteAddr, String remoteHost, String userAgent) throws PortalException, SystemException { if (!AdminUtil.getEmailPasswordSentEnabled(companyId)) { return; } emailAddress = emailAddress.trim().toLowerCase(); if (!Validator.isEmailAddres...
String fromName = AdminUtil.getEmailFromName(companyId); String fromAddress = AdminUtil.getEmailFromAddress(companyId);
String fromName = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_FROM_NAME); String fromAddress = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_FROM_ADDRESS);
public void sendPassword( String companyId, String emailAddress, String remoteAddr, String remoteHost, String userAgent) throws PortalException, SystemException { if (!AdminUtil.getEmailPasswordSentEnabled(companyId)) { return; } emailAddress = emailAddress.trim().toLowerCase(); if (!Validator.isEmailAddres...
String subject = AdminUtil.getEmailPasswordSentSubject(companyId); String body = AdminUtil.getEmailPasswordSentBody(companyId);
String subject = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_PASSWORD_SENT_SUBJECT); String body = PrefsPropsUtil.getString( companyId, PropsUtil.ADMIN_EMAIL_PASSWORD_SENT_BODY);
public void sendPassword( String companyId, String emailAddress, String remoteAddr, String remoteHost, String userAgent) throws PortalException, SystemException { if (!AdminUtil.getEmailPasswordSentEnabled(companyId)) { return; } emailAddress = emailAddress.trim().toLowerCase(); if (!Validator.isEmailAddres...
String[] reservedEmailAddresses = AdminUtil.getReservedEmailAddresses(user.getCompanyId());
String[] reservedEmailAddresses = PrefsPropsUtil.getStringArray( user.getCompanyId(), PropsUtil.ADMIN_RESERVED_EMAIL_ADDRESSES);
protected void validate( String userId, String emailAddress, String firstName, String lastName, String smsSn) throws PortalException, SystemException { User user = UserUtil.findByPrimaryKey(userId); if (!Validator.isEmailAddress(emailAddress)) { throw new UserEmailAddressException(); } else if (!User.isDefa...
setModified(true);
public void setPassword(String password) { if (((password == null) && (_password != null)) || ((password != null) && (_password == null)) || ((password != null) && (_password != null) && !password.equals(_password))) { if (!XSS_ALLOW_PASSWORD) { password = XSSUtil.strip(password); } _password = pass...
setModified(true);
public void setPasswordEncrypted(boolean passwordEncrypted) { if (passwordEncrypted != _passwordEncrypted) { _passwordEncrypted = passwordEncrypted; setModified(true); } }
setModified(true);
public void setPasswordExpirationDate(Date passwordExpirationDate) { if (((passwordExpirationDate == null) && (_passwordExpirationDate != null)) || ((passwordExpirationDate != null) && (_passwordExpirationDate == null)) || ((passwordExpirationDate != null) && (_passwordExpirationDate != null) && !pa...
setModified(true);
public void setPasswordReset(boolean passwordReset) { if (passwordReset != _passwordReset) { _passwordReset = passwordReset; setModified(true); } }
setModified(true);
public void setEmailAddress(String emailAddress) { if (((emailAddress == null) && (_emailAddress != null)) || ((emailAddress != null) && (_emailAddress == null)) || ((emailAddress != null) && (_emailAddress != null) && !emailAddress.equals(_emailAddress))) { if (!XSS_ALLOW_EMAILADDRESS) { emailAddress =...
setModified(true);
public void setGreeting(String greeting) { if (((greeting == null) && (_greeting != null)) || ((greeting != null) && (_greeting == null)) || ((greeting != null) && (_greeting != null) && !greeting.equals(_greeting))) { if (!XSS_ALLOW_GREETING) { greeting = XSSUtil.strip(greeting); } _greeting = gree...
setModified(true);
public void setActive(boolean active) { if (active != _active) { _active = active; setModified(true); } }
java.lang.String groupId, java.lang.String userId, java.lang.String name, java.lang.String primKey, boolean portletActions, boolean addCommunityPermissions, boolean addGuestPermissions)
java.lang.String groupId, java.lang.String name, boolean portletActions)
public static void addResources(java.lang.String companyId, java.lang.String groupId, java.lang.String userId, java.lang.String name, java.lang.String primKey, boolean portletActions, boolean addCommunityPermissions, boolean addGuestPermissions) throws com.liferay.portal.PortalException, com.liferay.portal.Sys...
resourceLocalService.addResources(companyId, groupId, userId, name, primKey, portletActions, addCommunityPermissions, addGuestPermissions);
resourceLocalService.addResources(companyId, groupId, name, portletActions);
public static void addResources(java.lang.String companyId, java.lang.String groupId, java.lang.String userId, java.lang.String name, java.lang.String primKey, boolean portletActions, boolean addCommunityPermissions, boolean addGuestPermissions) throws com.liferay.portal.PortalException, com.liferay.portal.Sys...
setModified(true);
public void setFailedLoginAttempts(int failedLoginAttempts) { if (failedLoginAttempts != _failedLoginAttempts) { _failedLoginAttempts = failedLoginAttempts; setModified(true); } }
ImageServiceUtil.deleteImage(id);
ImageLocalServiceUtil.deleteImage(id);
public static void remove(String id) { try { ImageServiceUtil.deleteImage(id); } catch (Exception e) { _log.warn(e); } }