Website not connected to content catalog (hybris) - sap-commerce-cloud

I followed those steps:
https://wiki.hybris.com/pages/viewpage.action?pageId=294094418
Changing mystoreinitialdata/coredata impexes
After those steps, I can see my content, product and classification on catalog/catalogs on backoffice.
But when I go to wcms/websites, i see 5 items. apparelde, uk, electronics, powertools and my newly created mystore.
mystore does not have name , active=true and content catalogs is empty.
I want to add my catalog to website by programmatically.
I think it is about coredata , not sampledata.
when I search
mystore site
it can be found only here
# Language
$lang=en
# Create CMS Site
UPDATE CMSSite;uid[unique=true];name[lang=$lang];locale[lang=$lang]
;mystore;"Mystore Site";en_GB
import/coredata/stores/mystore/site_en.impex
But powertools has two more powertools site
# CMS Navigation Nodes
UPDATE CMSNavigationNode;$contentCV[unique=true];uid[unique=true];title[lang=$lang]
;;AcceleratorNavNode;"Accelerator"
;;FollowUsNavNode;"Follow Us"
;;HybrisNavNode;"Hybris"
;;MyAccountNavNode;"My Account"
;;PowertoolsNavNode;"Powertools Site"
;;SiteRootNode;"SiteRoot"
##-- level 2. children of SiteRoot --##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&componentRef);&nodeRef
;PowertoolsNavNode;;Powertools Site;SiteRootNode;;PowertoolsNavNode
which are in cms-content and cms-content en impexes.
Should I add them or another way ?
Because apparel does only have one too , same folder as mystore
# Language
$lang=en
# Create CMS Site
UPDATE CMSSite;uid[unique=true];name[lang=$lang];locale[lang=$lang]
;apparel-de;"Apparel Site DE";en_GB

You have to set the catalogs per impex files. The correct impex files for this is under:
\src\hybris\bin\custom\xx\xxinitialdata\resources\xxinitialdata\import\coredata\stores\xxSite\site.impex
An than with the following impex line you set the catalog to the site:
# CMS Site
INSERT_UPDATE CMSSite;uid[unique=true];theme(code);channel(code);stores(uid);contentCatalogs(id);defaultCatalog(id);defaultLanguage(isoCode);siteMapConfig(&siteMapConfigId);urlPatterns;active;previewURL;startingPage(uid,$contentCV);urlEncodingAttributes;defaultPromotionGroup(Identifier)[default=$promoGrp];salesOrg(code)[default=$siteUid];
;$siteUid;blue;B2C;$storeUid;$contentCatalog;$productCatalog;$defaultLanguage;$storeUidSiteMapConfig;$cmsSiteUrlPattern;true;$storefrontContextRoot/?site=$siteUid;homepage;storefront,language;
It is exactly this expession:
INSERT_UPDATE CMSSite;uid[unique=true];contentCatalogs(id);defaultCatalog(id)
;$siteUid;$contentCatalog;$productCatalog

Related

How can I make a main URL with sub URL for different Django app?

I want to make a main URL and that URL will be the main route for all my Django apps.
Suppose I have 3 apps: blog, linux and business. I want to make URLs like this:
127.0.0.1:8000/blog/ (when i will click blog menu)
127.0.0.1:8000/blog/linux ( when i will click linux menu)
127.0.0.1:8000/blog/business (when i will click business menu)
The blog app will be my index home page and all the apps' links will be like this. I don't want to import all of the views and models in the blog app. The project's structure will be the same and I don't want to change it.
All I want is to make blog common for all the apps. If I click a post on a linux page, the URL will be like this:
127.0.0.1:8000/blog/linux/post name
How can I do this?
This is my project's structure:
[]
You can write all the URLs into the urls.py in your project folder or you can make a urls.py in your apps folder. Maybe read this
After Creating the App in django project by following procedure in https://docs.djangoproject.com/en/3.0/intro/tutorial01/
App Folder (blog app folder, found inside project folder)
Add these urls
127.0.0.1:8000/blog/linux
127.0.0.1:8000/blog/business
to the app/urls.py file above the admin.site url path
Project Folder:
Configure the urls.py file in the project folder by adding the 127.0.0.1:8000/blog/ url above the admin.site url path. This configuration is done to load this url when the server starts running.
The django checks for the requested url pattern and will route the first discovered url.
The django cannot identify duplicate url.

How to remove a value from the collection using Impex in HYBRIS?

I'm trying to extend the OOTB Impex to remove customersupportagentrole from customersupportmanagergroup but it not working. Please help.
this is OOB Impex.
INSERT_UPDATE CsAgentGroup;UID[unique=true];locname[lang=en];groups(uid)[mode=append];description
;customersupportmanagergroup;Customer Support Manager Group;customersupportmanagerrole,customersupportagentrole,csagentgroup,csagentmanagergroup;The Customer Support Manager Group has access to the Customer Support Backoffice's Customer Support Manager Group and Customer Support Agent Group views AND/OR the Assisted Service Module.
;customersupportagentgroup;Customer Support Agent Group;customersupportagentrole,csagentgroup;The Customer Support Agent Group has access to the Customer Support Backoffice's Customer Support Agent Group views and AND/OR the Assisted Service Module.
this is my Impex to remove customersupportagentrole from customersupportmanagergroup
INSERT_UPDATE CsAgentGroup;UID[unique=true];locname[lang=en];groups(uid)[mode=append];description
;customersupportmanagergroup;Customer Support Manager Group;customersupportmanagerrole,csagentgroup,csagentmanagergroup;The Customer Support Manager Group has access to the Customer Support Backoffice's Customer Support Manager Group and Customer Support Agent Group views AND/OR the Assisted Service Module.
;customersupportagentgroup;Customer Support Agent Group;customersupportagentrole,csagentgroup;The Customer Support Agent Group has access to the Customer Support Backoffice's Customer Support Agent Group views and AND/OR the Assisted Service Module.
You are using mode=append which basically append your values to the existing collection(groups). In your case, some Impex(OOTB) may already add customersupportagentrole to customersupportmanagergroup before your Impex gets executed. Now your Impex will not override existing value, it just appends. So try using mode=replace, which basically override existing values.
INSERT_UPDATE CsAgentGroup; UID[unique=true] ; groups(uid)[mode=replace] ;
; customersupportmanagergroup ; customersupportmanagerrole,csagentgroup,csagentmanagergroup ;
; customersupportagentgroup ; customersupportagentrole,csagentgroup ;
You can do it like this, if you don't use the mode operator in groups it will replace the collection with the componenets you specify
INSERT_UPDATE CsAgentGroup; UID[unique = true] ; groups(uid) ;; customersupportmanagergroup;csagentgroup,csagentmanagergroup;
or if you put [mode=remove] it will delete the component you specify
INSERT_UPDATE CsAgentGroup; UID[unique = true] ; groups(uid) [mode=remove] ;; customersupportmanagergroup;customersupportmanagerrole;
You need to remove for existing items in your impex.
Below code remove CsAgentGroup item (thanks #FarrukChishti for your attention)
REMOVE CsAgentGroup;UID[unique=true];groups(uid)
;customersupportmanagergroup;customersupportagentrole
We need to remove only relation so we can remove item from relation type like below or update existing like other answers.
REMOVE PrincipalGroupRelation;source[unique=true](uid);target[unique=true](uid)
;customersupportmanagergroup;customersupportagentrole
You want to update customersupportmanagergroup so that any link connecting customersupportmanagergroup to customersupportagentrole is removed while the customersupportagentrole still exists in database.
Using remove query will delete customersupportagentrole from database.
UPDATE CsAgentGroup;UID[unique=true];groups(uid)
;customersupportmanagergroup;customersupportmanagerrole,csagentgroup,csagentmanagergroup

Jhipster - [src]="getImageUrl()" for user's avatar image not working

I have updated column: image_url in [jhi_user] table with different values, and nothing seems to work, example: image_url= ../../../content/media/angular-js.png
Question:
Where in jhipster's file structure should i create a folder to hold user's profiles pictures, and what should the image_url value be so that it works with
<img [src]="getImageUrl()">
It's worth mentioning that this works:
<img src="../../../content/media/angular-js.png">
i created a folder "media" with image: angular-js.png
I am using mysql database and generator-jhipster: "4.6.2"
Thank you for your help in advance
There are 2 kind of images in web apps: the static assets are used for layout (icons, background, logos, ...) they are bundled within your app and the other ones that can be changed without rebuilding your app and which are data.
Static assets can be long term cached by the browser, this is why JHipster uses webpack to version their URLs with a hash code, to modify files that reference them (html, css) and bundle them.
In your design, your image URL is stored in a column of the User entity that points to an avatar image which is a static asset. So webpack is not able to rewrite it.
So either you exclude these images from webpack build process or you store your images as Blobs in your database to enable your users to upload their own images.
Second option would consist in creating a new entity Avatar that holds the Blob and have a one-to-one relationship with User entity. The reason for another entity si that JHipster does not let you modify the User entity.

appcmd.exe to overwrite a single site's entire xml config (applying the settings to a site that already exists)

I don't want to delete and recreate a site I just want to be able to apply the entire config to it and override any settings that are different.
I backed up the site config with %windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml
This command throws an error:
appcmd.exe add site /in < c:\sites.xml
ERROR ( message:Failed to add duplicate collection element "mysite". )
Do I really have to break out ALL of my IIS configuration into separate appcmd commands or is there a way to apply the entire xml in one shot and only have it override settings?
I want to have a single xml template that I can push out to all my webservers hosting this site.
If you already exists installed sites then you must by have other ID for new site
<SITE SITE.NAME="NewSite" SITE.ID="1094096085" bindings="*" state="Started">
<site name="NewSite" id="1094096085" serverAutoStart="false">
Else you get conflict by ID
You should try shared config
http://www.iis.net/learn/manage/managing-your-configuration-settings/shared-configuration_264
Regarding:
ERROR ( message:Failed to add duplicate collection element "mysite". )
It seems that you can not add a website that already exist.
Why dont you delete it and add it again with the new configurations?
You can also try to modify only the relevant sections.

export liferay user group to OpenLDAP

I configured liferay-portal-6.2-ce-ga4 with OpenLDAP. Users are imported into OpenLDAP from liferay. But User group of liferay are not exported into OpenLDAP. Here is my portal-ext.properties:
ldap.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
ldap.server.name=ldapadmin
ldap.auth.enabled=true
ldap.import.enabled=true
ldap.export.enabled=true
ldap.import.on.startup=true
ldap.export.on.startup=true
ldap.export.method.0=group
ldap.export.method.0=user
ldap.password.policy.enabled=true
ldap.base.provider.url.0=ldap://localhost:389
ldap.base.dn.0=dc=test,dc=com
ldap.security.principal.0=cn=admin,dc=test,dc=com
ldap.security.credentials.0=secret
ldap.auth.search.filter.0=(mail=#email_address#)
ldap.import.user.search.filter.0=(objectClass=inetOrgPerson)
ldap.user.mappings.0=userId=uid\nscreenName=cn\nemailAddress=mail\npassword=userPassword\nfirstName=givenName\nlastName=sn
ldap.import.group.search.filter.0=(objectClass=posixGroup)
ldap.group.mappings.0=groupName=cn\ndescription=description\nuser=memberUid
ldap.users.dn.0=ou=people,dc=test,dc=com
ldap.groups.dn.0=ou=groups,dc=test,dc=com
ldap.user.default.object.classes.0=inetOrgPerson, top
ldap.group.default.object.classes.0=posixGroup, top, groupOfUniqueNames,organizationalUnit
I have checked by clicking on 'Test LDAP Groups' button I can see around 5 groups which are created in OpenLDAP using OpenLDAP GUI but can't see any group which i create in liferay. Its not exporting User Groups its only exporting users. Please give some solution for this.
I think the keys you use on your portal-ext.properties file are wrong.
In the documentation we can read:
#
# Settings for exporting users from the portal to LDAP. This allows a user
# to modify his first name, last name, etc. in the portal and have that
# change pushed to the LDAP server. This setting is not used unless the
# property "ldap.auth.enabled" is set to true.
#
ldap.export.enabled=false
#
# Set this to true if groups and their associations should be exported from
# the portal to LDAP. This setting is not used unless the property
# "ldap.auth.enabled" is set to true.
#
ldap.export.group.enabled=true
So you should use:
ldap.export.enabled=true
ldap.export.group.enabled=true

Resources