fr.paris.lutece.plugins.pluginwizard.business.model
Class ResourceKeyDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.pluginwizard.business.model.ResourceKeyDAO
All Implemented Interfaces:
IResourceKeyDAO

public final class ResourceKeyDAO
extends java.lang.Object
implements IResourceKeyDAO

This class provides Data Access methods for ResourceKey objects


Constructor Summary
ResourceKeyDAO()
           
 
Method Summary
 void addEmptyKeys(int nPluginId, java.util.ArrayList<java.lang.String> listKeys, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Adds the list of required i18n keys
 void delete(int nResourceKeyId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void deleteAllByPlugin(int nPluginId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete all records from the table
 void deleteByPlugin(int nPluginId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete all resources related to plugin record from the table
 void deleteDependency(int nResourceKeyId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete the dependency
 java.util.Collection<ResourceKey> getAllResourceKeys(int nPluginId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Fetches all the resource keys by plugin
 void insert(ResourceKey resourceKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 void insertDependency(int nIdPlugin, int nIdResourceKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Inserts the dependency between the plugin and its resource keys
 boolean isEmpty(int nPluginId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Verifies whether no resource is present for a plugin
 boolean isValid(int nPluginId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns whether all the resource keys are filled before generation
 ResourceKey load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of the resourceKey from the table
 int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Generates a new primary key
 java.util.Collection<ResourceKey> selectResourceKeysList(int nPluginId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns all the resource keys related to a generated plugin
 java.util.Collection<ResourceKey> selectResourceKeysList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the resourceKeys and returns them as a collection
 void store(ResourceKey resourceKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceKeyDAO

public ResourceKeyDAO()
Method Detail

newPrimaryKey

public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Generates a new primary key

Parameters:
plugin - The Plugin
Returns:
The new primary key

insert

public void insert(ResourceKey resourceKey,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IResourceKeyDAO
Parameters:
resourceKey - instance of the ResourceKey object to insert
plugin - The plugin

insertDependency

public void insertDependency(int nIdPlugin,
                             int nIdResourceKey,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Inserts the dependency between the plugin and its resource keys

Parameters:
nIdPlugin - The id of the plugin
nIdResourceKey - The id of the resource key
plugin - The plugin

load

public ResourceKey load(int nId,
                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of the resourceKey from the table

Specified by:
load in interface IResourceKeyDAO
Parameters:
nId - The identifier of the resourceKey
plugin - The plugin
Returns:
the instance of the ResourceKey

delete

public void delete(int nResourceKeyId,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete a record from the table

Specified by:
delete in interface IResourceKeyDAO
Parameters:
nResourceKeyId - The identifier of the resourceKey
plugin - The plugin

deleteAllByPlugin

public void deleteAllByPlugin(int nPluginId,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete all records from the table

Parameters:
nPluginId - The identifier of the resourceKey
plugin - The plugin

deleteDependency

public void deleteDependency(int nResourceKeyId,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete the dependency

Parameters:
nResourceKeyId - The identifier of the ressource
plugin - The plugin

store

public void store(ResourceKey resourceKey,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table

Specified by:
store in interface IResourceKeyDAO
Parameters:
resourceKey - The reference of the resourceKey
plugin - The plugin

selectResourceKeysList

public java.util.Collection<ResourceKey> selectResourceKeysList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the resourceKeys and returns them as a collection

Specified by:
selectResourceKeysList in interface IResourceKeyDAO
Parameters:
plugin - The plugin
Returns:
The Collection which contains the data of all the resourceKeys

selectResourceKeysList

public java.util.Collection<ResourceKey> selectResourceKeysList(int nPluginId,
                                                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns all the resource keys related to a generated plugin

Specified by:
selectResourceKeysList in interface IResourceKeyDAO
Parameters:
nPluginId - The identifier of the plugin
plugin - The plugin
Returns:
A collection of resource keys

getAllResourceKeys

public java.util.Collection<ResourceKey> getAllResourceKeys(int nPluginId,
                                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Fetches all the resource keys by plugin

Parameters:
nPluginId - The identifier of the generated plugin
plugin - The plugin
Returns:
A collection of resource keys

isValid

public boolean isValid(int nPluginId,
                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns whether all the resource keys are filled before generation

Specified by:
isValid in interface IResourceKeyDAO
Parameters:
nPluginId - The identifier of the plugin
plugin - The plugin
Returns:
A boolean value indicating whether the plugin is valid

addEmptyKeys

public void addEmptyKeys(int nPluginId,
                         java.util.ArrayList<java.lang.String> listKeys,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Adds the list of required i18n keys

Specified by:
addEmptyKeys in interface IResourceKeyDAO
Parameters:
nPluginId - The id of the plugin
listKeys - The markers identifier
plugin - The plugin

isEmpty

public boolean isEmpty(int nPluginId,
                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Verifies whether no resource is present for a plugin

Specified by:
isEmpty in interface IResourceKeyDAO
Parameters:
nPluginId - The identifier of the plugin
plugin - The plugin
Returns:
A boolean value which is true when no resource is associated to the plugin

deleteByPlugin

public void deleteByPlugin(int nPluginId,
                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete all resources related to plugin record from the table

Specified by:
deleteByPlugin in interface IResourceKeyDAO
Parameters:
nPluginId - The identifier of the plugin
plugin - The plugin


Copyright © 2012 Mairie de Paris. All Rights Reserved.