Changeset 6551


Ignore:
Timestamp:
Oct 2, 2014, 1:51:08 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #1859: Add support for installing configurations for other plug-ins than what is defined by an extension

This should now work. Simply needed to check the database for an existing plug-in if the plug-in had not been found in extensions.xml for the current extension.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-stable/src/core/net/sf/basedb/util/extensions/manager/processor/PluginInstallationProcessor.java

    r6444 r6551  
    3030
    3131import net.sf.basedb.core.DbControl;
     32import net.sf.basedb.core.Include;
    3233import net.sf.basedb.core.ItemKey;
    3334import net.sf.basedb.core.ItemQuery;
     
    175176           
    176177            PluginDefinition plugin = allPlugins.get(pluginClassName);
     178            if (plugin == null)
     179            {
     180              try
     181              {
     182                plugin = PluginDefinition.getByClassName(dc, pluginClassName);
     183              }
     184              catch (RuntimeException ex)
     185              {}
     186            }
    177187            if (plugin != null)
    178188            {
     
    181191              {
    182192                ItemQuery<PluginConfiguration> query = plugin.getPluginConfigurations();
     193                query.setIncludes(Include.ALL);
    183194                query.restrict(Restrictions.eq(Hql.property("name"), Expressions.parameter("name", name, Type.STRING)));
    184195                List<PluginConfiguration> existing = query.list(dc);
     
    203214              }
    204215            }
    205  
     216            else
     217            {
     218              numError++;
     219              wFile.setError(true);
     220              String msg = "Failed to install plug-in configuration '" + name + "', no plug-in: " + pluginClassName;
     221              if (results != null) results.addErrorMessage(xtFile, msg);
     222              log.error(msg);
     223            }
    206224          }
    207225        }
     
    214232        if (numInstalled > 0) results.addMessage(xtFile, numInstalled + " plug-in(s) installed.");
    215233        if (numUpdated > 0) results.addMessage(xtFile, numUpdated + " plug-in(s) updated.");
    216         if (numConfigurations > 0) results.addMessage(xtFile, numConfigurations + " plug-in configuration(s) created");
     234        if (numConfigurations > 0) results.addMessage(xtFile, numConfigurations + " plug-in configuration(s) created.");
    217235        if (numInstalled == 0 && numUpdated == 0 && numProcessed > 0)
    218236        {
    219           results.addMessage(xtFile, numProcessed + " plug-in(s) loaded");
     237          results.addMessage(xtFile, numProcessed + " plug-in(s) loaded.");
    220238        }
    221239      }
Note: See TracChangeset for help on using the changeset viewer.