Inno Setup built-in control names - inno-setup

I frequently find that I need the names of built-in controls e.g. WizardForm.StatusLabel. Is there a definitive reference to all the built-in control names somewhere, and if not, how do you go about finding these? As a worked example, how would I find the name of the control that shows the filename that is being extracted on the WizardForm.InstallingPage i.e. the label underneath the WizardForm.StatusLabel?

The only public documentation is TWizardForm reference. It lists names of all controls. But in a rather random order.
I find it way easier to check Wizard.dfm in Inno Setup source code repository. It defines the controls in their hierarchy. So if you search for InstallingPage, you will find that there are these controls:
object FInstallingPage: TNewNotebookPage
object FFilenameLabel: TNewStaticText
...
end
object FStatusLabel: TNewStaticText
...
end
object FProgressGauge: TNewProgressBar
...
end
end
For a use in Pascal Script, drop the F prefix (e.g. instead of FFilenameLabel, use FilenameLabel).

Related

How to change persistence property of cq:inplaceEditing

I wish to use cq:inplaceEditing to modify a property on my JCR whenever it is used by the AEM authors. Unfortunately, I do not know how to modify the name of the property that it actually modifies in the JCR. It appears that it only modifies the value of the property "text" by default.
For my purposes, I want to use its rich-text-editing for properties that have names I define, not just the default name "text."
The image at this link shows the tree which contains the cq:inplaceEditing (courtesy of CRXDE):
These are the attributes of cq:editConfig:
These are the attributes of cq:inplaceEditing:
...and this is what a content node of my JCR looks like when I use the inplaceEditor. I've blotted out the names of some properties for potential security reasons. Note that the "text" property below was changed when I used the inplaceEditor. Also note that I want to be able to define the property name that the inplaceEditor changes, rather than just the "text" property:
Is there a way to use a different property name instead of "text"?
-----------EDIT----------
After changing the property "textPropertyName" to the property that I am searching for, it still doesn't appear to actually modify the behavior of the inplaceEditor. It still only modifies the "text" property of my JCR nodes instead of the one that I put in the "textPropertyName" attribute.
This picture contains the attributes of my cq:InplaceEditingConfig:
The picture below contains the attributes of the JCR node at the path specified in the "configPath" variable in the picture above. Note that I set the textPropertyName attribute in this node and the text component still modifies the default attribute "text" instead of the one specified:
Finally, the picture below shows the contents of my JCR tree inside of the text component.
-----------ANOTHER EDIT----------
I discovered that the inline text editor was persisting the correct property after I had switched to the classic UI. For some reason, it doesn't work correctly with the touch UI.
How to find it
The inplace editing capability is defined by subclasses of CQ.ipe.InplaceEditing function. You can find it easily by just searching for editorType through the CRXDE tool.
Searching for the CQ.ipe.InplaceEditing returns multiple results such as CQ.ipe.TextEditor that at the very end of the script registers desired editorType i.e.: CQ.ipe.InplaceEditing.register("text", CQ.ipe.TextEditor);
The answer
Reading through the editor code you can find the first configurable property called textPropertyName which according to it's documentation is just what you are looking for. Combining it with the inplace configuration node (see Adobe's documentation) it is the solution for your case.
An example
You can try it by yourself on an instance of Geometrixx component.
First go to CRXDE and find Geometrixx Text component: /apps/geometrixx-gov/components/text.
Notice /apps/geometrixx-gov/components/text/cq:editConfig/cq:inplaceEditing#configPath property value.
Find /apps/geometrixx-gov/components/text/dialog/items/tab1/items/text resource and add new property: textPropertyName=myPropertyName.
Then just open the Geometrixx Gov page add Geometrixx Text component, edit it inplace and look into the Network console. You'll notice POST request with the altered parameter name
edit after TouchUI clarification
TouchUI case
If you want to achieve the same for TouchUI interface it doesn't go so easy, unfortunately. The text inplace editor for TouchUI is defined by /libs/cq/gui/components/authoring/clientlibs/editor/js/editors/InlineTextEditor.js.
Searching for "text" gives you an overview how hardcoded is this property. For AEM 6.1 (on which I'm testing it) you can find it's occurence in the ns.persistence.readParagraphContent function where the initialContent is extracted from the resource JSON map. Another occurence can be found in finishInlineEdit and addHistoryStep methods. Changing all three occurences of "text" to your value brings expected outcome.
This is obviously non-acceptable - it's a platform-wide change and will affect other (incl. ootb) components where it might no be expected. The simplest would be to just copy-paste whole editor into your clientlib and register the editor into a new name - see last couple of lines: ns.editor.register. If you feel comfortable in JS, it might be worth to extend this editor and alter just three methods that are affected.
As of AEM 6.3, the textPropertyName works correctly with the out-of-the-box PlainTextEditor.js
The property needs to be set on a config node under the cq:InplaceEditingConfig
Note – the source of the editor can now be found at:
/libs/cq/gui/components/authoring/editors/clientlibs/core/inlineediting/js/PlainTextEditor.js

Remove all elements not found in diagram in Enterprise Architect

We have a large project and I am using Enterprise Architect version 10 to reverse engineer a small package within the project into UML for the purposes of refactoring. I want to only include elements that will be contained within the diagrams I am going to create (I know this is stupid, but we can't have 1 model to rule them all).
I would like to reverse all the source and then delete all elements that do not end up on my diagrams. Is there a way to do this? I know that I can find any given element in the diagrams from the GUI, so would there at least be a way to script this?
The alternative is to manually pick all dependencies and reverse only those files, which I may end up doing.
Thanks
EA comes with a built-in search called "Find Orphans". This will list all elements that do not appear on a diagram. You can run this search (Ctrl+Alt+A, select "Diagram Searches" from the first list box and "Find Orphans" from the second list box and click Run), select all the results (Ctrl+A) and delete all (Ctrl+Del). However, this is at your own risk - there is nothing wrong with an element being in the model but not on any diagrams.
Yes, you can script this. It will be a little involved, but it can be done.
There's no immediate API support to find what you're looking for so you'll need to go into the database to find all elements that are not shown in any diagrams. Once you've done that, you can delete each such element from its containing package.
Elements are stored in t_object and diagram objects (the graphical representation of one element in one diagram) in t_diagramobjects. An entry in t_diagramobjects has a reference to the diagram (Diagram_ID) and to the element being displayed (Object_ID).
(If you're new to EA hacking, yes, they're called Elements in the API and Objects in the database. Just a fact of life.)
So:
Find all t_object.Object_ID which do not occur in t_diagramobjects.Object_ID.
Loop through this set and, using Repository.GetElementByID(), retrieve each Element.
Fetch the element's containing package using Repository.GetPackageByID(element.PackageID).
Spin through the package's Elements collection using GetAt() in a for loop, find the Element whose ElementID matches the one you're after and Delete() it. Don't forget to Refresh() the collection afterwards.
There is a method Repository.SQLQuery(), which allows you to perform a select query against the database, but you have to parse the result from a single XML string.
It's simpler to use Repository.GetElementsByQuery(), which returns the elements in a Collection, but this requires you to predefine the query as an EA search. If you use this, you can skip steps 1 and 2 above.
Of course, you could go straight into the database and simply delete all those t_object rows which are not referred to from t_diagramobjects. This is a terribly bad idea which will (I'm pretty sure) leave you with a corrupted database. When you use the API to delete things, EA cleans up all references (so no connectors are left dangling, etc).
And of course, you should only unleash a script like this if you are absolutely sure there are no other elements that aren't shown in diagrams that need to be kept. So a temp project for this is probably a good idea.
Note, finally, that packages are also elements, and if you don't want to lose all your imported source in one fell swoop by deleting the package they're in (because the package itself is typically not shown in a diagram, is it?) you should probably exclude t_object.Object_Type / Element.Type "Package".
I know this is old but I think I have something to contribute :)
The simplest answer has already been given and it is the "Find Orphans" thingy. Now while cleaning a big EA repository I inherited I noticed there are cases where a given object may not be in a diagram but a child object will. In this case you don't want to be cleaning the parent object or you may lose the child.
So I crafted the following search:
select
o.ea_guid as CLASSGUID, o.object_type as CLASSTYPE, *
from
t_object o
where
o.Object_Type != 'Package'
and
not exists (select t_diagramobjects.Diagram_ID from t_diagramobjects where t_diagramobjects.Object_ID = o.object_ID)
and
not exists (select t2.OBJECT_ID from t_object t2 where t2.PARENTID=o.OBJECT_ID)
It will only return "orphans that don't have a parent". Of course it could be improved to only return "orphans that don't have a parent that is itself an orphan" but I did not need that and could do some manual work...
(you access the SQL Search interface by Control+F/Builder/SQL)
The user interface in Enterprise Architect version 12 appears to have changed slightly for finding orphaned elements.
Ctrl + F to "Find in Project".
Select "Diagram Searches" from the Search Category drop down.
Select "Find Orphans" from the Search drop down.
Leave blank to find all orphans.
Click Run or press Enter.

How to import two cc both contain compositeData?

I do not know that the question is right? Please do not take it your mind if it is crazy. Actually I am working on xpages application. There I need to do two things, that I want to add the picklist functionality and binding the dynamic data like field_1,field_2,field_3, ... upto n depands on customer choice.I am using the composite data for both custom controls. I can remove the picklist control's composite data and also I can do it by passing the scope variables. But that takes more time than the composite data.
I did not get any error. But the binded documents is not saving.
Is it possible to import the CCs that are having composite Data?
Code for first CC:-
<xc:viewpicklist datasrc="view1" dialogID="dialog1" dialogWidth="700px" dialogTitle="Pick this field value!!!">
<xc:this.viewColumn>
<xp:value>0</xp:value>
<xp:value>1</xp:value>
<xp:value>2</xp:value>
</xc:this.viewColumn>
</xc:viewpicklist>
Code for Second CC:-
<xc:BOM_Partinfo BOM_Partinfo="#{document1}"
TNUM="field#{index+1}" Desc="Desc#{index+1}" quan="Ea#{index+1}"
exp="exp#{index+1}" cap="cap#{index+1}" total="price#{index+1}"
RD="RD#{index+1}" m="manufact#{index+1}"
m_n="manufactnum#{index+1}">
</xc:BOM_Partinfo>
You can read information that is set in the properties of a custom control if it was static in the calling page:
var x = getComponent("yourcomponentid");
x.getPropertyMap().get("parametername");
but you want to propagate a data source from the outer control to the inner control...
You need to plan carefully. If you hand over the data source, then your custom control is dependent on a fixed set of fields in the data source (that would be a parameter of type com.ibm.xsp.model.DocumentDataSource). This would violate the encapsulation principles. So I would recommend you actually hand over data bindings - the advantage: you are very flexible what to bind to (not only data sources, but also beans and scope variables would work then). The trick is you provide the binding name as you would statically type it in (e.g. "document1.subject" or "requestScope.bla" ). In your control you then do
${"#{compositeData.field1}"}
${"#{compositeData.field2}"}
You need one for each field.
You cannot send a document data source to a custom control using composite data parameters.
You can try and use this script instead
http://openntf.org/XSnippets.nsf/snippet.xsp?id=access-datasources-of-custom-controls
Define data source in XP/CC where you want those CCs. Define parameter "dataSourceName" for both CCs. Inside each of them use EL "requestScope[compositeData.dataSourceName].fieldName" everywhere you want to bind to datasource.

Dynamically adding the same UserControl multiple times

I have a simple UserControl that I've created that simply allows a user to enter the date. For the time being, it has a single Textbox with ID="tbDate". I am trying to dynamically add this control multiple times via (for example) placeholder.Controls.Add(LoadControl()) but am receiving the error "An entry with the same key already exists". I could, perhaps, change the ID of the elements but then it would be difficult to grab the value entered by the user.
Does anyone have an idea on this?
Thanks!
I generate a unique identifier as part of a Component class that I created and then use that value as the Control.ID. You can generate this unique value in any way you'd like but I am storing it as part of a database table. In the end it isn't that important since when the class is instantiated the values are initialized and consistent throughout the run of the application.
The class has a private instance variable:
private Control _control;
When adding the control to the form (and, specifically, the placeholder) I do something similiar to this. Note that c references my created class.
c.Control.ID = c.ComponentName + c.UniqueIdentifier;
phHere.Controls.Add(c.Control);
Then when I need to reference the control at a later point I essentially reverse the steps above:
string component = c.ComponentName + c.UniqueIdentifier;
UserControl uc = (UserControl)ph.FindControl(component);
Hopefully this helps. If you have any questions please feel free to ask. The root of the problem, though, is that the Control.ID must be set in order to avoid the error.
Thanks

Sharepoint : Prevent a feature from activating on a condition

I made a feature that creates a list with some default data (with a list definition and all required XML)
I observed that when the list already exists, the data will be inserted again in the list... So I tried to make a "FeatureReceiver" to prevent the feature from creating the list if it already exists, but the base class of FeatureReceiver is an abstract class, so even if the list doesn't exists, I can't "call" the base function to continue the normal process...
Is there an easy way to do this or will I have to create the list through the FeatureReceiver by calling the XML file?
I would suggest that you create the lists and all the other stuff you have to do (add/remove fields, contenttypes etc) all through code. I usually never create any lists through xml. This might give you some guidance:
http://johanleino.wordpress.com/2009/08/12/howto-add-splist-based-on-a-custom-template/

Resources