Examples of PreferencesValidator


Examples of com.dotcms.repackage.javax.portlet.PreferencesValidator

        Validator.isNotNull(prefsValidator) &&
        GetterUtil.getBoolean(PropsUtil.get(
          PropsUtil.PREFERENCE_VALIDATE_ON_STARTUP))) {

        try {
          PreferencesValidator prefsValidatorObj =
            PortalUtil.getPreferencesValidator(portletModel);

          prefsValidatorObj.validate(
            PortletPreferencesSerializer.fromDefaultXML(
              defaultPreferences));
        }
        catch (Exception e) {
          _log.warn(
View Full Code Here

Examples of com.dotcms.repackage.javax.portlet.PreferencesValidator

        PortletContextPool.get(portlet.getPortletId());

      return pcw.getPreferencesValidator();
    }
    else {
      PreferencesValidator prefsValidator = null;

      if (Validator.isNotNull(portlet.getPreferencesValidator())) {
        prefsValidator =
          (PreferencesValidator)InstancePool.get(
            portlet.getPreferencesValidator());
View Full Code Here

Examples of com.dotcms.repackage.javax.portlet.PreferencesValidator

    boolean active = ParamUtil.getBoolean(req, "portlet_active");

    Portlet portlet = PortletManagerUtil.getPortletById(
      PortalUtil.getCompanyId(req), portletId);

    PreferencesValidator prefsValidator =
      PortalUtil.getPreferencesValidator(portlet);

    if (prefsValidator != null) {
      try {
        prefsValidator.validate(
          PortletPreferencesSerializer.fromDefaultXML(
            defaultPreferences));
      }
      catch (Exception e) {
        throw new PortletDefaultPreferencesException();
View Full Code Here

Examples of com.dotcms.repackage.javax.portlet.PreferencesValidator

    try {
      Portlet portlet =
        PortletManagerUtil.getPortletById(_companyId, _pk.portletId);

      PreferencesValidator prefsValidator =
        PortalUtil.getPreferencesValidator(portlet);

      if (prefsValidator != null) {
        prefsValidator.validate(this);
      }

      PortletPreferencesManagerUtil.updatePreferences(_pk, this);
    }
    catch (PortalException pe) {
View Full Code Here

Examples of com.dotcms.repackage.javax.portlet.PreferencesValidator

        if (Validator.isNotNull(portlet.getSchedulerClass())) {
          schedulerInstance = (Scheduler)contextClassLoader.loadClass(
            portlet.getSchedulerClass()).newInstance();
        }

        PreferencesValidator prefsValidator = null;
        if (Validator.isNotNull(portlet.getPreferencesValidator())) {
          prefsValidator =
            (PreferencesValidator)contextClassLoader.loadClass(
              portlet.getPreferencesValidator()).newInstance();

          try {
            if (GetterUtil.getBoolean(PropsUtil.get(
                PropsUtil.PREFERENCE_VALIDATE_ON_STARTUP))) {

              prefsValidator.validate(
                PortletPreferencesSerializer.fromDefaultXML(
                  portlet.getDefaultPreferences()));
            }
          }
          catch (Exception e1) {
View Full Code Here

Examples of javax.portlet.PreferencesValidator

        }
    }

    public PreferencesValidator getPreferencesValidator(PortletDefinition pd)
    {
        PreferencesValidator validator = null;
       
        try
        {
            String paName = pd.getApplication().getName();
            String pdName = pd.getPortletName();
View Full Code Here

Examples of javax.portlet.PreferencesValidator

     */
    private void internalStore() throws IOException, ValidatorException {
        // Validate the preferences before storing, if a validator is defined.
        //   If the preferences cannot pass the validation,
        //   an ValidatorException will be thrown out.
        PreferencesValidator validator = window.getPortletEntity()
            .getPreferencesValidator();
        if (validator != null) {
          validator.validate(this);
        }
        // Store the portlet preferences.
        InternalPortletPreference[] prefs = (InternalPortletPreference[])
            (new ArrayList(preferences.values())).toArray(
                new InternalPortletPreference[preferences.size()]);
View Full Code Here

Examples of javax.portlet.PreferencesValidator

     * @return the preferences validator instance for this portlet.
     * @throws ValidatorException  if fail to instantiate the validator.
     */
    public PreferencesValidator getPreferencesValidator()
    throws ValidatorException {
      PreferencesValidator validator = PreferencesValidatorRegistry
          .getRegistry()
          .getPreferencesValidator(getPortletDefinition());
      return validator;
    }
View Full Code Here

Examples of javax.portlet.PreferencesValidator

   */
  public PreferencesValidator getPreferencesValidator(PortletDD portletDD)
  throws ValidatorException {
   
    // Try to retrieve the validator from cache.
    PreferencesValidator validator = (PreferencesValidator)
        cache.get(portletDD);
    if (validator != null) {
      return validator;
    }
   
View Full Code Here

Examples of javax.portlet.PreferencesValidator

   public PortletRequestImpl(PortletContainerImpl container, PortletInvocation invocation)
   {
      int mode = this instanceof RenderRequest ? PortletPreferencesImpl.RENDER : PortletPreferencesImpl.ACTION;
      PropertyContext prefs = (PropertyContext)invocation.getAttribute(PropertyContext.PREFERENCES_ATTRIBUTE);
      PreferencesValidator validator = container.getPreferencesValidator();
      ContainerPortletInfo info = container.getInfo();
      ContainerPreferencesInfo containerPrefs = info.getPreferences();
      ContainerNavigationInfo navigationInfo = info.getNavigation();
      UserContext userContext = invocation.getUserContext();
      HttpServletRequestWrapper realReq = new HttpServletRequestWrapper(invocation.getDispatchedRequest());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.