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

What if I include AWS-1, AWS-2, and AWS-3? #14

Open
wants to merge 155 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
66a3339
Disabling UI Tests
lopezton-anthem Dec 19, 2018
9a06309
Updating Framework Version
lopezton-anthem Dec 20, 2018
0c65290
NIM-20992, Lookup Search Improvements
lopezton-anthem Dec 3, 2018
7b78d9b
defect fix for nested collection updates
sandeepmantha Dec 19, 2018
a9f1bce
Updating Framework Version
lopezton-anthem Dec 20, 2018
a59cce3
Next Development Version
lopezton-anthem Dec 21, 2018
0e10a19
Uncheck all the checked rows onFilter event - this is to prevent keeping
rakeshnpatel Dec 4, 2018
25336fe
NIM-20846
rakeshnpatel Dec 3, 2018
5811573
updates method name
rakeshnpatel Dec 3, 2018
6dcc171
Grid multi-select to select all records in dataset based on
swethavemuri-anthem Dec 21, 2018
5ac3407
Merge pull request #323 from swethavemuri-anthem/feature/grid_multise…
dinakarmeda Dec 22, 2018
497b44a
Merge pull request #324 from swethavemuri-anthem/feature/grid_multise…
jayantchaudhuri Dec 24, 2018
cbf402b
Testing build
lopezton-anthem Jan 11, 2019
1ca61b4
Revert "Testing build"
lopezton-anthem Jan 11, 2019
74ee2d3
Cross domain path variable resolver
swethavemuri-anthem Jan 15, 2019
a38f062
Use CommandBuilder to construct uri instead of StringBuilder&test update
swethavemuri-anthem Jan 15, 2019
c2ccc34
Enhancing CommandBuilder with frequently used util methods
swethavemuri-anthem Jan 15, 2019
07d0f91
Merge pull request #338 from swethavemuri-anthem/feature/cross_domain…
soham-anthem Jan 15, 2019
a4bebba
Version bump to 1.1.11-M1
Jan 17, 2019
0a272c5
Defect fix - project subdocument attributes in look up
sandeepmantha Jan 17, 2019
998ffa8
Merge remote-tracking branch 'upstream/1.2.x' into 1.2.x
sandeepmantha Jan 17, 2019
2829c6c
constants added + test case improved
sandeepmantha Jan 18, 2019
dec3e74
negative scenario testcase
sandeepmantha Jan 18, 2019
f7f3e6e
Issue Template
lopezton-anthem Jan 18, 2019
9bf6cf1
Merge pull request #353 from lopezton-anthem/feature/issue-template
dinakarmeda Jan 22, 2019
46cab1b
created unit testcases for form elements
purnamashetty Jan 23, 2019
494fbad
Cross domain path variable resolver
swethavemuri-anthem Jan 15, 2019
24c67fa
Use CommandBuilder to construct uri instead of StringBuilder&test update
swethavemuri-anthem Jan 15, 2019
73dd63d
Enhancing CommandBuilder with frequently used util methods
swethavemuri-anthem Jan 15, 2019
23754be
Additional test cases
swethavemuri-anthem Jan 23, 2019
6712976
NIMBUS-22: Serverside Object structure for graphs
rakeshnpatel Jan 24, 2019
168163d
Merge branch '1.2.x' of https://[email protected]/openanthem/ni…
rakeshnpatel Jan 24, 2019
5fe094f
Adds comment for @Chart configuration options
rakeshnpatel Jan 24, 2019
8ab935b
1. test case to showcase returning single DataGroup instead of
rakeshnpatel Jan 24, 2019
ae49005
removes the test case that shows returning single DataGroup instead of
rakeshnpatel Jan 24, 2019
1d2e40e
Merge pull request #359 from rakeshnpatel/1.2.x
dinakarmeda Jan 24, 2019
036821d
chart support
sandeepmantha Jan 24, 2019
f06a73c
Merge remote-tracking branch 'upstream/1.2.x' into 1.2.x
sandeepmantha Jan 24, 2019
5cfa20c
Input mask component
vivek-anthem Jan 28, 2019
0ec1e9e
Merge branch '1.2.x' of https://github.com/openanthem/nimbus-core int…
vivek-anthem Jan 28, 2019
37150ec
created form elements testcases
purnamashetty Jan 28, 2019
24bb328
Merge branch '1.2.x' of https://github.com/openanthem/nimbus-core int…
purnamashetty Jan 28, 2019
dd25d78
label support for graphs
sandeepmantha Jan 28, 2019
2085a90
updates the regex for aggregate query match
rakeshnpatel Jan 28, 2019
0edc227
Merge branch '1.2.x' of https://[email protected]/openanthem/ni…
rakeshnpatel Jan 28, 2019
d1e0a73
Merge pull request #366 from rakeshnpatel/1.2.x
dinakarmeda Jan 28, 2019
67691e8
using expression evaluation interface in search look up
sandeepmantha Jan 28, 2019
b53d020
NIMBUS-10: Rich Text Component
lopezton-anthem Jan 28, 2019
a727142
Bumping Styles Version
lopezton-anthem Jan 29, 2019
34cca02
Documentation & clean up
vivek-anthem Jan 29, 2019
ec34df3
doc updates
sandeepmantha Jan 29, 2019
2ca9b6a
removed typo
sandeepmantha Jan 29, 2019
53e4827
Merge pull request #347 from lopezton-anthem/feature/NIMBUS-10
dinakarmeda Jan 29, 2019
0630803
Hiding parent container when the child is hidden. This is to avoid empty
dinakarmeda Jan 29, 2019
0252d0f
Removing references to unused component(svg-definitions).
swethavemuri-anthem Jan 29, 2019
2e777e3
Removing SvgDefinitions reference from testcase
swethavemuri-anthem Jan 29, 2019
a3b1ef7
Merge pull request #370 from swethavemuri-anthem/feature/1.2.x_sync
dinakarmeda Jan 29, 2019
a37ce5c
code cleanup
purnamashetty Jan 29, 2019
a9de674
Merge pull request #365 from purnamashetty/1.1.x-t
dinakarmeda Jan 29, 2019
7deb9e5
Merge branch '1.2.x' of https://github.com/openanthem/nimbus-core.git…
dinakarmeda Jan 29, 2019
24c5345
Merge pull request #371 from dinakarmeda/1.2.x
dinakarmeda Jan 29, 2019
d5da0b4
added ' check in the regex for aggregate
rakeshnpatel Jan 28, 2019
b8f7c55
Merge branch '1.2.x' of https://[email protected]/openanthem/ni…
rakeshnpatel Jan 29, 2019
3516b87
Merge pull request #372 from rakeshnpatel/1.2.x
dinakarmeda Jan 29, 2019
5a56ac5
NIMBUS-10: RichText Component (readonly support)
lopezton-anthem Jan 29, 2019
53725d3
Merge pull request #373 from lopezton-anthem/feature/NIMBUS-10
dinakarmeda Jan 29, 2019
c291161
stepsize support on y-axis
sandeepmantha Jan 30, 2019
4434af6
updated docs
sandeepmantha Jan 30, 2019
820d9b2
merge
sandeepmantha Jan 30, 2019
753a67f
Merge pull request #346 from sandeepmantha/1.2.x
dinakarmeda Jan 30, 2019
9d17dea
Merge pull request #358 from swethavemuri-anthem/feature/cross_domain…
soham-anthem Jan 30, 2019
31dd939
missed checkin
sandeepmantha Jan 30, 2019
29b2bf0
Merge pull request #374 from sandeepmantha/1.2.x
dinakarmeda Jan 30, 2019
262fcd5
NIMBUS-10: RichText Component (test cases)
lopezton-anthem Jan 30, 2019
79c69c0
Merge pull request #375 from lopezton-anthem/feature/NIMBUS-10
dinakarmeda Jan 31, 2019
0b84b0a
updated page.service.spec.ts
purnamashetty Jan 31, 2019
f6108b0
i/p mask with unit tests
vivek-anthem Jan 31, 2019
918b0df
merge conflict
vivek-anthem Jan 31, 2019
3ea3024
updated base-label.component
purnamashetty Jan 31, 2019
c32cc8f
import
vivek-anthem Jan 31, 2019
6b03640
updated input-label.component.spec.ts
purnamashetty Jan 31, 2019
5578db3
Merge pull request #377 from purnamashetty/1.2.x
dinakarmeda Jan 31, 2019
dcc8ff2
Merge pull request #378 from vivekkamineni2018/1.2.x
dinakarmeda Jan 31, 2019
fd8e37e
component name change
vivek-anthem Jan 31, 2019
715424f
Merge remote-tracking branch 'upstream/1.1.11' into 1.1.x
lopezton-anthem Feb 1, 2019
4401add
Merge remote-tracking branch 'upstream/1.1.11-M1' into 1.1.x
lopezton-anthem Feb 1, 2019
7cb2d26
Merge fix
lopezton-anthem Feb 1, 2019
699c218
Merge branch '1.1.x' into 1.2.x
lopezton-anthem Feb 1, 2019
191f1a1
Spring Boot version Upgrade
jayantchaudhuri Feb 4, 2019
cba70c3
fix for submit buttons disabled property on form rentry
sandeepmantha Feb 4, 2019
a645b63
Upgrade to spring boot 2.0.5
jayantchaudhuri Feb 4, 2019
4bddad1
Access conditional for panel menus and sub-panel menus
vivek-anthem Feb 4, 2019
e18197c
Merge branch '1.2.x' of https://github.com/openanthem/nimbus-core int…
vivek-anthem Feb 4, 2019
2d0ddf1
Changes aggregate query to use spring's aggregate implementation rather
jayantchaudhuri Feb 4, 2019
14a0720
NIMBUS-108
rakeshnpatel Feb 5, 2019
97b5531
updates method javadoc
rakeshnpatel Feb 5, 2019
a2782ec
Merge pull request #381 from vivekkamineni2018/1.2.x
dinakarmeda Feb 5, 2019
f4af1d2
Merge pull request #380 from sandeepmantha/1.2.x
dinakarmeda Feb 5, 2019
9500b6d
NIMBUS-64::Rich Text Values Dropdown
lopezton-anthem Feb 4, 2019
8d9270f
Nexus Staging Version Fix
lopezton-anthem Feb 5, 2019
62e50c6
Review comments and adds optional check in the sort methods
rakeshnpatel Feb 5, 2019
56541ee
Merge pull request #382 from lopezton-anthem/feature/NIMBUS-64
dinakarmeda Feb 5, 2019
ec33349
defect fix to address param state being reset
sandeepmantha Feb 6, 2019
885c671
new sample model attribute
sandeepmantha Feb 6, 2019
977ce2b
remove mb-3 cssClass push to parent Div
Feb 6, 2019
18c640b
Merge branch '1.2.x' of https://github.com/dinakarmeda/nimbus-core in…
Feb 6, 2019
f0a334c
fixing previousLeafState issue
lopezton-anthem Feb 7, 2019
680465b
Merge pull request #389 from lopezton-anthem/bugfix/NIMBUS-117
dinakarmeda Feb 8, 2019
ad2ca24
changed div to fieldset in template
Feb 8, 2019
1280529
Merge pull request #387 from sandeepmantha/1.2.x
dinakarmeda Feb 8, 2019
dc7922a
override style for fieldelement within card details.
dinakarmeda Feb 11, 2019
9f6a415
update styles
Feb 11, 2019
d806765
logout link defect
vivek-anthem Feb 12, 2019
3d3818a
Merge branch '1.2.x' of https://[email protected]/openanthem/ni…
rakeshnpatel Feb 12, 2019
6c55d11
Review comments from @Tony
rakeshnpatel Feb 12, 2019
f5a5b3c
updated page.service.spec.ts
purnamashetty Feb 12, 2019
eb472e5
merge confict
purnamashetty Feb 12, 2019
e9290c6
Review comments from @Soham
rakeshnpatel Feb 12, 2019
9e7e472
refactor
vivek-anthem Feb 12, 2019
274c618
Merge pull request #392 from purnamashetty/1.1.x-t
dinakarmeda Feb 12, 2019
6516043
Merge pull request #391 from vivekkamineni2018/1.2.x
dinakarmeda Feb 12, 2019
6ba1803
move section style one level up to nm-section container.
dinakarmeda Feb 12, 2019
715b02b
Merge branch '1.2.x' of https://github.com/dinakarmeda/nimbus-core.gi…
dinakarmeda Feb 12, 2019
9af713e
Merge branch '1.2.x' of https://github.com/openanthem/nimbus-core.git…
dinakarmeda Feb 12, 2019
face9e4
rollback accordion changes
dinakarmeda Feb 12, 2019
e1972ec
Review comment from @Soham
rakeshnpatel Feb 12, 2019
34667c6
Merge pull request #383 from rakeshnpatel/1.2.x
soham-anthem Feb 12, 2019
96c7b5d
update sass version
dinakarmeda Feb 12, 2019
da363ac
Merge pull request #394 from dinakarmeda/1.2.x
dinakarmeda Feb 12, 2019
b0418a9
reset button handling - prevent disable event directive from triggering
dinakarmeda Feb 13, 2019
4489a48
test case fixes
dinakarmeda Feb 13, 2019
0ba8712
Merge pull request #395 from dinakarmeda/1.2.x
dinakarmeda Feb 13, 2019
62ea21f
toast message seperate to app level
sandeepmantha Feb 13, 2019
33801c1
Merge remote-tracking branch 'upstream/1.2.x' into 1.2.x
sandeepmantha Feb 13, 2019
be0952d
missed files for toast message
sandeepmantha Feb 13, 2019
01cea83
fix section class
dinakarmeda Feb 13, 2019
2edd965
Merge branch '1.2.x' of https://github.com/openanthem/nimbus-core.git…
dinakarmeda Feb 13, 2019
0e97885
Merge pull request #396 from dinakarmeda/1.2.x
dinakarmeda Feb 13, 2019
d58c4f9
test file changes for nmmessage service
sandeepmantha Feb 13, 2019
d2e042d
optimization of async call
sandeepmantha Feb 13, 2019
974b052
Merge pull request #397 from sandeepmantha/1.2.x
dinakarmeda Feb 13, 2019
faa7da8
unit tests
vivek-anthem Feb 13, 2019
e298ae2
Tab component & input-switch orientation
vivek-anthem Feb 13, 2019
8e6ac2f
Test Files license agreement.
vivek-anthem Feb 13, 2019
b7ddad2
Toast message
vivek-anthem Feb 13, 2019
32b85ae
Merge pull request #399 from vivekkamineni2018/1.2.x
dinakarmeda Feb 14, 2019
bcf42bc
Merge branch '1.2.x' into 1.3.x
lopezton-anthem Feb 14, 2019
de2cb08
Adds the OSSRH snapshot and release repositories
ktemple-wt Feb 15, 2019
cb77daf
Runs UI tests in Chrome Headless
ktemple-wt Feb 15, 2019
1c86bd8
Defaults to browser setup from karma.conf.js
ktemple-wt Feb 15, 2019
090622e
Moves maven-wrapper to the base directory
ktemple-wt Feb 15, 2019
74072e0
Adds a Maven config file containing the project version number
ktemple-wt Feb 15, 2019
a77d0a3
Ignores the flattened POM output from flatten-maven-plugin
ktemple-wt Feb 15, 2019
fe2f705
Uses the Maven config file to get the project version number
ktemple-wt Feb 15, 2019
c40aff0
Switched the URL to HTTPS to test AG46
ktemple-wt Feb 27, 2019
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
53 changes: 53 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!--
Please fill the report below. Your issue will be added to the overall list of issues and will be reviewed on a first-come first-serve basis.
-->

# Issue Details

**Type of Issue** (check one with "X")
```
[ ] Bug Report => Please search GitHub for a similar issue or PR before submitting
[ ] Feature Request => Please ensure feature is not already in progress
[ ] Support Request => Please do not submit support requests here, instead see: https://discourse.oss.antheminc.com/
```

## Current Behavior
<!--
Please describe the issue in a short summary.
-->


## Expected Behavior
<!--
Please describe the expectation of what should occur in the scenario previously described.
-->


## How to Reproduce the Issue
### Steps to Reproduce
<!--
Please list the steps required to reproduce the issue (if any)
-->


### Code Snippet
<!--
Please add any code that is necessary to reproduce the issue.

If the current behavior is recreated better with an example, please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar.
-->


# Environment Details
* **Nimbus Version:**
<!--
Please tell us the version of the framework was this issue found in.
-->


* **Browser:**
<!--
Please list all browsers where this could be reproduced.
-->

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ local.properties
# STS (Spring Tool Suite)
.springBeans

# Maven flatten plugin
*.flattened-pom.xml

# Code Recommenders
.recommenders/

Expand Down
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-B -Drevision=1.3.0.BUILD-SNAPSHOT
2 changes: 1 addition & 1 deletion nimbus-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.antheminc.oss</groupId>
<artifactId>nimbus-parent</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>nimbus-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
import org.activiti.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFactory;
import org.activiti.engine.impl.history.HistoryLevel;
import org.activiti.engine.impl.persistence.deploy.Deployer;
import org.activiti.runtime.api.identity.UserGroupManager;
import org.activiti.spring.SpringAsyncExecutor;
import org.activiti.spring.SpringProcessEngineConfiguration;
import org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration;
import org.apache.commons.dbcp.BasicDataSource;
import org.apache.commons.dbcp2.BasicDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -116,10 +117,10 @@ public class BPMEngineConfig extends AbstractProcessEngineAutoConfiguration {
public SpringProcessEngineConfiguration springProcessEngineConfiguration(
@Qualifier("processDataSource") DataSource processDataSource,
PlatformTransactionManager jpaTransactionManager, SpringAsyncExecutor springAsyncExecutor,
BeanResolverStrategy beanResolver) throws Exception {
BeanResolverStrategy beanResolver, UserGroupManager userGroupManager) throws Exception {

SpringProcessEngineConfiguration engineConfiguration = this
.baseSpringProcessEngineConfiguration(processDataSource, jpaTransactionManager, springAsyncExecutor);
.baseSpringProcessEngineConfiguration(processDataSource, jpaTransactionManager, springAsyncExecutor,userGroupManager);

if (deploymentName.isPresent()) {
engineConfiguration.setDeploymentName(deploymentName.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@
package com.antheminc.oss.nimbus.app.extension.config;


import java.time.ZonedDateTime;
import java.time.temporal.TemporalAccessor;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.auditing.DateTimeProvider;
import org.springframework.data.domain.AuditorAware;
import org.springframework.web.client.RestTemplate;

Expand Down Expand Up @@ -123,6 +128,7 @@ public AuditorAware<String> auditorProvider(BeanResolverStrategy beanResolver) {
return new SpringSecurityAuditorAware(beanResolver);
}


@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
Expand All @@ -133,4 +139,15 @@ public ClassPropertyConverter classPropertyConverter() {
return new ClassPropertyConverter();
}

@Bean("default.zdt.provider")
public DateTimeProvider defaultZDTProvider() {
return new DateTimeProvider() {

@Override
public Optional<TemporalAccessor> getNow() {
return Optional.of(ZonedDateTime.now());
}
};
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.EnableMongoAuditing;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.convert.CustomConversions;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;

import com.antheminc.oss.nimbus.context.BeanResolverStrategy;
import com.antheminc.oss.nimbus.domain.model.state.repo.IdSequenceRepository;
Expand All @@ -38,11 +38,11 @@
*
*/
@Configuration
@EnableMongoAuditing
@EnableMongoAuditing(dateTimeProviderRef="default.zdt.provider")
public class DefaultMongoConfig {

@Bean
public CustomConversions defaultMongoCustomConversions() {
public MongoCustomConversions defaultMongoCustomConversions() {
return new MongoConvertersBuilder().addDefaults().build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public CommandExecutorTaskDelegate commandExecutorTaskDelegate(BeanResolverStrat
}

@Bean(name="default._search$execute?fn=lookup")
public FunctionHandler<?, ?> lookupFunctionHandler(){
return new DefaultSearchFunctionHandlerLookup<>();
public FunctionHandler<?, ?> lookupFunctionHandler(BeanResolverStrategy beanResolver){
return new DefaultSearchFunctionHandlerLookup<>(beanResolver);
}

@Bean(name="default._search$execute?fn=example")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
Expand Down Expand Up @@ -58,6 +59,26 @@ public static CommandBuilder withUri(String absoluteUri) {
return cb;
}

public static CommandBuilder withCommand(Command cmd) {
CommandBuilder cb = new CommandBuilder(cmd);
cb.handleUriAndParamsIfAny(cmd.getAbsoluteUri());
return cb;
}

/**
* Builds a CommandBuilder by appending a given platform path to a uri untill a given end CommandElementType
* @param rootCmd
* @param endWhenType
* @param appendPath
* @return
*/
public static CommandBuilder withPlatformRelativePath(Command rootCmd, Type endWhenType, String appendPath) {
String hostUri = rootCmd.buildUri(endWhenType);
StringBuilder absoluteUri = new StringBuilder(hostUri);
absoluteUri.append(appendPath);
return withUri(absoluteUri.toString());
}

public static CommandBuilder withDomainRelativePath(Command rootCmd, String domainRelPath) {
String rootDomainAlias = rootCmd.getRootDomainAlias();
String nestedDomainPath = StringUtils.removeStart(Constants.SEPARATOR_URI.code + rootDomainAlias, domainRelPath);
Expand Down Expand Up @@ -233,4 +254,13 @@ public CommandBuilder addParams(Map<String, String[]> rParams) {
return this;
}

public CommandBuilder setAction(Action action) {
cmd.setAction(action);
return withCommand(cmd);
}

public CommandBuilder setBehaviors(List<Behavior> behaviors) {
cmd.setBehaviors(behaviors);
return withCommand(cmd);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.antheminc.oss.nimbus.domain.cmd.exec.internal;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Map;
import java.util.Optional;
import java.util.regex.Matcher;
Expand All @@ -27,8 +29,15 @@

import com.antheminc.oss.nimbus.InvalidConfigException;
import com.antheminc.oss.nimbus.context.BeanResolverStrategy;
import com.antheminc.oss.nimbus.domain.cmd.Action;
import com.antheminc.oss.nimbus.domain.cmd.Behavior;
import com.antheminc.oss.nimbus.domain.cmd.Command;
import com.antheminc.oss.nimbus.domain.cmd.CommandBuilder;
import com.antheminc.oss.nimbus.domain.cmd.CommandElement.Type;
import com.antheminc.oss.nimbus.domain.cmd.CommandMessage;
import com.antheminc.oss.nimbus.domain.cmd.CommandMessageConverter;
import com.antheminc.oss.nimbus.domain.cmd.exec.CommandExecution.MultiOutput;
import com.antheminc.oss.nimbus.domain.cmd.exec.CommandExecutorGateway;
import com.antheminc.oss.nimbus.domain.cmd.exec.CommandPathVariableResolver;
import com.antheminc.oss.nimbus.domain.cmd.exec.ParamPathExpressionParser;
import com.antheminc.oss.nimbus.domain.defn.Constants;
Expand Down Expand Up @@ -59,12 +68,14 @@ public class DefaultCommandPathVariableResolver implements CommandPathVariableRe
private final PropertyResolver propertyResolver;
private final SessionProvider sessionProvider;
private final Environment environment;
private final CommandExecutorGateway executorGateway;

public DefaultCommandPathVariableResolver(BeanResolverStrategy beanResolver, PropertyResolver propertyResolver) {
this.converter = beanResolver.get(CommandMessageConverter.class);
this.propertyResolver = propertyResolver;
this.sessionProvider = beanResolver.get(SessionProvider.class);
this.environment = beanResolver.get(Environment.class);
this.executorGateway = beanResolver.find(CommandExecutorGateway.class);
}


Expand Down Expand Up @@ -126,6 +137,9 @@ protected String map(Param<?> param, String pathToResolve) {
if(StringUtils.startsWithIgnoreCase(pathToResolve, Constants.MARKER_ELEM_ID.code))
return mapColElem(param, pathToResolve);

if(StringUtils.startsWithIgnoreCase(pathToResolve, Constants.SEGMENT_PLATFORM_MARKER.code))
return String.valueOf(mapCrossDomain(param, pathToResolve));

return mapQuad(param, pathToResolve);
}

Expand All @@ -149,12 +163,17 @@ protected String mapEnvironment(Param<?> param, String pathToResolve) {
protected String mapQuad(Param<?> param, String pathToResolve) {
if(StringUtils.startsWith(pathToResolve, "json(")) {
String paramPath = StringUtils.substringBetween(pathToResolve, "json(", ")");
Param<?> p = param.findParamByPath(paramPath) != null? param.findParamByPath(paramPath): param.getParentModel().findParamByPath(paramPath);
if(p == null) {
logit.error(() -> new StringBuffer().append(" Param (using paramPath) ").append(paramPath).append(" not found from param reference: ").append(param).toString());
return NULL_STRING;
Object state;
if (StringUtils.startsWithIgnoreCase(paramPath, Constants.SEGMENT_PLATFORM_MARKER.code)) {
state = mapCrossDomain(param, paramPath);
} else {
Param<?> p = param.findParamByPath(paramPath) != null? param.findParamByPath(paramPath): param.getParentModel().findParamByPath(paramPath);
if(p == null) {
logit.error(() -> new StringBuffer().append(" Param (using paramPath) ").append(paramPath).append(" not found from param reference: ").append(param).toString());
return NULL_STRING;
}
state = p.getLeafState();
}
Object state = p.getLeafState();
String json = getConverter().toJson(state);
return String.valueOf(json);
} else {
Expand All @@ -179,4 +198,30 @@ protected String mapColElem(Param<?> commandParam, String pathToResolve) {
// throw ex ..or.. blank??
return "";
}

/**
*
* @param commandParam
* @param pathToResolve
* @return
* @since 1.1.11
*/
protected Object mapCrossDomain(Param<?> commandParam, String pathToResolve) {
Command rootCmd = commandParam.getRootExecution().getRootCommand();
CommandBuilder cmdBuilder = CommandBuilder.withPlatformRelativePath(rootCmd, Type.AppAlias, pathToResolve);
cmdBuilder.setAction(Action._get);
cmdBuilder.setBehaviors(new LinkedList<>(Arrays.asList(Behavior.$state)));
Command cmd = cmdBuilder.getCommand();
CommandMessage cmdMsg = new CommandMessage(cmd, null);
MultiOutput output = executorGateway.execute(cmdMsg);
Object response = output.getSingleResult();

if (response == null) {
logit.error(() -> new StringBuffer().append(" Param (using paramPath) [").append(pathToResolve).append("] not found from param: ").append(commandParam).toString());
return null;
}

logit.debug(() -> new StringBuffer().append(" Param (using paramPath) [").append(pathToResolve).append("] has been resolved to ").append(response).toString());
return response;
}
}
Loading