Monday 6 September 2010

Lotus Connections 2.5 - Checking Out Configurations Don't Work For Me

I'm currently working on a requirement to add a link to the top-half of the Lotus Connections 2.5 Business Card, linking off to a separate application. Part of the requirement is to open this separate application in a new window, rather than over-writing the window in which the user is currently accessing Connections or, at least, the Business Card.

Following the Information Centre here: -

Adding third-party links via the XML configuration file

I'm directed to modify LotusConnections-config.xml *AND* service-location.xsd

Now I'm quite happy to check out the configuration files: -

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/wsadmin.sh -lang jython
execfile("/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/bin_lc_admin/connectionsConfig.py")
LCConfigService.checkOutConfig("/root","lc25Cell01")

and then hand edit LotusConnections-config.xml and service-location.xsd before checking them back in again: -

LCConfigService.checkInConfig()

and synchronise the nodes: -

synchAllNodes()

*BUT* I didn't expect the check in process to (a) not update the copy of service-location.xsd held within the cell configuration and (b) even worse, revert it back to it's pre-exported state.

The symptoms that I saw, when starting Profiles, were: -

9/6/10 15:04:11:420 BST] 0000002e VenturaConfig E com.ibm.ventura.internal.config.VenturaConfigFileValidator$DefaultContentHandler error CLFRO2024I: Error Line 142: cvc-enumeration-valid: Value 'googleService' is not facet-valid with respect to enumeration '[activities, blogs, communities, directory, dogear, personTag, presenceAwareness, profiles, sametimeLinks, homepage, quickr, search, wikis, files, global, news, mobile]'. It must be a value from the enumeration.

                                 org.xml.sax.SAXParseException: cvc-enumeration-valid: Value 'googleService' is not facet-valid with respect to enumeration '[activities, blogs, communities, directory, dogear, personTag, presenceAwareness, profiles, sametimeLinks, homepage, quickr, search, wikis, files, global, news, mobile]'. It must be a value from the enumeration.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
...

[9/6/10 15:04:11:432 BST] 0000002e VenturaConfig E com.ibm.ventura.internal.config.VenturaConfigurationProviderImpl getConfiguration CLFRO2001E: com.ibm.ventura.internal.config.VenturaConfigurationProviderImpl Error processing config file: path /opt/IBM/WebSphere/AppServer/profiles/AppSrv01//config//cells//lc25Cell01//LotusConnections-config, filename LotusConnections-config.xml
                                 com.ibm.ventura.internal.config.exception.ValidationException: cvc-enumeration-valid: Value 'googleService' is not facet-valid with respect to enumeration '[activities, blogs, communities, directory, dogear, personTag, presenceAwareness, profiles, sametimeLinks, homepage, quickr, search, wikis, files, global, news, mobile]'. It must be a value from the enumeration.
        at com.ibm.ventura.internal.config.VenturaConfigFileValidator.validateDoc(VenturaConfigFileValidator.java:118)
        at com.ibm.ventura.internal.config.VenturaConfigFileValidator.validateConfigurationFile(VenturaConfigFileValidator.java:79)
        at com.ibm.ventura.internal.config.VenturaConfigurationProviderImpl.getConfiguration(VenturaConfigurationProviderImpl.java:370)
...

Now the exception makes it quite clear - I've referenced a service called googleService which doesn't exist in service-location.xsd *because* the check-in process didn't upload the changes.

This is the "vanilla" copy of the file: -

        <xsd:simpleType name="serviceNames">
                <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="activities" />
                        <xsd:enumeration value="blogs" />
                        <xsd:enumeration value="communities" />
                        <xsd:enumeration value="directory" />
                        <xsd:enumeration value="dogear" />
                        <xsd:enumeration value="personTag" />
                        <xsd:enumeration value="presenceAwareness" />
                        <xsd:enumeration value="profiles" />
                        <xsd:enumeration value="sametimeLinks" />
                        <xsd:enumeration value="homepage" />
                        <xsd:enumeration value="quickr" />
                        <xsd:enumeration value="search" />
                        <xsd:enumeration value="wikis" />
                        <xsd:enumeration value="files" />
                        <xsd:enumeration value="global" />
                        <xsd:enumeration value="news" />
                        <xsd:enumeration value="mobile" />
                </xsd:restriction>
        </xsd:simpleType>

and this is my edited version: -

        <xsd:simpleType name="serviceNames">
                <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="activities" />
                        <xsd:enumeration value="blogs" />
                        <xsd:enumeration value="communities" />
                        <xsd:enumeration value="directory" />
                        <xsd:enumeration value="dogear" />
                        <xsd:enumeration value="personTag" />
                        <xsd:enumeration value="presenceAwareness" />
                        <xsd:enumeration value="profiles" />
                        <xsd:enumeration value="sametimeLinks" />
                        <xsd:enumeration value="homepage" />
                        <xsd:enumeration value="quickr" />
                        <xsd:enumeration value="search" />
                        <xsd:enumeration value="wikis" />
                        <xsd:enumeration value="files" />
                        <xsd:enumeration value="global" />
                        <xsd:enumeration value="news" />
                        <xsd:enumeration value="mobile" />
                        <xsd:enumeration value="googleService" />
                </xsd:restriction>
        </xsd:simpleType>

Once I realised, all was well.

For the record, here's the entry that I added into LotusConnections-config.xml as per the Information Centre: -

<sloc:serviceReference serviceName="googleService"
  href="http://www.google.com"   enabled="true"
  ssl_href="http://www.google.com"   ssl_enabled="false"
  person_card_service_url_pattern="/search?hl=en&amp;q={email}&amp;btnG=Google+Search"
  person_card_service_name_js_eval="'Google Me'"/>

I'll keep hacking away to achieve my objective of opening the Google service in a new window, and report back.

8 comments:

Erik Sorensen said...

hey David - is there a way to define another serviceReference, but to restrict access to it somehow? (e.g. an iNotes service only accessible to people with mail setup)

Dave Hay said...

@Erik - I've not seen that particular requirement before; on my current project, we're looking at mapping JEE roles to certain user groups ( in Active Directory ) and/or using servlet filters. Can you expand upon the requirement further ? If needed, please email me to david_hay@uk.ibm.com, or ping me on Skype - david_hay

Erik Sorensen said...

I was just customizing the navigation... adding links to some internal applications. In the same way LC shows or hides links based on whether a feature is installed and enabled or not (i.e. via ... in apps.jsp), I was wondering if I could do something similar for internal apps. For example, only HR folks would see the HR app link.

We do this today with a custom landing page app, but rolling out Connections - so trying to include same thing if possible.

Erik Sorensen said...

gah - it stripped out: c:if test="${services.wikis}"

Dave Hay said...

@Erik - thanks for the clarification; will have a chat with some smarter ( than me ) people, and see what we can do here.

Unknown said...

Hi I dunno if you find your answer about why your .xml is breaking and also if it has already been fix on the cumulative fixes, but the problem reside on the special characters on the url of the service reference, you need to escape them such as & to "&" .. without the quotes.

Hope this helps :)

Unknown said...

Ohh well the browser escaped the special character .. "&" + "#38;"
without quotemarks ..

Dave Hay said...

@Jorge - thanks for this, I'll bear your kind advice in mind. Regards, Dave

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...