How to create Navigation Node in Hybris using Impex ?
How to map categories to navigation nodes ?
How to map category landing pages or PLP to navigation nodes ?
How to establish relation between navigation bar and jsp page ?
In import/sampledata/contentCatalogs/yourCatalog/cms-content.impex after filling the macros with your project specific definitions:
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;children(uid,$contentCV)[mode=append]
;root;;root;;
##- level 1. SiteRoot -##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&componentRef);&nodeRef
;SiteRootNode;;SiteRootNode;root;;SiteRootNode
##-- level 2. children of SiteRoot --##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&componentRef);&nodeRef
;YOUR-SITE-NAMENavNode;;YOUR-SITE-NAME Site;SiteRootNode;;YOUR-SITE-NAMENavNode
##--- level 3. children of <YOUR-SITE-NAME>NavNode ---##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&componentRef);&nodeRef
;YOUR-SITENAMECategoryNavNode;;Categories;YOUR-SITE-NAMENavNode;;YOUR-SITE-NAMECategoryNavNode
##---- level 4. children of Category Nav ----##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&linkRef);&nodeRef
;FIRST-CATEGORYNavNode;;FIRST-CATEGORY;YOUR-SITE-NAMECategoryNavNode;;FIRST-CATEGORYNavNode
## entries of the above navigation nodes ##
INSERT_UPDATE CMSNavigationEntry;uid[unique=true];$contentCV[unique=true];name;navigationNode(&nodeRef);item(CMSLinkComponent.uid,CMSLinkComponent.$contentCV);
;FIRST-CATEGORYNavNodeEntry;;FIRST-CATEGORY Navigation Node Entry;FIRST-CATEGORYNavNodeFIRST-CATEGORYCategoryLink;
## links of the above navigation nodes ##
INSERT_UPDATE CMSLinkComponent;$contentCV[unique=true];uid[unique=true];name;url;&linkRef;&componentRef;target(code)[default='sameWindow']
;;FIRST-CATEGORYCategoryLink;FIRST-CATEGORY Category Link;/Open-Catalogue/FIRST-CATEGORY/c/FIRST-CATEGORY-ID;FIRST-CATEOGRYCategoryLink;FIRST-CATEGORYCategoryLink;
Keep in mind that /c/FIRST-CATEGORY-ID is leading to the category
with this id. You also have to have the Page template configured in
coredata/contentCatalogs/yourCatalog/cms-content.impex (this impex
is usually filled by the hybris system automatically) related to the
SearchResults page so that the products in the category appear.
You have to configure your root category in the projectNamecore
extension in the spring xml
<bean id="PROJECT-NAMECategorySource" parent="abstractCategorySource">
<property name="rootCategory" value="ROOT-CATEGORY-NAME"/>
</bean>
<bean id="PROJECT-NAMECategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
<property name="categorySource" ref="PROJECT-NAMECategorySource"/>
</bean>
<bean id="PROJECT-NAMECategoryNameValueProvider" parent="abstractCategoryNameValueProvider">
<property name="categorySource" ref="PROJECT-NAMECategorySource"/>
</bean>
This is done so that hybris knows your category system and so that it is able to give the right results and configure the PATH in the pages.
ROOT-CATEGORY - the main category that is the parent of all categories;
PROJECT-NAME - your project name;
SITE-NAME - your site name;
It will be easier for you if you take a look at the powertoolsstore/apparelstore/electronicsstore or more accurately the cms content impex in the sampledata of the projects so that you have the main idea.
Hope it helps!
Related
Indexing an external content type is pretty straight forward.
However I find it very troublesome to figure out the specific "crawl state" of a particular item.
Looking at the "Url View" inside SharePoint CA it shows me all my crawled/indexed items. Unfortunately the url part is nowhere near readable. So I have no clue where to look for my specific item in question.
Example:
bdc3://adventureworksdbtest/Default/00000000%2D0000%2D0000%2D0000%2D000000000000/418/AdventureworksDB/420?s_id=i0QMAAA==&s_ce=0408808680g000g10204000g0o20003s
Guid.Empty?
418?
420?
Some encoded id? (it's not BASE64. i0QMAAA== translates to nothing).
The AdventureWorks product table has a productID (int) and a name (string). In my BDC model I mapped the "Title" column to the product's "Name" column for my Product entity. See below...
<Entity Name="Product" Namespace="Rs.Exp.IndexingConnector.BuiltinDbConnector" Version="1.0.0.1">
<Properties>
<Property Name="OriginalName" Type="System.String">[Production].[Product]</Property>
<Property Name="EntitySetName" Type="System.String">[Production].[Product]</Property>
<Property Name="Title" Type="System.String">Name</Property>
</Properties>
<Identifiers>
<Identifier Name="ProductID" TypeName="System.Int32" />
</Identifiers>
<!-- [...] -->
</Entity>
That's working. However it has no influence on the "index url". Any hints? Something I have to live with? How do you debug this?
Update: DisplayUriField sounds like a good thing to look into. Although all I found so far is not what I am looking for. I'm not looking for a way to provide an url myself (where would I link to anyway?!) - I just want the "generated url" to be more meaningful.
Answering my own question in case anyone else is wondering how this works.
The Method(Instance) Property "DisplayUriField" is in fact providing the desired functionality. As a value you can set the name of a TypeDescriptor which is part of your entity schema.
For example if you have a TypeDescriptor like the one below (make sure your SELECT statement returns the column in question)...
<TypeDescriptor Name="Url" TypeName="System.String">
<Properties>
<Property Name="ShowInPicker" Type="System.Boolean">false</Property>
</Properties>
</TypeDescriptor>
...you can use it as a value for your DisplayUriField property:
<MethodInstances>
<MethodInstance Name="GetAllProducts" Type="Finder" ReturnParameterName="GetAllProducts_Returned" Default="true" DefaultDisplayName="Get All Products">
<Properties>
<Property Name="RootFinder" Type="System.String">x</Property>
<Property Name="LastModifiedTimeStampField" Type="System.String">ModifiedDate</Property>
<Property Name="DisplayUriField" Type="System.String">Url</Property>
</Properties>
</MethodInstance>
</MethodInstances>
My Database Table Url column contains urls like this
http://localhost/adventurworks/catalog/1
http://localhost/adventurworks/catalog/316
http://localhost/adventurworks/catalog/317
[...]
Whatever is in your column will be shown in SharePoints Crawl Log ("Url View").
If your column ("Url") is nullable and does not contain any value BDC will use a default name for that specific item.
Of course after all the custom url is pretty damn useless. However it allows me to figure out whether one specific item has been crawled (successfully) or not because I can relate the shown Url to the ProductID - which I cannot with those bdc3:// urls.
I know Button.command is the theme ID for normal buttons and I can set properties for it. And I know eventHandlers don't have a theme ID by default. So to set properties of an eventHandler centrally, I've historically added what I've had this in my theme:
<control>
<name>Button.EventHandler</name>
<property mode="override">
<name>onStart</name>
<value>loading();</value>
</property>
<property mode="override">
<name>onError</name>
<value>stoploading();</value>
</property>
<property mode="override">
<name>onComplete</name>
<value>stoploading();</value>
</property>
</control>
But I then need to add the themeId Button.EventHandler to each eventHandler.
Is there a way to set properties in a theme for children, so set properties on all eventHandlers that are children of Button.Command controls?
I cannot help You with solving Your theme problem, but perhaps I can give You solution to general problem.
I assume that what You try to achieve is to attach some nice loader to all partial refresh events. This can be done on a lower level by using dojo.subscribe API: http://dojotoolkit.org/reference-guide/1.6/dojo/subscribe.html
Example code:
// we need to activate io events
dojo.config.ioPublish = true
dojo.subscribe("/dojo/io/send", function(/*dojo.Deferred*/dfd){
loading();
});
dojo.subscribe("/dojo/io/stop", function(){
stoploading();
});
This code has to be run on application start (onClientLoad event will do just fine)
I am trying to use a Content Query Web Part to create a "What's New" page in Sharepoint 2010. The goal of this page is to display any documents that have been uploaded in the last 14 days. The trick is that these documents could belong to any number of lists that are defined in any number of list definitions. These are custom list definitions based on custom content types. We do have a base content type that each of our custom content types inherit from. They are also all part of the same content type group. I have determined that it is not possible to use the SP UI to set up the CQWP to return items from multiple list types, since one of the required query fields is list type. So - I'm attempting to use CAML to define this CQWP and this is where I'm having trouble. My end goal is for the CAML to be defined in a site definition (onet.xml file) but I've also not had any luck with uploading a .webpart file from the SP UI. I have found several articles that explain how this should be done but haven't been able to get the suggested solutions to work. This MSDN article tells me it should be possible using the ListsOverride element. This is how the article tells me to do it:
<![CDATA[
<Lists BaseType="0">
</Lists> ]]>
Since I'm looking for Document Libraries I would use a base type of 1 rather than 0.
I have been unable to determine the syntax for what that would actually look like from within the onet.xml file so I thought I'd start with trying to get it uploaded as a .webpart file.
This is what the ListsOverride element looks like:
<property name="ListsOverride" type="string">
<![CDATA[<Lists BaseType="1"></Lists>]]>
</property>
However - as soon as I upload a .webpart file with this in the CAML and add the webpart to a page I break that page in Sharepoint. This is what I get:
Server Error in '/' Application.
Attempted to use an object that has ceased to exist.
Research on that error points me to code that disposes of an object such as SPContext.Current.Web but I don't even have any code at all here. It almost looks like the CQWP has a bug in it. OR - I'm either not formatting that CAML properly or maybe I need to change something in a different element in the CAML?
I am running Sharepoint 2010 SP1 with all the latest patches. (I believe)
I've tried several other formats but without luck.
I tried getting rid of the embedded CDATA tags like this:
<property name="ListsOverride" type="string">
<Lists BaseType="1"></Lists>
</property>
But then Sharepoint won't let me upload the .webpart file. (Invalid .webpart file)
The format with the embedded CDATA tags seems to be the only way it lets me upload the file.
I've tried (just for the sake of narrowing down my issue) to specify specific lists like this:
<property name="ListsOverride" type="string">
<![CDATA[<Lists><List Id="{5a2f79bb-cc82-4171-88ac-65f20e7b5fa8}" /></Lists>]]>
That doesn't break the page but the webpart gives me less than useful error on the page (Unable to display this Web Part)
I'm not 100% sure that I used the appropriate GUID in that attempt. I got it from looking in the server explorer in Visual Studio (Under Lists and Libraries >> Document Libraries >> My List Type. (I got the GUID from the Id property)
I should mention that I am fairly new with Sharepoint development. I would have hoped that something seemingly so core to what Sharepoint does would be much easier than this.
Can someone please point out what I am doing wrong? Maybe I'm going about the whole thing in the wrong way? I appreciate any help that anyone can give me!
I found that the issue was all the "extra" fields that SharePoint had populated.
In my case, I started by configuring the content query web part on the page and then exporting it to get the xml. Then, I put the XML in my onet.xml file of my site definition. That worked fine initially, but as I tried to configure the base types, it did not behave as expected.
If I removed all the additional fields and just used the few fields that I actually needed to configure, then it started to work. In fact, I didn't even need to use the ListsOverride element, since there is a BaseType property that works just fine. It appears that one of the other properties that I was pulling in was really the cause of my issues.
Here's a webpart definition that I used in my onet.xml:
<AllUsersWebPart WebPartZoneID="WebPartZone" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Recently Updated Documents</property>
<property name="ChromeType" type="chrometype">TitleOnly</property>
<property name="ChromeState" type="chromestate">Normal</property>
<property name="WebUrl" type="string">~site</property>
<property name="BaseType" type="string">1</property>
<property name="ContentTypeBeginsWithId" type="string">0x0101008B0856395DCD40F99C9B42B6BF92BDDB</property>
<property name="FilterField1" type="string">{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}</property>
<property name="FilterType1" type="string">DateTime</property>
<property name="FilterOperator1" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Geq</property>
<property name="FilterDisplayValue1" type="string">-14</property>
<property name="FilterValue1" type="string">-14</property>
<property name="SortBy" type="string">{8c06beca-0777-48f7-91c7-6da68bc07b69}</property>
<property name="SortByFieldType" type="string">DateTime</property>
<property name="SortByDirection" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+SortDirection, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Desc</property>
<property name="ItemXslLink" type="string">~sitecollection/Style Library/DealerPortal/ItemStyle.xsl</property>
<property name="CommonViewFields" type="string">Name,Text;Created,DateTime;Modified,DateTime;Body,Note;DocumentIconImageUrl;OnClickForWebRendering</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</AllUsersWebPart>
I want to add the WhatsPopularWebPart as a delegate control. Registered a controlid in the masterpage and created a feature with this XML-manifest:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control ControlAssembly="Microsoft.Office.Server.WebAnalytics.UI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ControlClass="Microsoft.Office.Server.WebAnalytics.Reporting.WhatsPopularWebPart" Id="WebAnalyticsDelegate" >
<Property Name="Title">Most viewed pages</Property>
<Property Name="DateRange">SevenDays</Property>
<Property Name="ItemLimit">6</Property>
</Control>
However, the webpart keeps saying "Loading". I think the callback is not executed. When I look at the HTML, the WebPartId is only zeroes (0000-00000-00 etc.) instead of a valid GUID. Perhaps that is the problem?
I want to add the webpart to every page on the site, therefore using delegate controls.
Hum...
I don't see why it is not working. See this link :
http://blog.brianfarnhill.com/2008/12/08/using-the-delegate-control-to-deploy-a-web-part-through-features/
Maybe it is a problem with This particular webpart : http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/93782f9c-b582-436c-8c66-12349fd752b2
Have you tried with other webpart ?
Solution: ContentPlaceHolder in masterpage and in every page layout a webpart zone in that ContentPlaceHolder. Further in the provisioning of the pagelayout an with the webpart definition of the WhatsPopularWebPart. Problem solved.
In Sharepoint 2007, I have created a layout. As you know when the user creates a page he chooses a layout from a listbox.
When you select a different element in the listbox, there is a preview image that changes on the left.
I thought this was controlled by the node PublishingPreviewImage in the xml of the layout. I have verified that the image exists in that place.
It is not working.
The code I use is:
<File Path="TituloTextoCtrl.aspx" Url="TituloTextoCtrl.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists ="TRUE">
<Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/titulotextoctrl.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/titulotextoctrl.png" />
<Property Name="MasterPageDescription" Value="Plantilla Titulo+Texto+Control" />
<Property Name="ContentType" Value="Titulo+Texto+Control" />
<Property Name="PublishingAssociatedContentType" Value=";#Vialibre_ContentTypeGeneral;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39005215cca003b74e479baa123eb1dc5702;#" />
</File>
You also need XML to provision the image:
<Module Name="MyPreviewImages" Url="_catalogs/masterpage" IncludeFolders="??-??" Path="" RootWebOnly="TRUE">
<File Url="titulotextoctrl.png" Name="Preview Images/titulotextoctrl.png" Type="GhostableInLibrary">
</File>
</Module>
first of all upload yor layout page image in site collection document library or picture libary. Then Go to site actions--> site settings-->Galleries-->master pages and pagelayouts-->. In pagelayouts you can see your new layoutpage.
choose edit properties of your layoutpage there you can see the properties of that layout page. There is one column called preview image, give the url of image there that you already uploaed in the docu libary. click on Ok, now you have got preview image of your layout page.
Thx to Rich Bennema and Hojo for answering, there are right, but at the same time, my problem is that this layouts were deployed, and when I deploy again changing the PublishingPreviewImage, the layout is not updating. So my problem was a problem of controlling events so that everytime that I deploy the layouts are recreated in case there is changes.
This I know because it has worked for new layouts.
So for those who try this. Use the code I have provided with the one of Rich Bennema to upload the image.