rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
java.lang.String companyId, java.lang.String name)
java.lang.String groupId)
public static com.liferay.portal.model.Group getGroup( java.lang.String companyId, java.lang.String name) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { GroupService groupService = GroupServiceFactory.getService(); return groupService.getGroup(companyId, name); } catc...
return groupService.getGroup(companyId, name);
return groupService.getGroup(groupId);
public static com.liferay.portal.model.Group getGroup( java.lang.String companyId, java.lang.String name) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { GroupService groupService = GroupServiceFactory.getService(); return groupService.getGroup(companyId, name); } catc...
public static java.util.List getLayouts(java.lang.String ownerId, java.lang.String parentLayoutId)
public static java.util.List getLayouts(java.lang.String ownerId)
public static java.util.List getLayouts(java.lang.String ownerId, java.lang.String parentLayoutId) throws com.liferay.portal.SystemException { try { LayoutLocalService layoutLocalService = LayoutLocalServiceFactory.getService(); return layoutLocalService.getLayouts(ownerId, parentLayoutId); } catch (com.lifer...
return layoutLocalService.getLayouts(ownerId, parentLayoutId);
return layoutLocalService.getLayouts(ownerId);
public static java.util.List getLayouts(java.lang.String ownerId, java.lang.String parentLayoutId) throws com.liferay.portal.SystemException { try { LayoutLocalService layoutLocalService = LayoutLocalServiceFactory.getService(); return layoutLocalService.getLayouts(ownerId, parentLayoutId); } catch (com.lifer...
protected abstract String createFolder(CommandArgument arg);
public void createFolder( CommandArgument arg, HttpServletRequest req, HttpServletResponse res) { Document doc = _createDocument(); Node root = _createRoot( doc, arg.getCommand(), arg.getType(), arg.getCurrentFolder(), ""); Element errorEl = doc.createElement("Error"); root.appendChild(errorEl); String returnValue...
protected abstract String createFolder(CommandArgument arg);
protected abstract String fileUpload( CommandArgument arg, String fileName, File file, String extension);
public void fileUpload( CommandArgument arg, HttpServletRequest req, HttpServletResponse res) { ServletFileUpload upload = new ServletFileUpload( new LiferayFileItemFactory(UploadServletRequest.DEFAULT_TEMP_DIR)); List items = null; try { items = upload.parseRequest(req); } catch (FileUploadException fue) { throw ne...
protected abstract String fileUpload( CommandArgument arg, String fileName, File file, String extension);
protected abstract void getFolders( CommandArgument arg, Node root, Document doc);
public void getFolders( CommandArgument arg, HttpServletRequest req, HttpServletResponse res) { Document doc = _createDocument(); Node root = _createRoot( doc, arg.getCommand(), arg.getType(), arg.getCurrentFolder(), getPath(arg)); getFolders(arg, root, doc); _writeDocument(doc, res); }
protected abstract void getFolders( CommandArgument arg, Node root, Document doc);
protected abstract void getFoldersAndFiles( CommandArgument arg, Node root, Document doc);
public void getFoldersAndFiles( CommandArgument arg, HttpServletRequest req, HttpServletResponse res) { Document doc = _createDocument(); Node root = _createRoot( doc, arg.getCommand(), arg.getType(), arg.getCurrentFolder(), getPath(arg)); getFoldersAndFiles(arg, root, doc); _writeDocument(doc, res); }
protected abstract void getFoldersAndFiles( CommandArgument arg, Node root, Document doc);
setModified(true);
public void setAddress(String address) { if (((address == null) && (_address != null)) || ((address != null) && (_address == null)) || ((address != null) && (_address != null) && !address.equals(_address))) { if (!XSS_ALLOW_ADDRESS) { address = XSSUtil.strip(address); } _address = address; setModi...
setModified(true);
public void setClassName(String className) { if (((className == null) && (_className != null)) || ((className != null) && (_className == null)) || ((className != null) && (_className != null) && !className.equals(_className))) { if (!XSS_ALLOW_CLASSNAME) { className = XSSUtil.strip(className); } _cl...
setModified(true);
public void setClassPK(String classPK) { if (((classPK == null) && (_classPK != null)) || ((classPK != null) && (_classPK == null)) || ((classPK != null) && (_classPK != null) && !classPK.equals(_classPK))) { if (!XSS_ALLOW_CLASSPK) { classPK = XSSUtil.strip(classPK); } _classPK = classPK; setModi...
setModified(true);
public void setCompanyId(String companyId) { if (((companyId == null) && (_companyId != null)) || ((companyId != null) && (_companyId == null)) || ((companyId != null) && (_companyId != null) && !companyId.equals(_companyId))) { if (!XSS_ALLOW_COMPANYID) { companyId = XSSUtil.strip(companyId); } _co...
setModified(true);
public void setCreateDate(Date createDate) { if (((createDate == null) && (_createDate != null)) || ((createDate != null) && (_createDate == null)) || ((createDate != null) && (_createDate != null) && !createDate.equals(_createDate))) { _createDate = createDate; setModified(true); } }
setModified(true);
public void setEmailAddressId(String emailAddressId) { if (((emailAddressId == null) && (_emailAddressId != null)) || ((emailAddressId != null) && (_emailAddressId == null)) || ((emailAddressId != null) && (_emailAddressId != null) && !emailAddressId.equals(_emailAddressId))) { if (!XSS_ALLOW_EMAILADDRESSI...
setModified(true);
public void setModifiedDate(Date modifiedDate) { if (((modifiedDate == null) && (_modifiedDate != null)) || ((modifiedDate != null) && (_modifiedDate == null)) || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate.equals(_modifiedDate))) { _modifiedDate = modifiedDate; setModified(true);...
setModified(true);
public void setPrimary(boolean primary) { if (primary != _primary) { _primary = primary; setModified(true); } }
setModified(true);
public void setTypeId(String typeId) { if (((typeId == null) && (_typeId != null)) || ((typeId != null) && (_typeId == null)) || ((typeId != null) && (_typeId != null) && !typeId.equals(_typeId))) { if (!XSS_ALLOW_TYPEID) { typeId = XSSUtil.strip(typeId); } _typeId = typeId; setModified(true); } ...
setModified(true);
public void setUserId(String userId) { if (((userId == null) && (_userId != null)) || ((userId != null) && (_userId == null)) || ((userId != null) && (_userId != null) && !userId.equals(_userId))) { if (!XSS_ALLOW_USERID) { userId = XSSUtil.strip(userId); } _userId = userId; setModified(true); } ...
setModified(true);
public void setUserName(String userName) { if (((userName == null) && (_userName != null)) || ((userName != null) && (_userName == null)) || ((userName != null) && (_userName != null) && !userName.equals(_userName))) { if (!XSS_ALLOW_USERNAME) { userName = XSSUtil.strip(userName); } _userName = user...
catch (NoSuchGroupException nsge) { _log.error( "Upgrade failed because data does not have a valid group id. " + "Manually assign a group id in the database."); }
private void _upgradeEvent() throws Exception { Connection con = null; PreparedStatement ps = null; ResultSet rs = null; try { con = DataAccess.getConnection(Constants.DATA_SOURCE); ps = con.prepareStatement(_UPGRADE_EVENT); ps.setString(1, Group.DEFAULT_PARENT_GROUP_ID); rs = ps.executeQuery(); while (r...
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 addEntry( String companyId, String groupId, String userId, String categoryId, String entryId, String title, String content) throws IOException { synchronized (IndexWriter.class) { content = Html.stripHtml(content); IndexWriter writer = LuceneUtil.getWriter(companyId); Document doc = new ...
ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY); PermissionServiceUtil.setUserPermissions(userId, themeDisplay.getPortletGroupId(), actionIds, resourceId);
PermissionServiceUtil.setUserPermissions( userId, themeDisplay.getPortletGroupId(), actionIds, resourceId);
protected void updateUserPermissions(ActionRequest req) throws Exception { String resourceId = ParamUtil.getString(req, "resourceId"); String userId = ParamUtil.getString(req, "userIdsPosValue"); String[] actionIds = StringUtil.split( ParamUtil.getString(req, "userIdActionIds")); ThemeDisplay themeDisplay = (T...
public static String getPortletTitle( Portlet portlet, ServletContext ctx, Locale locale) {
public static String getPortletTitle(String portletId, User user) throws LanguageException {
public static String getPortletTitle( Portlet portlet, ServletContext ctx, Locale locale) { PortletConfig portletConfig = PortletConfigFactory.create(portlet, ctx); ResourceBundle resourceBundle = portletConfig.getResourceBundle(locale); return resourceBundle.getString(WebKeys.JAVAX_PORTLET_TITLE); }
PortletConfig portletConfig = PortletConfigFactory.create(portlet, ctx); ResourceBundle resourceBundle = portletConfig.getResourceBundle(locale); return resourceBundle.getString(WebKeys.JAVAX_PORTLET_TITLE);
return LanguageUtil.get( user, WebKeys.JAVAX_PORTLET_TITLE + StringPool.PERIOD + portletId);
public static String getPortletTitle( Portlet portlet, ServletContext ctx, Locale locale) { PortletConfig portletConfig = PortletConfigFactory.create(portlet, ctx); ResourceBundle resourceBundle = portletConfig.getResourceBundle(locale); return resourceBundle.getString(WebKeys.JAVAX_PORTLET_TITLE); }
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 static 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 { try { ResourceLocalService resourceLocalSe...
return resourceLocalService.getResource(companyId, name, typeId, scope, primKey);
return resourceLocalService.getResource(resourceId);
public static 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 { try { ResourceLocalService resourceLocalSe...
public static void clearCache(String companyId) { String groupName = _encodeGroupName(companyId);
public static void clearCache() { String[] companyIds = PortalInstances.getCompanyIds();
public static void clearCache(String companyId) { String groupName = _encodeGroupName(companyId); _cache.flushGroup(groupName); _log.info("Cleared layout cache for " + companyId); }
_cache.flushGroup(groupName); _log.info("Cleared layout cache for " + companyId);
for (int i = 0; i < companyIds.length; i++) { clearCache(companyIds[i]); }
public static void clearCache(String companyId) { String groupName = _encodeGroupName(companyId); _cache.flushGroup(groupName); _log.info("Cleared layout cache for " + companyId); }
PortletPreferences portletPrefences = PortletPreferencesUtil.findByPrimaryKey(pk);
PortletPreferences portletPreferences = null; try { portletPreferences = PortletPreferencesUtil.findByPrimaryKey(pk); } catch (NoSuchPortletPreferencesException nsppe) { portletPreferences = PortletPreferencesUtil.create(pk); }
public PortletPreferences updatePreferences( PortletPreferencesPK pk, PortletPreferencesImpl prefs) throws PortalException, SystemException { PortletPreferences portletPrefences = PortletPreferencesUtil.findByPrimaryKey(pk); String xml = PortletPreferencesSerializer.toXML(prefs); portletPrefences.setPreference...
portletPrefences.setPreferences(xml);
portletPreferences.setPreferences(xml);
public PortletPreferences updatePreferences( PortletPreferencesPK pk, PortletPreferencesImpl prefs) throws PortalException, SystemException { PortletPreferences portletPrefences = PortletPreferencesUtil.findByPrimaryKey(pk); String xml = PortletPreferencesSerializer.toXML(prefs); portletPrefences.setPreference...
PortletPreferencesUtil.update(portletPrefences);
PortletPreferencesUtil.update(portletPreferences);
public PortletPreferences updatePreferences( PortletPreferencesPK pk, PortletPreferencesImpl prefs) throws PortalException, SystemException { PortletPreferences portletPrefences = PortletPreferencesUtil.findByPrimaryKey(pk); String xml = PortletPreferencesSerializer.toXML(prefs); portletPrefences.setPreference...
return portletPrefences;
return portletPreferences;
public PortletPreferences updatePreferences( PortletPreferencesPK pk, PortletPreferencesImpl prefs) throws PortalException, SystemException { PortletPreferences portletPrefences = PortletPreferencesUtil.findByPrimaryKey(pk); String xml = PortletPreferencesSerializer.toXML(prefs); portletPrefences.setPreference...
public com.liferay.portal.model.Group addGroup(java.lang.String className, java.lang.String classPK, java.lang.String name,
public com.liferay.portal.model.Group addGroup(java.lang.String name,
public 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, java.rmi.RemoteException;
if (_textObj == null) { getTextObj(); }
public String getType() { if ((_type == null) && (_textObj != null)) { MemoryCacheImageInputStream mcis = new MemoryCacheImageInputStream( new ByteArrayInputStream(_textObj)); Iterator itr = ImageIO.getImageReaders(mcis); _type = null; if (itr.hasNext()) { Object obj = itr.next(); if (obj instanceof ...
setModified(true);
public void setText(String text) { if (((text == null) && (_text != null)) || ((text != null) && (_text == null)) || ((text != null) && (_text != null) && !text.equals(_text))) { if (!XSS_ALLOW_TEXT) { text = XSSUtil.strip(text); } _text = text; setModified(true); } }
reverseAjax = (ReverseAjax) ses.getAttribute(WebKeys.REVERSE_AJAX); reqWait = reverseAjax.getRequestWait();
public String getJSON( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception { boolean release = ParamUtil.getBoolean(req, "release"); JSONObject jo = new JSONObject(); HttpSession ses = req.getSession(); ReverseAjax reverseAjax = (ReverseAjax) ses.getAttrib...
if (reverseAjax.pendingEvents()) {
if (missedEvents || (reverseAjax.pendingEvents() && !reqWait.isExpired())) {
public String getJSON( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception { boolean release = ParamUtil.getBoolean(req, "release"); JSONObject jo = new JSONObject(); HttpSession ses = req.getSession(); ReverseAjax reverseAjax = (ReverseAjax) ses.getAttrib...
else if (reqWait == null) { jo.put("status", "failure"); }
public String getJSON( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception { boolean release = ParamUtil.getBoolean(req, "release"); JSONObject jo = new JSONObject(); HttpSession ses = req.getSession(); ReverseAjax reverseAjax = (ReverseAjax) ses.getAttrib...
} else { jo.put("status", "failure");
public String getJSON( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception { boolean release = ParamUtil.getBoolean(req, "release"); JSONObject jo = new JSONObject(); HttpSession ses = req.getSession(); ReverseAjax reverseAjax = (ReverseAjax) ses.getAttrib...
_timedOut = false; _expired = true;
public synchronized void expire() { notify(); }
catch (NoSuchGroupException nsge) { _log.error( "Upgrade failed because data does not have a valid group id. " + "Manually assign a group id in the database."); }
private void _upgradeQuestion() throws Exception { Connection con = null; PreparedStatement ps = null; ResultSet rs = null; try { con = DataAccess.getConnection(Constants.DATA_SOURCE); ps = con.prepareStatement(_UPGRADE_QUESTION); ps.setString(1, Group.DEFAULT_PARENT_GROUP_ID); rs = ps.executeQuery(); wh...
companyId, autoUserId, userId, autoPassword, password1, password2, passwordReset, emailAddress, locale, firstName, middleName, lastName, nickName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, organizationId, locationId);
creatorUserId, companyId, autoUserId, userId, autoPassword, password1, password2, passwordReset, emailAddress, locale, firstName, middleName, lastName, nickName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, organizationId, locationId);
public int authenticate(String companyId, String userId, String password) throws AuthException { LdapContext ctx = null; try { // Check the LDAP server to ensure the company id, email address, // and password is valid Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_...
java.lang.String companyId, java.lang.String userId)
java.lang.String userId)
public static com.liferay.portal.model.User getUserById( java.lang.String companyId, java.lang.String userId) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { UserLocalService userLocalService = UserLocalServiceFactory.getService(); return userLocalService.getUserById(com...
return userLocalService.getUserById(companyId, userId);
return userLocalService.getUserById(userId);
public static com.liferay.portal.model.User getUserById( java.lang.String companyId, java.lang.String userId) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { UserLocalService userLocalService = UserLocalServiceFactory.getService(); return userLocalService.getUserById(com...
java.lang.String companyId, boolean autoUserId, java.lang.String userId, boolean autoPassword,
java.lang.String creatorUserId, java.lang.String companyId, boolean autoUserId, java.lang.String userId, boolean autoPassword,
public static com.liferay.portal.model.User addUser( java.lang.String companyId, boolean autoUserId, java.lang.String userId, boolean autoPassword, java.lang.String password1, java.lang.String password2, boolean passwordReset, java.lang.String emailAddress, java.util.Locale locale, java.lang.String firstName, ja...
java.lang.String organizationId, java.lang.String locationId, boolean sendEmail)
java.lang.String organizationId, java.lang.String locationId)
public static com.liferay.portal.model.User addUser( java.lang.String companyId, boolean autoUserId, java.lang.String userId, boolean autoPassword, java.lang.String password1, java.lang.String password2, boolean passwordReset, java.lang.String emailAddress, java.util.Locale locale, java.lang.String firstName, ja...
return userLocalService.addUser(companyId, autoUserId, userId, autoPassword, password1, password2, passwordReset, emailAddress, locale, firstName, middleName, lastName, nickName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, organizationId, locationId, sendEmail);
return userLocalService.addUser(creatorUserId, companyId, autoUserId, userId, autoPassword, password1, password2, passwordReset, emailAddress, locale, firstName, middleName, lastName, nickName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, organizationId, locationId);
public static com.liferay.portal.model.User addUser( java.lang.String companyId, boolean autoUserId, java.lang.String userId, boolean autoPassword, java.lang.String password1, java.lang.String password2, boolean passwordReset, java.lang.String emailAddress, java.util.Locale locale, java.lang.String firstName, ja...
setModified(true);
public void setDescription(String description) { if (((description == null) && (_description != null)) || ((description != null) && (_description == null)) || ((description != null) && (_description != null) && !description.equals(_description))) { if (!XSS_ALLOW_DESCRIPTION) { description = XSSUtil.str...
setModified(true);
public void setName(String name) { if (((name == null) && (_name != null)) || ((name != null) && (_name == null)) || ((name != null) && (_name != null) && !name.equals(_name))) { if (!XSS_ALLOW_NAME) { name = XSSUtil.strip(name); } _name = name; setModified(true); } }
setModified(true);
public void setParentUserGroupId(String parentUserGroupId) { if (((parentUserGroupId == null) && (_parentUserGroupId != null)) || ((parentUserGroupId != null) && (_parentUserGroupId == null)) || ((parentUserGroupId != null) && (_parentUserGroupId != null) && !parentUserGroupId.equals(_parentUserGroupId))) { ...
setModified(true);
public void setUserGroupId(String userGroupId) { if (((userGroupId == null) && (_userGroupId != null)) || ((userGroupId != null) && (_userGroupId == null)) || ((userGroupId != null) && (_userGroupId != null) && !userGroupId.equals(_userGroupId))) { if (!XSS_ALLOW_USERGROUPID) { userGroupId = XSSUtil.str...
setModified(true);
public void setItemId(String itemId) { if (((itemId == null) && (_itemId != null)) || ((itemId != null) && (_itemId == null)) || ((itemId != null) && (_itemId != null) && !itemId.equals(_itemId))) { if (!XSS_ALLOW_ITEMID) { itemId = XSSUtil.strip(itemId); } _itemId = itemId; setModified(true); } ...
setModified(true);
public void setOrderId(String orderId) { if (((orderId == null) && (_orderId != null)) || ((orderId != null) && (_orderId == null)) || ((orderId != null) && (_orderId != null) && !orderId.equals(_orderId))) { if (!XSS_ALLOW_ORDERID) { orderId = XSSUtil.strip(orderId); } _orderId = orderId; setModi...
setModified(true);
public void setPrice(double price) { if (price != _price) { _price = price; setModified(true); } }
setModified(true);
public void setProperties(String properties) { if (((properties == null) && (_properties != null)) || ((properties != null) && (_properties == null)) || ((properties != null) && (_properties != null) && !properties.equals(_properties))) { if (!XSS_ALLOW_PROPERTIES) { properties = XSSUtil.strip(propertie...
setModified(true);
public void setQuantity(int quantity) { if (quantity != _quantity) { _quantity = quantity; setModified(true); } }
setModified(true);
public void setShippedDate(Date shippedDate) { if (((shippedDate == null) && (_shippedDate != null)) || ((shippedDate != null) && (_shippedDate == null)) || ((shippedDate != null) && (_shippedDate != null) && !shippedDate.equals(_shippedDate))) { _shippedDate = shippedDate; setModified(true); } }
setModified(true);
public void setSku(String sku) { if (((sku == null) && (_sku != null)) || ((sku != null) && (_sku == null)) || ((sku != null) && (_sku != null) && !sku.equals(_sku))) { if (!XSS_ALLOW_SKU) { sku = XSSUtil.strip(sku); } _sku = sku; setModified(true); } }
String captcha = _producer.createText();
String captchaText = _producer.createText();
public void processAction( ActionMapping mapping, ActionForm form, PortletConfig config, ActionRequest req, ActionResponse res) throws Exception { try { PortletSession ses = req.getPortletSession(); String captcha = _producer.createText(); ses.setAttribute(WebKeys.CAPTCHA, captcha); HttpServletResponse h...
ses.setAttribute(WebKeys.CAPTCHA, captcha);
ses.setAttribute(WebKeys.CAPTCHA_TEXT, captchaText);
public void processAction( ActionMapping mapping, ActionForm form, PortletConfig config, ActionRequest req, ActionResponse res) throws Exception { try { PortletSession ses = req.getPortletSession(); String captcha = _producer.createText(); ses.setAttribute(WebKeys.CAPTCHA, captcha); HttpServletResponse h...
_producer.createImage(httpRes.getOutputStream(), captcha);
_producer.createImage(httpRes.getOutputStream(), captchaText);
public void processAction( ActionMapping mapping, ActionForm form, PortletConfig config, ActionRequest req, ActionResponse res) throws Exception { try { PortletSession ses = req.getPortletSession(); String captcha = _producer.createText(); ses.setAttribute(WebKeys.CAPTCHA, captcha); HttpServletResponse h...
public Role addRole(String companyId, String name)
public Role addRole(String userId, String companyId, String name)
public Role addRole(String companyId, String name) throws PortalException, SystemException { return addRole(companyId, name, null, null); }
return addRole(companyId, name, null, null);
return addRole(userId, companyId, name, null, null);
public Role addRole(String companyId, String name) throws PortalException, SystemException { return addRole(companyId, name, null, null); }
addRole(companyId, systemRoles[i]);
addRole(null, companyId, systemRoles[i]);
public void checkSystemRoles(String companyId) throws PortalException, SystemException { String[] systemRoles = PortalUtil.getSystemRoles(); for (int i = 0; i < systemRoles.length; i++) { try { RoleFinder.findByC_N_2(companyId, systemRoles[i]); } catch (NoSuchRoleException nsre) { addRole(companyId, sys...
ResourceLocalServiceUtil.deleteResource( role.getCompanyId(), Role.class.getName(), Resource.TYPE_CLASS, Resource.SCOPE_INDIVIDUAL, role.getPrimaryKey().toString());
public void deleteRole(String roleId) throws PortalException, SystemException { Role role = RoleUtil.findByPrimaryKey(roleId); if (PortalUtil.isSystemRole(role.getName())) { throw new RequiredRoleException(); } RoleUtil.remove(roleId); }
e.printStackTrace();
_log.error(e);
public void destroy() { // Destroy portlets try { Iterator itr = PortletLocalServiceUtil.getPortlets( _companyId).iterator(); while (itr.hasNext()) { Portlet portlet = (Portlet)itr.next(); PortletInstanceFactory.destroy(portlet); } } catch (Exception e) { e.printStackTrace(); } // Scheduler Job...
JobScheduler.shutdown();
if (_log.isDebugEnabled()) { _log.debug("Process shutdown events"); } try { EventsProcessor.process(PropsUtil.getArray( PropsUtil.GLOBAL_SHUTDOWN_EVENTS), true); EventsProcessor.process(PropsUtil.getArray( PropsUtil.APPLICATION_SHUTDOWN_EVENTS), new String[] {_companyId}); } catch (Exception e) { _log.error(e); }
public void destroy() { // Destroy portlets try { Iterator itr = PortletLocalServiceUtil.getPortlets( _companyId).iterator(); while (itr.hasNext()) { Portlet portlet = (Portlet)itr.next(); PortletInstanceFactory.destroy(portlet); } } catch (Exception e) { e.printStackTrace(); } // Scheduler Job...
e.printStackTrace();
_log.error(e);
public void init() throws ServletException { synchronized (MainServlet.class) { // Initialize if (_log.isDebugEnabled()) { _log.debug("Initialize"); } super.init(); // Process startup events if (_log.isDebugEnabled()) { _log.debug("Process startup events"); } try { EventsProcessor.process( ...
e.printStackTrace();
_log.error(e);
public void service(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { if (!PortalInstances.matches()) { res.setContentType(Constants.TEXT_HTML); String html = ContentUtil.get( "com/liferay/portal/dependencies/init.html"); res.getOutputStream().print(html); return; } ...
try { java.util.Properties propsFromDatabase = PropertiesLocalServiceUtil.getPortalProperties(companyId); value = propsFromDatabase.getProperty(key); } catch (SystemException se) { } if (value == null) {
if (companyId != null) {
public static String get(String companyId, String key) { String value = null; try { java.util.Properties propsFromDatabase = PropertiesLocalServiceUtil.getPortalProperties(companyId); value = propsFromDatabase.getProperty(key); } catch (SystemException se) { } if (value == null) { ExtPropertiesLoader pr...
public static String getUserId(HttpServletRequest req) { return getUserId(req.getSession());
public static String getUserId(HttpSession ses) { return (String)ses.getAttribute(WebKeys.USER_ID);
public static String getUserId(HttpServletRequest req) { return getUserId(req.getSession()); }
if (orgGroupRole.isNew() || orgGroupRole.isModified()) { session = openSession(); if (orgGroupRole.isNew()) { OrgGroupRole orgGroupRoleModel = new OrgGroupRole(); orgGroupRoleModel.setOrganizationId(orgGroupRole.getOrganizationId()); orgGroupRoleModel.setGroupId(orgGroupRole.getGroupId()); orgGroupRoleModel.setRoleId(...
session = openSession(); session.saveOrUpdate(orgGroupRole); session.flush(); orgGroupRole.setNew(false);
public com.liferay.portal.model.OrgGroupRole update( com.liferay.portal.model.OrgGroupRole orgGroupRole) throws SystemException { Session session = null; try { if (orgGroupRole.isNew() || orgGroupRole.isModified()) { session = openSession(); if (orgGroupRole.isNew()) { OrgGroupRole orgGroupRoleModel = ...
!StringUtil.startsWith(src, "https:
!StringUtil.startsWith(src, "https: !StringUtil.startsWith(src, "mhtml:
public void processAction( ActionMapping mapping, ActionForm form, PortletConfig config, ActionRequest req, ActionResponse res) throws Exception { String cmd = ParamUtil.getString(req, Constants.CMD); if (!cmd.equals(Constants.UPDATE)) { return; } String src = ParamUtil.getString(req, "src"); if (!src.star...
public static String getProtocol(ActionRequest req) { return getProtocol(req.isSecure());
public static String getProtocol(boolean secure) { if (!secure) { return HTTP; } else { return HTTPS; }
public static String getProtocol(ActionRequest req) { return getProtocol(req.isSecure()); }
ActionRequest req, String portletId, boolean uniquePerLayout, boolean uniquePerGroup)
String portletId, String layoutId, String ownerId)
public static PortletPreferences getPortletSetup( ActionRequest req, String portletId, boolean uniquePerLayout, boolean uniquePerGroup) throws PortalException, SystemException { ActionRequestImpl reqImpl = (ActionRequestImpl)req; return getPortletSetup( reqImpl.getHttpServletRequest(), portletId, uniquePerLay...
ActionRequestImpl reqImpl = (ActionRequestImpl)req; return getPortletSetup( reqImpl.getHttpServletRequest(), portletId, uniquePerLayout, uniquePerGroup);
Layout layout = LayoutLocalServiceUtil.getLayout(layoutId, ownerId); PortletPreferencesPK pk = new PortletPreferencesPK( portletId, layoutId, ownerId); return PortletPreferencesLocalServiceUtil.getPreferences( layout.getCompanyId(), pk);
public static PortletPreferences getPortletSetup( ActionRequest req, String portletId, boolean uniquePerLayout, boolean uniquePerGroup) throws PortalException, SystemException { ActionRequestImpl reqImpl = (ActionRequestImpl)req; return getPortletSetup( reqImpl.getHttpServletRequest(), portletId, uniquePerLay...
Random random = new Random();
Randomizer randomizer = Randomizer.getInstance();
public void run(HttpServletRequest req, HttpServletResponse res) throws ActionException { try { // Disable caching for CSS and JavaScript PropsUtil.set(PropsUtil.LAST_MODIFIED_CHECK, "false"); // Do not randomize look and feel unless the user is logged in ThemeDisplay themeDisplay = (ThemeDisplay)req.getA...
Theme theme = (Theme)themes.get(random.nextInt(themes.size()));
Theme theme = (Theme)themes.get( randomizer.nextInt(themes.size()));
public void run(HttpServletRequest req, HttpServletResponse res) throws ActionException { try { // Disable caching for CSS and JavaScript PropsUtil.set(PropsUtil.LAST_MODIFIED_CHECK, "false"); // Do not randomize look and feel unless the user is logged in ThemeDisplay themeDisplay = (ThemeDisplay)req.getA...
random.nextInt(colorSchemes.size()));
randomizer.nextInt(colorSchemes.size()));
public void run(HttpServletRequest req, HttpServletResponse res) throws ActionException { try { // Disable caching for CSS and JavaScript PropsUtil.set(PropsUtil.LAST_MODIFIED_CHECK, "false"); // Do not randomize look and feel unless the user is logged in ThemeDisplay themeDisplay = (ThemeDisplay)req.getA...
deleteOrder(req);
deleteOrders(req);
public void processAction( ActionMapping mapping, ActionForm form, PortletConfig config, ActionRequest req, ActionResponse res) throws Exception { String cmd = ParamUtil.getString(req, Constants.CMD); try { if (cmd.equals(Constants.ADD) || cmd.equals(Constants.UPDATE)) { updateOrder(req); } else if (cm...
if (country.isNew() || country.isModified()) { session = openSession(); if (country.isNew()) { Country countryModel = new Country(); countryModel.setCountryId(country.getCountryId()); countryModel.setCountryCode(country.getCountryCode()); countryModel.setName(country.getName()); countryModel.setActive(country.getActiv...
session = openSession(); session.saveOrUpdate(country); session.flush(); country.setNew(false);
public com.liferay.portal.model.Country update( com.liferay.portal.model.Country country) throws SystemException { Session session = null; try { if (country.isNew() || country.isModified()) { session = openSession(); if (country.isNew()) { Country countryModel = new Country(); countryModel.setCountr...
public Marker( final int severity,
public Marker( final Tags.Type tag, final int severity,
public Marker( final int severity, final String message ) { this.severity = severity; this.message = defaultString( message ); }
notNull( tag ); this.tag = tag;
public Marker( final int severity, final String message ) { this.severity = severity; this.message = defaultString( message ); }
public static Marker error( final String message,
public static Marker error( final Tags.Type tag, final String message,
public static Marker error( final String message, final int... location ) { return marker( IMarker.SEVERITY_ERROR, message, location ); }
return marker( IMarker.SEVERITY_ERROR, message, location );
return marker( tag, IMarker.SEVERITY_ERROR, message, location );
public static Marker error( final String message, final int... location ) { return marker( IMarker.SEVERITY_ERROR, message, location ); }
public static Marker info( final String message,
public static Marker info( final Tags.Type tag, final String message,
public static Marker info( final String message, final int... location ) { return marker( IMarker.SEVERITY_INFO, message, location ); }
return marker( IMarker.SEVERITY_INFO, message, location );
return marker( tag, IMarker.SEVERITY_INFO, message, location );
public static Marker info( final String message, final int... location ) { return marker( IMarker.SEVERITY_INFO, message, location ); }
private static Marker marker( final int severity,
private static Marker marker( final Tags.Type tag, final int severity,
private static Marker marker( final int severity, final String message, final int... location ) { if( location == null || location.length == 0 ) return new Marker( severity, message ); if( location.length == 1 ) ...
return new Marker( severity, message );
return new Marker( tag, severity, message );
private static Marker marker( final int severity, final String message, final int... location ) { if( location == null || location.length == 0 ) return new Marker( severity, message ); if( location.length == 1 ) ...
return new Marker( severity, message, location[ 0 ] ); return new Marker( severity, message, location[ 0 ], location[ 1 ], location[ 2 ] );
return new Marker( tag, severity, message, location[ 0 ] ); return new Marker( tag, severity, message, location[ 0 ], location[ 1 ], location[ 2 ] );
private static Marker marker( final int severity, final String message, final int... location ) { if( location == null || location.length == 0 ) return new Marker( severity, message ); if( location.length == 1 ) ...
public static Marker warning( final String message,
public static Marker warning( final Tags.Type tag, final String message,
public static Marker warning( final String message, final int... location ) { return marker( IMarker.SEVERITY_WARNING, message, location ); }
return marker( IMarker.SEVERITY_WARNING, message, location );
return marker( tag, IMarker.SEVERITY_WARNING, message, location );
public static Marker warning( final String message, final int... location ) { return marker( IMarker.SEVERITY_WARNING, message, location ); }
public java.util.List getFileEntries(java.lang.String folderId, int begin, int end) throws com.liferay.portal.SystemException;
public java.util.List getFileEntries(java.lang.String folderId) throws com.liferay.portal.SystemException;
public java.util.List getFileEntries(java.lang.String folderId, int begin, int end) throws com.liferay.portal.SystemException;
public ClientPutBase(FreenetURI uri, String identifier, int verbosity, FCPConnectionHandler handler, FCPClient client, short priorityClass, short persistenceType, String clientToken, boolean global, boolean getCHKOnly, boolean dontCompress, int maxRetries, boolean earlyEncode) { super(uri, identifier, verbosity, handle...
public ClientPutBase(FreenetURI uri, String identifier, int verbosity, FCPConnectionHandler handler, short priorityClass, short persistenceType, String clientToken, boolean global, boolean getCHKOnly, boolean dontCompress, int maxRetries, boolean earlyEncode) { super(uri, identifier, verbosity, handler, priorityClass, ...
public ClientPutBase(FreenetURI uri, String identifier, int verbosity, FCPConnectionHandler handler, FCPClient client, short priorityClass, short persistenceType, String clientToken, boolean global, boolean getCHKOnly, boolean dontCompress, int maxRetries, boolean earlyEncode) { super(uri, identifier, verbosity, ...
JSONObject jFolderObj = new JSONObject();;
JSONObject jFolderObj = new JSONObject();
private String _getFolders(HttpServletRequest req) throws Exception { JSONObject jsonObj = new JSONObject(); JSONArray jFolders = new JSONArray(); int count = 1; List folders = MailUtil.getAllFolders(req.getSession()); for (int i = 0; i < folders.size(); i++) { MailFolder folderObj = (MailFolder)folders.get(i);...
private String _getMessage(HttpServletRequest req) throws Exception {
private String _getMessage(HttpServletRequest req, HttpServletResponse res) throws Exception {
private String _getMessage(HttpServletRequest req) throws Exception { JSONObject jsonObj = new JSONObject(); String folderId = ParamUtil.getString(req, "folderId"); long messageId = ParamUtil.getLong(req, "messageId"); MailUtil.setCurrentFolder(req.getSession(), folderId); MailMessage mm = MailUtil.getMessage(req...
long messageId = ParamUtil.getLong(req, "messageId");
StringBuffer header = new StringBuffer(); ServletContext ctx = (ServletContext)req.getAttribute(WebKeys.CTX);
private String _getMessage(HttpServletRequest req) throws Exception { JSONObject jsonObj = new JSONObject(); String folderId = ParamUtil.getString(req, "folderId"); long messageId = ParamUtil.getLong(req, "messageId"); MailUtil.setCurrentFolder(req.getSession(), folderId); MailMessage mm = MailUtil.getMessage(req...
jsonObj.put("id", messageId);
jsonObj.put("header", header.toString());
private String _getMessage(HttpServletRequest req) throws Exception { JSONObject jsonObj = new JSONObject(); String folderId = ParamUtil.getString(req, "folderId"); long messageId = ParamUtil.getLong(req, "messageId"); MailUtil.setCurrentFolder(req.getSession(), folderId); MailMessage mm = MailUtil.getMessage(req...
rtString = _getMessage(req);
rtString = _getMessage(req, res);
public String getJSON( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception { String cmd = ParamUtil.getString(req, Constants.CMD); String rtString = ""; try { if ("deleteMessages".equals(cmd)) { _deleteMessages(req); } else if ("getFolders".equals(...
String userId, String password, int [] messageUIDs)
String userId, String password, long [] messageUIDs)
public static void deleteMessages( String userId, String password, int [] messageUIDs) throws Exception { Folder folder = _getCurrentFolder(userId); if (!folder.getName().equals(MAIL_TRASH_NAME)) { moveMessages(userId, password, messageUIDs, MAIL_TRASH_NAME); } else { Message [] msgs = _getCurrentFold...