alfresco tag content on create - forms

is it possible to display tag form during document (cm:content) creation in Alfresco 5.2 share ?
I've searched in share-form-config.xml for an example and I've not found an answer.
I've tried with
<config evaluator="model-type" condition="myco:myType">
<forms>
<form>
<field-visibility>
<!-- ... -->
<!-- tags and categories -->
<show id="cm:taggable" for-mode="edit" force="true" />
<!-- ... -->
</field-visibility>
<appearance>
<!-- ... -->
<field id="cm:taggable">
<control>
<control-param name="compactMode">true</control-param>
<control-param name="params">aspect=cm:taggable</control-param>
<control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
<control-param name="createNewItemIcon">tag</control-param>
</control>
</field>
<!-- ... -->
</appearance>
</form>
</forms>
but it works only during edit forms (with <config evaluator="node-type" condition="myco:myType">, not during creation.
SOLUTION
the previous code is right except for
<!-- tags and categories -->
<show id="cm:taggable" for-mode="edit" force="true" />
which should be without the for-mode="edit" during creation of a document.

I can't tell what you are doing because you haven't included the enclosing "" element. If you want to change the form that exists for new nodes use the "model-type" evaluator, like:
<config evaluator="model-type" condition="sc:whitepaper">
The "node-type" evaluator is used for existing nodes.
If that doesn't meet your requirements you might take a look at the Uploader Plus add-on.

Related

Can we use PrimaryCommandSurface in Outlook add-in generated by yo office

Is there any way we can use PrimaryCommandSurface to show the add-in on the top Ribbon in the outlook add-in development, if yes Please help with the updated valid manifest.xml.
If not help with the other way how to create outlook top Ribbon commands plug-in
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<CustomTab id="Contoso Tab">
<!-- If you want to use a default tab that comes with Office, remove the above CustomTab element, and then uncomment the following OfficeTab element -->
<!-- <OfficeTab id="TabData"> -->
<Label resid="residLabel4" />
<Group id="Group1Id12">
<Label resid="residLabel4" />
<Icon>
<bt:Image size="16" resid="icon1_32x32" />
<bt:Image size="32" resid="icon1_32x32" />
<bt:Image size="80" resid="icon1_32x32" />
</Icon>
<Tooltip resid="residToolTip" />
<Control xsi:type="Button" id="Button1Id1">
<!-- information about the control -->
</Control>
<!-- other controls, as needed -->
</Group>
</CustomTab>
</ExtensionPoint>
<ExtensionPoint xsi:type="ContextMenu">
<OfficeMenu id="ContextMenuCell">
<Control xsi:type="Menu" id="ContextMenu2">
<!-- information about the control -->
</Control>
<!-- other controls, as needed -->
</OfficeMenu>
</ExtensionPoint>
The PrimaryCommandSurface stands for the ribbon in Office. In case of Outlook we deal with read or compose items, so we should use the MessageReadCommandSurface for received items, for example:
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<-- OfficeTab Definition -->
</OfficeTab>
</ExtensionPoint>
The TabDefault is the idMso value of the built-in tab in Outlook.
Also you you can place controls into a custom tab in the following way:
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<CustomTab id="TabCustom1">
<-- CustomTab Definition -->
</CustomTab>
</ExtensionPoint>
If you need to get a ribbon UI displayed for the composed items in Outlook you need to use the MessageComposeCommandSurface extension point that puts buttons on the ribbon for add-ins using mail compose form:
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<-- OfficeTab Definition -->
</OfficeTab>
</ExtensionPoint>
And to place controls into the custom tab:
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<CustomTab id="TabCustom1">
<-- CustomTab Definition -->
</CustomTab>
</ExtensionPoint>
See the ExtensionPoint element for more information.

Office Js: avoid doubling "&" symbol on ribbon button tooltip

I am developing a Word addin with Office-js. I want to create a button in my ribbon. This button's name and tooltip should be AAA & BBB.
So, I developed the following part of the xml manifest.
<Group id="XXX.GrpYYY">
<Label resid="XXX.GrpYYY.Label"/>
<Icon>...</Icon>
<Control xsi:type="Button" id="XXX.BtnYYY">
<Label resid="XXX.BtnYYY.Label" />
<Supertip>
<Title resid="XXX.BtnYYY.Label" />
<Description resid="XXX.BtnYYY.Tooltip" />
</Supertip>
<Icon>...</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="XXX.YYY.SL" />
</Action>
</Control>
</Group>
And this is the relevant part of the Resources in the xml manifest:
<bt:ShortStrings>
...
<bt:String id="XXX.GrpYYY.Label" DefaultValue="MY GROUP" />
...
<bt:String id="XXX.BtnYYY.Label" DefaultValue="AAA & BBB" />
...
</bt:ShortStrings>
<bt:LongStrings>
...
<bt:String id="XXX.BtnYYY.Tooltip" DefaultValue="AAA & BBB" />
...
</bt:LongStrings>
This is the result:
As you can see the & symbol in the tooltip is doubled.
Is it a bug or am I doing something wrong? Is there a way to avoid doubling this symbol?

Confluence Macro Browser autocompletion for attachments

I am trying to show all attachments (from the current page) in an auto-completed drop-down list. This is the part in the atlassian-plugin.xml which defines the parameters:
<xhtml-macro name="plugin-name" class="com.example.macro.name" key="macroname-xhtml" icon="/download/resources/${project.groupId}.${project.artifactId}/icons/macroname.png">
<category name="formatting"/>
<parameters>
<parameter name="content_input" type="confluence-content" />
<parameter name="space_input" type="spacekey" />
<parameter name="attachment_input" type="attachment" />
</parameters>
</xhtml-macro>
The confluence-content and spacekey types work just fine. It shows a textfield which autocompletes Pages and Spaces.
However, the attachment type shows a empty drop-down list (select box) which cannot auto-complete.
The official Confluence documentation says it should work like I do:
https://developer.atlassian.com/display/CONFDEV/Including+Information+in+your+Macro+for+the+Macro+Browser
I must be missing something here, but I don't know what. Anyone might know what the problem is?
If you want a drop-down list with all the attachments then you may also try the following:
<xhtml-macro name="plugin-name" class="com.example.macro.name" key="macroname-xhtml" icon="/download/resources/${project.groupId}.${project.artifactId}/icons/macroname.png">
<category name="confluence-content" />
<parameters>
<parameter name="page" type="confluence-content" required="false"
multiple="false" />
<parameter name="name" type="attachment" required="false" />
</parameters>
</xhtml-macro>
Don't change the names of the parameters
If you want to add a filter, then you need the following:
<web-resource key="macro-browser-smart-fields" name="Macro Browser Smart Fields">
<resource type="download" name="confluence-core-macro-fields.js" location="js/confluence-core-macro-fields.js" />
<dependency>confluence.editor.actions:editor-macro-browser</dependency>
<context>macro-browser</context>
</web-resource>
confluence-core-macro-fields.js
(function($) {
AJS.MacroBrowser.activateSmartFieldsAttachmentsOnPage("plugin-name", [ "png", "jpg", "gif" ]);
})(AJS.$);
I found that setting the type as attachment (following official documentation) is bugged. I have found a work-around to display attachments in a auto-complete box.
<parameter name="xsd" type="confluence-content" required="true">
<option key="type" value="attachment"/>
<option key="showKeyInPlaceholder" value="false" />
<option key="showValueInPlaceholder" value="true" />
</parameter>

Passing values between workflow tasks

I have a problem with passing property values between tasks. For example, in a start task I have defined a property:
<type name="mcwm:submitStart">
<parent>bpm:startTask</parent>
<properties>
<property name="mcwm:projectName">
<title>Naziv projekta</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
In my share-config-custom.xml I show that property on the start page and that's ok.
...
<show id="mcwm:projectName"/>
...
<field id="mcwm:projectName" set="general" />
...
Now on my second form I want to show the same field with the value that has been entered in the start form. In the model I didn't specify again this property for the second task, I just wrote:
...
<type name="mcwm:preparationOfProjectCharter">
<parent>bpm:workflowTask</parent>
</type>
...
And in the share-config-custom.xml, I copied the first form configuration for the second form with one little change in the force="true" attribute:
...
<show id="mcwm:projectName" force="true"/>
...
<field id="mcwm:projectName" set="general" />
...
Now the field is there in my second form, but the value that is entered on my first form isn't - do I have to do something else to accomplish that and pass property values between forms?
Regards,
Aleksadnar
Yes, you need to do something extra. See the Workflowadministration Wiki.
You need to pass variables through the workflow-context, either via mapping as shown in the Wiki or through the context itself (at least for JBPM, and probably also for Activiti)

Wikipedia API: how to retrieve multiple titles AND resolve redirects in 1 call?

It appears from the MediaWiki API:Query page that you can only resolve a redirect one at a time.
The document even says "The example below isn't really useful because it doesn't use any query modules, but shows how the redirects parameter works."
But how can you get the redirect information -- using a query module that does return multiple results?
If you have any result that returns pages, then you can just append redirects to the query and it resolves the redirects. If you don't have results that returns pages, you can usually convert it to that by using a generator.
For example, the query
http://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Redirects_from_gender&redirects
returns something like (shortened)
<api>
<query>
<categorymembers>
<cm pageid="648" ns="0" title="Actress" />
<cm pageid="19887132" ns="0" title="Administratrix" />
</categorymembers>
</query>
</api>
If you convert that into a generator
http://en.wikipedia.org/w/api.php?action=query&generator=categorymembers&gcmtitle=Category:Redirects_from_gender
you get
<api>
<query>
<pages>
<page pageid="648" ns="0" title="Actress" />
<page pageid="19887132" ns="0" title="Administratrix" />
</pages>
</query>
</api>
And if you now add redirects
http://en.wikipedia.org/w/api.php?action=query&generator=categorymembers&gcmtitle=Category:Redirects_from_gender&redirects
you get
<api>
<query>
<redirects>
<r from="Actress" to="Actor" />
<r from="Administratrix" to="Administrator (law)" />
</redirects>
<pages>
<page pageid="21504235" ns="0" title="Actor" />
<page pageid="6676496" ns="0" title="Administrator (law)" />
</pages>
</query>
</api>
You can also use prop=redirects with any generator, e.g. generator=allpages. This is a new feature since MW-1.23, fixing bug T59057.
When using generator=allpages with max limits (gaplimit=max and rdlimit=max) and apihighlimits right is available, all redirects on ArchWiki are resolved in a single query ;)
https://wiki.archlinux.org/api.php?action=query&generator=allpages&gapfilterredir=nonredirects&gaplimit=max&prop=redirects&rdprop=pageid|title|fragment&rdlimit=max