Deciding to use ALang
Before deciding to use ALang, be aware of the pros and cons. ALang, or Alloy Language, is a "programming language" developed by Omnidocs. ALang is intended to supplement the command calls of OfficeExtensions.
Currently, ALang does not support functionality not already supported in BaseExtensions. Therefore, it is important to ask yourself "do I really need ALang for this implementation?". It can be beneficial to ask a technical colleague this very question as well.
ALang handles complex solutions better than BaseExtensions, but at the same time it is more complex to configure and is bound to cause more headaches than BaseExtensions unless used wisely.
ALang should be considered in solutions where "if this, then that"-complexity is high. Simplified you could say that:
"If this, then that" = BaseExtensions
"If this and this but not this, then that and that but not that" = ALang
Example of usage
One such solution where ALang was fruitfully used to manage a great deal of complexity is RegionH's "A4 Pjece" template. In this case, RegionH needed to be able to change between 7 frontpage layouts in three different layout types, bringing the total number of possible layouts to 21. For each possible layout, up to twenty alterations take place such as moving and colouring shapes and styles etc.
Supporting the "A4 Pjece" in a BaseExtensions module would mean hundreds of lines of command calls, which in turn would pose issues for maintenance as well as performance.
To read more on how ALang can be configured to solve this issue, see this article.
Using ALang
Plugin is located here:
...SD.Installers\AlloyPlugins\RawPlugins\SkabelonDesign.ALang
Place the following command in your module:
<Cmd case="SkabelonDesign.ALang:execute">
Log
When errors occur or something is just not working as it should, you must always take a look at the log. Go to this path and open the .txt file for the program concerned:
%appdata%\OfficeExtensions\User\Temp\Wordlog.txt
The log can be very helpful as it often explains exactly what went wrong when executing ALang.
Example of configuration
Command in module context:
<Button label="Select shapeName" icon="ShapeSelect" size="large" showInWord="false">
<Cmd case="SkabelonDesign.ALang:execute"> <ForEach name="Shape" source="Document.Shapes"> <If source="Shape.Visible" equals="True"> <True> <If source="Shape.Name" contains="shapeName"> <True> <Select target="Shape"/> <Break/> </True> </If> </True> </If> </ForEach> </Cmd>
</Button>
Comments
0 comments
Article is closed for comments.