;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- (declaim (optimize (speed 0) (safety 3) (debug 3))) (in-package :snow) (defclass octopus-projects-with-roles-service (rest-service) () (:documentation "")) (defun octopus-projects-with-roles-json () (with-noauth (instance octopus-projects-with-roles-service) t)) (defclass octopus-projects-with-roles/view-service (octopus-projects-with-roles-service) ((form :initarg :form :initform nil :accessor form) (location-p :initform nil)) (:documentation "")) (defun octopus-projects-with-roles-view-json () (with-noauth (instance octopus-projects-with-roles/view-service) (setf (form instance) (make-form "octopus-projects-with-roles-form" nil t `((:name "roles" :label "Roles (comma or space separated)" :field-type "text" :required "required" :value ,(or (session-value :octopus-roles) "")) (:label "Find Projects With Roles" :field-type "button" :onclick "on_octopus_projects_with_roles_results_clicked()")))))) (defclass octopus-projects-with-roles/results-service (octopus-projects-with-roles/view-service) ((stdout :initarg :stdout :initform nil :accessor stdout) (location-p :initform nil)) (:documentation "")) (defun octopus-projects-with-roles-results-json (roles) (with-noauth (instance octopus-projects-with-roles/results-service) (cl-fad:with-output-to-temporary-file (f :template "/tmp/snow/temp-%") (get-octopus-projects-with-roles (make-instance 'octopus-process-step :target-roles (remove-if (lambda (x) (org-ckons-core::null-or-empty-p x)) (cl-ppcre:split "[, ]" roles)) :stdout (pathname f))) (setf (stdout instance) (uiop:native-namestring (pathname f)))) (setf (session-value :octopus-roles) roles)))