Using Impex how to export Import B2BCustomerUserPermission Relation - sap-commerce-cloud

OUR Hybris environment is refreshing. Post refresh we have a requirement to retain the users and its user permission. We have exported users and user permission. We are struggling with creating Impex to link user and user permission using a flex query. Anyone know the impex to link the user and userpermission using flex query?
---- Extension: b2bcommerce ---- Type: B2BCustomer ----
"$customer_B2B_query=select {m:pk} from { B2BCustomer as m} "
"#% impex.setTargetFile( ""B2BCustomer.csv"" );"
insert_update B2BCustomer;\
pk[target=foreignPk];\
email[allownull=true];\
name;\
active[allownull=true];\
existingComUser;\
isDefaultAccountSet;\
syncToOkta;\
primaryB2BUnit(uid);\
backOfficeLoginDisabled;\
authorizedToUnlockPages[allownull=true];\
telephone;\
orderPin;\
sapIsReplicated;\
customerID;\
token;\
uid[unique=true,allownull=true];\
groups(uid);\
userPermissions(pk[target=foreignPk])
"#% impex.exportItemsFlexibleSearch(""$customer_B2B_query"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1  );"
---- Extension: core ---- Type: UserPermission --------------------------
"$userpermissions_query=select {m:pk} from { UserPermission as m} "
"#% impex.setTargetFile( ""UserPermission.csv"" );"
insert_update UserPermission;\
pk[unique=true,alias=foreignPk];\
active;\
soldTo(uid);\
customer(uid);\
userRole(code);
userType(code)
"#% impex.exportItemsFlexibleSearch(""$userpermissions_query"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1  );"
Now I need help with Impex to reimport link the bmpcustomer and userpemission.

Related

Redshift Query Syntax error (using SQL Workbench): Is there an easy way to go directly to the "position" mentioned in the error?

Is there an easy way to go directly to the position mentioned in an error message in SQL Workbench/Redshift (error provided below the code)? Thanks!
Here is the error:
An error occurred when executing the SQL command:
select
application_id,
case when stage_name in (
'Application Review',
'New Lead',
'Recruiter Review',
'Reached Out', ...
Amazon Invalid operation: syntax error at or near ")"
Position: 201; [SQL State=42601, DB Errorcode=500310] 1 statement
failed.
Execution time: 0.16s
Here's the Query:
select
application_id,
case when stage_name in (
'Application Review',
'New Lead',
'Recruiter Review',
'Reached Out',
'Make Decision',
'Resume Review',
) then 'Application Review'
when stage_name in ('Preliminary Phone Screen', 'Recruiter Screen','Handoff','Researcher Screen','Exploratory') then 'Recruiter Screen'
when stage_name in (
'Phone Interview',
'Phone Interview 2'
'Phone Interview #1',
'Phone Interview #2',
'Phone/Initial Interview #1',
'Phone/Initial Interview #2',
'Hiring Manager Review',
'Hiring Manager Screen',
'Final Interview',
'Take Home Test',
'Initial Interview')
then 'Initial Interview'
when stage_name in
( 'Onsite Interview #1',
'Face to Face',
'Face to Face 2',
'Onsite Interview #2',
'Onsite Interview')
then 'Onsite Interview'
when stage_name = 'Homework' then 'Homework' when stage_name in
( 'Post Onsite',
'Reference Check',
'Hiring Review',
'Hiring Review Debrief',
'Hiring Review/Debrief',
'Post Hiring Review / Debrief',
'Post Hiring Review/Post Debrief',
'Hiring Review / Debrief',
'Post Hiring Review / Post Debrief',
'Team Match')
then 'Post Onsite'
when stage_name = 'Byteboard Interview' then 'Byteboard Interview'
when stage_name IN ('Filtered','Filtered.ai Matching') then 'Filtered'
when stage_name = 'HackerRank Test' then 'HackerRank Test'
when stage_name = 'ClassMarker' then 'ClassMarker'
when stage_name = 'Offer' then 'Offer'
else 'Other' end as app_Stage_Name_group,
min(entered_on) as entered_on,
max(exited_on) as exited_on
from
application_stages
where
entered_on is not null
group by
1,
2
If you are using Build 125, you can configure this through workbench.settings by using the same settings that are used for Postgres to identify the error position.
Edit the file with a regular text editor and add these two lines:
workbench.db.redshift.errorinfo.regex.position=(?i)position:\\s+[0-9]+
workbench.db.redshift.errorinfo.leading.comment.included=true
Then the cursor should automatically jump to the position in the editor identified by the error message.
The settings file is located in the configuration directory. The exact location is shown in the about dialog and the options dialog.
Make sure you close SQL Workbench/J before editing the file.

How do I run prettier for markdown files for Hugo the static site generator?

I use Vim version 7.4.629 and I want to use prettier to clean up markdown files for Hugo the static site generator. How do I configure Vim correctly?
Here is an error message:
_index.md|1 col 3| Invalid left-hand side in assignment
Here is an example _index.md file:
---
title: "Privacy Policy"
description: "Privacy Policy"
date: 2020-01-01T12:56:17+01:00
draft: false
menu:
footer:
name: Privacy Policy
url: /privacy-policy/
weight: 1
---
{{< divmd class="section-x" >}}
{{< divmd class="container" >}}
## Privacy Policy
---
### Privacy policy for website operators based on GDPR specifications
We are delighted you are visiting our website
{{< /divmd >}}
{{< /divmd >}}
The line "proseWrap": "always", in the .prettierrc solved the problem.
Here the an example of my .prettierrc.
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"traillingComma": "all",
"bracketSpacing": false,
"proseWrap": "always",
"jsxBracketSameLine": false
}

What is the correct way to add or override "type" in filebeat.yml?

I am working on stashing jenkins logs using filbeat to ELK stack. I need to add or override "type" in filbeat.yml.
Please find here the logstash.conf
logstash.conf.jpg
I need to add or override the "type" (highlighted in red in picture) in my filebeat.yml.
Please find the filebeat.yml here:
filebeat.inputs:
- type: log
enabled: true
paths:
- /opt/app/elk/logs/jenkins.log
multiline.pattern: '^%{MONTH} %{MONTHDAY}, %{YEAR} %{TIME} (AM|PM)'
multiline.negate: true
multiline.match: before
To add a field using filebeat uses the following configuration:
- type: log
paths:
- /path/to/your/files/*.log
fields:
type: your-type
fields_under_root: true
The fields_under_root: true will add the field type in the top-level of the document, if you set it to false, it will add inside the fields object, so you have a field named fields.type.

Admin user has no authority to see settings and other aspect of the application

I have created an app using Jhipster and after running backend with './mvnw' and frontend as 'npm start'.
And then I go to the login page
My authorities array is empty for the admin.
And due to that, it has no authority to see anything else and that's why I am getting an error as follows.
"You are not authorized to access this page."
My response.
activated: true
authorities: []
createdBy: "system"
createdDate: null
email: "admin#localhost"
firstName: "Administrator"
id: 3
imageUrl: ""
langKey: "en"
lastModifiedBy: "system"
lastModifiedDate: null
lastName: "Administrator"
login: "admin"
Any help will be appreciated
It should the settings and active sessions page.

how to attach AWS scp-organization unit's (OUs) policies to particular organization unit(OU) using python script?

YAML file:
Organization-unit:
xyz
Organization-unit:
xyz2
Policies:
- name: scp-xyz
description:
- name: scp-xyz2
description:
using python how to attach xyz organization unit to scp-xyz only under aws organization.
output: list of policies and organization unit info
{'Policies': [{'Id': 'p-xw7j86as', 'Arn': '', 'Name': 'scp-xyz', 'Description': 'Allows access to every operation', 'Type': 'SERVICE_CONTROL_POLICY', 'AwsManaged': True}
{'Policies': [{'Id': 'p-xw7j006as', 'Arn': '', 'Name': 'scp-xyz2', 'Description': 'Allows access to every operation', 'Type': 'SERVICE_CONTROL_POLICY', 'AwsManaged': True}
{'OrganizationalUnit': {'Id': 'ou-uwjh-87', 'Arn': 'a', 'Name': 'xyz'}
{'OrganizationalUnit': {'Id': 'ou-uw-87', 'Arn': 'a', 'Name': 'xyz2'}
I have below sample to attach policy to OU:
response = client.attach_policy(
PolicyId='string', #policy ID string requires "p-" followed by from 8 to
128 lower-case letters or digits.
TargetId='string' # ID of OU
)
Can anyone please guide me how can I do this task ?
REsult should be like below :
[![SCP-xyz policy should attach with xyz organization unit][1]][1]

Resources