Skip to content

Community studies#27

Merged
steve-fischer-200 merged 22 commits intomasterfrom
community-studies
Feb 14, 2025
Merged

Community studies#27
steve-fischer-200 merged 22 commits intomasterfrom
community-studies

Conversation

@steve-fischer-200
Copy link
Copy Markdown
Collaborator

Not 100% tested, but close enuf for a PR. will complete testing later today, hopefully

Copy link
Copy Markdown
Member

@ryanrdoherty ryanrdoherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few easy improvements plus one major bug.

print(str(datetime.datetime.now()) + " Processing record type: " + recordType['nativeDisplayName'], flush=True)
searchUrlName = getSearchUrlName(recordType, recordTypeName, paramName)
runReportToFile(wdkServiceUrl, outputDir, recordTypeName, searchUrlName, paramName, paramValue, recordType, batchType, batchName, batchTimestamp, batchId)
searchInfo = getSearchInfo(recordType, recordTypeName, paramName)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why you changed the return type of this method to package URL + dynAttrs when you already have them here (using above)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i understand.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind. Didn't have the whole file open and thought this was part of a different method.


<wdkModel>

<constant name="projectIdPropList">projectId</constant> <!-- used by the community studies process query -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I see the utility of a constant here. It's only used in the XML below right? Might actually be confusing to read the %% macro below and think maybe this is dynamic?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did it to highlight that it is a hard-coded value that has to agree with another program

@Override
public void validateParameters(PluginRequest request) throws PluginModelException, PluginUserException { }

static Question getQuestion(PluginRequest request) throws PluginModelException {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this and use PluginUtilities.getContextQuestion(request). May need to update EbrcWebSvcCommon since I just added it (already had a RecordClass lookup so very easy add).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not currently depending on ebrc code, so i'm gonna leave this as is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably move that into WDK... but not today. :)

WdkModel wdkModel = question.getRecordClass().getWdkModel();
List<UserDatasetIds> communityDatasetIds = getCommunityDatasetIds(request, question, wdkModel);
UserFactory userFactory = new UserFactory(wdkModel);
List<Long> userIds = communityDatasetIds.stream().map(udi -> udi.ownerId).collect(Collectors.toList());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to collect into a set here. The method in UserFactory will do it too but maybe be clear that you want to remove duplicates? Just use Collectors.toSet().

Copy link
Copy Markdown
Member

@ryanrdoherty ryanrdoherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User IDs in set below (optional since also handled elsewhere). Otherwise approve.

Copy link
Copy Markdown
Collaborator Author

@steve-fischer-200 steve-fischer-200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all set

@steve-fischer-200 steve-fischer-200 merged commit 94c2d4a into master Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants