Just curious to know to how one can export the access rights of user groups in hybris. Searched hybris wiki but git no help...
Basically i want to retrieve data like(For example):
UserGroup Read Create Change
CronJobGroup + - +
Thanks in advance,
You can generate export scripts in the hMC, you will get:
"#% impex.setLocale( new Locale( ""en"" , """" ) );"
"#% impex.setTargetFile( ""UserRight.csv"" , true, 0, 0 );"
"#% impex.exportItems( ""UserRight"" , false );"
You can use this in the hac under impex export (or hMC).
Related
I have created a new usergroup and have given permission to read,write,delete Types and attributes. Here I observe I am not able to access Facet Search configuration through backoffice with that user. I dont want to assign 'admingroup' to the user. Is there any type or attribute to which I can assign access to that user such that user can run indexing.
Below is impex I have used to assign role :-
$START_USERRIGHTS;;;;;;;;;
Type;UID;MemberOfGroups;Password;Target;read;change;create;remove;change_perm
UserGroup;nextAdmintGroup;;;;;;;;
;;;;Consignment;+;-;-;-;-
;;;;ConsignmentEntry;+;-;-;-;-
;;;;ConsignmentStatus;+;-;-;-;-
;;;;PackagingInfo;+;-;-;-;-
;;;;Principal;+;-;-;-;-
;;;;User;+;+;+;-;-
;;;;Customer;+;+;+;-;-
;;;;CustomerType;+;+;+;-;-
;;;;Employee;+;+;+;-;-
;;;;Customer.customerID;+;-;-;-;-;
;;;;Customer.uid;+;-;-;-;-;
;;;;EmployeeBenefit;+;-;-;-;-
;;;;RewardPoints;+;+;+;-;-
;;;;Cronjob;+;+;+;-
;;;;Job;+;-;-;-
;;;;CartEntry;+;+;+;-
;;;;Cart;+;+;+;-
;;;;Order;+;-;-;-
;;;;Referral;+;+;+;-
;;;;UserBirthday;+;+;+;-
;;;;Customer.managementHold;+;+;+;-
;;;;SavedValues;+;-;-;-
;;;;SavedValueEntry;+;-;-;-
;;;;Customer.defaultPaymentInfo;+;-;-;-
;;;;AbstractOrder;+;-;-;-;-
;;;;AbstractOrderProcessingStep;+;-;-;-;-
;;;;OrderEntry;+;-;-;-;-
;;;;OrderStatus;+;-;-;-;-
;;;;AbstractOrderEntry;+;-;-;-;-
;;;;AbstractOrderEntry.Product;+;-;-;-;-
;;;;OrderModificationRecord;+;-;-;-;-
;;;;OrderEntryModificationRecordEntry;+;-;-;-;-
;;;;OrderCancelRecordEntry;+;-;-;-;-
;;;;OrderEntryCancelRecordEntry;+;-;-;-;-
;;;;OrderHistoryEntry;+;-;-;-;-
;;;;PaymentMode;+;;;
;;;;PaymentInfo;+;-;-;-
;;;;Format;+;;;
;;;;Agreement;+;+;+;+
;;;;Title;+;;;
;;;;Company;+;+;+;+
;;;;UserGroup;+;;;
;;;;Discount;+;;;
;;;;Order;+;-;-;-
;;;;Cart;+;-;-;-
;;;;Address;+;+;+;-;-
;;;;Country;+;+;-;-;-
;;;;Region;+;+;-;-;-
;;;;ZoneDeliveryModeValue;+;+;-;-;-
;;;;DeliveryMode;+;+;-;-;-
# Access Rights for Products & Catalog;;;;;;;;;
;;;;ItemSyncTimestamp;+;;;
;;;;SyncItemJob;+;;;
;;;;Type;+;;;
;;;;Product;+;+;+;-;-;
;;;;Category;+;+;+;-;-;
;;;;variantType;+;+;+;-;-;
;;;;Catalog;+;;;
;;;;CatalogVersion;+;+;+;-;-;
;;;;ClassificationAttributeUnit;+;;;
;;;;Media;+;+;+;-;-;
;;;;MediaContainer;+;+;+;-;-;
;;;;MediaFormat;+;+;+;-;-;
;;;;MediaFolder;+;+;+;-;-;
;;;;Vendor;+;+;+;-;-;
;;;;StockLevel;+;+;+;-;-;
;;;;Tax;+;+;+;-;-;
;;;;TaxRow;+;+;+;+-;-;
;;;;PriceRow;+;+;+;-;-;
;;;;ProductFeature;+;+;+;-;-;
;;;;ProductReference;+;+;+;-;-;
;;;;Warehouse;+;+;+;-;-;
;;;;ProductTaxCode;+;+;+;-;-;
;;;;ProductOrderLimit;+;+;+;-;-;
;;;;PromotionSourceRule;+;+;+;-;-;
;;;;PromotionSourceRuleTemplate;+;+;+;-;;
;;;;PromotionGroup;+;+;+;-;;
;;;;AbstractCoupon;+;+;+;-;;
;;;;CouponRedemption;+;;;;;
;;;;CodeGenerationConfiguration;+;;;;;
;;;;BTGConfig;+;+;+;-;;
;;;;Voucher;+;+;+;-;;
;;;;RuleGroup;+;-;-;-;-;
;;;;RuleStatus;+;-;-;-;-;
;;;;Campaign;+;-;-;-;-;
;;;;AbstractComponentContainer;+;+;+;+;+;
;;;;AbstractComponentContainer.itemtype;+;-;-;-;-;
;;;;AbstractCMSComponent;+;+;+;+;+;
;;;;AbstractCMSComponent.itemtype;;-;-;-;-;
;;;;AbstractCMSAction;+;+;+;+;+;
;;;;AbstractCMSAction.itemtype;;-;-;-;-;
;;;;SimpleCMSAction;+;+;+;+;+;
;;;;PickUpInStoreAction;+;+;+;+;+;
;;;;AddToCartAction;+;+;+;+;+;
;;;;ShareOnSocialNetworkAction;+;+;+;+;+;
;;;;AbstractPage;+;+;+;+;+;
;;;;AbstractPage.itemtype;;-;-;-;-;
;;;;AbstractRestriction;+;+;+;+;+;
;;;;AbstractRestriction.itemtype;;-;-;-;-;
;;;;BaseStore;+;-;-;-;-
;;;;BaseSite;+;-;-;-;-
;;;;CMSItem;+;+;+;+;+;
;;;;CMSItem.itemtype;;-;;;;
;;;;CMSRelation;+;+;+;+;+;
;;;;CMSCatalogRestriction;;;+;+;+;
;;;;CMSCategoryRestriction;;;+;+;+;
;;;;CMSProductRestriction;;;+;+;+;
;;;;CatalogPage;-;-;-;-;-;
;;;;CategoryPage;;;+;+;+;
;;;;ContentCatalog;+;+;+;-;-;
;;;;ContentPage;;;+;+;+;
;;;;ContentSlot;+;+;+;+;+;
;;;;ContentSlotForPage;+;+;+;+;+;
;;;;ContentSlotForTemplate;+;+;+;+;+;
;;;;ContentSlotName;+;+;+;+;+;
;;;;ElementsForContainer;+;+;+;+;+;
;;;;ElementsForSlot;+;+;+;+;+;
;;;;CMSImageComponent;;;+;+;+;
;;;;BannerComponent;;;+;+;+;
;;;;CMSLinkComponent;;;+;+;+;
;;;;Media;+;+;+;+;+;
;;;;CockpitUIScriptConfigMedia;-;-;-;-;-;
;;;;MediaContainer;+;+;+;+;+;
;;;;MediaContext;+;+;+;+;+;
;;;;MediaFormat;+;+;+;+;+;
;;;;MediaFormatMapping;+;+;+;+;+;
;;;;PageRestrictions;+;+;+;+;+;
;;;;PageTemplate;+;+;+;+;+;
;;;;CMSParagraphComponent;;;+;+;+;
;;;;ProductPage;;;+;+;+;
;;;;SimpleCMSComponent;;;+;+;+;
;;;;CatalogsForCMSSite;+;+;+;+;+;
;;;;AvailableSlotsForTemplate;+;+;+;+;+;
;;;;RestrictionsForPages;+;+;+;+;+;
;;;;CatalogsForRestriction;+;+;+;+;+;
;;;;CategoriesForRestriction;+;+;+;+;+;
;;;;ProductsForRestriction;+;+;+;+;+;
;;;;UsersForRestriction;+;+;+;+;+;
;;;;UserGroupsForRestriction;+;+;+;+;+;
;;;;PreviewDataToCatalogVersion;+;+;+;+;+;
;;;;PreviewData;+;+;+;+;+;
;;;;CMSSite;+;+;+;-;-;
;;;;MiniCartComponent;+;+;+;+;+;
;;;;CategoryFeatureComponent;+;+;+;+;+;
;;;;ProductFeatureComponent;+;+;+;+;+;
;;;;ProductVariantSelectorComponent;+;+;+;+;+;
;;;;ProductAddToCartComponent;+;+;+;+;+;
;;;;ProductReferencesComponent;+;+;+;+;+;
;;;;SimpleSuggestionComponent;+;+;+;+;+;
;;;;PurchasedCategorySuggestionComponent;+;+;+;+;+;
;;;;CartSuggestionComponent;+;+;+;+;+;
;;;;SearchBoxComponent;+;+;+;+;+;
;;;;CMSMediaParagraphComponent;+;+;+;+;+;
;;;;CMSUiExperienceRestriction;+;+;+;+;+;
;;;;CMSActionRestriction;+;+;+;+;+;
;;;;AccountNavigationComponent;+;+;+;+;+;
;;;;AccountNavigationCollectionComponent;+;+;+;+;+;
;;;;JspIncludeComponent;+;+;+;+;+;
;;;;AccountBookmarkComponent;+;+;+;+;+;
;;;;Usb2cNavigationBarComponent;+;+;+;+;+;
;;;;CDPPersonalizedContentComponent;+;+;+;+;+;
$END_USERRIGHTS;;;;;
After some research I was able to fix this. Added below line in impex code mentioned in question
;;;;SolrFacetSearchConfig;+;+;+;-;-;
Is it possible to typecast an attribute of an itemtype in ImpEx export script to be fired via Admin Console in Hybris.I wanted to do something like this:
if(student instanceof UGStudent)
UGStudent ugStudent = (UGStudent) ugstudent;
so that I can have attributes specific to the subtype as well.
I don't understand completely what exactly you are trying to do. May be this can help you.
Export Script :
"#% impex.setLocale( new Locale( ""en"" , """" ) );"
INSERT_UPDATE UGStudent;uid
"#% impex.exportItems(""SELECT {pk} FROM {UGStudent}"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"
You can define UGStudent specific attributes in INSERT_UPDATE.
I don't know whether the below impex is correct for my requirement.please correct me if i am wrong.i want to assign categories to classification class.
$classificationSystem=hpeClassification
$classificationCatalogVersion=catalogversion(catalog(id[default=$classificationSystem]),version[default='1.0'])[unique=true,default=$classificationSystem:1.0]
$classificationClasses=Classificationclass(code[unique=true],name[lang=en],supercategories(code,$classificationCatalogVersion),$classificationCatalogVersion);
INSERT_UPDATE Product;code[unique=true];$classificationClasses;$catalogVersion;
;5476;/facets/care;
I think your missing some elements
First you need to define a classification catalog version macro:
$systemName=TelcoClassification;
$systemVersion=1.0;
INSERT_UPDATE ClassificationSystem; id[unique=true]; name[lang=en];
;$systemName;Telco ClassificationSystem;
$classCatalogVersion=catalogversion(catalog(id[default=$systemName]),version[default=$systemVersion])
Then you define the Classification class macro
$class=classificationClass(ClassificationClass.code,$classCatalogVersion)[unique=true]
You create the DB object :
INSERT_UPDATE ClassificationSystemversion; catalog(id)[unique=true] ; version[unique=true] ; active ; writeprincipals(uid); languages(isocode); inclPacking[virtual=true,default=true]; inclDuty[virtual=true,default=true]; inclFreight[virtual=true,default=true]; inclAssurance[virtual=true,default=true]
;$systemName ;$systemVersion ;true ;employeegroup;en;
INSERT_UPDATE ClassificationClass;$classCatalogVersion[unique=true];code[unique=true];allowedPrincipals(uid)[default='customergroup']
;;compatibilityclassification
You define the attribute for classification :
INSERT_UPDATE ClassificationAttribute;$classSystemVersion;code[unique=true]
;;featurecompatibility
$class=classificationClass(ClassificationClass.code,$classCatalogVersion)[unique=true]
$attribute=classificationAttribute(code,$classSystemVersion)[unique=true]
INSERT_UPDATE ClassificationAttributeValue;code[unique=true];$classSystemVersion
;feature_bt10
INSERT_UPDATE ClassAttributeAssignment;$class;$attribute;position;$unit;attributeType(code[default=string]);multiValued[default=false];range[default=false];localized[default=false];attributeValues(code,$classSystemVersion)
;compatibilityclassification;featurecompatibility;0;;enum;true;;;feature_bt10
And you link it to a product
$clAttrModifiers=system='TelcoClassification',version='1.0',translator=de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeTranslator,lang=en
$feature1=#featurecompatibility[$clAttrModifiers];
UPDATE Product;code[unique=true];$feature1;$catalogversion
;109058;feature_bt10;
For category:
INSERT_UPDATE Category;code[unique=true];allowedPrincipals(uid)[default='customergroup'];$catalogversion
;devices
UPDATE Category; $catalogversion; code[unique=true]; supercategories(code,$classCatalogVersion)[mode=append]
;;devices;compatibilityclassification;
Old question, but here is the answer, for the product instead of assigning the attribute assign the category.
UPDATE Product;code[unique=true];supercategories(code)[mode = append];
; 5476; <code of your classification class>;
$classificationSystem=hpeClassification
$classificationCatalogVersion=catalogversion(catalog(id[default=$classificationSystem]),version[default='1.0'])[unique=true,default=$classificationSystem:1.0]
$classificationSystemVersion=systemVersion(catalog(id[default=$classificationSystem]),version[default='1.0'])[unique=true,default=$classificationSystem:1.0]
$code=/facet/Category
$class=classificationClass($code,$classificationCatalogVersion)[unique=true]
$attribute=classificationAttribute(code,$classificationSystemVersion)[unique=true]
$unit=unit(code,$classificationSystemVersion)
INSERT_UPDATE ClassAttributeAssignment;$class;$attribute;multiValued[default=false];range[default=false];attributeType(code[default=string]);localized[default=true];$unit;attributeValues(code,$classificationSystemVersion);
The problem is the use of macro for code(i.e $code).I modified the impex and bellow version should work(However it will not insert nothing in DB):
$classificationSystem=hpeClassification
$classificationCatalogVersion=catalogversion(catalog(id[default=$classificationSystem]),version[default='1.0'])[unique=true,default=$classificationSystem:1.0]
$classificationSystemVersion=systemVersion(catalog(id[default=$classificationSystem]),version[default='1.0'])[unique=true,default=$classificationSystem:1.0]
$class=classificationClass(code,$classificationCatalogVersion)[unique=true]
$attribute=classificationAttribute(code,$classificationSystemVersion)[unique=true]
$unit=unit(code,$classificationSystemVersion)
INSERT_UPDATE ClassAttributeAssignment;$class;$attribute;multiValued[default=false];range[default=false];attributeType(code[default=string]);localized[default=true];$unit;attributeValues(code,$classificationSystemVersion);
An example of inserting an instance in DB would be:
$classificationSystem=hpeClassification
$classificationCatalogVersion=catalogversion(catalog(id[default=$classificationSystem]),version[default='1.0'])[unique=true,default=$classificationSystem:1.0]
$classificationSystemVersion=systemVersion(catalog(id[default=$classificationSystem]),version[default='1.0'])[unique=true,default=$classificationSystem:1.0]
$class=classificationClass(code,$classificationCatalogVersion)[unique=true]
$attribute=classificationAttribute(code,$classificationSystemVersion)[unique=true]
$unit=unit(code,$classificationSystemVersion)
INSERT_UPDATE ClassAttributeAssignment;$class;$attribute;multiValued[default=false];range[default=false];attributeType(code[default=string]);localized[default=true];$unit;attributeValues(code,$classificationSystemVersion);
;accessoryclassification;bands
Where "accessoryclassification" is the code of an already existing(in DB) Classification Class and "bands" is the code of already existing classification attribute
I'm using to paramters with following commands:
[BUSINESS VIEW].[All Business View].[STAGES] in (prompt('STAGES1','string','Arrival announced'))
and
[BUSINESS VIEW].[All Business View].[NEXTSTAGE] in (prompt('NEXTSTAGE','string','Arrival announced'))
As you see what i'm trying to do is set default value in case user didn't select one both of them are optional.
When running the report i get this error:
"XQE-DAT-0001
Data source adapter error: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-440, SQLSTATE=42884, SQLERRMC=PROMPT;FUNCTION, DRIVER=3.63.123 - when processing query: SELECT
"COGNOS"."TERMINALNAME" AS "TERMINALNAME",
"COGNOS"."CCN" AS "CCN",
"COGNOS"."CIDENTIFICATION" AS "CIDENTIFICATION",
"COGNOS"."STAGES" AS "STAGES",
"COGNOS"."NEXTSTAGE" AS "NEXTSTAGE",
SUM("COGNOS"."TIMETAKEN") AS "TIMETAKEN"
FROM
"KAP"."COGNOS" "COGNOS"
WHERE
"COGNOS"."STAGES" IN (
prompt('STAGES1','string','Arrival announced') ) AND
"COGNOS"."NEXTSTAGE" IN (
prompt('NEXTSTAGE','string','Arrival announced') )
GROUP BY
"COGNOS"."TERMINALNAME",
"COGNOS"."CCN",
"COGNOS"."CIDENTIFICATION",
"COGNOS"."STAGES",
"COGNOS"."NEXTSTAGE"."
I keep trying all day to get to set default value to parameter in case user didn't select but didn't find a way to get it run successfully. Anyone had luck with that ?
[BUSINESS VIEW].[All Business View].[STAGES] in (#promptmany('STAGES1','string','''Arrival announced''')#)
and
[BUSINESS VIEW].[All Business View].[NEXTSTAGE] in (#promptmany('NEXTSTAGE','string','''Arrival announced''')#)