XML Comments <list> not displaying in IntelliSense - vb.net

I am trying to get VB.NET XML Comments to work with IntelliSense, and maybe it doesn't work the way I think it does.
''' <summary>
''' Gets or sets the Patient Code.
''' <list type="bullet">
''' <listheader><description>Validation:</description></listheader>
''' <item><description>Field Required</description></item>
''' <item><description>Field Max Length: 25</description></item>
''' </list>
''' </summary>
''' <value>The region reference key.</value>
This should, when you are typing in a function, display the "Get or sets the Patient Code" then below that, it should display a list of bulleted items with "Validation:" as the header?
alt text http://www.codejames.com/errored.jpg
Maybe I am doing it wrong, but it doesn't seem to be working correctly.

You are not doing this incorrectly, it's just simply not supported. While the HTML markups may appear in the output of some tools, IntelliSense is not one of them.
IntelliSense is a textual display in Visual Studio 2008 and we do not support displaying many / most of the markups as they should appear in an HTML style display. Instead we tend to strip out the markup tags that are not supported and display the resulting text.

You can "fake" it (without the numbers) by surrounding the <description> contents with the <para> tag -- this will at least show up in Intellisense nicely spaced, but without the appropriate list delimiter (bullet, number).
<summary>
Gets or sets the Patient Code.
<list type="bullet">
<listheader><description>Validation:</description></listheader>
<item><description>Field Required</description></item>
<item><description>Field Max Length: 25</description></item>
</list>
</summary>
<value>The region reference key.</value>
If you don't care all that much about the generated output, just add your bullet in each line:
<item><description><para>* Field Required</para></description></item>
See also <list> XML Documentation
Update
Since posting this, VS2012 11.0.60610.01 Update 3 seems to have added formatting support, so you no longer need the <para> internal wrapping or adding your own bullets.

Related

OfficeJS Word Addin - Modify content control in the whole document ( including header/footer )

Due to the office API limitation ( API is only restricted to rich text content controls). We had to insert content controls as an OOXML object. It inserted the content control correctly but office API doesn’t recognize that as a content control. For example, using office API, if you call a method to get all the content controls, above content control will not be returned.
If you run following code, it will not return those content controls that were inserted like that.
// Run a batch operation against the Word object model.
Word.run(function (context) {
// Create a proxy object for the content controls collection.
var contentControls = context.document.contentControls;
}
Here is the OOXML:
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
<pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml" />
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml">
<pkg:xmlData>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml">
<w:body>
<w:sdt>
<w:sdtPr>
<w:alias w:val="[REPLACE_THIS]" />
<w:id w:val="1382295294" />
<w:placeholder>
<w:docPart w:val="4D926923E99F45DBAF2203E4FEA73047" />
</w:placeholder>
<w:dataBinding w:xpath="[REPLACE_THIS]" w:storeItemID="{AFE97E21-6B3F-435F-8566-BD38F346ABE4}" />
<w:showingPlcHdr />
</w:sdtPr>
<w:sdtContent>
<w:p>
<w:r>
<w:t>[REPLACE_THIS]</w:t>
</w:r>
</w:p>
</w:sdtContent>
</w:sdt>
</w:body>
</w:document>
</pkg:xmlData>
</pkg:part>
</pkg:package>
As Office API doesn't have any built-in methods to get these content controls and modify them. I have to read each section of the document, Get the OOXML , modify it and insert it back. Is there any other way to do this ? As this is really cumbersome and error-prone process.
I am assuming that you are using OOXML to insert other types of content controls (i.e. plain text, combo, date, etc.) and if that's the case, yes, in the content control collection we do not support, as of now, other types of content controls other than rich text. This is mostly because of a limitation in Word Online who only supports rich text as of today, and we ship APIs that can guarantee a multiplatform behavior. The plan is that when it eventually supports other types they will be included as part of the collection (hence the type property).
so, yes for now your only way out is to get the OOXML and handle the other types of control via XML. You can probably target the OOXML you get if you wrap them with a rich text content control and only getting the OOXML of the wrapper content controls.

Sitecore 7 Lucene: strip HTML from computed field

I am pasting together all "paragraph" child nodes from an "article" node in a computed field. This is to achieve that an article can be searched & found by its paragraph contents.
To achieve this, I did the following, under the <fields hint="raw:AddComputedIndexField"> node:
<field fieldName="Paragraphs" storageType="YES" indexType="TOKENIZED">
MyWebsite.ComputedFields.Paragraphs,MyWebsite
</field>
In this computed field, I concat the paragraph HTML bodies together.
I was assuming Sitecore would strip the HTML for me (like it does for rich text fields), but it does noet.
For "rich text" fields, it is probably the RichTextFieldReader that strips the HTML tags out. Decompiling the code confirms this.
The RichTextFieldReader is configured in the FieldReaders section. Trying to add a raw:AddFieldReaderByFieldNamesection below, does not seem to do anything.
The full section looks as follows, but does not work in this setup:
<FieldReaders type="Sitecore.ContentSearch.FieldReaders.FieldReaderMap, Sitecore.ContentSearch">
<mapFieldByTypeName hint="raw:AddFieldReaderByFieldTypeName">
....default stuff here...
</mapFieldByTypeName>
<mapFieldByFieldName hint="raw:AddFieldReaderByFieldName">
<fieldReader fieldName="Paragraphs" fieldReaderType="Sitecore.ContentSearch.FieldReaders.RichTextFieldReader, Sitecore.ContentSearch"></fieldReader>
</mapFieldByFieldName>
</FieldReaders>
Any other clues on how to achieve this (by config, not by using HTML agility pack etc)
The problem is the mapFieldByFieldName is expecting to match a field with that name from the Sitecore item, not a custom computed field in your index so the field reader is never called.
I don't know how to achieve this from config, but if you do not want to directly use HAP but are willing to use some code then after you paste your fields together in your computed field class just do what Sitecore does in the GetPlainText() method:
string input = "concatenated string";
return HttpUtility.HtmlDecode(Regex.Replace(input, "<[^>]*>", string.Empty));
or use the util method Sitecore.StringUtil.RemoveTags(text)

Reporting Services Error?

When running a report in preview I get the following error The definition of the report is invalid , the tablix 'Tablix11' contains an invalid TablixMember. The sort Expressions element is not allowed if Group is omitted.
I have never come across this error before and cant understand what is causing it.
The error can be replicated by creating a simple Tablix and looking at the underlying XML.
When you create a Tablix with a group, the underlying RDL XML will include something like this:
<TablixRowHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember>
<Group Name="Group1">
<GroupExpressions>
<GroupExpression>=Fields!val.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!val.Value</Value>
</SortExpression>
</SortExpressions>
<TablixMembers>
<TablixMember>
<Group Name="Details3" />
</TablixMember>
</TablixMembers>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
If you remove the entire Group element, this will give the same error you're seeing:
If you also remove the SortExpressions element this will allow the report to render without error.
However - it's impossible for me to say how your RDL file got in this state in the first place. Given that hacking XML to get things running is seldom a good idea, my recommendation would be to start the tablix from scratch instead of hacking things to a working state - you might just be introducing more problems.
But at least hopefully now you can see why the error might be occurring.
I found that the Tablix header had a textbox property containing interactive sort. This text box is in the header, and not part of the detail. When I deleted the field from the detail of the tablix, the interactive sort remained on the textbox in the header.
Changing it on the header by right clicking on the header textbox of the tablix, then selecting textbox properties, then selecting "interactive sorting", and then correcting the "sort by" value to the correct field name did the trick.

Doxygen: Empty Detail Description

Context - Doxygen tool on C codes to generated RTF documents.
In the documentation of Modules/Groups, we are getting the header "Detailed Description" even if no detail description is provided for some particular module/group.
In generated RTF document this looks ugly. Is it possible to get rid of this empty Detail Description sections?
I tried "ALWAYS_DETAILED_SEC = NO" but it is not working. I cannot do "HIDE_UNDOC_MEMBERS = YES" as the group/module contains members (struct, functions ...) which are documented.
This may be a bit late, however others may be interested (I was).
You can remove the group detailed description completely using the layout file, though if you have a brief description a More... link will still be created (which links to nothing). My solution was the disable brief description for groups and move detailed description to the top of the page (essentially replacing it).
Create a layout file by running the following command dOxygen -l. The creates the default layout file. The section we are interested in is groups, near the bottom:
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
Now set visible="yes" to visible="no" in the briefdescription field. Near the bottom of the file you will see a <detaileddescription title=""/> Move this to the top, above or below briefdescription. You should now have:
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="no"/>
<detaileddescription title="Description"/>
<groupgraph visible="$GROUP_GRAPHS"/>
Note that I've changed the title to "Description" by filling in the title field. Save the file. Now in your Doxyfile, you need to specify a custom layoutfile. Add the following line (or search for it and fill it in):
LAYOUT_FILE=DoxygenLayout.xml
Assuming your paths are correct etc, you should now have group pages with brief description replaced with the full description.
The reason as to why "Detailed Description" gets generated even if there is no Documentation in the Entities (Modules/Groups, etc..) is because the Doxyfile tag EXTRACT_ALL is set to YES.
By Setting,
EXTRACT_ALL = NO
ALWAYS_DETAILED_SEC = NO
Only the entities documented with Doxygen special comments will get Documented. And only those entities having #details -> Detailed description will be listed under the Detailed Description section.
Unfortunately it doesn't generate if the class has been documented like:
/// <summary>
/// This is..
/// </summary>
class ABC
{
}
remove the 'summary' tags, i.e. it should be like
///
/// This is..
///
class ABC
{
}
search for detailed description(at the begining) in the link below
http://www.star.bnl.gov/public/comp/sofi/doxygen/docblocks.html

Struts 2 property not being read from properties file

After following the struts 2 web pages and numerous examples, my application still will not pick up values from the struts.properties file.
I am trying this in order to give some values a money type format:
<s:property value="getText('struts.money.format',{value})" />
My struts.properties file which is under WEB-INF/classes and therefore visible has the following single line
struts.money.format= {0,number,\u00A4##0.00}
I get the string struts.money.format printed to the screen. If I change the first parameter of the getText call, the new string I put also will get printed instead of a true lookup happening.
If I do <s:property value="value" /> I will get back a proper number. If I drop the second argument on the getText call, I would expect to get back the right hand side of the assignment in the properties file, but i get the same struts.money.format back.
I am using Tomcat 6 with Struts 2.2.1.1. Is there an additional part of the puzzle I am possibly leaving out?
So in my struts.xml file, I put this line
<constant name="struts.custom.i18n.resources" value="struts" />
It needs this to know that I am trying to use a struts.properties file. I had assumed that by default a file named struts.properties was along the chain of places to look for a constant such as this. Only if you named it something else did you need to specify that. Even though it is in WEB-INF/classes which is recommended by the Struts 2 documentation, it just simply was not looking in this file.
EDIT
For what it is worth, I also had to modify my struts text tag like so
<s:property value="getText('struts.money.format',{#java.lang.Double#valueOf(value)})" />
Actually, value should have been a BigDecimal, but it was being treated at the view level here as java.lang.String. The problem is that some of the String objects had exponential formatting (like 1.642E07 or something to that effect) and the struts formatter could not handle the exponential formatting. The valueOf eliminates this exponential fomatting