Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • DM/dm-docs
  • hammonds/dm-docs
  • hparraga/dm-docs
3 results
Show changes
#!/usr/bin/env python
#
# User route descriptor.
#
from dm.common.utility.configurationManager import ConfigurationManager
from workflowSessionController import WorkflowSessionController
class WorkflowRouteDescriptor:
@classmethod
def getRoutes(cls):
contextRoot = ConfigurationManager.getInstance().getContextRoot()
# Static instances shared between different routes
workflowSessionController = WorkflowSessionController()
# Define routes.
routes = [
# Get workflow
{
'name' : 'getWorkflowByName',
'path' : '%s/workflowsByOwner/:(owner)/:(encodedName)' % contextRoot,
'controller' : workflowSessionController,
'action' : 'getWorkflowByName',
'method' : ['GET']
},
]
return routes
#!/usr/bin/env python
import cherrypy
import json
from dm.common.utility.encoder import Encoder
from dm.common.service.dmSessionController import DmSessionController
from dm.proc_web_service.service.impl.workflowSessionControllerImpl import WorkflowSessionControllerImpl
class WorkflowSessionController(DmSessionController):
def __init__(self):
DmSessionController.__init__(self)
self.workflowSessionControllerImpl = WorkflowSessionControllerImpl()
@cherrypy.expose
@DmSessionController.require(DmSessionController.canManageStation())
@DmSessionController.execute
def getWorkflowByName(self, owner, encodedName, **kwargs):
if not owner:
raise InvalidRequest('Invalid owner provided.')
name = Encoder.decode(encodedName)
if not name:
raise InvalidRequest('Invalid workflow name provided.')
response = self.workflowSessionControllerImpl.getWorkflowByName(owner, name).getFullJsonRep()
return response
all:
for d in $(SUBDIRS); do $(MAKE) -C $$d $(ARCH); done
dist:
for d in $(SUBDIRS); do $(MAKE) -C $$d $(ARCH); done
clean:
for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
distclean:
for d in $(SUBDIRS); do $(MAKE) -C $$d distclean; done
for d in $(SUBDIRS); do rm -f `find $$d -name 'RELEASE.local'`; done
tidy: distclean