alfresco passing a username to a link doclibaction - alfresco

I need to pass the username to a link in a doclibaction. I am using share alfresco 4.2.
The following section is from my share-config-custom.xml file.
<action id="document-edit-xmlapp" type="link" label="actions.document.document-edit-xmlapp">
<param name="href">http://alfresco.eb.com/oxygen-sdk-sample-webapp/app/oxygen.html?url=webdav-http://alfresco.eb.com/alfresco{webdavUrl}&showSave=true&author={?this is what I need?}</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>evaluator.doclib.action.checkInXMLEdit</evaluator>
</action>
I need to pass the username to the author query parameter. Any idea on how to do this?
Thanks
Mark

My final section of code that worked was
<action id="document-edit-xmlapp" type="link" label="actions.document.document-edit-xmlapp">
<param name="href">http://alfresco.eb.com/oxygen-sdk-sample-webapp/app/oxygen.html?url=webdav-http://alfresco.eb.com/alfresco{webdavUrl}&showSave=true&author={node.properties.modifier.userName}</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>evaluator.doclib.action.checkInXMLEdit</evaluator>
</action>

Related

Launching node of rosserial_python in gazebo launch script

I am using Gazebo simulation. I want to connect arduino to my model in Gazebo. I used following coding in the gazebo launch script:
<node pkg="rosserial_python" type="serial_node.py" name="rosserial" output="screen">
<param name="port" value="/dev/ttyACM0" />
<param name="baud" value="57600" />
</node>
when I launch the gazebo with roslaunch command the following error apeares:
ERROR: cannot launch node of type [rosserial_python/serial_node.py]: can't locate node [serial_node.py] in package [rosserial_python]
Does anybody know about my problem?
Try this:
<arg name="port" default="/dev/ttyACM0" />
<node name="serial_node" pkg="rosserial_python" type="serial_node.py">
<param name="port" value="$(arg port)"/>
<param name="baud" value="57600" />
</node>

Messages are not displayed properly after customizing Alfresco share

I want to add the action "document-edit-properties" in the folder details page. So in share-config-custom.xml I have added the action id in the actionGroup(for id =folder-details) as below. Now the action is visible in the folder details page, but the title and the "All properties" are not displayed properly in the popup.
<actionGroup id="folder-details">
<action index="100" id="folder-download"/>
<action index="105" id="document-edit-metadata" icon="folder-edit-metadata" label="actions.folder.edit-metadata" />
<action index="115" id="document-edit-properties" icon="folder-edit-properties" label="actions.folder.edit-metadata" />
<action index="110" id="document-approve" icon="folder-approve" />
<action index="120" id="document-reject" icon="folder-reject" />
<action index="130" id="document-copy-to" icon="folder-copy-to" label="actions.folder.copy-to" />
<action index="140" id="document-move-to" icon="folder-move-to" label="actions.folder.move-to" />
<action index="150" id="folder-manage-rules" />
<action index="160" id="document-delete" icon="folder-delete" label="actions.folder.delete" />
<action index="170" id="document-manage-granular-permissions" icon="folder-manage-permissions" label="actions.folder.manage-permissions" />
<action index="180" id="document-manage-repo-permissions" icon="folder-manage-permissions" label="actions.folder.manage-permissions" />
<action index="190" id="document-manage-aspects" label="actions.folder.manage-aspects" />
<action index="200" id="document-change-type" label="actions.folder.change-type" />
<action index="210" id="view-in-explorer" />
<action index="220" id="document-view-in-source-repository" label="actions.folder.view-source-repository" />
<action index="350" id="document-view-googlemaps" />
<action index="360" id="document-cloud-sync" />
<action index="370" id="document-cloud-unsync" />
<action index="380" id="document-view-in-cloud" />
<action index="390" id="document-request-sync"/>
</actionGroup>
Am unable to figure out why message is not proper. In folder browse page the messages are displayed properly.
Alfresco Version : 4.2.6
Can someone please help... Thanks in advance!
Make sure that you add a bean for your message properties and that you specify the properties and labels you need in Share. See http://docs.alfresco.com/4.2/concepts/kb-preset-internationalization.html for details.
Also, see the answer (at the bottom) of a question about some of this here https://community.alfresco.com/thread/199192-content-model-localization-in-share
So, the fix is what I suggest above. Add a bean to a context file like this
<!-- Add module specific messages and labels -->
<bean id="org.alfresco.share-amp.resources"
class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.web-extension.messages.share-amp</value>
</list>
</property>
</bean>
That bean references a properties file in web-extension/messages named share-amp.properties. It should have the following content.
## Edit Details Dialog
edit-details.title=Edit Properties: {0}
edit-details.label.edit-metadata=All Properties...
Why do you need to do this? If you look at onActionDetails in actions.js, you'll see that it's trying to resolve those and is not able to. I'm not sure why as I haven't done a lot of YUI/share customization, but what I suggest here will fix it for you.

Writing different levels to different files in log4cxx

I want to have log messages from each log level go to a different file. From the name, LevelMatchFilter seems like what I want, except it seems to not filter anything from a different level.
I think the following properties should do that using LevelRangeFilter. However, anything sent to the global logger ends up in INFO.log, regardless of the level.
log4j.rootLogger = OFF
# Global level based logs
log4j.logger.global = ALL, Info
log4j.appender.Info=org.apache.log4j.FileAppender
log4j.appender.Info.File=Logs/INFO.log
log4j.appender.Info.layout=org.apache.log4j.PatternLayout
log4j.appender.Info.layout.ConversionPattern=%d [%p] %m%n
log4j.appender.Info.filter.a=org.apache.log4j.filter.LevelRangeFilter
log4j.appender.Info.filter.a.LevelMin=info
log4j.appender.Info.filter.a.LevelMax=info
log4j.appender.Info.filter.a.AcceptOnMatch=true
I also tried using INFO for the values of LevelMin and LevelMax but that had the same results.
What am I doing wrong?
As a side question, is there a way to turn on debugging of the log4cxx configuration when using a property file? I found an option when using an xml file, but none of the obvious translations to properties (debug=true, log4j.debug=true) and any effect.
As of log4cxx 0.10 (and probably earlier), the properties format does not support filters. So the XML configuration (or programmatic configuration) is required.
<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
<appender name="Info" class="org.apache.log4j.FileAppender">
<param name="file" value="Logs/INFO.log" />
<param name="append" value="false" />
<!-- If this filter accepts the message, it will be printed. That happens if this is an info message -->
<filter class="org.apache.log4j.filter.LevelMatchFilter">
<param name="levelToMatch" value="INFO" />
<param name="acceptOnMatch" value="true" />
</filter>
<!-- If it is not an info message, this filter will reject it -->
<filter class="org.apache.log4j.filter.DenyAllFilter"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%p] %m%n" />
</layout>
</appender>
<root>
<priority value="off" />
</root>
<logger name="global">
<priority value="all" />
<appender-ref ref="Info" />
</logger>
</log4j:configuration>

Unity Interception MethodSignatureMatchingRule could not be resolved

Im using Unity (3.0) interception to add some crosscutting concerns to my application. Somehow I can't use the MethodSignatureMatchingRule in my configuration getting this error message:
{"The type name or alias MethodSignatureMatchingRule could not be resolved. Please check your configuration file and verify this type name."}
My configuration:
<?xml version="1.0"?>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<sectionExtension type="Microsoft.Practices.Unity.InterceptionExtension.Configuration.InterceptionConfigurationExtension, Microsoft.Practices.Unity.Interception.Configuration" />
<alias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
<containers>
<container name="MyContainer">
<extension type="Interception"/>
<interception>
<policy name="EhabAspect">
<matchingRule name="MethodSignatureMatchingRule" type="MethodSignatureMatchingRule">
<constructor>
<param name="methodName" value="Receive" type="string"/>
</constructor>
</matchingRule>
<callHandler ... (omitted)
</policy>
</interception>
<register type="IMyClass" mapTo="MyClass">
<lifetime type="singleton" />
<interceptor type="InterfaceInterceptor"/>
<policyInjection/>
</register>
</container>
</containers>
</unity>
The same configuration with the NamespaceMatchingRule works fine.
My assembly contains a reference to
Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.Unity
Microsoft.Practices.Unity.Configuration
Any suggestions?
I was facing the same problem here. I solved using the full qualified name of the of the class.
<matchingRule name="AuthorizationMethod" type="Microsoft.Practices.Unity.InterceptionExtension.MethodSignatureMatchingRule, Microsoft.Practices.Unity.Interception">
<constructor>
<param name="methodName" value="Authenticate" type="string"/>
<param name="parameterTypeNames" dependencyName="EmptyArray"/>
</constructor>
</matchingRule>

Configure Spring JNDI datasource with DBCP and connection parameters

I am using Spring 3 and attempting to use a JNDI (named) data source with DBCP connection pooling.
I would like to be able to set pool parameters, but my
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
</bean>
doesn't support the necessary params:
<!-- Connection Pool settings -->
<param name="maxActive" value="5" />
<param name="maxIdle" value="2" />
<param name="maxWait" value="10000" />
<param name="removeAbandoned" value="true" />
<param name="removeAbandonedTimeout" value="60" />
<param name="logAbandoned" value="true" />
<!-- Purge invalid connections -->
<param name="validationQuery" value="SELECT 1" />
<param name="testOnBorrow" value="true" />
I've googled this extensively, and it looks like it's expected that the container (tomcat) should set these kinds of params for JNDI connections, not the application.
Unfortunately in my situation (cloudbees) I don't have control over tomcat.
Is what I'm attempting even possible?
ok, I've figured out how to do this. For reference, you need to use the Cloudbees SDK's bindings feature:
bees app:bind -a APP_ID -db DB_ID -as DATASOURCE_NAME maxActive=5 maxIdle=2 \
maxWait=10000 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true \
validationQuery="SELECT 1" testOnBorrow=true

Resources