B2B hybris module gen does not work - sap-commerce-cloud

AFter using b2b_acc recipe, i want to do module gen. like:
ant modulegen -Dinput.module=accelerator -Dinput.name=qqq -Dinput.package=com.fffff.sampa -Dinput.template=develop
but it gives error of
hybris "java.util.regex.PatternSyntaxException": Illegal repetition near index 0 ${YMODULE_TOKEN}(.*)
And there is no information about how to do for b2b.
What can i do? I need to develop a b2b website. Should i use extgen?
Now it gives this:
java.lang.IllegalArgumentException: cannot merge namespace
((fulfilmentprocess)) into (()) due to duplicate attribute
'ConsignmentProcess.done(java.lang.Boolean):((fulfilmentprocess))::YAttributeDescriptor[fulfilmentprocess-items.xml:18(AttributeTagListener)][PROPERTY]'
vs
'ConsignmentProcess.done(java.lang.Boolean):((yacceleratorfulfilmentprocess))::YAttributeDescriptor[yacceleratorfulfilmentprocess-items.xml:18(AttributeTagListener)][PROPERTY]'

When you are creating your custom extension using modulegen, you should delete existing template extension as well in your localextension.properties file.
Remove any of the following extensions that might appear in your localextensions.xml file
yacceleratorcore
yacceleratorfacades
yacceleratorstorefront
yacceleratorinitialdata
yacceleratortest
yacceleratorcockpits
yacceleratorfulfilmentproces
Read Here for more details on how to customize Accelerator using modulegen :
https://help.hybris.com/6.6.0/hcd/8ace75c786691014a5e9dcafa29d5410.html

Removing yacceleratorbackoffice work for me.

This issue is version-dependent but try removing yacceleratorfulfilmentproces or yacceleratorbackoffice from localextensions.xml and that may help.

Related

Merge schemas of custom dialog - Error conflicting definitions

I am following the steps of this page:
https://learn.microsoft.com/en-us/composer/how-to-create-custom-actions
and have reached to the part where it is required to merge the two schemas: bots and your custom one. However when running the powershell script found inside the created project template (CoreAssistant template) I have the following error:
Error conflicting definitions of HelpDialog.dialog :
C:\Users\user\source\repos\AvanadeCoreAssistant\AvanadeCoreAssistant\dialogs\imported\Microsoft.Bot.Components.HelpAndCancel\HelpDialog\HelpDialog.dialog
Microsoft.Bot.Components.HelpAndCancel:
C:\Users\user.nuget\packages\microsoft.bot.components.helpandcancel\1.1.2\exported\HelpDialog\HelpDialog.dialog
Error conflicting definitions of HelpDialog.en-us.lu.dialog :
C:\Users\user\source\repos\AvanadeCoreAssistant\AvanadeCoreAssistant\dialogs\imported\Microsoft.Bot.Components.HelpAndCancel\HelpDialog\recognizers\HelpDialog.en-us.lu.dialog
Microsoft.Bot.Components.HelpAndCancel:
C:\Users\user.nuget\packages\microsoft.bot.components.helpandcancel\1.1.2\exported\HelpDialog\recognizers\HelpDialog.en-us.lu.dialog
Error conflicting definitions of HelpDialog.lu.dialog
HelpDialog is a predefined dialog that was already present. I have installed NodeJs and #botframework-cli package because it was required from the powershell script in order to run bf dialog:merge and now it seems these two sources have some kind of conflict.
To add to other answers, changes that worked for me are as follows:
update-schema.ps1, line 11, change "!**/generated" to "!../generated" and add "!../dialogs/imported"
Also, make sure that your custom action project is INSIDE of your bot directory, it should be a folder next to the "schemas" folder for the script to find it.
Note/Edit: Having the project nested inside the bot works to get the script working, though I do not recommend it due to causing other errors. Oddly, I found it was best to move the whole custom solution up a level, next to the bot project. You may have to edit the [botName].sln file in notepad to reference the location of the project, as well as editing the bot project's project reference.
I fixed it by changing the script. I noticed the script was trying to ignore the folder imported and generated but the error message indicated it was not doing so. So I changed it from !**/generated to !../generated.
I experienced the same issue.
To fix this problem you could simply delete the corresponding dialogs in the "imported" folder. Note that this will, however, delete these dialogs in your bot, which is not optimal but should be of little concern for a sample application.

The hybris extension is skipped, during Initialization. How to debug and resolve it?

Initially all the Extensions were imported. But after some modifications (and tried to initialize), i am facing below issue.
Question: is how to debug it and fix the issue?
Edited:
As per suggestion of #Mafick.
i tried to update "sapbusinessagreementaddon" extension through hac. i found the cms-responsive-content_zh_CN.impex file( which was throwing the exception).
please find the code below:
cms-responsive-content_zh_CN.impex
$contentCatalog=powertoolsContentCatalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged]
$jarResourceCms=jar:com.sap.hybris.sapbusinessagreementaddon.constants.SapbusinessagreementaddonConstants&/sapbusinessagreementaddon/import/cockpit/cmscockpit
$contentCatalogName=Powertools Content Catalog
$addonExtensionName=sapbusinessagreementaddon
$lang=zh_CN
# update linkname
UPDATE CMSLinkComponent;$contentCV[unique=true];uid[unique=true];linkName[lang=$lang]
;;BusinessAgreementsLink;"商业协议"
The error thrown in the hac is: as below
UPDATE CMSLinkComponent;catalogVersion(CatalogVersion.catalog(Catalog.id[default=powertoolsContentCatalog]),CatalogVersion.version[default=Staged])[default=powertoolsContentCatalog:Staged][unique=true];uid[unique=true];linkName[lang=zh_CN]
,8796103869500,,,column 3: cannot resolve value '商业协议' for attribute 'linkName' because: cannot find language for value 'zh_CN';;BusinessAgreementsLink;商业协议
Conclusion:
As per the issue it cannot resolve "zh_CN" (linkName[lang]). So how can i resolve this issue? Where should i specify lang(zh_CN) to find the language by hybris?
Such that it execute's impex successfully.
As you can see this happens while you are importing 'project data'.
So go into your hybris admin console (/hac) -> Update and deselect all checkboxes and only activate sapbusinessagreementaddon below in project data. Than have a look on the console.
UPDATE
Have a look in to this impex file
/projects/hybris/custom/xxxinitialdata/resources/xxxinitialdata/import/coredata/common/essential-data.impex
There you can define your Languages. Add here your missing language
You probably have errors in one or more sample data impexes in the sapbusinessagreementaddon extension, try importing them manually one by one (from hac), and see which one crashes
Update :
Seems zh_CN language is missing from your database, try creating it using the following :
INSERT_UPDATE Language;isocode[unique=true];active[default=true]
;zh_CN;
Adapt this code to correspond more to your needs

Cannot resolve value 'homepage' for attribute 'startingPage' (hybris)

I created a project with ant modulegen. b2b from b2c recipe, because hybris wiki says this.
But i could not get a proper result on backoffice / wcms / website
for that, mystore shows empty for
Name
and
Content Catalogs
I found that inpex that is not working on hac admin.
This is path
mystoreinitialdata/import/coredata/stores/mystore/site.impex
This is the error:
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,catalogVersion(CatalogVersion.catalog(Catalog.id[default=mystoreContentCatalog]),CatalogVersion.version[default=Staged])[default=mystoreContentCatalog:Staged]);urlEncodingAttributes;defaultPromotionGroup(Identifier)[default=mystorePromoGrp]
,8796093187112,,,column 12: could not resolve item for homepage| column 12: cannot resolve value 'homepage' for attribute 'startingPage';mystore;blue;B2C;mystore;mystoreContentCatalog;mystoreProductCatalog;en;mystoreSiteMapConfig;(?i)^https?://[^/]+(/[^?])?\?(.\&)?(site=mystore)(|\&.)$,(?i)^https?://mystore.[^/]+(|/.|\?.)$,(?i)^https?://api.hybrisdev.com(:[\d]+)?/rest/.$,(?i)^https?://localhost(:[\d]+)?/rest/.*$;true;/?site=mystore;homepage;storefront,language;
error is for that line
> # 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]
> ;$siteUid;blue;B2C;$storeUid;$contentCatalog;$productCatalog;$defaultLanguage;$storeUidSiteMapConfig;(?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$,(?i)^https?://api\.hybrisdev\.com(:[\d]+)?/rest/.*$,(?i)^https?://localhost(:[\d]+)?/rest/.*$;true;$storefrontContextRoot/?site=$siteUid;homepage;storefront,language
I followed the recipe wiki and
https://wiki.hybris.com/pages/viewpage.action?pageId=294094425
that wiki. What am i doing wrong?
INSERT_UPDATE CMSSite;uid[unique=true];theme(code);channel(code);stores(uid);contentCatalogs(id);defaultCatalog(id);defaultLanguage(isoCode);urlPatterns;active;previewURL;startingPage(uid,$contentCV);urlEncodingAttributes;defaultPromotionGroup(Identifier)[default=PromoGrp];# unknown attributes [ContentPage.$contentCV] - cannot resolve item reference;# invalid item expression '# unknown attributes [ContentPage.$contentCV] - cannot resolve item reference' - unexpected expression at 45
,,,,unknown attributes [ContentPage.$contentCV] - cannot resolve item reference, invalid item expression '# unknown attributes [ContentPage.$contentCV] - cannot resolve item reference' - unexpected expression at 45;$siteUid;lambda;B2B;$storeUid;$contentCatalog;$productCatalog;$defaultLanguage;(?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$;true;$storefrontContextRoot/?site=$siteUid;homepage;storefront,language,currency
Add this to your impex before importing CMS Site
INSERT_UPDATE SiteMapPage;&siteMapPage;code(code)[unique=true];frequency(code)[unique=true];priority[unique=true];active[default=true]
;Homepage;Homepage;daily;1.0;;
I think some Impex might have failed during your system initialization. So what I would suggest.
Since you have set up the custom extension with your store data, remove all OOTB stores(powertools, apparel-us etc.) from your localextension.xml file
Initialize your system. Look for the error log in the console, note down all Impex which fail to load
Correct those Impex and run it through hac Impex-Import
Once setup correctly your store correctly, you can follow this to access your site as root
You're using a version 6.7 of Hybris but you're following the wiki for the version 5.7.
Follow this link. Here instead you can find the trails.

Error: A namespace cannot directly contain members such as fields EntityFramework.dll' could not be found

enter image description hereI want to create model: add > class > ado.net entity, for my db first project and also want to create CRUD operation by asp.netscaffolding, but failed to create a model with necessary code.and thus i failed to create scaffolding .
in my model file AllahHelp.Context.cs, there is no code, only the text "ErrorGeneratingOutput".
Error 1:
A namespace cannot directly contain members such as fields or methods F:\project\WebApplication8\WebApplication8\Models\AllahHelp.Context.cs 1 1 WebApplication8
Error 2:
Compiling transformation: Metadata file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools..\IDE\EntityFramework.dll' could not be found F:\project\WebApplication8\WebApplication8\Models\AllahHelp.tt 1 1 WebApplication8
If there is an error transforming your .tt files into class files, your class files will just have "ErrorGeneratingOutput" in the source file, which causes a "namespace cannot directly contain members such as fields" error, but doesn't really have anything to do with that.
Your actual error sounds like you're missing a reference to EntityFramework.dll. Right click the project, choose "Manage NuGet Packages..." and find and install EntityFramework to your project.
In some situations I've also run into a problem where since the transformation occurs before files are copied, referenced dlls don't ever get copied since the error occurs and stops the process. In this case you would need to remove the model from your project temporarily, successfully compile the project, and then add the model back.
According to this similar question it could also be because of your install path. If that is your issue, try to find where the dll is, and correct the environment variable VS120COMNTOOLS (Control Panel -> System -> Advanced System Settings -> Environment Variables -> System Variables)
(Be careful changing system variables, though.)
I was getting this error when attempting to build a project using .tt templates. I fixed the issue by checking everywhere that I used C# code injection and making sure that I closed each section of C# code by including #>.
Example:
Problematic code:
{
"find": "__LOCATION__",
"replaceWith": "<#= deployment.Location"
},
Fixed code:
{
"find": "__LOCATION__",
"replaceWith": "<#= deployment.Location #>"
},

openam jar file for custom module development

Where will I get the opensso.jar within the openAM-12 folder?
This jar file essential for developing the custom module. The amserver.jar is named as openam-core-12.0.0 and opensso-sharedlib.jar is named as openam-shared-12.0.0.
But opensso.jar cannot be found within the folder openAM-12. Please help me.
I don't believe there is a clear replacement for opensso.jar, from what I can see it looks like that it has been mainly separated into OpenFM and openam-cli-impl.

Resources