Skip to content

Commit

Permalink
Merge branch 'moqui:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dixitdeepak authored May 9, 2024
2 parents e46876a + 1c69844 commit 3106eee
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 9 deletions.
5 changes: 3 additions & 2 deletions addons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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 +107,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
1 change: 1 addition & 0 deletions framework/entity/ScreenEntities.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ along with this software (see the LICENSE.md file). If not, see
<moqui.basic.EnumerationType description="Screen Theme Resource Type" enumTypeId="ScreenThemeResourceType"/>
<moqui.basic.Enumeration description="Style Sheet (CSS) URL" enumId="STRT_STYLESHEET" enumTypeId="ScreenThemeResourceType"/>
<moqui.basic.Enumeration description="Script URL" enumId="STRT_SCRIPT" enumTypeId="ScreenThemeResourceType"/>
<moqui.basic.Enumeration description="Script Footer URL" enumId="STRT_SCRIPT_FOOTER" enumTypeId="ScreenThemeResourceType"/>
<moqui.basic.Enumeration description="Shortcut Icon URL" enumId="STRT_SHORTCUT_ICON" enumTypeId="ScreenThemeResourceType"/>
<moqui.basic.Enumeration description="Header Logo URL" enumId="STRT_HEADER_LOGO" enumTypeId="ScreenThemeResourceType"/>
<moqui.basic.Enumeration description="Header Title" enumId="STRT_HEADER_TITLE" enumTypeId="ScreenThemeResourceType"/>
Expand Down
36 changes: 35 additions & 1 deletion framework/service/org/moqui/impl/UserServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,40 @@ along with this software (see the LICENSE.md file). If not, see
<actions><script>ec.user.setPreference(preferenceKey, preferenceValue)</script></actions>
</service>

<service verb="login" noun="UserAccount" authenticate="anonymous-all" allow-remote="false">
<implements service="org.moqui.impl.UserServices.get#ExternalUserAuthcFactorInfo"/>
<in-parameters>
<parameter name="username"/>
<parameter name="password"/>
<parameter name="code"/>
</in-parameters>
<out-parameters>
<parameter name="loggedIn" type="Boolean"/>
</out-parameters>
<actions>
<if condition="ec.web?.sessionAttributes?.moquiPreAuthcUsername"><then>
<!-- already pre-auth'ed, verify code below -->
<set field="username" from="ec.web?.sessionAttributes?.moquiPreAuthcUsername"/>
</then><else>
<!-- no pre-auth, try logging in (pre-auth if 2nd factor required) -->
<set field="loggedIn" from="ec.user.loginUser(username, password)"/>
</else></if>
<if condition="ec.web.sessionAttributes.moquiAuthcFactorRequired"><then>
<if condition="code"><then>
<service-call name="org.moqui.impl.UserServices.validate#ExternalUserAuthcCode"
in-map="[code:code]" out-map="validateOut"/>
<if condition="validateOut.verified"><then>
<set field="loggedIn" from="ec.user.internalLoginUser(validateOut.username)"/>
</then><else>
<message type="danger" public="true">Authentication code is not valid</message>
</else></if>
</then><else>
<service-call name="org.moqui.impl.UserServices.get#ExternalUserAuthcFactorInfo" out-map="context"/>
</else></if>
</then></if>
</actions>
</service>

<service verb="create" noun="UserAccount" authenticate="anonymous-all" allow-remote="false">
<in-parameters>
<auto-parameters entity-name="moqui.security.UserAccount" include="nonpk"><exclude field-name="currentPassword"/>
Expand Down Expand Up @@ -377,7 +411,7 @@ along with this software (see the LICENSE.md file). If not, see
<field-map field-name="toAddresses" from="userAccount.emailAddress"/>
<field-map field-name="bodyParameters" from="bodyParameters + [userAccount:userAccount, resetPassword:resetPassword]"/>
</service-call>
<message public="true" type="success">A reset password was sent by email to ${userAccount.emailAddress}. This password may only be used to change your password. Your current password is still valid.</message>
<message public="true" type="success">A reset password was sent to the email of username ${userAccount.username}. This password may only be used to change your password. Your current password is still valid.</message>
<if condition="userAccount.requirePasswordChange == 'Y'"><message public="true" type="info">You must change your password before login.</message></if>
</actions>
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,23 @@ class ElasticFacadeImpl implements ElasticFacade {
if (index == null) return null
index = index.trim()
if (index.isEmpty()) return null
return indexPrefix != null && !index.startsWith(indexPrefix) ? indexPrefix.concat(index) : index
// handle comma separated index names
return index.split(",").collect({
it = it.trim()
return indexPrefix != null && !it.startsWith(indexPrefix) ? indexPrefix.concat(it) : it
}).join(",")
// return indexPrefix != null && !index.startsWith(indexPrefix) ? indexPrefix.concat(index) : index
}
String unprefixIndexName(String index) {
if (index == null) return null
index = index.trim()
if (index.isEmpty()) return null
return indexPrefix != null && index.startsWith(indexPrefix) ? index.substring(indexPrefix.length()) : index
// handle comma separated index names
return index.split(",").collect({
it = it.trim()
return indexPrefix != null && it.startsWith(indexPrefix) ? it.substring(indexPrefix.length()) : it
}).join(",")
// return indexPrefix != null && index.startsWith(indexPrefix) ? index.substring(indexPrefix.length()) : index
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,12 @@ class EntityDbMeta {
ResultSet tableSet2 = null
boolean beganTx = useTxForMetaData ? efi.ecfi.transactionFacade.begin(5) : false
try {
con = efi.getConnection(groupName)
try {
con = efi.getConnection(groupName)
} catch (EntityException ee) {
logger.warn("Could not get connection so treating entity ${ed.fullEntityName} in group ${groupName} as table does not exist: ${ee.toString()}")
return false
}
DatabaseMetaData dbData = con.getMetaData()

String[] types = ["TABLE", "VIEW", "ALIAS", "SYNONYM", "PARTITIONED TABLE"]
Expand Down
6 changes: 3 additions & 3 deletions framework/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout
<DefaultRolloverStrategy max="20"/>
</RollingFile>
<MoquiLog4jAppender name="MoquiSubscribers"/>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %5p %12.12t %38.38c{1.9.1.}} %m%n"/>
</Console>
<Async name="AsyncLog">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="LogFile"/>
<AppenderRef ref="ErrorFile"/>
<AppenderRef ref="MoquiSubscribers"/>
</Async>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %5p %12.12t %38.38c{1.9.1.}} %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.apache" level="warn"/>
Expand Down

0 comments on commit 3106eee

Please sign in to comment.