AIML - Changing bot properties - aiml

I found the bot.aiml file here, and it uses things such as <bot name="genus"/>. I assume this works similar to something like <get name="name"/>, which would get the client's name. So, how would I set properties such as genus for the bot, so that I can retrieve it this way?

Suppose the bot asks you your name and when you say "MY NAME IS JACOB", you want the bot to say "I WILL REMEMBER THAT YOUR NAME IS JACOB", and set the value of variable "clientname" to "JACOB".
Add these lines to your AIML file:
<category>
<pattern>MY NAME IS *</pattern>
<template>I will remember that your name is </star><think><set name="clientname"></star></set></template>
</category>
In this, </star> tag represents whatever you will enter in the place of * (JACOB in this case).

I think the original question is about the bot's properties, not about user properties.
In AIML v1 (and v2) bot properties are retrieved using <bot name="name"/> (for example) for getting the bot's name. User properties are retrieved using <get name="name"/> and are updated using <set name="name">Fred</set> (for example). I don't think standard AIML has any means for updating the bot's properties after the bot is loaded.

Related

What does add key value means in web.config file

HI all i am trying to figure out the values and their meanings in web.config files, there are two lines which are not making sense to me if you can elaborate on this please.
<add key="Imp.Import.shops.FileLocation" value="C:\_imp\" />
<add key="Imp.Import.shops.ArchiveLocation" value="C:\_imp\_archive\" />
It just allows for many entries for a section, the key must be unique. It's typically used when there is code written to look for that exact entry, for example the appSettings section of the web/app .config files are for general use. For those values to be loaded and used you must add code to look for a specific key so there is an implied contract between adding an item in the appSettings and adding code to actually use it.
To read the setting value:
Add a reference to System.Configuration.ConfigurationManager
Code:
var archiveLocation = ConfigurationManager.AppSettings["Imp.Import.shops.ArchiveLocation"];
If you didn't write the system then you can safely assume there is code written that needs to read these settings, the key identifies the setting by name.

Sitecore ECM 2.1 - branches, sublayouts and dynamic datasources

It's my first time implementing Sitecore ECM feature. I've cut up some html templates into layouts and sublayouts, created the datasources I needed, and made a branch template with the $name item set to be of template "AB Testable message".
Following Frank Rooijen's blog post: http://www.newguid.net/sitecore/2013/building-custom-newsletter-templates-for-sitecores-ecm-2-x/ I've set the body field in the $name to go to my message root child, set all the sublayout datasources to the relevant child items of the message root.
Andit all works fine!
What I really want to know is how the sublayout's datasource paths are derived to their new location after being instantiated from the create/insert action from the ECM Speak page.
I've been using reflector to try and get some insight, but I don't think I'm looking in the right places.
The ECM package adds a new config file at /App_Config/Includes/Sitecore.EmailCampaign.config. Within that file you can see some new event handlers are added, most notably:
<event name="item:added">
<handler type="Sitecore.Modules.EmailCampaign.Core.ItemEventHandler, Sitecore.EmailCampaign" method="OnItemAdded" />
</event>
<event name="item:copied">
<handler type="Sitecore.Modules.EmailCampaign.Core.ItemEventHandler, Sitecore.EmailCampaign" method="OnMessageCopied" />
</event>
If you decompile Sitecore.EmailCampaign.dll and look at the corresponding Class and follow through the code you will see call to MessageRelationsCorrector.CorrectItemRelations() which handles all the work to replace the IDs of the DataSources of new created and copied messages.
jammykam is spot on.
The one thing that I'd add though (after banging my head for a while) is that even though the processing first does a check on template descends from AB Testable Message or the other email types, the actual correction of item relations only happens if the email template is exactly one of the built-in templates like AB Testable Message. Don't try and have you own template that derives. Sigh.

Magento - left.ptml not showing on all product list pages

left.phtml the file that displays the left navigation on a magento page is only showing on one list view page and not the others does anyone have a solution to get that file to show in all list views
If you are tasking left.phtml,
Then According magento structure left.phtml are only show for Non-Anchor category in it left side of category.
And layer navigation are only showing for Anchor category.for anchor left.phtml is not showing.
For non-Anchor categories
see catalog.xml code
<catalog_category_default translate="label">
<label>Catalog Category (Non-Anchor)</label>
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
Also for
Anchor categories
see at catalog.xml
<catalog_category_layered translate="label">
<label>Catalog Category (Anchor)</label>
<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
</reference>
Hope ,you will understand.
Check the layout in folder theme/package (it can be in default/default, when your theme is in another folder)
Check if layout is plugged (use in your layout.xml something like <remove name="header">). If header will be removed - you use correct layout
Check the handle and reference name, where you are adding block. For example: you are adding layered navigation block. On one page it placed in handle <catalog_category_layered>, but your page there no this handle. Try to add to <catalog_category_default> or even in <default>.
Open your template and check if the block was added there. Look for
<?php $this->getChildHtml('blockName'); ?>
Try to change your block name (maybe on this page already exist block with the same name)
(this option can be useless for you) Please check the block output in system / configuration / advanced
Maybe there is a conflict between two navigation modules (for example module A and module B). The module A can use it for rewrite. But the module B will use it only for investigation and use on this page it's own calls. In that case the module A will not work (to resolve this issue you need to change rewrite. class A should rewrite class B)
If you are trying to add navigation to CMS page - try to google this topic (how to add navigation to CMS page). There are many examples and I don't want to duplicate them.

Use UpdateListItems webbservice on Sharepoint using Infopath form without managed code

I need to create a Infopath form that users can use to create posts and update a Sharepoint list.
I have located the list GUID and the Lists.asmx webbservice. I have made sure that I am admin with full rights on the List in question. The list is a basic 2 column (1 line of text).
I have created the CAML template:
<?xml version="1.0" encoding="UTF-8"?>
<Batch OnError="Continue">
<Method ID="1" Cmd="New">
<Field Name="Field1"></Field>
<Field Name="Field2"></Field>
</Method>
</Batch>
Two data connections using the CAML:
XML-file - loading the CAML.
Send data using Lists.asmx-service - "UpdateListItems"-method.
The parameters for the UpdateListItems : tns:listName connected to a variable containing the GUID. tns:updates connected to /Batch in loaded CAML, XML-subtree included.
I have added a Repeating Table using the XMLfile-connection (CAML) where I can fill the column values for the new Listitem.
I have added a button that triggers action rules that use the dataconnection and "UpdateListItems"-method. The button also is tested trigger other rule actions, so the button itself works.
As I try post a new item to the sharepoint-list I receive no error message, everything seems to work fine, but no items is created.
If I change anything, like the GUID or other things, I recieve different error messages, so it appears as Infopath thinks everything works fine, but Sharepoint isn't doing anything with my list. No items is created.
Anyone has any idea of what could it be that goes wrong?
Edit: I have used other webservices from the same Sharepoint-server without any problems.
This suggestion may be a bit dated, but...
I just had a similar problem. By using ULSViewer on the SharePoint server and reading the MSDN documentation I figured out that the Name attribute in the CAML Field tag should be the internal name Sharepoint assigns to your list column when you create it. In my case I had to change the CAML from:
<Field Name="pub1">
to
<Field Name="_x0066_ub1">
I had the same problem - you have to point the Web service submit to site /_vti_bin/lists.asmx not to server /_vti_bin/lists.asmx. For example your site is on address server/site, you should use server/site/_vti_bin/lists.asmx, not server/_vti_bin/lists.asmx. My problem was with some subsites, so you could check it if it's the same to you.
When creating new items using UpdateListItem, you need to include a Field tag for the list's ID column. It should be formatted as such:
<Field Name='ID'>New</Field>
Is Title still a required column in your list (it is by default). If so, try adding that to your XML:
<Field Name='Title'></Field>
and I dont think that
<Field Name='ID'></Field>
is required when doing a NEW command (inserting a new list item), but it is required for an UPDATE command (updating an existing list item) - I certainly didnt need it when I tested this.

Sitecore media publishing to file system when not configured to do so

I have a SiteCore instance where the web.config values for media are as follows:
<setting name="Media.DisableFileMedia" value="false" />
<setting name="Media.UploadAsFiles" value="false" />
<setting name="Media.FileFolder" value="/App_Data/MediaFiles" />
<setting name="Media.UseItemPaths" value="true" />
So, this should mean that the item will be stored in the database and not the file system, correct? I ask because they are being stored on the file system, with a path that looks like this:
/App_Data/Replicated/MediaFiles/6/4/E/{64EC628B-9C94-4416-B9BD-5A90EA7D8971}220px-Liliumbulbiferumflowertop.jpg
Does anyone know why that would be? This is a small part of a larger puzzle I'm trying to understand.
I have learned that users can manually specify whether a file should be uploaded as files on the filesystem. I discovered that content editors on a site I have been developing were doing so out of habit based on past sites they had worked on. To prevent users from having this choice, you may set the Upload.UserSelectableDestination setting to false (default is true).
Media.DisableFileMedia is more to turn on or off the option of either storing the media item in SC or on the file system (in the actual SC UI)
Media.UploadAsFiles is used to indicate whether the media items are put in SC (if false) or on the file system (if true) - If you have DisableFileMedia set to true, then this is ignored and considered to be "true"
Media.FileFolder is obviously the location of where to put the files on the file system, should any the above be set to true.
Media.UseItemPaths actually has nothing to do with storing media items on the file system. It simply is a toggle between showing URLs like "~/media/[item id]" vs the full path of the media item.
I have met the same problem. After the 5 hours of investigation, i found that App_config\Include\ScalabilitySettings.config overrides the Media.FileFolder value. So disable the ScalabilitySettings.config and try again. It will store all file in the folder which was specified by the Media.FileFolder setting.
Answer for solving the problem:
disable App_config\Include\ScalabilitySettings.config or change value of Media.FileFolder in this config