Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #18

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
36fbdca
Merge branch 'moqui:master' into master
dixitdeepak Nov 6, 2023
e7d8b9a
Merge branch 'moqui:master' into master
dixitdeepak Nov 29, 2023
10abd87
Merge branch 'moqui:master' into master
dixitdeepak Dec 3, 2023
5f605d0
Merge branch 'main' into master
dixitdeepak Dec 3, 2023
8b6538a
Master (#11) (#12)
dixitdeepak Dec 3, 2023
d76763a
Add sentDate field to WikiBlogCategory entity
jonesde Dec 7, 2023
b62f9db
Merge branch 'moqui:master' into master
dixitdeepak Dec 13, 2023
62b98b2
Library updates: Jetty to 10.0.18, Log4J to 2.22.0, H2 to 2.2.224, co…
jonesde Dec 19, 2023
e46876a
Merge branch 'moqui:master' into master
dixitdeepak Dec 22, 2023
22f3a16
create a service to unify login attempts
pythys Jan 8, 2024
a2fb0f4
Merge pull request #628 from pythys/user-vulnerability
jonesde Jan 10, 2024
f1f5f05
Follow up on PR #628: formatting changes only to reduce indentation a…
jonesde Jan 10, 2024
ba5fa64
Re-ordered Console Appender in log4j2.xml
AyanF Feb 7, 2024
5cd501f
Merge pull request #629 from AyanF/improved-log4j2-config
jonesde Feb 9, 2024
d750346
Add screen resource type for a footer script
acetousk Feb 16, 2024
f264e9e
Add xolvegroup/WorkManagement, corrected branch on xolvegroup/Sales i…
jonesde Feb 17, 2024
86dc2c9
Merge pull request #630 from moqui/footer-screen-resource
jonesde Feb 20, 2024
b9d8cf9
In addons.xml add moqui-demo and moqui-poi to demo component set
jonesde Feb 24, 2024
dd78edc
In EntityDbMeta fix issue with datasources that do not use JDBC, bulk…
jonesde Feb 24, 2024
1c69844
In ElasticFacadeImpl fix issue with index name prefixing and unprefix…
jonesde Feb 27, 2024
3106eee
Merge branch 'moqui:master' into master
dixitdeepak May 9, 2024
226f482
Add start compoennt to addons and createComponent task to build.grade
acetousk Jul 11, 2024
e8eec05
Improve git next step messages
acetousk Jul 11, 2024
c0d8f4c
Update build.gradle
acetousk Jul 11, 2024
e4e6663
Fix MoquiConf.xml generation
acetousk Jul 12, 2024
5edbd03
Merge pull request #636 from moqui/createComponent
acetousk Jul 18, 2024
29f6f6e
Add acme example with postgres, fix Dockerfile generation, and add li…
acetousk Jul 31, 2024
803f2ae
Add opensearch README file
acetousk Jul 31, 2024
f6e7025
Merge pull request #639 from moqui/acme-docker-compose
acetousk Jul 31, 2024
f24d4a5
Merge branch 'moqui:master' into master
dixitdeepak Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# gradle/build files
build
.gradle
Expand All @@ -13,7 +14,18 @@ build
/docker/runtime
/docker/db
/docker/elasticsearch/data/nodes
/docker/opensearch/data/nodes
/docker/opensearch/data/nodes/*
!/docker/opensearch/data/nodes/README
/docker/acme.sh
/docker/nginx/conf.d
/docker/nginx/vhost.d
/docker/nginx/html
## Do not want to accidentally commit production certificates https://www.theregister.com/2024/07/25/data_from_deleted_github_repos/
/docker/certs
!/docker/certs/moqui1.local.*
!/docker/certs/moqui2.local.*
!/docker/certs/moqui.local.*
!/docker/certs/README

# IntelliJ IDEA files
.idea
Expand Down
6 changes: 4 additions & 2 deletions addons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<!-- Example Component -->
<component name="example" group="moqui" version="3.0.0" branch="master"/>
<component name="start" group="moqui" version="1.0.0" branch="master"/>

<!-- Moqui Tool Components -->
<component name="moqui-aws" group="moqui" version="1.1.0" branch="master"/>
Expand Down Expand Up @@ -95,7 +96,8 @@
<component name="moqui-easyexcel" group="chunlinyao" version="" branch="master"/><!-- no releases -->
<component name="OFBizToMantle" group="jonesde" version="" branch="master"/><!-- no releases -->
<component name="ServiceJobMonitor" group="tailorsoft" version="" branch="master"/><!-- no releases -->
<component name="Sales" group="xolvegroup" version="" branch="master"/><!-- no releases -->
<component name="Sales" group="xolvegroup" version="" branch="main"/><!-- no releases -->
<component name="WorkManagement" group="xolvegroup" version="" branch="main"/><!-- no releases -->

<!-- Component Sets -->
<!-- NOTE: using these component sets is NOT recommended, with so many components doing
Expand All @@ -106,7 +108,7 @@
<component-set name="apps" components="HiveMind,PopCommerce,PopRestStore,MarbleERP"/>
<component-set name="ecosystem" sets="framework,mantle,apps"/>

<component-set name="demo" components="example,HiveMind,PopCommerce,PopRestStore,MarbleERP"/>
<component-set name="demo" components="moqui-poi,moqui-demo,example,HiveMind,PopCommerce,PopRestStore,MarbleERP"/>
<component-set name="popc" components="PopCommerce,PopRestStore"/>

<!-- Release builds:
Expand Down
179 changes: 179 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,185 @@ task getComponent {
getComponentTop(curLocationType)
}
}
task createComponent {
description "Create a new component. Set new component name with -Pcomponent=new_component_name (based on the moqui start component here: https://github.com/moqui/start)"
doLast {
String curLocationType = file('.git').exists() ? 'git' : 'current'
if (project.hasProperty('locationType')) curLocationType = locationType

if (project.hasProperty('component')) {
checkRuntimeDirAndDefaults(curLocationType)
Set compsChecked = new TreeSet()

def startComponentName = 'start'

File componentDir = getComponent(startComponentName, curLocationType, parseAddons(), parseMyaddons(), compsChecked)
if (componentDir?.exists()) {
logger.lifecycle("Got component start, dependent components checked: ${compsChecked}")

def newComponent = file("runtime/component/${component}")
def renameSuccessful = componentDir.renameTo(newComponent)
if (!renameSuccessful) {
logger.error("Failed to rename component start to ${component}. Try removing the existing component directory first or giving this program write permissions.")
} else {
logger.lifecycle("Renamed component start to ${component}")
}

print "Updated file: "
newComponent.eachFileRecurse(groovy.io.FileType.FILES) { file ->
try {
// If file name is startComponentName.* rename to component.*
if (file.name.startsWith(startComponentName)) {
String newFileName = (file.name - startComponentName)
newFileName = component + newFileName
File newFile = new File(file.parent, newFileName)
file.renameTo(newFile)
file = newFile
print "${file.path - newComponent.path - '/'}, "
}

String content = file.text
if (content.contains(startComponentName)) {
content = content.replaceAll(startComponentName, component)
file.text = content
print "${file.path - newComponent.path - '/'}, "
}
} catch (IOException e) {
println "Error processing file ${file.path}: ${e.message}"
}
}
print "\n\n"
println "Select rest api (r), screens (s), or both (B):"
def componentInput = System.in.newReader().readLine()

if (componentInput == 'r') {
new File(newComponent, 'screen').deleteDir()
new File(newComponent, 'template').deleteDir()
new File(newComponent, 'data/AppSeedData.xml').delete()
new File(newComponent, 'MoquiConf.xml').delete()
def moquiConf = new File(newComponent, 'MoquiConf.xml')
moquiConf.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
"<!-- No copyright or license for configuration file, details here are not considered a creative work. -->\n" +
"<moqui-conf xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://moqui.org/xsd/moqui-conf-3.xsd\">\n" +
"</moqui-conf>")
println "Selected rest api so, deleted screen, template, and AppSeedData.xml\n"
} else if (componentInput == 's') {
new File(newComponent, "services/${component}.rest.xml").delete()
new File(newComponent, 'data/ApiSeedData.xml').delete()
println "Selected screens so, deleted rest api and ApiSeedData.xml\n"
} else if (componentInput == 'b' || componentInput == 'B' || componentInput == '') {
println "Selected both rest api and screens\n"
} else {
println "Invalid input. Try again"
newComponent.deleteDir()
return
}

println "Are you going to code or test in groovy or java [y/N]"
def codeInput = System.in.newReader().readLine()

if (codeInput == 'y' || codeInput == 'Y') {
println "Keeping src folder\n"
} else if (codeInput == 'n' || codeInput == 'N' || codeInput == '') {
new File(newComponent, 'src').deleteDir()
new File(newComponent, 'build.grade').delete()
println "Selected no so, deleted src and build.grade\n"
} else {
println "Invalid input. Try again"
newComponent.deleteDir()
return
}

println "Setup a git repository [Y/n]"
def gitInput = System.in.newReader().readLine()
if (gitInput == 'y' || gitInput == 'Y' || gitInput == '') {
new File(newComponent, '.git').deleteDir()
// Setup git repository

def grgit = Grgit.init(dir: newComponent.path)
grgit.add(patterns: ['.'])
// Can't get signing to work easily. If signing works well then might as well commit
// grgit.commit(message: 'Initial commit')
println "Selected yes, so git is initialized\n"
println "To setup the git remote origin, type the git remote url or enter to skip"
def remoteUrl = System.in.newReader().readLine()
if (remoteUrl != '') {
grgit.remote.add(name: 'origin', url: remoteUrl)
println "Run the following to push the git repository:\ncd runtime/component/${component} && git commit -m 'Initial commit' && git push && cd ../../.."
} else {
println "Run the following to push the git repository:\ncd runtime/component/${component} && git commit -m 'Initial commit' && git remote add origin [email protected]:yourgroup/${component} && git push && cd ../../.."
}
} else if (gitInput == 'n' || gitInput == 'N') {
new File(newComponent, '.git').deleteDir()
println "Selected no, so git is not initialized\n"
println "Run the following to push the git repository:\ncd runtime/component/${component} && git commit -m 'Initial commit' && git remote add origin [email protected]:yourgroup/${component} && git push && cd ../../.."
} else {
println "Invalid input. Try again"
newComponent.deleteDir()
return
}

println "Add to myaddons.xml [Y/n]"
def myaddonsInput = System.in.newReader().readLine()
if (myaddonsInput == 'y' || myaddonsInput == 'Y' || myaddonsInput == '') {
def myaddonsFile = file('myaddons.xml')
if (myaddonsFile.exists()){
// Iterate through myaddons file and delete the lines that are </addons>
// Read the lines from the file
def lines = myaddonsFile.readLines()

// Filter out the lines that contain </addons>
def filteredLines = lines.findAll { !it.contains("</addons>") }

// Write the filtered lines back to the file
myaddonsFile.text = filteredLines.join('\n')
} else {
println "myaddons.xml not found. Creating one\nEnter repository github (g), github-ssh (GS), bitbucket (b), or bitbucket-ssh (bs)"
def repositoryInput = System.in.newReader().readLine()
myaddonsFile.append("<addons default-repository=\"")
if (repositoryInput == 'g' || repositoryInput == 'G') {
myaddonsFile.append('github')
} else if (repositoryInput == 'gs' || repositoryInput == 'GS' || repositoryInput == '') {
myaddonsFile.append('github-ssh')
} else if (repositoryInput == 'b' || repositoryInput == 'B') {
myaddonsFile.append('bitbucket')
} else if (repositoryInput == 'bs' || repositoryInput == 'BS') {
myaddonsFile.append('bitbucket-ssh')
} else {
println "Invalid input. Setting to github-ssh"
myaddonsFile.append('github-ssh')
}
myaddonsFile.append("\">")
}

println "Enter the component git repository group"
def groupInput = System.in.newReader().readLine()

println "Enter the component git repository name"
def nameInput = System.in.newReader().readLine()

// get git branch
def grgit = Grgit.open(dir: newComponent.path)
def branch = grgit.branch.current().name

myaddonsFile.append("\n <component group=\"${groupInput}\" name=\"${nameInput}\" branch=\"${branch}\"/>")
myaddonsFile.append("\n</addons>")

} else if (myaddonsInput == 'n' || myaddonsInput == 'N') {
println "Selected no, so component not added to myaddons.xml\n"
} else {
println "Invalid input. Try again"
newComponent.deleteDir()
return
}

}
} else {
throw new InvalidUserDataException("No component property specified")
}

}
}
task getCurrent {
description "Get the current archive for a component, also check each component it depends on and if not present get its current archive; requires component property"
doLast { getComponentTop('current') }
Expand Down
Loading
Loading