org.exoplatform.application.registry.jcr
Class ApplicationRegistryServiceImpl

java.lang.Object
  extended by org.exoplatform.application.registry.jcr.ApplicationRegistryServiceImpl
All Implemented Interfaces:
ApplicationRegistryService, org.picocontainer.Startable

public class ApplicationRegistryServiceImpl
extends java.lang.Object
implements ApplicationRegistryService, org.picocontainer.Startable

Created by The eXo Platform SARL Author : Tung Pham thanhtungty@gmail.com Nov 23, 2007


Constructor Summary
ApplicationRegistryServiceImpl(org.exoplatform.services.jcr.ext.registry.RegistryService service)
           
 
Method Summary
 void clearAllRegistries()
          remove all ApplicationCategory and Application in it
 java.util.List<Application> getAllApplications()
          get list of all current applications
 Application getApplication(java.lang.String id)
          get application with id provided
 Application getApplication(java.lang.String category, java.lang.String name)
          get application in specific category and have name provided in param
 java.util.List<ApplicationCategory> getApplicationCategories()
          get list of all current application categories (unsorted)
 java.util.List<ApplicationCategory> getApplicationCategories(java.util.Comparator<ApplicationCategory> sortComparator)
          get list of all current application categories (sorted)
 java.util.List<ApplicationCategory> getApplicationCategories(java.lang.String accessUser, java.lang.String... appTypes)
          get list of application categories (and applications in each category)
 ApplicationCategory getApplicationCategory(java.lang.String name)
          get ApplicationCategory with name provided
 java.util.List<Application> getApplications(ApplicationCategory category, java.util.Comparator<Application> sortComparator, java.lang.String... appTypes)
          get list of applications (sorted) in specific category and have specific type
 java.util.List<Application> getApplications(ApplicationCategory category, java.lang.String... appTypes)
          get list of applications (unsorted) in specific category and have specific type
 void importAllPortlets()
          Get all deployed portlet, add to portlet's ApplicationCategory If ApplicationCategory currently doesn't exist, it'll be created If Application've already existed, it'll be ignored
 void importExoGadgets()
          Get all Gadget, add to eXoGadgets application category When first added, it's access permission will be Everyone If ApplicationCategory currently doesn't exist, it'll be created Gadget that has been imported before will be ignored
 void initListener(org.exoplatform.container.component.ComponentPlugin com)
           
 void remove(Application app)
          Remove an Application from database
 void remove(ApplicationCategory category)
          remove application category (and all application in it) from database
 void save(ApplicationCategory category)
          save an application category to database
 void save(ApplicationCategory category, Application application)
          Save Application in ApplicationCategory If ApplicationCategory or Application don't exist, they'll be created
 void start()
           
 void stop()
           
 void update(Application application)
          Update an Application
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationRegistryServiceImpl

public ApplicationRegistryServiceImpl(org.exoplatform.services.jcr.ext.registry.RegistryService service)
                               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getApplicationCategories

public java.util.List<ApplicationCategory> getApplicationCategories(java.lang.String accessUser,
                                                                    java.lang.String... appTypes)
                                                             throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get list of application categories (and applications in each category)

Specified by:
getApplicationCategories in interface ApplicationRegistryService
Parameters:
accessUser - - username of user that his access permissions is used to filter app categories and apps
appTypes - - array of application type, used to filter applications in each application category
Throws:
java.lang.Exception

getApplicationCategories

public java.util.List<ApplicationCategory> getApplicationCategories()
                                                             throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get list of all current application categories (unsorted)

Specified by:
getApplicationCategories in interface ApplicationRegistryService
Throws:
java.lang.Exception

getApplicationCategories

public java.util.List<ApplicationCategory> getApplicationCategories(java.util.Comparator<ApplicationCategory> sortComparator)
                                                             throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get list of all current application categories (sorted)

Specified by:
getApplicationCategories in interface ApplicationRegistryService
Parameters:
sortComparator - - used to sort application category list
Throws:
java.lang.Exception

getApplicationCategory

public ApplicationCategory getApplicationCategory(java.lang.String name)
                                           throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get ApplicationCategory with name provided

Specified by:
getApplicationCategory in interface ApplicationRegistryService
Parameters:
name - - ApplicationCategory's name
Throws:
java.lang.Exception

save

public void save(ApplicationCategory category)
          throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
save an application category to database

Specified by:
save in interface ApplicationRegistryService
Parameters:
category - - application category that will be saved
Throws:
java.lang.Exception

remove

public void remove(ApplicationCategory category)
            throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
remove application category (and all application in it) from database

Specified by:
remove in interface ApplicationRegistryService
Parameters:
category - - application category that will be removed
Throws:
java.lang.Exception

getAllApplications

public java.util.List<Application> getAllApplications()
                                               throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get list of all current applications

Specified by:
getAllApplications in interface ApplicationRegistryService
Throws:
java.lang.Exception

getApplication

public Application getApplication(java.lang.String id)
                           throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get application with id provided

Specified by:
getApplication in interface ApplicationRegistryService
Parameters:
id - - must be valid applicationId (catgoryname/applicationName), if not, this will throw exception
Throws:
java.lang.Exception

getApplication

public Application getApplication(java.lang.String category,
                                  java.lang.String name)
                           throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get application in specific category and have name provided in param

Specified by:
getApplication in interface ApplicationRegistryService
Parameters:
category - - name of application category
name - - name of application
Throws:
java.lang.Exception

getApplications

public java.util.List<Application> getApplications(ApplicationCategory category,
                                                   java.lang.String... appTypes)
                                            throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get list of applications (unsorted) in specific category and have specific type

Specified by:
getApplications in interface ApplicationRegistryService
Parameters:
category - - ApplicationCategory that you want to list applications
appTypes - - array of application type
Throws:
java.lang.Exception

getApplications

public java.util.List<Application> getApplications(ApplicationCategory category,
                                                   java.util.Comparator<Application> sortComparator,
                                                   java.lang.String... appTypes)
                                            throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
get list of applications (sorted) in specific category and have specific type

Specified by:
getApplications in interface ApplicationRegistryService
Parameters:
category - - ApplicationCategory that you want to list applications
sortComparator - - comparator used to sort application list
appTypes - - array of application type
Throws:
java.lang.Exception

importExoGadgets

public void importExoGadgets()
                      throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
Get all Gadget, add to eXoGadgets application category When first added, it's access permission will be Everyone If ApplicationCategory currently doesn't exist, it'll be created Gadget that has been imported before will be ignored

Specified by:
importExoGadgets in interface ApplicationRegistryService
Throws:
java.lang.Exception

importAllPortlets

public void importAllPortlets()
                       throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
Get all deployed portlet, add to portlet's ApplicationCategory If ApplicationCategory currently doesn't exist, it'll be created If Application've already existed, it'll be ignored

Specified by:
importAllPortlets in interface ApplicationRegistryService
Throws:
java.lang.Exception

remove

public void remove(Application app)
            throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
Remove an Application from database

Specified by:
remove in interface ApplicationRegistryService
Parameters:
app - - Application that you want to remove
Throws:
java.lang.Exception

save

public void save(ApplicationCategory category,
                 Application application)
          throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
Save Application in ApplicationCategory If ApplicationCategory or Application don't exist, they'll be created

Specified by:
save in interface ApplicationRegistryService
Parameters:
category - - ApplicationCategory that your application'll be saved to
application - - Application that will be saved
Throws:
java.lang.Exception

update

public void update(Application application)
            throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
Update an Application

Specified by:
update in interface ApplicationRegistryService
Parameters:
application - - Application that you want to update
Throws:
java.lang.Exception

clearAllRegistries

public void clearAllRegistries()
                        throws java.lang.Exception
Description copied from interface: ApplicationRegistryService
remove all ApplicationCategory and Application in it

Specified by:
clearAllRegistries in interface ApplicationRegistryService
Throws:
java.lang.Exception

initListener

public void initListener(org.exoplatform.container.component.ComponentPlugin com)
                  throws java.lang.Exception
Specified by:
initListener in interface ApplicationRegistryService
Throws:
java.lang.Exception

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable


Copyright © 2011 eXo Platform SAS. All Rights Reserved.