summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app/services
diff options
context:
space:
mode:
authormconway <michael_conway@unc.edu>2013-10-22 20:53:50 (GMT)
committer mconway <michael_conway@unc.edu>2013-10-22 20:53:50 (GMT)
commiteb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7 (patch)
tree5906cc044be862bc7daf619d7c108fbb5068701f /idrop-web/grails-app/services
parentf891433d0a168c8f8936360d43bfd3165ab16db0 (diff)
downloadQCG-Data-eb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7.zip
QCG-Data-eb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7.tar.gz
QCG-Data-eb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7.tar.bz2
[#1458] rule edit panel
Diffstat (limited to 'idrop-web/grails-app/services')
-rw-r--r--idrop-web/grails-app/services/org/irods/mydrop/service/RuleProcessingService.groovy34
1 files changed, 19 insertions, 15 deletions
diff --git a/idrop-web/grails-app/services/org/irods/mydrop/service/RuleProcessingService.groovy b/idrop-web/grails-app/services/org/irods/mydrop/service/RuleProcessingService.groovy
index 875e7b6..6b5f64f 100644
--- a/idrop-web/grails-app/services/org/irods/mydrop/service/RuleProcessingService.groovy
+++ b/idrop-web/grails-app/services/org/irods/mydrop/service/RuleProcessingService.groovy
@@ -1,42 +1,46 @@
package org.irods.mydrop.service
import org.irods.jargon.core.connection.IRODSAccount
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
+import org.irods.jargon.core.pub.IRODSAccessObjectFactory
+import org.irods.jargon.core.utils.LocalFileUtils
+import org.irods.jargon.core.utils.MiscIRODSUtils
import org.irods.jargon.ruleservice.composition.RuleCompositionService
import org.irods.jargon.ruleservice.composition.RuleCompositionServiceImpl
-import org.irods.jargon.core.utils.MiscIRODSUtils
-import org.irods.jargon.core.utils.LocalFileUtils
class RuleProcessingService {
-
+
static transactional = false
IRODSAccessObjectFactory irodsAccessObjectFactory
- def loadRuleFromIrodsFile(IRODSAccount irodsAccount, String rulePath) {
-
+ def loadRuleFromIrodsFile(IRODSAccount irodsAccount, String rulePath) {
+
RuleCompositionService ruleService = new RuleCompositionServiceImpl(irodsAccessObjectFactory, irodsAccount)
log.info("attempting to retrieve rule for ${rulePath}")
-
+
return ruleService.loadRuleFromIrods(rulePath)
-
- }
-
+ }
+
+ def storeRule(IRODSAccount irodsAccount, String rulePath, String ruleBody, List<String> inputParameters, List<String> outputParameters) {
+
+ log.info("storeRule")
+ RuleCompositionService ruleService = new RuleCompositionServiceImpl(irodsAccessObjectFactory, irodsAccount)
+ return ruleService.storeRuleFromParts(rulePath, ruleBody, inputParameters, outputParameters)
+ }
+
def isRule(String rulePath) {
if (!rulePath) {
return false
}
-
+
def fileName = MiscIRODSUtils.getLastPathComponentForGiveAbsolutePath(rulePath)
def fileExtension = LocalFileUtils.getFileExtension(fileName)
log.info("extension is:${fileExtension}")
-
+
if (fileExtension && fileExtension == ".r") {
return true
} else {
return false
- }
-
+ }
}
-
}