How do I configure Tridion Pages with Extension XML to get published to file system and rest to Broker DB? - tridion

I am trying to configure cd_storage_conf file to get the pages with extension XML to get published to file system. I am not sure what value should I give for typeMapping attribute in Item node to enable this configuration. Can anyone help?

Add an itemType element with a typeMapping of "Page" and an itemExtension attribute of ".xml" to your cd_storage_conf.xml. Be sure to do this for both your deployer and your application so that your configurations match
From the online documentation (login required): Configuring content storage
You can store specific types of Pages (that is, Web pages with
specific file extensions) in a different storage medium. To do this,
insert an Item element inside the ItemTypes element:
<Item typeMapping="Page" itemExtension=".Jsp" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID" />

Related

AEM Metadata Schema Editor Form doesn't show Asset Rating field

I'm creating new fields to customize the Assets Metadata Schema, however, there is a field missing: Asset Rating. Looking into the web I've figured out that is disabled on .jsp configuration file, so, I've enabled that (uncommenting) directly in CRX repository. However, after trying this approach the field keeps missing on the form
Obs.: I don't what means that comment
<!-- CQ-4284633 Disable ratings component in metaschema editor when skyline is enabled -->.
Are you using AEM as a Cloud Service? If so, the Asset Ratings widget is not supported in the schema editor.
From the feature parity section of the AEM Assets Cloud notable changes.

How to generate machineKey in web.config using wix?

I need to generate machineKey in my web application installer and put it into the application's web.config. How can I do this?
We need to split the answer in two:
Generate the Machine Key: You will need to implement a custom action to generate the Machine Key (There are many tutorials about creating custom actions so I won't cover that here, review the links below). The important part is the code to generate the Key, review these links: C#, Powershell. You can store the result on an installer property, you may need to make it a secure property to avoid it to apear on the installer logs.
Add the value to the Web.config: Now that you have the key, you can use some of the wix custom actions to modify the web.config, you can use XmlConfig or XmlFile. With this you will be able to modify the Xml file to add the machineKey node using the property created on the previous step. Review the links below for reference on how to use these to update the configuration file.
IMPORTANT: The machineKey element is only valid in the Web.config file at the root of your application and is not valid at the subfolder level.
Additional links:
Adding a Custom Action
Editing Web.Config Connection string settings with Wix
Custom actions with C#
How to pass parameters to the custom action?

Invalid config file in clean install - missing configuration section 'contactRepository'

I have done the following:
installed a clean Sitecore 7.5 instance
added the relevant asp.net web forms controls and pages to support the site
imported and published a content tree from an old application
Visiting the base site url yields a YSOD with the error message:
Could not find configuration node: contactRepository
Now I understand what this means - there's an expected configuration section that is missing. Adding an empty element contactRepository yields an expected message that this section is not defined.
What is contactRepository, what is its associated configuration section type, what is it for and what values should be specified in it? Alternatively, how can I turn off whatever demands this section to be present?
edit #1:
In the Sitecore.Analytics.config file in the node there are the following two lines:
<!--This configuration node is obsolete and will be removed in a future version of Sitecore. Use "contactRepository" node to get access to Contact repository-->
<contactRepository ref="contactRepository"/>
The comment is total gibberish. Which node? 'Use' how? 'get access' in what sense? How is this different to what's there?
replacing with an empty <contactRepository> without the ref attribute, commenting out this node, both nodes, and the whole tracking node makes no difference to the application's behaviour.
Looking at my local Sitecore 7.5 setup the Contact Repository settings should be in your Sitecore.Analytics.config.
The contacts repository settings relate to the new xDB stuff.
Please ensure you have the correct Sitecore.Analytics config files for 7.5.
There should be around 15 config files with new settings for xDB.
Please read this blog post for more information on the new Analytics setup.
https://www.sitecore.net/learn/blogs/technical-blogs/getting-to-know-sitecore/posts/2014/10/introducing-the-sitecore-analytics-index

Unable to access resources in .net web project

How do I access resources in a .Net Web Project. I created a web project and then in App_LocalResources folder added a resx file "AstroWap.resx". Now how do I access values from that. The property My.Resources itself is not available.
Good reference reading to use resource files here
To create an access properties - right click your solution, select properties then click the link to create a resource file. You should see a excel type grid. Type your key value pairs in there.
To access it should be
<Namespace>.Properties.Resources.<ResourceName>
The issue is probably how you have added the resource. It might have circumvented the auto generated code which gives you the above syntax
You can check if it has added the auto gen code by looking in your web project under properties -> resources.resx -> resource.cs.designer. The designer file is the autogenerated file and you can see the access code for the underlying resx file. This assumes you have used the default resx file as above. See image for example in solution explorer
In addition this SO question does give more options for accessing resx files if you have some project constraints. I appreciate not everyone can do the above due to team work practices etc.. It's just what I do. And it does work.
Use following code for it:
<%=GetLocalResourceObject("labelname")%>
in aspx page.
If your page name is Test.aspx then your resource file must have name as Test.aspx.resx, otherwise you can not access the resource file value.

File browser control to replace <input type="file">

I'm working on an ASP.NET web application for our corporate intranet users. I have a form where a user should provide a path to the file on the local network (something like "\localServer\someFolder\someFile.ext") without uploading the actual file. The issue is that users don't want to type the whole file path and want to use some kind of visual browse dialog.
The standard HTML <input type=file> element allows to browse for a file, but most of the browsers (except for IE) don't allow to access file's full path, so I think it should be done by some external component like Silverlight, Flash, Java applet etc.
I tried to do it with Silverlight, but I'm getting a SecurityException when trying to access file's full path using Silverlight's OpenFileDialog class.
This java applet http://jumploader.com/demo_images.html seems to do something similar to what I'm looking for, but it's focused on uploading files - I only need to be able to get file's full path and pass it to the server as a string.
Any suggestions would be appreciated.
Telerik ASP.NET AJAX RadFileExplorer has the functionality you're looking for:
http://www.telerik.com/products/aspnet-ajax/fileexplorer.aspx
You can use their Custom File Content Provider to hook the GUI to your server's file system.
http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/dbfilebrowsercontentprovider/defaultcs.aspx
This should be possible with Flash's uploading capabilities. SWFUpload has an API that you may be able to access from JavaScript to extract the selected file name without actually uploading anything. See docs here, for example getFile():
getFile is used to retrieve a File Object from the queue. The file retrieved by passing in a file id (the id property from a file object) or a file index (the index property from a file object).

Resources