add property to onet.xml sharepoint 2010 - sharepoint-2010

I am wondering if there is somebody who can help me with this probelm.
I want to add a property to onet.xml of my custom webtemplate. so that if you create a site from this web template the site will contain the property.
is that possible? Thank you.

Please refer this... it contains some information about onet.xml

This is also a very useful link describing how to reference properties from your custom web part. http://aarebrot.net/blog/2008/11/loading-custom-web-parts-inside-your-onet-xml/
The link explains how v3 format looks like, if you haven't noticed it is different from using v2:
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Client.Publishing.Intranet.WebParts.ClientStoryRotator,Client.Publishing.Intranet.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=320209e28e1f8058" />
<importErrorMessage>$Resources:cmscore,WebPartImportError;</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">$Resources:Client.Publishing.Intranet.Lists.Articles,list_Stories_Title;</property>
<property name="Description" type="string">$Resources:Client.Publishing.Intranet.Lists.Articles,list_Stories_Description;</property>
<property name="ListName" type="string">$Resources:Client.Publishing.Intranet.Lists.Articles,list_Stories_Title;</property>
<property name="WebName" type="string">$Resources:Client.Publishing.Intranet.SiteTemplates,webpart_Library_Url;</property>
<property name="Width" type="string">$Resources:Client.Publishing.Intranet.SiteTemplates,webpart_Stories_Width;</property>
</properties>
</data>
</webPart>
</webParts>

Related

TeamCity API method to get Slack notification info

Im trying to list my TeamCity builds in my own site with the TeamCity API to create dashboard. One feature I need is to notify the right person. To do so I set in the build setting the right Slack channel as the notification configuration.
My question is, is there a way to get this info from the TeamCity API? And if not, is there any way to get this info from other place?
Thanks!
UPD: This is how the Slack notifier is configured:
On this picture we choose the 'Slack' option in menu.
Here in bottom option we set the slack channel for this build
You get get the information about Build features via TeamCity REST API and the features will in turn contain information about configured Slack notifiers.
Example of a response for a GET request to https://<serverUrl>/app/rest/buildTypes/id:MY_BUILD_CONFIGURATION_ID:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<buildType id="MY_BUILD_CONFIGURATION_ID" name="Build configuration name" projectName="project name" projectId="PROJECT_ID" href="/app/rest/buildTypes/id:MY_BUILD_CONFIGURATION_ID" webUrl="https://<serverUrl>/viewType.html?buildTypeId=MY_BUILD_CONFIGURATION_ID">
...
<features count="1">
<feature id="BUILD_EXT_63" type="notifications">
<properties count="11">
<property name="branchFilter" value="+:<default>
+:br_name"/>
<property name="buildFinishedFailure" value="true"/>
<property name="buildFinishedSuccess" value="true"/>
<property name="firstSuccessAfterFailure" value="true"/>
<property name="notifier" value="jbSlackNotifier"/>
<property name="plugin:notificator:jbSlackNotifier:addBranch" value="true"/>
<property name="plugin:notificator:jbSlackNotifier:addBuildStatus" value="true"/>
<property name="plugin:notificator:jbSlackNotifier:channel" value="#slack-channel-name"/>
<property name="plugin:notificator:jbSlackNotifier:connection" value="PROJECT_EXT_10"/>
<property name="plugin:notificator:jbSlackNotifier:maximumNumberOfChanges" value="10"/>
<property name="plugin:notificator:jbSlackNotifier:messageFormat" value="verbose"/>
</properties>
</feature>
</features>
...
</buildType>
The property you are interested in is plugin:notificator:jbSlackNotifier:channel

Jackrabbit Indexing Config Whitelisting (Magnolia CMS 5.5.5 Fulltextsearch)

I want to do a whitelisting of what properties are indexed/searched and shown in excerpt with a Magnolia search.
I am changing the indexing_configuration.xml in my website workspace.
Removing the index and restarting magnolia did not change anything...
By now I have this in my indexing_configuration.xml (next to other stuff)
but these are the String properties I want to include in my ecxcerpt the rest should be excluded:
<index-rule nodeType="nt:hierarchyNode">
<property boost="10" useInExcerpt="true">introTitle</property>
<property boost="1.0" useInExcerpt="true">introAbstract</property>
<property boost="1.0" useInExcerpt="true">contentText</property>
<property boost="1.0" useInExcerpt="true">subText</property>
<property boost="10" useInExcerpt="true">title</property>
<!-- exclude jcr:* and mgnl:* properties -->
<property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">.*:.*</property>
</index-rule>
<index-rule nodeType="mgnl:contentNode">
<property boost="5" nodeScopeIndex="false" useInExcerpt="true">introTitle</property>
<property boost="2" nodeScopeIndex="false" useInExcerpt="true">introAbstract</property>
<property boost="2" nodeScopeIndex="false" useInExcerpt="true">contentText</property>
<property boost="2" nodeScopeIndex="false" useInExcerpt="true">subText</property>
<property boost="5" nodeScopeIndex="false" useInExcerpt="true">title</property>
<!-- exclude jcr:* and mgnl:* properties -->
<property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">.*:.*</property>
</index-rule>
How can i get this to work as intended? Thanks for your help..
Most likely cause is that Magnolia/JR is not seeing your new configuration. Did you change your repo configuration (workspace.xml in website workspace) to point it to new index configuration?
Default looks like:
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index" />
<!-- SearchIndex will get the indexing configuration from the classpath, if not found in the workspace home -->
<param name="indexingConfiguration" value="/info/magnolia/jackrabbit/indexing_configuration.xml"/>
and you need to point it to your new file.
Also not sure why you are setting indexing based on nt:hierarchyNode or mgnl:contentNode rather then using more specific mgnl:page/mgnl:component

Payara setup together with sniffy profiler

I'm trying to profile application running on Payara server with Sniffy profiler.
Maven dependency is added and file web.xml is modified according to the documentation.
I have added sniffy.jar to the payara\payara41\glassfish\domains\domain1\lib\ folder.
I have modified glassfish-resources.xml file as follows:
<resources>
<jdbc-resource enabled="true" jndi-name="jdbc/Agenda" object-type="user" pool-name="AgendaPool">
<description/>
</jdbc-resource>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="oracle.jdbc.pool.OracleDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="AgendaPool" non-transactional-connections="false" ping="false" pool-resize-quantity="2" pooling="true" res-type="javax.sql.DataSource" statement-cache-size="0" statement-leak-reclaim="false" statement-leak-timeout-in-seconds="0" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="URL" value="sniffer:jdbc:oracle:thin:#localhost:1521:XE"/>
<property name="User" value="XXX"/>
<property name="Password" value="XXX"/>
<property name="driverClass" value="io.sniffy.MockDriver"/>
</jdbc-connection-pool>
</resources>
I'm able to see HTTP methods response times but not queries response times:
No query response time.
Is my configuration correct? Why there are no response times for executed queries?
Sniffy doesn't work with oracle.jdbc.pool.OracleDataSource
See more details in this question: Invalid Oracle URL specified with Sniffy

Setting up NHibernate Velocity Cache on Azure

I am attempting to set up 2nd level caching for NHibernate 3.2 with Windows Azure Caching. So far, using https://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/, I have setup Azure caching in my web.config :
<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
...
<dataCacheClients>
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="App.UI" />
</dataCacheClient>
I then downloaded and added the Velocity cache provider DLLs from http://sourceforge.net/projects/nhcontrib/files/NHibernate.Caches/3.2.0.GA_for_NH3.2.0GA/
Finally, my hibernate.cfg.xml is:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
...
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache" >true</property>
<property name="cache.provider_class">NHibernate.Caches.Velocity.VelocityProvider, NHibernate.Caches.Velocity</property>
</session-factory>
</hibernate-configuration>
UPDATE
Solved, the dependency issue, I now get an error
{"ErrorCode:\"dcacheClient\" tag not specified in the application configuration file. Specify valid tag in configuration file."}
Thank you

Apache cxf using XSLTJaxbProvider as a JAXRSDataBinding

(apologies for broken links at stackoverflow limits new users to 2 in one post!)
I've scaffolded a web service server using Spring STS and MyEclipse for spring and was interested in transforming the out going soap message.
First thing I wanted to transform was the namespace prefixing so my spring config looked like this
<jaxws:endpoint xmlns:tns="ttps://etc etc">
<jaxws:dataBinding>
<ref bean="data-binding"/>
</jaxws:dataBinding>
</jaxws:endpoint>
<bean ref="data-binding" class="org.apache.cxf.jaxb.JAXBDataBinding">
<property name="namespaceMap">
<map>
<entry>
<key>
<value>ttp://thing</value>
</key>
<value>BeepBeep</value>
</entry>
</map>
</property>
</bean>
this worked fine and my soap message was outputted completely and correctly.
<as>
<b>
<stuff/>
</b>
<c>
<more stuff/>
</c>
</as>
Second I need to change the soap xml but more than the transform features at http://cxf.apache.org/docs/transformationfeature.html allowed
so I read up about the XSLTJaxbProvider at http://cxf.apache.org/docs/jax-rs-advanced-xml.html and plugging in a rs provider to a ws binding at ttp://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-CXFDataBindingsasJAXRSproviders to create the following config
<jaxws:endpoint xmlns:tns="ttps://etc etc">
<jaxws:dataBinding>
<ref bean="jaxrs-data-binding"/>
</jaxws:dataBinding>
<bean id="jaxrs-data-binding" class="org.apache.cxf.jaxrs.provider.JAXRSDataBinding">
<property name="namespaceMap">
<map>
<entry>
<key>
<value>ttp://thing</value>
</key>
<value>BeepBeep</value>
</entry>
</map>
</property>
<property name="provider" ref="xsltProvider"/>
<bean id="xsltProvider" class="org.apache.cxf.jaxrs.provider.XSLTJaxbProvider">
<property name="outTemplate" value="classpath:/WEB-INF/templates/transform.xsl"/>
</bean>
now I get an JAXB Exception: Class not known to this context for classes b and c and even if I have an empty xslt stylesheet I get the xml
<as/>
I have tinkered with the config to every end and added #XmlSeeAlso all over the place to no avail.
I guess I have to ask is what I've done possible in config? The fact that it all works as expected before I try and wire in the rs provider as a ws databinding might mean it's not?
Any advice greatly appreciated. Maybe there is a better way to use xslt/manipulate the xml?
Thanks