Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>i) OrganizationUtil: <code>com.liferay.portal.service.persistence.OrganizationUtil</code></p> </blockquote> <p>The classes from the persistence layer directly talk to the Database and hence are good to be used from the service layer and also if you care about transaction.</p> <p>Following are the words from the <a href="http://docs.liferay.com/portal/6.1/javadocs/com/liferay/portal/service/persistence/OrganizationUtil.html" rel="nofollow" title="Liferay 6.1 Official Documentation for com.liferay.portal.service.persistence.OrganizationUtil">documentation</a>:</p> <blockquote> <p>The persistence utility for the organization service. This utility wraps OrganizationPersistenceImpl and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.</p> </blockquote> <hr> <blockquote> <p>ii) OrganizationServiceUtil: <code>com.liferay.portal.service.OrganizationServiceUtil</code></p> </blockquote> <p>It can be called from any layer as such. This class also does permission checks (based on Permissions given in Liferay) which may be useful in some cases. This can also be used through web-service.</p> <p>Well lets see what liferay's <a href="http://docs.liferay.com/portal/6.1/javadocs/com/liferay/portal/service/OrganizationServiceUtil.html" rel="nofollow" title="Liferay 6.1 Official Documentation for com.liferay.portal.service.OrganizationServiceUtil">documentation</a> has to say: </p> <blockquote> <p>The utility for the organization remote service. This utility wraps com.liferay.portal.service.impl.OrganizationServiceImpl and is the primary access point for service operations in application layer code running on a remote server.</p> <p>This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.</p> </blockquote> <hr> <blockquote> <p>iii) OrganizationLocalServiceUtil: <code>com.liferay.portal.service.OrganizationLocalServiceUtil</code></p> </blockquote> <p>This can also be used if you don't want any permission checks. The <code>OrganizationServiceUtil</code> ultimately makes a call to the <code>localService</code> layer.</p> <p>Liferay's <a href="http://docs.liferay.com/portal/6.1/javadocs/com/liferay/portal/service/OrganizationLocalServiceUtil.html" rel="nofollow" title="Liferay 6.1 Official Documentation for com.liferay.portal.service.OrganizationLocalServiceUtil">Documentation</a>:</p> <blockquote> <p>The utility for the organization local service. This utility wraps com.liferay.portal.service.impl.OrganizationLocalServiceImpl and is the primary access point for service operations in application layer code running on the local server.</p> <p>This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.</p> </blockquote> <h3>Conclusion</h3> <ol> <li>Use OrganizationUtil if you care about transaction i.e. have to update multiple tables in a transaction then use this.</li> <li>Use OrganizationServiceUtil if you creating Organization outside liferay or if you need permission checks &amp; you don't care about transaction (i.e. transaction with your custom code)</li> <li>Use OrganizationLocalServiceUtil if you are not using a web-service and you don't care about transaction or permissions.</li> </ol> <p>Hope this gives you a fair idea. Let me know if it is still unclear.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload