001
014
015 package com.liferay.portal.ccpp;
016
017 import com.sun.ccpp.ProfileFactoryImpl;
018
019 import javax.ccpp.Profile;
020 import javax.ccpp.ProfileFactory;
021 import javax.ccpp.ValidationMode;
022
023 import javax.servlet.http.HttpServletRequest;
024
025
028 public class PortalProfileFactory {
029
030 public static Profile getCCPPProfile(HttpServletRequest request) {
031 ProfileFactory profileFactory = ProfileFactory.getInstance();
032
033 if (profileFactory == null) {
034 profileFactory = ProfileFactoryImpl.getInstance();
035
036 ProfileFactory.setInstance(profileFactory);
037 }
038
039 Profile profile = profileFactory.newProfile(
040 request, ValidationMode.VALIDATIONMODE_NONE);
041
042 if (profile == null) {
043 profile = _profile;
044 }
045
046 return profile;
047 }
048
049 private static final Profile _profile = new EmptyProfile();
050
051 }