Changeset 6341


Ignore:
Timestamp:
Oct 31, 2013, 2:16:52 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1778: Can't re-install an extension with an error

Added the ResetErrorFlagProcessor which is executed first with a filter instance that ignore the error flag.

Location:
branches/3.2-stable
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2-stable/src/clients/web/net/sf/basedb/clients/web/extensions/ExtensionsControl.java

    r6340 r6341  
    6666import net.sf.basedb.util.extensions.manager.processor.ExtractResourcesProcessor;
    6767import net.sf.basedb.util.extensions.manager.processor.PluginInstallationProcessor;
     68import net.sf.basedb.util.extensions.manager.processor.ResetErrorFlagProcessor;
    6869import net.sf.basedb.util.extensions.manager.processor.UnregisterExtensionsProcessor;
    6970import net.sf.basedb.util.extensions.xml.ExtensionPointFilter;
     
    244245        new InstalledFilter(settings) : new InstallFilter(request);
    245246     
     247      // 2. Reset error flags if not initial scan
     248      if (!initialScan)
     249      {
     250        ResetErrorFlagProcessor resetError = new ResetErrorFlagProcessor();
     251        manager.processFiles(resetError, new InstallFilter(request, true)); // Ignore error flag
     252      }
     253       
    246254      // 2a. Load extension definitions
    247255      WebClientRegisterExtensionsProcessor registerExtensions =
  • branches/3.2-stable/src/clients/web/net/sf/basedb/clients/web/extensions/InstallFilter.java

    r5689 r6341  
    2626import net.sf.basedb.util.Values;
    2727import net.sf.basedb.util.extensions.manager.ExtensionsFile;
     28import net.sf.basedb.util.extensions.manager.processor.ResetErrorFlagProcessor;
    2829import net.sf.basedb.util.filter.Filter;
    2930
     
    4142
    4243  private final HttpServletRequest request;
     44  private final boolean ignoreErrorFlag;
    4345 
    4446  public InstallFilter(HttpServletRequest request)
    4547  {
     48    this(request, false);
     49  }
     50 
     51  /**
     52    Create a filter that allow us to ignore the error flag. Needed
     53    to be able to reset the error status for extensions that has
     54    been selected for re-install. See {@link ResetErrorFlagProcessor}.
     55    @since 3.2.4
     56  */
     57  public InstallFilter(HttpServletRequest request, boolean ignoreErrorFlag)
     58  {
    4659    this.request = request;
     60    this.ignoreErrorFlag = ignoreErrorFlag;
    4761  }
    4862 
     
    5064  public boolean evaluate(ExtensionsFile xtFile)
    5165  {
    52     if (!xtFile.isValid() || (xtFile.hasError()))
     66    if (!xtFile.isValid() || (xtFile.hasError() && !ignoreErrorFlag))
    5367    {
    5468      // Do not install files with errors
  • branches/3.2-stable/www/admin/extensions/wizard.jsp

    r5960 r6341  
    151151          checkInstall = true;
    152152        }
     153        else if (xtFile.hasError())
     154        {
     155          status = "Error";
     156          allowInstall = true;
     157          allowUninstall = true;
     158        }
    153159        else
    154160        {
Note: See TracChangeset for help on using the changeset viewer.