from .configuration import Configuration
from girder.utility import setting_utilities
from .constants import Features, Branding, Deployment

from .launch_taskflow import launch_taskflow
from .user import get_orcid, set_orcid, get_twitter, set_twitter

from girder.plugin import GirderPlugin

@setting_utilities.validator({
    Features.NOTEBOOKS,
    Deployment.SITE,
    Branding.PRIVACY,
    Branding.LICENSE,
    Branding.HEADER_LOGO_ID,
    Branding.FOOTER_LOGO_ID,
    Branding.FOOTER_LOGO_URL,
    Branding.FAVICON_ID
})
def validateSettings(event):
    pass

class AppPlugin(GirderPlugin):
    DISPLAY_NAME = 'OpenChemistry App'

    def load(self, info):
        info['apiRoot'].configuration = Configuration()

        # Twitter and orcid stuff
        info['apiRoot'].user.route('GET', (':id', 'orcid'), get_orcid)
        info['apiRoot'].user.route('POST', (':id', 'orcid'), set_orcid)
        info['apiRoot'].user.route('GET', (':id', 'twitter'), get_twitter)
        info['apiRoot'].user.route('POST', (':id', 'twitter'), set_twitter)

        # Launch a taskflow with a single endpoint
        info['apiRoot'].queues.route('POST', ('launchtaskflow',), launch_taskflow)

from .configuration import Configuration
from girder.api.rest import Resource
from girder.utility import setting_utilities
from .constants import Features, Branding, Deployment

from .launch_taskflow import launch_taskflow
from .user import get_orcid, set_orcid, get_twitter, set_twitter

from girder.plugin import GirderPlugin

@setting_utilities.validator({
    Features.NOTEBOOKS,
    Deployment.SITE,
    Branding.PRIVACY,
    Branding.LICENSE,
    Branding.HEADER_LOGO_ID,
    Branding.FOOTER_LOGO_ID,
    Branding.FOOTER_LOGO_URL,
    Branding.FAVICON_ID
})
def validateSettings(event):
    pass

class AppPlugin(GirderPlugin):
    DISPLAY_NAME = 'OpenChemistry App'

    def load(self, info):
        info['apiRoot'].configuration = Configuration()

        # Twitter and orcid stuff
        info['apiRoot'].user.route('GET', (':id', 'orcid'), get_orcid)
        info['apiRoot'].user.route('POST', (':id', 'orcid'), set_orcid)
        info['apiRoot'].user.route('GET', (':id', 'twitter'), get_twitter)
        info['apiRoot'].user.route('POST', (':id', 'twitter'), set_twitter)

        # Launch a taskflow with a single endpoint
        info['apiRoot'].launch_taskflow = Resource()
        info['apiRoot'].launch_taskflow.route('POST', ('launch',), launch_taskflow)

Put the endpoint at /launch_taskflow/launch
Put the endpoint at /launch_taskflow/launch

Put it here instead of under "queues"

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

  from .configuration import Configuration
+ from girder.api.rest import Resource
  from girder.utility import setting_utilities
  from .constants import Features, Branding, Deployment
  
  from .launch_taskflow import launch_taskflow
  from .user import get_orcid, set_orcid, get_twitter, set_twitter
  
  from girder.plugin import GirderPlugin
  
  @setting_utilities.validator({
      Features.NOTEBOOKS,
      Deployment.SITE,
      Branding.PRIVACY,
      Branding.LICENSE,
      Branding.HEADER_LOGO_ID,
      Branding.FOOTER_LOGO_ID,
      Branding.FOOTER_LOGO_URL,
      Branding.FAVICON_ID
  })
  def validateSettings(event):
      pass
  
  class AppPlugin(GirderPlugin):
      DISPLAY_NAME = 'OpenChemistry App'
  
      def load(self, info):
          info['apiRoot'].configuration = Configuration()
  
          # Twitter and orcid stuff
          info['apiRoot'].user.route('GET', (':id', 'orcid'), get_orcid)
          info['apiRoot'].user.route('POST', (':id', 'orcid'), set_orcid)
          info['apiRoot'].user.route('GET', (':id', 'twitter'), get_twitter)
          info['apiRoot'].user.route('POST', (':id', 'twitter'), set_twitter)
  
          # Launch a taskflow with a single endpoint
+         info['apiRoot'].launch_taskflow = Resource()
-         info['apiRoot'].queues.route('POST', ('launchtaskflow',), launch_taskflow)
+         info['apiRoot'].launch_taskflow.route('POST', ('launch',), launch_taskflow)
  
Put the endpoint at /launch_taskflow/launch
## Code Before:
from .configuration import Configuration
from girder.utility import setting_utilities
from .constants import Features, Branding, Deployment

from .launch_taskflow import launch_taskflow
from .user import get_orcid, set_orcid, get_twitter, set_twitter

from girder.plugin import GirderPlugin

@setting_utilities.validator({
    Features.NOTEBOOKS,
    Deployment.SITE,
    Branding.PRIVACY,
    Branding.LICENSE,
    Branding.HEADER_LOGO_ID,
    Branding.FOOTER_LOGO_ID,
    Branding.FOOTER_LOGO_URL,
    Branding.FAVICON_ID
})
def validateSettings(event):
    pass

class AppPlugin(GirderPlugin):
    DISPLAY_NAME = 'OpenChemistry App'

    def load(self, info):
        info['apiRoot'].configuration = Configuration()

        # Twitter and orcid stuff
        info['apiRoot'].user.route('GET', (':id', 'orcid'), get_orcid)
        info['apiRoot'].user.route('POST', (':id', 'orcid'), set_orcid)
        info['apiRoot'].user.route('GET', (':id', 'twitter'), get_twitter)
        info['apiRoot'].user.route('POST', (':id', 'twitter'), set_twitter)

        # Launch a taskflow with a single endpoint
        info['apiRoot'].queues.route('POST', ('launchtaskflow',), launch_taskflow)

## Instruction:
Put the endpoint at /launch_taskflow/launch
## Code After:
from .configuration import Configuration
from girder.api.rest import Resource
from girder.utility import setting_utilities
from .constants import Features, Branding, Deployment

from .launch_taskflow import launch_taskflow
from .user import get_orcid, set_orcid, get_twitter, set_twitter

from girder.plugin import GirderPlugin

@setting_utilities.validator({
    Features.NOTEBOOKS,
    Deployment.SITE,
    Branding.PRIVACY,
    Branding.LICENSE,
    Branding.HEADER_LOGO_ID,
    Branding.FOOTER_LOGO_ID,
    Branding.FOOTER_LOGO_URL,
    Branding.FAVICON_ID
})
def validateSettings(event):
    pass

class AppPlugin(GirderPlugin):
    DISPLAY_NAME = 'OpenChemistry App'

    def load(self, info):
        info['apiRoot'].configuration = Configuration()

        # Twitter and orcid stuff
        info['apiRoot'].user.route('GET', (':id', 'orcid'), get_orcid)
        info['apiRoot'].user.route('POST', (':id', 'orcid'), set_orcid)
        info['apiRoot'].user.route('GET', (':id', 'twitter'), get_twitter)
        info['apiRoot'].user.route('POST', (':id', 'twitter'), set_twitter)

        # Launch a taskflow with a single endpoint
        info['apiRoot'].launch_taskflow = Resource()
        info['apiRoot'].launch_taskflow.route('POST', ('launch',), launch_taskflow)
