Programmatically change widget title in IBM Connections - ibm-connections

I'am trying to programmatically change a widget title in Connections. I use the following REST end-point:
/communities/service/atom/community/widgets?communityUuid=xyz&widgetInstanceId=xyz
Using the following PUT:
<?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<title type="text">Bestandjes</title>
<category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="widget">
</category>
<snx:widgetDefId>Files</snx:widgetDefId>
<snx:widgetInstanceId>Wfa656aa9103e_41d2_a7fc_44e84d642aa4</snx:widgetInstanceId>
<snx:hidden>false</snx:hidden>
<snx:location>col2</snx:location>
</entry>
With the WidgetInstanceId and communityID as a parameter. After the PUT is being executed, no error did occur but the title stays the same. Any suggestions?

You should be able to get this working by adding the following:
<snx:customTitle>TestChangeBookmarks</snx:customTitle>
i.e.
<?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<title type="text">Bookmarks</title>
<category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="widget">
</category>
<snx:customTitle>TestChangeBookmarks</snx:customTitle>
<snx:widgetInstanceId>W127627423458_49a0_bba1_af9bbf24d395</snx:widgetInstanceId>
<snx:hidden>false</snx:hidden>
<snx:location>col2</snx:location>
</entry>
*Note the element should contain the current title of the widget before making changes.
*Note is ignored for PUT request, therefore it is not needed.
More information on the widget entry elements can be found here:
https://www-10.lotus.com/ldd/lcwiki.nsf/xpAPIViewer.xsp?lookupName=IBM+Connections+5.0+API+Documentation#action=openDocument&res_title=Working_with_community_widgets_ic50&content=apicontent
Updated Community Widget Title

Related

Filtering XML via XMLFilter in Excel, but wrong XPath

I have an XML from which I want to filter the Title and EMail.
This is the XML:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xml:base="https://mysite/vis/_api/">
<id>https://mysite/vis/_api/Web/GetUserById(1284)</id>
<category term="SP.User" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/GetUserById(1284)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Groups" type="application/atom+xml;type=feed" title="Groups" href="Web/GetUserById(1284)/Groups" />
<title />
<updated>2020-01-15T18:23:48Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">1284</d:Id>
<d:IsHiddenInUI m:type="Edm.Boolean">false</d:IsHiddenInUI>
<d:LoginName>i:0#.w|opmain\xespsa</d:LoginName>
<d:Title>Alex, Johnson</d:Title>
<d:PrincipalType m:type="Edm.Int32">1</d:PrincipalType>
<d:Email>Alex.Johnson#stackoverflow.net</d:Email>
<d:IsSiteAdmin m:type="Edm.Boolean">false</d:IsSiteAdmin>
<d:UserId m:type="SP.UserIdInfo">
<d:NameId>s-1-5-21-1377870913-3677095212-3270174719-20443</d:NameId>
<d:NameIdIssuer>urn:office:idp:activedirectory</d:NameIdIssuer>
</d:UserId>
</m:properties>
</content>
</entry>
I tried using the XMLFILTER function from Excel, but my XPath is wrong:
=XMLFILTERN(E4;"//content/title[1]")
How can I get the correct xpath in this case since Title is inside content?
TLDR/from comments: Excel doesn't care about namespaces. Reuse the prefixes in the source XML and ignore the default namespace...
//content/m:properties/d:Title
It's probably because your XML has namespaces.
content is in the default namespace http://www.w3.org/2005/Atom.
properties is in the namespace http://schemas.microsoft.com/ado/2007/08/dataservices/metadata bound to the prefix m.
Title is in the namespace http://schemas.microsoft.com/ado/2007/08/dataservices bound to the prefix d.
I'm not sure how Excel/XMLFILTER handles namespaces in XPath (hopefully someone answers that does), but ideally you'd bind those namespace uris to prefixes and use the prefixes in the XPath.
If you can't, you'll probably have to resort to using local-name()...
//*[local-name()='content']/*[local-name()='properties']/*[local-name()='Title']
If there's a possibility of elements with the same local name, but different namespaces (and you need to distinguish between them), you can also use namespace-uri()...
//*[local-name()='content' and namespace-uri()='http://www.w3.org/2005/Atom']/*[local-name()='properties' and namespace-uri()='http://schemas.microsoft.com/ado/2007/08/dataservices/metadata']/*[local-name()='Title' and namespace-uri()='http://schemas.microsoft.com/ado/2007/08/dataservices']
Of course this is all assuming that those two XPath 1.0 functions are supported.
For the xPath argument in Excel, you should use the namespace:
The full path:
//content/m:properties/d:Title
//content/m:properties/d:Email
In your particular instance, you can more simply use:
//d:Title
//d:Email

Problem with style validation in geoserver

Try to set a style in geoserver styles editor.
but the validation fails
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>capitals</Name>
<UserStyle>
<Name>fix_histogram</Name>
<Title>Fix Histogram</Title>
<FeatureTypeStyle>
<Rule>
<Title>Capitals</Title>
<RasterSymbolizer>
<ContrastEnhancement>
<Normalize>
<VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
<VendorOption name="minValue">50</VendorOption>
<VendorOption name="maxValue">100</VendorOption>
</Normalize>
</ContrastEnhancement>
</RasterSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
line 19: cvc-complex-type.2.1: Element 'Normalize' must have no character or element information item [children], because the type's content type is empty.
but this code was taken from the example for RasterSymbolizer:
https://docs.geoserver.org/latest/en/user/styling/sld/reference/rastersymbolizer.html
Thanks,
It is possible that the schema that the editor is using has not been updated to recognise the vendor options you are using.
Does the style work if you apply it?

My first gmail gadget isn't showing

I'm trying to add a sidebar gadget to Gmail using the guidance given in https://developers.google.com/gmail/sidebar_gadgets. To get started, I've taken a copy of the Hello World file, changed the text a bit and placed it in http://bachtrack.com/mygooglegadget.xml. I've added it to the list of gadgets in my Gmail settings, as specified - it's visible on the settings page.
Trouble is, nothing else happens at all. There's no visible gadget anywhere in my sidebar as a result of this, in any of a variety of screens.
What am I doing wrong? Here's the code - I really don't think I changed anything other than the text, and it appears to parse OK...
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Google gadget example from Bachtrack" />
<Content type="html">
<![CDATA[
Hello from my Bachtrack Gmail gadget!
]]>
</Content>
</Module>
By the way, I think this is the same as the unanswered https://stackoverflow.com/questions/21378334/gmail-gadget-doesnt-appear-sidebar but I'm posting it separately to include the tag google-bigquery.

Access 2010 Web Database - Update textbox value from local variable?

How do I change a textbox value to the one I have in a local variable?
I have expression builder and macros - but not the VBA macros as there seems to be no way of having VBA macros on access web forms.
You can use a macro to set the value of a control on a web form to a local variable.
Here is a basic example (Access 2010 macros are written in XML). There are two code blocks - one that sets the local variable, and one that sets the value of the text box.
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application">
<UserInterfaceMacro For="cmdSetTxt2LocVar" Event="OnClick">
<Statements>
<Action Name="SetLocalVar">
<Argument Name="Name">LocVar</Argument>
<Argument Name="Expression">'foo'</Argument>
</Action>
</Statements>
</UserInterfaceMacro>
</UserInterfaceMacros>
And:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application">
<UserInterfaceMacro For="cmdSetTxt2LocVar" Event="OnClick">
<Statements>
<Action Name="SetProperty">
<Argument Name="ControlName">test</Argument>
<Argument Name="Property">Value</Argument>
<Argument Name="Value">LocVar</Argument>
</Action>
</Statements>
</UserInterfaceMacro>
</UserInterfaceMacros>
For a basic overview of UI macros, watch this video: http://office.microsoft.com/en-us/access-help/video-create-a-user-interface-ui-macro-VA101814109.aspx
For more information about SetProperty, see http://msdn.microsoft.com/en-us/library/ff194340.aspx

ContentType DocumentTemplate not found in a List

I have the following Feature:
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="9A3C5D02-A2EB-4725-97F7-CDA6DE319F1B"
Title="My Custom Types"
Scope="Site"
DefaultResourceFile="core"
Hidden="TRUE"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="Elements.xml" />
<ElementFile Location="templates/MeetingMinutes.docx" />
</ElementManifests>
</Feature>
Which contains the following Elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Templates" Url="_cts/Meeting Minutes" Path="templates" RootWebOnly="TRUE">
<File Url="MeetingMinutes.docx" Type="Ghostable" />
</Module>
<ContentType
ID="0x01010066DD088A6B8B46BCA775CCD119FBB3E8"
Name="Meeting Minutes"
Group="Custom Content Types"
Version="0">
<FieldRefs />
<DocumentTemplate TargetName="MeetingMinutes.docx"/>
</ContentType>
</Elements>
I then use this ContentType within a custom List Template:
<ContentTypes>
<ContentTypeRef ID="0x0101">
<Folder TargetName="Forms/Document" />
</ContentTypeRef>
<ContentTypeRef ID="0x01010066DD088A6B8B46BCA775CCD119FBB3E8">
<Folder TargetName="Forms/Document" />
</ContentTypeRef>
<ContentTypeRef ID="0x0120" />
</ContentTypes>
I deploy the solution, activate the feature, and create an instance of the List Template. I go into the library and select Settings > Document Library Settings > Content Types: Meeting Minutes > Parent: Meeting Minutes > Advanced settings. I'm now in the Advance Settings of the Site Content Type. The URL of the existing document template is MeetingMinutes.docx and there is an (Edit Template) link which points to http://myserver/sites/testsite/_cts/Meeting%20Minutes/MeetingMinutes.docx. Everything's shiny.
But, I hit the back button two times so I'm back in the settings of the List Content Type. This time when I click Advance settings, the URL of the existing document template is still MeetingMinutes.docx, but there is no (Edit Template) link. Troubling.
Pressing on, I go back to AllItems.aspx and click New > Meeting Minutes. As Word is loading, I see a little Opening dialog which says, Opening: http://myserver/sites/testsite/Shared%20Documents/Forms/Document/MeetingMinutes.docx, to which Word responds: "Word was unable to read this document. It may be corrupt."
So the Document Template works correctly in the Site Content Type (where it does me no good), but is not working in the List Content Type (where I really need it). Now, I know I could put this in _layouts, but from what I've read, _cts is the way to do it. What am I doing wrong?
Rich, I'm not exactly sure what's going on because I created a feature using your feature and elements files as you specified and it works correctly for me.
There is one difference though.
When I create a new document in the library from the content type, the template url is
http://myserver/sites/testsite/Shared%20Documents/Forms/Meeting Minutes/MeetingMinutes.docx
Not
http://myserver/sites/testsite/Shared%20Documents/Forms/Document/MeetingMinutes.docx
Somehow your content type seems to be looking in the wrong folder for the template. I hope that gives you some clues.
I had the same exact problem with document template for List Content Type.
What I did is just what SharePoint do when you create your library from web site : duplicate the document template inside the “Forms” folder of the library in a subfolder that have the same name than the content type.
You just need to add a module element somewhere in your project :
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="MeetingMinutesListInstanceTemplate" Url="Shared Documents/Meeting Minutes" Path="templates" RootWebOnly="TRUE">
<File Url="MeetingMinutes.docx" Type="Ghostable" />
</Module>
</Elements>
It worked for me.

Resources