/**
 * Copyright 2005-2014 The Kuali Foundation
 *
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.opensource.org/licenses/ecl2.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// krad conversion script properties
// script paths and general properties
script.path.template="./templates"
script.path.properties=""
script.dir.tmp=System.getProperty("java.io.tmpdir")

// project properties - used for war overlay
project.app = "sampleapp"
project.namespace = "KR-SAP"
project.artifact.iswar=true
project.artifact = [groupId:"org.kuali.rice",artifactId:"rice-sampleapp",version:"2.2.1", type:"war" ]
project.parent = [groupId:"org.kuali.rice",artifactId:"rice-sampleapp",version:"2.2.1", type:"war" ]
project.dependencies = [\
  [groupId:"org.kuali.rice",artifactId:"rice-sampleapp",version:"2.2.1", type:"pom" ], \
  [groupId:"org.kuali.rice",artifactId:"rice-sampleapp",version:"2.2.1", classifier:"classes" ], \
  [groupId:"com.oracle",artifactId:"ojdbc6",version:"11.2.0.2.0", type:"jar" ] \
  ]

// experimental - used to handle multimodule projects
project.usePomData = false  // set to true to use project pom.xml data from pom.xml over config file
project.hasModules = false  // set to true to treat project as multimodule
project.modules = [:] // holds module data using artifactId as key, includes pom and path data for each
project.filterModules = []  // filters which modules to include; ignores if array is empty

// input directory and paths - use full path for input.dir
input.dir=""
input.path.src.default="/src"
input.path.src.resources="/src/main/resources"
input.path.src.java="/src/main/java"
input.path.src.webapp="/src/main/webapp"

// output directory and paths - use full path for output.dir
output.dir=System.getProperty("java.io.tmpdir") + "/krad-conv/"
output.path.src.default="/src/"
output.path.src.resources="/src/main/resources/"
output.path.test.java="/src/test/java/"
output.path.src.java="/src/main/java/"
output.path.src.webapp="/src/main/webapp/"
output.path.db.sql="/db/sql/"

output.filePrefix="KradConv"

// used for building out directory structure
output.path.list = [output.path.src.default, output.path.src.resources, output.path.src.java, output.path.test.java, output.path.src.webapp, output.path.db.sql ]

// datdatasource properties
datasource.username = "RICE"
datasource.password = "RICE"
datasource.driver.name = "oracle.jdbc.driver.OracleDriver"
datasource.url = "jdbc:oracle:thin:@localhost:1521:XE"
datasource.platform = "Oracle9i"
// datasource.url = "jdbc:mysql://localhost/rice24"
// datasource.platform = "MySQL"
// datasource.driver.name = "com.mysql.jdbc.Driver"

// servlet properties
servlet.app  = "kradconv"
servlet.path = "kr-krad"
servlet.count = "99"

// element mapping and lists
map.convert.dd_prop = [
                           "businessObjectClass":"dataObjectClass",
                           "BusinessObjectEntry":"DataObjectEntry"]

map.convert.dd_validation_patterns = [
                           "validationPattern":"validCharactersConstraint", "AnyCharacterValidationPattern":"AnyCharacterPatternConstraint",
                           "AlphaValidationPattern":"AlphaPatternConstraint", "AlphaNumericValidationPattern":"AlphaNumericPatternConstraint",
                           "CharsetValidationPattern":"CharsetPatternConstraint", "NumericValidationPattern":"NumericPatternConstraint",
                           "RegexValidationPattern":"JavaClassPatternConstraint", "FixedPointValidationPattern":"FixedPointPatternConstraint",
                           "FloatingPointValidationPattern":"FloatingPointPatternConstraint","ZipcodeValidationPattern":"ZipcodePatternConstraint",
                           "YearValidationPattern":"YearPatternConstraint","TimestampValidationPattern":"TimestampPatternConstraint",
                           "PhoneNumberValidationPattern":"PhoneNumberPatternConstraint","MonthValidationPattern":"MonthPatternConstraint",
                           "JavaClassValidationPattern":"JavaClassPatternConstraint","EmailAddressValidationPattern":"EmailAddressPatternConstraint",
                           "DateValidationPattern":"DatePatternConstraint","UTF8AnyCharacterValidationPattern":"UTF8AnyCharacterPatternConstraint"]

map.convert.dd_bean_control = ["CheckboxControlDefinition":"Uif-CheckboxControl",
                                              "DateControlDefinition":"Uif-DateControl",
                                              "FileControlDefinition":"Uif-FileControl",
                                              "HiddenControlDefinition":"Uif-HiddenControl",
                                              "SelectControlDefinition":"Uif-DropdownControl",
                                              "TextareaControlDefinition":"Uif-TextAreaControl",
                                              "TextControlDefinition":"Uif-TextControl",
                                              "CurrencyControlDefinition":"Uif-CurrencyTextControl",
                                              "RadioControlDefinition":"Uif-VerticalRadioControl",
                                              "KualiUserControlDefinition":"Uif-KimPersonControl",
                                              "LinkControlDefinition":"Uif-LinkField",
                                              "ButtonControlDefinition":"Uif-PrimaryActionButton" ]

map.convert_control_properties = ["*size":"p:size"]
map.convert_validation_pattern_properties = ["allowWhitespace":"allowWhitespace", "allowUnderscore":"allowUnderscore",
                        "allowPeriod":"allowPeriod", "allowNegative":"allowNegative", "allowDash":"allowDash",
                        "allowParenthesis":"allowParenthesis", "allowDollar":"allowDollar", "allowForwardSlash":"allowForwardSlash",
                        "lowerCase":"lowerCase", "validChars":"validChars", "precision":"precision", "scale":"scale",
                        "exactLength":"exactLength", "maxLength":"maxLength", "regexPattern":"value", "pattern":"value","validationErrorMessageKey":"messageKey"]
// action forms have related controller and view
map.convert.kns_action_class = [
  "default":[controller:"org.kuali.rice.krad.web.controller.UifControllerBase", form:"org.kuali.rice.krad.web.form.UifFormBase", view: "Uif-FormView"],
  "org.kuali.rice.kns.web.struts.form.KualiAction":[controller:"org.kuali.rice.krad.web.controller.UifControllerBase", form:"org.kuali.rice.krad.web.form.UifFormBase", view: "Uif-FormView"],
  "org.kuali.rice.kns.web.struts.form.KualiInquiryAction":[controller:"org.kuali.rice.krad.inquiry.InquiryController", form:"org.kuali.rice.krad.web.form.InquiryForm", view: "Uif-InquiryView"],
  "org.kuali.rice.kns.web.struts.form.KualiDocumentActionBase":[controller:"org.kuali.rice.krad.document.DocumentControllerBase", form:"org.kuali.rice.krad.web.form.DocumentFormBase", view: "Uif-DocumentView"],
  "org.kuali.rice.kns.web.struts.form.KualiLookupAction":[controller:"org.kuali.rice.krad.lookup.LookupController", form:"org.kuali.rice.krad.lookup.LookupForm", view: "Uif-InquiryView"],
  "org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentActionBase":[controller:"org.kuali.rice.krad.document.TransactionalDocumentControllerBase", form:"org.kuali.rice.krad.web.form.TransactionalDocumentFormBase", view: "Uif-TransactionalDocumentView"],
  "org.kuali.rice.kns.web.struts.form.KualiMaintenanceDocumentActionBase":[controller:"org.kuali.rice.krad.maintenance.MaintenanceDocumentController", form:"org.kuali.rice.krad.web.form.MaintenanceDocumentForm", view: "Uif-MaintenanceView"]
  ]

// action forms have related controller and view
map.convert.kns_action_form = [
  "default":[controller:"org.kuali.rice.krad.web.controller.UifControllerBase", form:"org.kuali.rice.krad.web.form.UifFormBase", view: "Uif-FormView"],
  "org.kuali.rice.kns.web.struts.form.KualiForm":[controller:"org.kuali.rice.krad.web.controller.UifControllerBase", form:"org.kuali.rice.krad.web.form.UifFormBase", view: "Uif-FormView"],
  "org.kuali.rice.kns.web.struts.form.InquiryForm":[controller:"org.kuali.rice.krad.inquiry.InquiryController", form:"org.kuali.rice.krad.web.form.InquiryForm", view: "Uif-InquiryView"],
  "org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase":[controller:"org.kuali.rice.krad.document.DocumentControllerBase", form:"org.kuali.rice.krad.web.form.DocumentFormBase", view: "Uif-DocumentView"],
  "org.kuali.rice.kns.web.struts.form.LookupForm":[controller:"org.kuali.rice.krad.lookup.LookupController", form:"org.kuali.rice.krad.lookup.LookupForm", view: "Uif-InquiryView"],
  "org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase":[controller:"org.kuali.rice.krad.document.TransactionalDocumentControllerBase", form:"org.kuali.rice.krad.web.form.TransactionalDocumentFormBase", view: "Uif-TransactionalDocumentView"],
  "org.kuali.rice.kns.web.struts.form.KualiMaintenanceDocumentFormBase":[controller:"org.kuali.rice.krad.maintenance.MaintenanceDocumentController", form:"org.kuali.rice.krad.web.form.MaintenanceDocumentForm", view: "Uif-MaintenanceView"],
  "org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm":[controller:"org.kuali.rice.krad.maintenance.MaintenanceDocumentController", form:"org.kuali.rice.krad.web.form.MaintenanceDocumentForm", view: "Uif-MaintenanceView"]
  ]


map.convert.jsp_to_tag = ["kul:page":"Uif-Page",
                        "kul:documentpage":"Uif-Page",
                        "kul:hiddenDocumentFields":"",
                                     "kul:documentOverview":"Uif-DocumentOverviewSection",
                                     "kul:tab":"Uif-TabSection",
                                     "kul:notes":"Uif-DocumentNotesSection",
                                     "kul:adHocRecipients":"Uif-DocumentAdHocRecipientsSection",
                                     "kul:routeLog":"Uif-DocumentRouteLogSection",
                                     "kul:panelFooter":"",
                                     "kul:documentControls":"",
                                     "table":"Uif-GridLayoutBase"]

map.convert.alternateBeanNames = ["AttributeDefinition": "BusinessObjectEntry", "AttributeReferenceDummy-genericSystemId": "BusinessObjectEntry"]

scaffold.portalTags.copyRelativePath = true
scaffold.portalTags.path.input = input.path.src.webapp
scaffold.portalTags.path.output = output.path.src.webapp
scaffold.portalTags.files = ["main.tab"]
map.scaffold.rdvconfig.additionalCorefiles = []


// default binding data model
map.binding.action_bean = ["name":"", "formName":"", "class":"", "jspFile":"", "uri":"", "controller":["name":"","class":"","package":"", "uri":""]]
map.binding.form_bean = ["name":"", "class":"", "path":""]
map.binding.file = [name:"", path:"", type:""]
map.binding.class = [header:"", author:"", className:"", parentClass:"", package:"", imports:[], members:[],methods:[]]
map.binding.method = [modifier:"", returnType:"", methodName:"", parameters:[], exceptions:[], body:"", annotations:[]]
map.binding.member = [modifier:"", classType:"", memberName:"", annotations:[]]
map.binding.uifform = [header:"", author:"", className:"", "parentClass":"", package:"", imports:[], members:[],methods:[]]
map.binding.uifview = [beanId:"", viewId:"", viewName:"", viewTitle:"", viewType:"", headerText:"", entryPageId:"", items:[], formClass:"", beans:[], pages:[]]
map.binding.uifpage = [beanId:"", template:"", cssClasses:[], validationMessagesBean:"", headerText:"", disclosureBean:"", layoutManagerBean:"", readOnly:"", autoFocus:"", disclosureBean:"", helpBean:""]
map.binding.uifcontroller = ["header":"", "author":"", "package":"", "imports":[], "uri":"", "className":"", "parentClassName":"", "formClassName":"", "actionMethods":[], "privateMethods":[], "oldActionClass":""]
list.remove.dd_beans = ["inquiryDefinition","lookupDefinition","relationships"]
list.convert.excludeActions = ["KualiSimpleAction.java,KualiDocumentActionBase.java" ]

// messages or strings
msg_bean_schema = 'http://www.springframework.org/schema/p'
msg_xml_schema_legacy = 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'

// patterns - dictionary patterns used to locate and process spring beans
pattern.dictionaryconversion.preProcessInclude = ~/.*\.xml$/
pattern.dictionaryconversion.preProcessExclude = ~/uif\/library/
pattern.dictionaryconversion.processInclude = ~/.*\.xml$/

bool.dictionaryconversion.carryoverAttributes = false
bool.dictionaryconversion.carryoverProperties = false
bool.dictionaryconversion.replaceControlProperty = true
bool.dictionaryconversion.maintainBusinessObjectStructure = false

bool.script.performStrutsConversion = true
bool.script.performDictionaryConversion = true
bool.script.performKimPermissionConversion = true
bool.script.copyWebXml = true
bool.script.copyPortalTags= true
bool.script.includeRiceValidationTest = false
pattern.script.ignoreStruts = ""

bool.datasource.connect = true

// templates - used for creating a new uif controller based on properties
template.uifcontroller.path="./src/main/resources/templates/UifControllerBaseNew.template.java"
template.uifcontroller.binding = ["header":"",
                                     "author":"",
                                     "package":"",
                                     "imports":[],
                                     "uri":"",
                                     "class_name":"",
                                     "parent_class_name":"",
                                     "form_class_name":"",
                                     "action_methods":[:],
                                     "private_methods":[:]]