Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Ean Schuessler
/
mo-mcp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
36e96772
authored
2025-12-03 17:52:42 -0600
by
Ean Schuessler
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Continued work to implement deep subscreen access
1 parent
5cad42c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
19 deletions
service/McpServices.xml
src/main/groovy/org/moqui/mcp/CustomScreenTestImpl.groovy
src/test/resources/MoquiConf.xml
service/McpServices.xml
View file @
36e9677
...
...
@@ -1186,27 +1186,17 @@ try {
//
Try
to
construct
a
reasonable
path
based
on
CURRENT
screen
being
processed
(not
always
the
original
parent)
def
currentScreenPath =
screenPath
//
This
is
the
current
screen
whose
subscreens
we're
processing
if
(currentScreenPath.contains("Catalog/Product.xml"))
{
//
We're
processing
Product.xml's
subscreens
actualSubScreenPath =
"component://SimpleScreens/screen/SimpleScreens/Catalog/Product/${subscreenName}.xml"
}
else
if
(currentScreenPath.contains("Catalog.xml"))
{
//
We're
processing
Catalog.xml's
subscreens
actualSubScreenPath =
"component://SimpleScreens/screen/SimpleScreens/Catalog/${subscreenName}.xml"
}
else
if
(currentScreenPath.contains("PopCommerceAdmin"))
{
actualSubScreenPath =
currentScreenPath.replace(".xml",
"/${subscreenName}.xml")
}
else
{
//
Generic
fallback:
construct
based
on
current
screen
path
def
lastSlash =
currentScreenPath.lastIndexOf('/')
if
(lastSlash
>
0) {
def basePath = currentScreenPath.substring(0, lastSlash + 1)
actualSubScreenPath = basePath + subscreenName + ".xml"
}
//
Generic
fallback:
construct
based
on
current
screen
path
def
lastSlash =
currentScreenPath.lastIndexOf('/')
if
(lastSlash
>
0) {
def basePath = currentScreenPath.substring(0, lastSlash + 1)
actualSubScreenPath = basePath + subscreenName + ".xml"
}
ec.logger.info("MCP Screen Discovery: Constructed fallback subscreen location for ${subScreenEntry.key}: ${actualSubScreenPath}")
}
if (actualSubScreenPath
&&
!processedScreens.contains(actualSubScreenPath)) {
ec.logger.info("MCP Screen Discovery: Processing subscreen path: ${actualSubScreenPath}")
ec.logger.info("MCP Screen Discovery: Processing subscreen path: ${actualSubScreenPath}
${screenPath}
")
processScreenWithSubscreens(actualSubScreenPath, screenPath, processedScreens, toolsAccumulator, toolName, level + 1)
} else if (!actualSubScreenPath) {
ec.logger.info("MCP Screen Discovery: Subscreen entry ${subScreenEntry.key} has no location, skipping")
...
...
@@ -1615,7 +1605,7 @@ def startTime = System.currentTimeMillis()
// Regular screen rendering with timeout for subscreen
try {
ec.logger.info("TESTRENDER ${subscreen
PathParts
} ${renderParams}")
ec.logger.info("TESTRENDER ${subscreen
Name.replaceAll('_','/')
} ${renderParams}")
// For subscreens, the path should be relative to the parent screen that's already set as root
// Since we're using the parent screen as root, we only need the subscreen name part
def testRender = screenTest.render(subscreenName.replaceAll('_','/'), renderParams, "POST")
...
...
src/main/groovy/org/moqui/mcp/CustomScreenTestImpl.groovy
View file @
36e9677
...
...
@@ -273,7 +273,7 @@ class CustomScreenTestImpl implements McpScreenTest {
// rootScreenDef is the parent screen, screenPath is the subscreen path
screenPathList
=
new
ArrayList
<>()
// Add root screen path (already a full component:// path)
screenPathList
.
add
(
csti
.
rootScreenDef
.
location
)
//
screenPathList.add(csti.rootScreenDef.location)
// Add subscreen path segments
String
[]
pathSegments
=
stri
.
screenPath
.
split
(
'/'
)
for
(
String
segment
in
pathSegments
)
{
...
...
@@ -316,7 +316,7 @@ class CustomScreenTestImpl implements McpScreenTest {
// do the render
try
{
logger
.
info
(
"Starting render for ${s
tri.screenPath
} with root ${csti.rootScreenLocation}"
)
logger
.
info
(
"Starting render for ${s
creenPathList
} with root ${csti.rootScreenLocation}"
)
screenRender
.
render
(
wfs
.
getRequest
(),
wfs
.
getResponse
())
// get the response text from the WebFacadeStub
stri
.
outputString
=
wfs
.
getResponseText
()
...
...
src/test/resources/MoquiConf.xml
View file @
36e9677
...
...
@@ -67,6 +67,8 @@
<screen-facade
boundary-comments=
"false"
>
<screen-text-output
type=
"html"
mime-type=
"text/html"
macro-template-location=
"template/screen-macro/ScreenHtmlMacros.ftl"
/>
<screen-text-output
type=
"markdown"
mime-type=
"text/markdown"
macro-template-location=
"template/screen-macro/DefaultScreenMacros.markdown.ftl"
/>
</screen-facade>
<!-- Test entity facade with in-memory database -->
...
...
Please
register
or
sign in
to post a comment