Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
Put your add-on component directories in this directory to load them when Moqui runs.
#hotwax-Asignment level 1
<<<<<<< HEAD
=======
#hotwax-Asignment level 1
>>>>>>> 4d4c91a4c86b4864e6a58bba7567d200bf0f7306
Binary file added Screenshot from 2023-12-06 15-24-14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot from 2023-12-06 15-24-33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot from 2023-12-06 15-24-52.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshot from 2023-12-06 15-30-08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions helloworld-component/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apply plugin: 'groovy'

//sourceCompatibility = '1.8'
//targetCompatibility = '1.8'

def moquiDir = projectDir.parentFile.parentFile.parentFile
def frameworkDir = file(moquiDir.absolutePath + '/framework')

// to run use "gradle dependencyUpdates"
apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories { jcenter() }
dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0' }
}
dependencyUpdates.resolutionStrategy = { componentSelection { rules -> rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier -> selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ }
if (rejected) selection.reject('Release candidate')
} } }

repositories {
flatDir name: 'localLib', dirs: frameworkDir.absolutePath + '/lib'
mavenCentral()
}

// Log4J has annotation processors, disable to avoid warning
tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }

dependencies {
implementation project(':framework')
runtimeOnly 'mysql:mysql-connector-java:5.1.47'
}

// by default the Java plugin runs test on build, change to not do that (only run test if explicit task)
// no longer workds as of gradle 4.8 or possibly earlier, use clear() instead: check.dependsOn.remove(test)
check.dependsOn.clear()

task cleanLib(type: Delete) { delete fileTree(dir: projectDir.absolutePath+'/lib', include: '*') }
clean.dependsOn cleanLib

task copyDependencies { doLast {
copy { from (configurations.runtimeClasspath - project(':framework').configurations.runtimeClasspath - project(':framework').jar.archivePath)
into file(projectDir.absolutePath + '/lib') }
} }
copyDependencies.dependsOn cleanLib
jar.dependsOn copyDependencies
Binary file not shown.
2 changes: 2 additions & 0 deletions helloworld-component/build/tmp/jar/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0

11 changes: 11 additions & 0 deletions helloworld-component/entity/entities.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/entity-definition-2.1.xsd">
<entity entity-name="Example" package="moqui.example">
<field name="exampleId" type="id" is-pk="true"/>
<field name="exampleName" type="text-medium"/>
<field name="exampleDate" type="date-time"/>
<field name="examplePrice" type="currency-amount"/>
<field name="exampleQuantity" type="text-medium"/>
</entity>
</entities>
Binary file not shown.
14 changes: 14 additions & 0 deletions helloworld-component/service/helloworld.rest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/rest-api-3.xsd"
name="example" displayName="Example REST API" version="2.0.0">
<resource name="examples" require-authentication="anonymous-all">
<method type="get"><entity name="Example" operation="list"/></method>
<method type="post"><service name="moqui.example.ExampleServices.create#Example"/></method>
<id name="exampleId">
<method type="get"><entity name="Example" operation="one"/></method>
<method type="patch"><service name="moqui.example.ExampleServices.update#Example"/></method>
</id>
</resource>



</resource>
52 changes: 52 additions & 0 deletions helloworld-component/service/moqui/example/ExampleServices.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/service-definition-3.xsd">

<service verb="create" noun="Example" displayName="Create an Example" authenticate="anonymous-all"
type="entity-auto">
<in-parameters>
<auto-parameters include="nonpk"/>
<parameter name="exampleId" required="true"/>
<parameter name="exampleName" required="true"/>
<parameter name="examplePrice"/>
<parameter name="exampleDate"/>
<parameter name="exampleQuantity"/>
</in-parameters>
<out-parameters>
<auto-parameters include="pk" required="true"/>
</out-parameters>
</service>

<service verb="get" authenticate="anonymous-all" noun="Example" displayName="Get details about an Example" type="entity-auto">
<in-parameters>
<parameter name="exampleId" required="true"/>
<parameter name="exampleName" required="true"/>
<parameter name="examplePrice"/>
<parameter name="exampleDate"/>
<parameter name="exampleQuantity"/>
</in-parameters>
<out-parameters>
<parameter name="exampleId" required="true"/>
<parameter name="exampleName" required="true"/>
<parameter name="examplePrice"/>
<parameter name="exampleDate"/>
<parameter name="exampleQuantity"/>
</out-parameters>
</service>

<service verb="update" noun="Example" displayName="Update an Example" type="entity-auto">
<in-parameters>
<parameter name="exampleId" required="true"/>
<parameter name="exampleName" required="true"/>
<parameter name="examplePrice" type="Integer"/>
<parameter name="exampleDate"/>
<parameter name="exampleQuantity"/>
</in-parameters>
<out-parameters>
<parameter name="exampleName" required="true"/>
<parameter name="examplePrice"/>
<parameter name="exampleDate"/>
<parameter name="exampleQuantity"/>
</out-parameters>
</service>
</services>
1 change: 1 addition & 0 deletions mantle-udm
Submodule mantle-udm added at 8e494b
1 change: 1 addition & 0 deletions mantle-usl
Submodule mantle-usl added at 98a6fb