CruiseControl.Net (CC.Net) - Change made to existing .xml files to assist ccnet config doesn't load for email publishers - cruisecontrol.net

As part of my new role I've been given at work, I have a CC.Net build server that has multiple project configured in a way that the main ccnet config file references xml files for each individual project and each holds the steps/script to build that project.
I tried to add a couple of new email addresses following exactly the same syntax for the already present email addresses using new lines, but when I stop and start the cc.net service and build that project from the dashboard, the emails are still not sent to these email addresses. These new email addresses should gets email being set as buildmaster roles in either case of failure or successful builds. The old email addresses that were already there are still getting the emails.
Seems like a matter of the new changes not being loaded onto CC.net. SOS!
Here is a sample of the code block:
<email mailport="25" includeDetails="TRUE" useSSL="FALSE">
<from>CruiseControl.NET-xxxxxxxx#xxxxxx.com</from>
<mailhost>xxxxxxx.xxxxxx.com</mailhost>
<users>
<user name="xxxx" group="buildmaster" address="xxx#xxx.com"/>
<user name="xxxx" group="buildmaster" address="xxx#xxx.com"/>
<user name="xxxx" group="buildmaster" address="xxx#xxx.com"/>
<user name="xxxx" group="buildmaster" address="xxx#xxx.com"/>
</users>
<groups>
<group name="developers">
<notifications>
<notificationType>Failed</notificationType>
<notificationType>Fixed</notificationType>
</notifications>
</group>
<group name="buildmaster">
<notifications>
<notificationType>Always</notificationType>
</notifications>
</group>
</groups>

Double check the location of your CC.NET config file. It's not always pointing where you think it is.

//in a way that the main ccnet config file references xml files for each individual project//
When you change a "sub file", it is not picked up by the filewatcher.
Change the subfile (as you have done).
Add a carriage return or a space or a comment (or ~something~) to the ccnet.config file. (Essentially no changes, but you are resaving it).
This will trigger the filewatcher (on the ccnet.config file)......which will re-read the "subfile".

Related

Sharing a Customization File (exportedUI) with different users

I created a custom ribbon in Excel, which calls several macros in my PERSONAL.XLSB, and exported the Customization File (exportedUI) to a location on a shared file server. All of the macros are saved as .bas files, which each user imports to their Personal.XLSB before trying to use the ribbon.
Everything works fine on my computer, the ribbon is accessible and all of the buttons work. But, it throws an error when another user clicks any button to utilize the Customization File from their machine.
I opened up the exportedUI file, and noticed that every action calls the PERSONAL.XLSB, which is saved on my local machine as:
C:\Users\my.name\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.XLSB...
This of course, does not work when other users have it saved as:
C:\Users\their.name\AppData\etc...
My only idea for a work-around right now, is to create a distinct exportedUI file for each user, but that can be quite laborious and messy, especially if I'd like to make modifications to any of the code in the future. I'd really like one file that can be shared with each user.
Is there a cleaner way to share a custom ribbon with other users on their machines? One file that each user can use?
Or am I stuck trying manipulate a file to coincide with a unique version for each user (probably through a text editor using a python script)???
I think you should be distributing the code via Excel Add-In file (.xlam).
You can attach a Ribbon to the Add-in itself, which isn't visable, much like the Personal.xlsb.
See Ron de Bruin's Change the Ribbon in Excel 2007-2016.
Just copy your code to a new file, rename it as a Excel Add-in (warning it will change your path every time you choose add-in from the drop down) and use the Custom UI Editor to create the Ribbon menu (which doesn't require a full file path).
End users can either just open the add-in file when they want to use your menus/code, or they can add it to their installed add-ins which start with Excel.
Edit...
Here is a sample UI XML from one of my add-ins. Using <ribbon startFromScratch="false"> with a namespace (nsCompany) allows me to have multiple add-in files add more buttons/menus to the same Ribbon.
<?xml version="1.0" encoding="utf-8" ?>
<!-- Ribbon for 2007+ -->
<customUI onLoad="Engineering Tools.xlam!EngRibbon.RibbonOnLoad" xmlns="http://schemas.microsoft.com/office/2006/01/customui" xmlns:nsCompany="Company Tools">
<ribbon startFromScratch="false">
<tabs>
<tab idQ="nsCompany:CompanyTab" label="Company" keytip="C">
<group id="ENGGroup1" label="PBS">
<button id="ENGButton11" label="Project Analysis" imageMso="ImportExcel" size="large" onAction="Engineering Tools.xlam!EngRibbon.USER_ImportMLBOM" getEnabled="Engineering Tools.xlam!EngRibbon.GetEnabled" tag="EngTool" keytip="I" />
<button id="ENGButton12" label="Login" imageMso="ServerConnection" size="large" onAction="Engineering Tools.xlam!EngRibbon.USER_Login" getEnabled="Engineering Tools.xlam!EngRibbon.GetEnabled" tag="EngTool" keytip="L" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

Why does my Sharepoint WebPart deploy (nominally), but is still not available for adding to a page/form?

I've created and "deployed" my latest Web Part (Visual Studio grins from ear-to-ear, and tells me, "Deploy succeeded").
But when I go to our Sharepoint site, and my "sandbox" page, and Edit it, I do not see the WebPart. As the Elements file shows, it should be available from the "Financial Affairs Forms" category:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="PostTravelExpenseWebPart" List="113" Url="_catalogs/wp">
<File Path="PostTravelExpenseWebPart\PostTravelExpenseWebPart.webpart" Url="PostTravelExpenseWebPart.webpart" Type="GhostableInLibrary" >
<Property Name="Group" Value="Financial Affairs Forms" />
</File>
</Module>
</Elements>
However, that category is devoid of the "PostTravelExpenseWebPart" I expect (or at least hope) to see there:
What might I be omitting?
UPDATE
I even went so far as to, while in Edit mode on the Web Page, expand the "Upload a Web Part" section below "Categories" after selecting one of the "Add a Web Part" links. I didn't know exactly what to upload (when browsing for a file, the File Dialog doesn't clue you in on what file extension it expects), so I, on a flayer, tried uploading PostTravelExpense.ascx
It accepted it without balking, but I do not see it anywhere (nor do I know why just the *.ascx file would be enough, but again, which file does it expect?) It doesn't allow me to upload the entire project folder.
UPDATE 2
In response to the comment below, note that The project's Assembly Deployment Target" property is set to GlobalAssembyCache
By comparing a working project with this one, I was finally able to get it to deploy without the "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." add-time error msg.
What I had to do was check every place in the working project where the primary namespace was referenced, and make sure that the corresponding namespace in the previously-unworking project was referenced in those same places
This required not only changing some of the files visible in Visual Studio's Solution Explorer treeview, but also two that I only was able to load into the editor by searching for strings they contained, specifically:
The ***.spdata** file, which I loaded up by searching for "SafeControl"
**Assembly.Info**, which I loaded up by searching for "AssemblyTitle"
That sure was a lot of hand-wringing and head-banging and pitiful whin[g]ing for something that one would think would automatically be taken care of by the IDE - when a namespace changes, make all the necessary changes, or at least notify the coder and offer to do so! Or, barring that, at the very least give him a better clue than "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." when the WebPart to be plopped onto the page proves unploppable.

Struts2 Freemarker XSS Vulnerability

In my application we use the struts URL tag in our freemarker templates like this:
<s.url action="struts-action-name"/>
The issue is that instead of appending the action url to the root url of the application it actually appends it to the current URL.
Say we hit www.example.com/community/examples/xss187ba"><ScRiPt>alert(1)</ScRiPt>506d1768713/career_development, and in the ftl for that page we have a form like this:
<form action="<s.url action="struts-action-name"/>">
The rendered ftl would look like this:
<form action="/community/examples/xss187ba"><ScRiPt>alert(1)</ScRiPt>506d1768713/career_development">
Which causes an alert to popup... has anyone dealt with this issue? Is this a bug in Struts or are we doing something wrong here?
The obvious fix is to use the URL tag like this:
<form action="<s.url value="/struts-action-name.jspa"/>">
On the other hand a quick search shows 2500 uses of that tag in the project and refactoring all those would not be a very fun/efficient job :(
Any help, comments or suggestions would be highly appreciated.
-Andre
The url tag doesn't "append" to anything--it creates a URL relative to the application, in this case based on a configured action name. Assuming an action named "f1" and a root deployment the only thing the tag would produce is an absolute URL /f1.action (or `/f1' with no extension).
Given:
<struts>
<constant name="struts.devMode" value="true"/>
<constant name="struts.action.extension" value=",,action"/>
<package name="default" namespace="/" extends="struts-default">
<action name="f1" class="radios.RadioAction" method="input">
<result name="input" type="freemarker">/WEB-INF/radios/input.ftl</result>
</action>
...
The FreeMarker fragment:
<#s.url action="f1"/>
will output:
/f1
You may need to provide more info: are you using specific plugins (like Convention), etc?
You could extend org.apache.struts2.views.jsp.URLTag and replace the exiting or add a new tag in struts-tags.tld.
I do find it weird that it does not automatically url-encode those parts of the URL, as that's what I would expect it to do.
So I would consider this a bug. Maybe contact the Struts developers about this one. Most of their other tags do automatic encoding, so it's weird that this one doesn't.

Magento Content Block Question

Noob Question here. I have created and successfully added an additional Page Layout to the existing theme on a client's website.
I then checked what was going on in the content area and found that a file, named grouped.phtml was being called.
The Problem:
I want to duplicate that file and call it (for example) grouped2.phtml and add it to my custom page layout, while keeping the first file (grouped.phtml) alone. How do I do this? Thank you ahead of time.
Copy grouped.phtml from base/default/template/catalog/product/view/type/ to grouped2.phtml in the same directory of your theme. Edit it as you wish.
Open up layout/catalog.xml in your theme. Find the lines that say
<block type="catalog/product_view_type_grouped" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml">
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"/>
</block>
Duplicate those lines with your grouped2.phtml
done.
======EDIT===========
If you wish to retain the standard grouped.phtml as the default, but use your grouped2.phtml in some specific instances, you can make XML layout changes in the "Custom Layout Update" field on the Design tab of the specific products or categories in the Magento Admin. In that case, use the following XML:
<remove name="product.info.grouped"/>
<block type="catalog/product_view_type_grouped" name="product.info.alternative.grouped" as="product_type_data" template="catalog/product/view/type/grouped2.phtml">
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"/>
</block>
Note that the inserted XML has a different name.

Adding a Content Type to all Document Libraries

We have hundreds of document libraries, spread all throughout various site collections in a MOSS 2007 SharePoint site.
The problem is, that I want to add Content Type to show up in addition to the "New Document" and "New Folder" content types: the "Link to a Document" content type (0x01010A). This new content type should should up for all existing and new document libraries.
What I've tried:
I thought that I would be able to add the following to a schema.xml somewhere inside the <ContentTypes></ContentTypes> node:
<!-- Link to Document Content Type -->
<ContentTypeRef ID="0x01010A" />
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\Publishing\Pages\schema.xml
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\DocumentLibrary\DocLib\schema.xml
This seems to have added the content type to the libraries OK, but it doesn't show up under the New menu (still just displays the "Document" and "Folder" content types). If I set "Allow management of content types?" to "Yes" then it shows up.
tl;dr
Q: How do I add the "Link to a Document" content type to all document libraries and have it show up in the New menu?
If you're comfortable with the SharePoint object model, it's possible to add a content type to a list or library programmatically. So you could write a feature receiver or even just a console application to be run on the server that would iterate through all lists within a site and add the content type.
Your code would look something like:
void AddContentTypeToList(string contentTypeId, SPSite site, SPList list)
{
SPContentTypeId ctid = new SPContentTypeId(contentTypeId);
SPContentType ct = site.RootWeb.ContentTypes[ctid];
if (list.ContentTypes[ct.Name] == null)
{
list.ContentTypes.Add(ct);
list.Update();
}
}
To manage buttons in new menu, use SPFolder.UniqueContentTypeOrder property (SPList.RootFolder.UniqueContentTypeOrder will get you there).
To add Content Type to new libraries... hmm... maybe create new List Definition, add a feature that deactivates document library and activates your custom document library feature? Probably too much effort if you have to modify existing, production SharePoint web's.
By the way it is not wise to modify built - in features (update's can overwrite them). There is a ContentTypeBinding feature element for this purpose. However it just binds ContentType to 1 list.
After doing some more investigation, I found out that by changing ..\12\TEMPLATE\FEATURES\DocumentLibrary\DocLib\schema.xml I could add the Link to a Document content type to all NEW document libraries. Changing the schema.xml and then doing an IISRESET did not change existing libraries.
In order to do this, the beginning of my schema.xml looked something like this:
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="$Resources:shareddocuments_Title;" Direction="$Resources:Direction;" Url="Shared Documents" BaseType="1" EnableContentTypes="TRUE">
<!-- Link to Document Content Type - Added EnableContentTypes="TRUE" -->
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x0101">
<Folder TargetName="Forms/Document" />
</ContentTypeRef>
<ContentTypeRef ID="0x0120" />
<!-- Link to Document Content Type -->
<ContentTypeRef ID="0x01010A" />
</ContentTypes>
Since this didn't change existing document libraries, I will need to write a console application that uses the code specified in the other two answers to update each library.
The URL field needs to be added to the Schema.XML in the element. The source can be found in one of the source files in the Template directory (can't look it up now). Just copy-paste the element for "URL".

Resources