Hybris Update Hot-Folder Process - sap-commerce-cloud

How to add new attribute for CSV file and how/where to update the code of the hot-folder process?

In the Hybris Hot Folder principle, we convert a CSV file to an ImpEx file using the specific header that can be configured using Spring Integration logic.
Files to update/configure:
To specify/add/update the configuration of your Hot Folder logic/header look for a file named something like hot-folder-spring.xml in the hot-folder custom extension.
What to add :
Add your attribute in the ImpEx header of your type located in hot-folder configuration file, something like :
<bean id="myTypeConverter" class="de.hybris.platform.acceleratorservices.dataimport.batch.converter.impl.DefaultImpexConverter">
<property name="header">
<value># ImpEx for Importing MyType objects into $CATALOG$
$catalog=$CATALOG$
#% impex.setLocale(Locale.ENGLISH);
INSERT_UPDATE MyType;code[unique=true];myAttribute[translator=com.dataimport.batch.converter.MyAttributeTranslator]// translator if need
</value>
</property>
<property name="impexRow">
<value>;{+0};{+1}</value> //{+1} = the number 1 is the position of the column of your attribute value {+csv-attribute-column-position}
</property>
</bean>
Note:
Hot Folder, is a folder from which data can be automatically imported
into the platform by simply placing the data inside of the folder.
Data are CSV files that can be converted to ImpEx files

There is a hybris Trail you can follow which explains in detail which steps need to be undertaken for a hot folder configuration:
https://wiki.hybris.com/pages/viewpage.action?pageId=294094383
You can see how to define filenames, directories, time intervals and so on.

Related

Website project: want to generate XML documentation on build

For legacy reasons, I'm maintaining a Web Site Project for which I want to provide up-to-date documentation from the XML documentation comments. I gather I can do that by tweaking the <compilers> section in web.config. I finally reached this point:
<system.codedom>
<compilers>
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider"
compilerOptions="/optimize /doc:C:\temp\my-output-here.xml"
warningLevel="1" />
</compilers>
</system.codedom>
Now when I start the website with (and thus invoke just-in-time compilation) I do get an XML file in the requested location but it's minimal:
<?xml version="1.0"?>
<doc>
<assembly>
<name>App_global.asax.abqhzva4</name>
</assembly>
<members>
</members>
</doc>
It seems like the <compiler> tag doesn't quite do what I want. It must be generating XML for the project folder itself rather than the .cs files, or it's getting overwritten with each compilation unit and I'm only seeing the trivial last one, or... I don't know. I'm not sure. This config tag is not well documented.
Long story short, I'm looking for a way to get XML documentation for all the .cs files in this website project. It doesn't matter if it's all in one file, in separate files, or even shoved into memory at run time.
I'm aware of the prior question on this, but the link provided there has been redirected to the Sandcastle site. That's great, but it's way more than I'm actually going to use on this project. Simply getting XML documentation at build time or run time is all that is necessary.
My question then is: What do I need to do to get the <compiler> config entry to generate XML docs for a Website Project?
I have an ugly workaround as well... But here goes!
1. Download the latest Sandcastle Installer from this page - https://github.com/EWSoftware/SHFB/releases
2. Unzip and run the installer
3. Copy EWSoftware.CodeDom.dll into your website's \bin directory. The default location of this file is - C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\Extras\EWSoftware.CodeDom.dll
4. Modify web.config as follows:
<configuration>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
compilerOptions="/docpath:C:\Publish\Docs"
type="EWSoftware.CodeDom.CSharpCodeProviderWithDocs, EWSoftware.CodeDom"
>
<!-- NOTE: Change version value as needed (v3.5, v4.0, etc.) -->
<providerOption name="CompilerVersion" value="v4.0"/>
</compiler>
</compilers>
</system.codedom>
</configuration>
Source: http://ewsoftware.github.io/EWSoftwareCodeDom/html/40ba6bda-95d6-4a64-834f-f7cedcb589d1.htm
5. Rebuild your solution and voila! The folder specified with the /docpath option will contain your XML documentation.

XML File Changes using Installshield2011

I am developing an add-on installer using Installshield 2011 and project type is Basic MSI. I got a requirement where i need to update app.config file; the mentioned app.config is not part of current installer; app.config will be available by installing the base product. And on top of this my add-on installer will update the app.config file.
I am using XML File Changes feature provided by Installshield, i have configured it in the following steps:
Import the updated app.config file under XML File changes view.
Create a new element and assign key and value to it.
Repeated 1 and 2 and added 7 to 8 new entries as per the requirement
During testing i am seeing that the app.config file has been updated but entries are in single line instead of one below the other. I cannot enable "Format XML after changes" because one of the service which is referenced to app.config is not working and when i revoke the option services runs perfectly.
Is there any workaround/option to tell/ask installshield insert xml tag one below the other not in sinlge line using XML File Changes?
Thanks,
Chetan
If XML Changes isn't formatting the document in a way that's acceptable, you could consider using the Text File Changes which is just a simpler search and replace without understanding the schema of XML. Otherwise options are to check out Windows Installer XML ( you can use the XmlConfig elements found in the Util extension in a merge module and then use that merge module in InstallShield ) or to just write your own custom actions.

Making a custom report with ccnet

So I have my output that I used the merge task to put into ccnet.
Now what I need to do is come up with my own custom xsl and output the data.
Any ideas on where there maybe a tutorial on how to do this?
For example what plugin do I need to use? Can I create my own? What does action name do?
<xslReportBuildPlugin description="MSBuild Output" actionName="MSBuildOutputBuildPlugin" xslFileName="xsl\msbuild.xsl" />
in your cruise control folder:
CruiseControl.NET\webdashboard\xsl
Copy any existing xsl (preferably one that is close to what you already want or in a format you like). you could start an xsl file from scratch also.
edit it to what you want it to be with your own file name.
I copied the msbuild.xsl to BMsBuild.xsl and made my changes.
then in dashboard.config
<xslReportBuildPlugin description="BBuildReport" actionName="BBuildReport" xslFileName="xsl\Bmsbuild.xsl"></xslReportBuildPlugin>
Description: what title you want it to have on the webdashboard link
actionName: a unique name that will be used to generate a URL for that xsl/report
xslFileName: the path to the xsl usually just xsl[your xsl file name].xsl
That's the easiest way. The file is nearly entirely xsl so there's not really anything special you need to do or know. Except that the xsl is going to target the merged xml file from whatever you have in the publishers xml logger tag in your ccnet.config
<publishers>
<statistics/>
<xmllogger logDir="D:\Projects\TFS\Main\BuildProcess\logs\ServiceBuilds" />
</publishers>

Sharepoint solution packaging: how do I get a custom icon for my features?

I am not sure how foolish I am being here!
I have a solution that packages up some master pages and layouts etc which I can deploy fine and the feature appears in the "Site Collection Features" list fine. However I would like to put a custom icon next to my feature. I would like the icon to be in the solution package and so require the image to be put in a list or folder when the solution is deployed (rather than a feature activated).
Is this possible? simple?
There is something about all this sharepoint solution/feature.xml/element.xml I don't grok yet!
It is possible and simple.
In your Feature.xml file, simply include the ImageUrl="" attribute and specify the location of your image. The best practice is to create a folder under the Template\Images folder with your images and then reference this location
Include the folder which contains your images in the solution ddf file
Once deployed, you should have a %12HIVE%\Templates\Images\ACMEImages folder which contains your image
Feature.xml sample:
<Feature
Id="21F724AE-9C1C-4F4D-AAE9-7789CA01A7E3"
Title="ACME Lists"
Description="List definitions for the ACME"
Version="1.0.0.0"
Hidden="false"
Scope="Web"
ImageUrl="ACMEImages\acmelogo.png"
xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- other feature file info omitted -->
DDF file sample:
.Set DestinationDir=IMAGES\AcmeImagesRootFiles\TEMPLATE\IMAGES\ACMEIMages\acmelogo.png
In SharePoint 2010, the Microsoft Default icon is: GenericFeature.gif - a 31 x 22 image. With VS 2010 and SP 2010, you can add a SharePoint "Images" mapped folder to your SharePoint project. Then place your image in this folder. Be sure to provide the Image URL in the Properties panel of the *.feature object. Use a path to the image as noted above.
Pete's solution didn't work for me although I did exactly as he suggests. My problem is that SharePoint is looking for the image in the /_Layouts folder rather than the Templates/Images folder.

Deployment of custom content type, forms, cqwp, and xsl

Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this.
Now, I would like to do 2 things.
First, I'd like to create a custom display form for the content type and include it in my solution so that it is automatically deployed when I deploy my solution. How do I include this in my solution and make my content type use it?
Secondly, you can query this type with the CQWP. I've thought about exporting it, adding more common view fields, and then modifying the XSL that is used to render it. How do I include this into my solution so that it is also deployed. I know i can export the CQWP webpart once it's all setup and include it in my project as a feature. But what abuot the XSL?
Looking forward to see your suggestions, cheers.
Did as described in the first answer. Worked like a charm.
Use STSDev to create the solution package.
That should help with creating the WSP. The custom form, CQWP webpart and the .xls file should also be deployable within the project.
To deploy the xslt, your feature will have an
<ElementManifest Location="mywebpartManifest.xml">
This then points to a files such as
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Yourfile.xslt" Url="Style Library" Path="" RootWebOnly="TRUE">
<File Url="yourfile.xslt" Type="GhostableInLibrary" />
</Module>
</Elements>
for the webpart:
<Module Name="myWebpart" List="113" Url="_catalogs/wp" RootWebOnly="FALSE">
<File Url="myWebpart.webpart" Type="GhostableInLibrary" />
</Module>
Now that file will need to be contained in the solution manifest.xml. This is done automatically from the STSDev project.
e.g.
<Resources>
<Resource Location="SimpleFeature\Feature.xml"/>
The actual schemas are:
Site
Solution
Feature
and a link to someone else with the issue
But where in the folder structure do you deploy the form and the .xsl to?
I have followed your guide and although it deploys the xslt to the feature in 12 Hive it does not place it in the correct style library folder
You need to deactivate / reactivate the feature. This will give you any error messages that are associated with copying the file over.

Resources