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

2016-01-29 #2

Merged
merged 2 commits into from
Jan 30, 2016
Merged
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
14 changes: 14 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@

Moqui Runtime Release Notes

===========================================================================
Release 1.6.2 - TBD
===========================================================================

Moqui Runtime 1.6.2 is a minor new feature and bug fix release, in parallel
with the release of Moqui Framework.

New Features

- The Tools app can now be run in Tenant instances, with the entities in
the tenantcommon group excluded from various screens

Bug Fixes

===========================================================================
Release 1.6.1 - 24 Jan 2016
===========================================================================
Expand Down
2 changes: 1 addition & 1 deletion base-component/tools/screen/Tools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ along with this software (see the LICENSE.md file). If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
-->
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-1.6.xsd"
include-child-content="true" tenants-allowed="DEFAULT" menu-image="glyphicon glyphicon-wrench" menu-image-type="icon">
include-child-content="true" menu-image="glyphicon glyphicon-wrench" menu-image-type="icon">
<subscreens default-item="dashboard">
</subscreens>
<widgets>
Expand Down
8 changes: 6 additions & 2 deletions base-component/tools/screen/Tools/AutoScreen/AutoEdit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ along with this software (see the LICENSE.md file). If not, see
<parameter name="aen" required="true"/>

<actions>
<set field="masterPrimaryKeyMap" from="ec.entity.getEntityDefinition(aen).getPrimaryKeys(context)"/>
<set field="aenDef" from="ec.entity.getEntityDefinition(aen)"/>
<if condition="aenDef == null || aenDef.getEntityGroupName() == 'tenantcommon'">
<message error="true">Could not find entity with name: ${aen}</message><return/></if>

<set field="masterPrimaryKeyMap" from="aenDef.getPrimaryKeys(context)"/>
<!-- only include dependent entities for tabs -->
<set field="relationshipInfoList" from="ec.entity.getEntityDefinition(aen).getRelationshipsInfo(true)"/>
<set field="relationshipInfoList" from="aenDef.getRelationshipsInfo(true)"/>
</actions>
<widgets>
<!-- NOTE: this template will take care of the active subscreen, if needed; it's not needed for the dynamic menu -->
Expand Down
4 changes: 4 additions & 0 deletions base-component/tools/screen/Tools/AutoScreen/AutoFind.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ along with this software (see the LICENSE.md file). If not, see
</transition>

<actions>
<set field="aenDef" from="ec.entity.getEntityDefinition(aen)"/>
<if condition="aenDef == null || aenDef.getEntityGroupName() == 'tenantcommon'">
<message error="true">Could not find entity with name: ${aen}</message><return/></if>

<entity-find entity-name="${aen}" list="entityValueList" offset="0" limit="50">
<search-form-inputs/></entity-find>
</actions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this software (see the LICENSE.md file). If not, see
<transition name="find"><default-response url="../AutoFind"/></transition>

<actions>
<set field="allEntityList" from="ec.entity.getAllEntitiesInfo(orderByField?:'fullEntityName', null, false, false)"/>
<set field="masterEntityList" from="ec.entity.getAllEntitiesInfo(orderByField?:'fullEntityName', null, true, true)"/>
<set field="allEntityList" from="ec.entity.getAllEntitiesInfo(orderByField?:'fullEntityName', null, false, false, true)"/>
<set field="masterEntityList" from="ec.entity.getAllEntitiesInfo(orderByField?:'fullEntityName', null, true, true, true)"/>
</actions>
<widgets>
<form-single name="SelectEntity" transition="find">
Expand Down
2 changes: 1 addition & 1 deletion base-component/tools/screen/Tools/DataView/EditDbView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ along with this software (see the LICENSE.md file). If not, see
<field-map field-name="dbViewEntityName"/>
<field-map field-name="entityAlias" value="MASTER"/>
</entity-find-one>
<set field="masterEntityList" from="ec.entity.getAllEntitiesInfo('entityName', null, false, false)"/>
<set field="masterEntityList" from="ec.entity.getAllEntitiesInfo('entityName', null, false, false, true)"/>
<set field="masterFieldList"
from="ec.entity.getAllEntityRelatedFields(fieldValues?.entityName, orderByField?:'+entityName', dbViewEntityName)"/>
</actions>
Expand Down
6 changes: 6 additions & 0 deletions base-component/tools/screen/Tools/DataView/ViewDbView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ along with this software (see the LICENSE.md file). If not, see
</transition>

<actions>
<entity-find-one entity-name="moqui.entity.view.DbViewEntityMember" value-field="masterMember">
<field-map field-name="dbViewEntityName"/><field-map field-name="entityAlias" value="MASTER"/></entity-find-one>
<set field="masterDef" from="ec.entity.getEntityDefinition(masterMember.entityName)"/>
<if condition="masterDef == null || masterDef.getEntityGroupName() == 'tenantcommon'">
<message error="true">Could not find master entity with name: ${masterMember.entityName}</message><return/></if>

<entity-find-one entity-name="moqui.entity.view.DbViewEntity" value-field="fieldValues"/>
<entity-find entity-name="${dbViewEntityName}" list="dbViewList">
<search-form-inputs/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ along with this software (see the LICENSE.md file). If not, see
</transition>

<actions>
<set field="entityDefinition" from="ec.entity.getEntityDefinition(entityName)"/>
<if condition="entityDefinition.getEntityGroupName() == 'tenantcommon'">
<message error="true">Data find and edit not allowed for entities in the tenantcommon group</message><return/></if>

<set field="dependentLevels" from="(dependentLevels ?: '0') as int"/>
<entity-find-one entity-name="${entityName}" value-field="entityValue"/>
<set field="relationshipInfoList" from="ec.entity.getEntityDefinition(entityName).getRelationshipsInfo(false)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ along with this software (see the LICENSE.md file). If not, see
</transition>

<actions>
<set field="entityDefinition" from="ec.entity.getEntityDefinition(entityName)"/>
<if condition="entityDefinition.getEntityGroupName() == 'tenantcommon'">
<message error="true">Data find and edit not allowed for entities in the tenantcommon group</message><return/></if>

<entity-find entity-name="${entityName}" list="entityValueList" offset="0" limit="50">
<search-form-inputs/>
</entity-find>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with this software (see the LICENSE.md file). If not, see

<actions>
<set field="pageSize" from="pageSize ?: 60"/>
<set field="entityList" from="ec.entity.getAllEntitiesInfo(orderByField?:'fullEntityName', filterRegexp, false, false)"/>
<set field="entityList" from="ec.entity.getAllEntitiesInfo(orderByField?:'fullEntityName', filterRegexp, false, false, false)"/>
<script>StupidUtilities.paginateList("entityList", null, context)</script>
</actions>
<widgets>
Expand Down
20 changes: 18 additions & 2 deletions base-component/tools/screen/Tools/Entity/DataExport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,23 @@ along with this software (see the LICENSE.md file). If not, see
ec.message.addError("No entity names specified, not exporting anything.")
return
}
if (entityNames instanceof List) edw.entityNames(entityNames) else edw.entityName(entityNames)

// check for entities in the tenantcommon group, not allowed in Tools app for multi-tenant security
if (entityNames instanceof List) {
for (String entityName in entityNames) {
def entDef = ec.entity.getEntityDefinition(entityName)
if (entDef == null || entDef.getEntityGroupName() == 'tenantcommon')
ec.message.addError("Could not find entity with name ${entityName}")
}
edw.entityNames(entityNames)
} else {
def entDef = ec.entity.getEntityDefinition(entityNames)
if (entDef == null || entDef.getEntityGroupName() == 'tenantcommon')
ec.message.addError("Could not find entity with name ${entityNames}")
edw.entityName(entityNames)
}

if (ec.message.hasError()) return

if (dependentLevels) edw.dependentLevels(dependentLevels as int)
if (fromDate) edw.fromDate(ec.l10n.parseTimestamp(fromDate, null))
Expand Down Expand Up @@ -62,7 +78,7 @@ along with this software (see the LICENSE.md file). If not, see
<form-single name="ExportData" transition="EntityExport">
<field name="entityNames">
<default-field><drop-down allow-multiple="true" size="80">
<list-options list="ec.entity.getAllEntitiesInfo('fullEntityName', null, false, true)" key="${fullEntityName}"/>
<list-options list="ec.entity.getAllEntitiesInfo('fullEntityName', null, false, true, true)" key="${fullEntityName}"/>
</drop-down></default-field>
</field>
<field name="dependentLevels"><default-field><text-line size="2" default-value="0"/></default-field></field>
Expand Down
27 changes: 24 additions & 3 deletions base-component/tools/screen/Tools/dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,38 @@ along with this software (see the LICENSE.md file). If not, see
<section name="RestApiSection"><actions>
<set field="restUrl" from="sri.buildUrl('/rest').url"/>
<set field="rootResources" from="ec.service.restApi.rootResourceMap.values()"/>

<set field="masterEntityNameList" from="ec.entity.getAllEntityNamesWithMaster()"/>
</actions><widgets>
<container-box>
<box-header><label text="REST API: Swagger UI" type="h5"/></box-header>
<box-body>
<section-iterate name="RootResourcesSection" list="rootResources" entry="resource"><widgets>
<link url="/assets/lib/swagger-ui/index.html?url=${restUrl}/service.swagger/${resource.name}"
url-type="plain" target-window="_blank" text="${resource.displayName ?: resource.name}"
tooltip="${resource.description ?: ''}"/>
<section name="RootResourceChildren" condition="resource.childMethods &gt; 100"><widgets>
<container-dialog id="RootResourceSwaggerDialog" button-text="${resource.displayName ?: resource.name} (${resource.childMethods})">
<section-iterate name="RootResourceSwaggerSection" list="resource.resourceMap.values()" entry="childResource"><widgets>
<container><link url="/assets/lib/swagger-ui/index.html?url=${restUrl}/service.swagger/${resource.name}/${childResource.name}"
text="${childResource.displayName ?: childResource.description ?: childResource.name} (${childResource.childMethods})"
link-type="anchor" target-window="_blank"/></container>
</widgets></section-iterate>
</container-dialog>
</widgets><fail-widgets>
<link url="/assets/lib/swagger-ui/index.html?url=${restUrl}/service.swagger/${resource.name}"
url-type="plain" target-window="_blank" text="${resource.displayName ?: resource.name} (${resource.childMethods})"
tooltip="${resource.description ?: ''}"/>
</fail-widgets></section>
</widgets></section-iterate>

<container-dialog id="EntitySwagger" button-text="Entity Master API">
<section-iterate name="EntitySwaggerSection" list="masterEntityNameList" entry="masterEntityName"><widgets>
<container><link url="/assets/lib/swagger-ui/index.html?url=${restUrl}/master.swagger/${masterEntityName}"
text="${masterEntityName}" link-type="anchor" target-window="_blank"/></container>
</widgets></section-iterate>
</container-dialog>
<!-- Generates enough that Swagger UI has a hard time loading it, takes a long time or fails:
<link url="/assets/lib/swagger-ui/index.html?url=${restUrl}/master.swagger/all"
url-type="plain" target-window="_blank" text="Entity Master API"/>
-->
<label text="The larger APIs take a few seconds to load. Runs in same session (already authenticated)." type="p"/>
</box-body>
</container-box>
Expand Down