How can i create a Dynamic Multi-Select List in hippo cms? - hippocms

I am trying to create a Dynamic Multi-Select List. I tried to add a DynamicDropdown and added Multiple in Fields properties but throws an error:
An error has occurred, sorry for that.
java.lang.IllegalStateException:
org.onehippo.forge.selection.frontend.plugin.DynamicDropdownPlugin
does not support fields that are multiple: please use
org.onehippo.forge.selection.frontend.plugin.DynamicMultiSelectPlugin
for that. Field name is *. Failed to instantiate plugin class
'org.onehippo.forge.selection.frontend.plugin.DynamicDropdownPlugin'
for wicket id
'home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown-preview.cluster..plugin.home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown.cluster.default.service.wicket.id'
in plugin
'home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown-preview.cluster..plugin.home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown.cluster.default.plugin.root'
(JcrPluginConfig:/hippo:namespaces/system/DynamicDropdown/editor:templates/default/root)

Indeed the DynamicDropdownPlugin is not meant for multi-selects, you should use the DynamicMultiSelectPlugin. Easiest to install using Essentials set=up tool, see 'Add a Selection Field to a Document Type
Using the Setup Application' at https://documentation.bloomreach.com/library/concepts/plugins/selections/configuration.html
HTH
Jeroen

Related

Wrong "ReflectedWorkItemIDFieldName" while migrating Azure DevOps Work Items

I am testing the azure-devops-migration-tools and have create a project using https://azuredevopsdemogenerator.azurewebsites.net/ (Parts Unlimited). I have generated the configuration.json and changed the Source and Target so I can test a migration, but I'm getting errors while migrating Work Items.
[15:14:41 ERR] Error running query
Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «ReflectedWorkItemId».
I've tried different options on the "ReflectedWorkItemIDFieldName" field, Scrum, Basic, Agile, Custom, empty but am still unable to migrate the work items.
How can I get the value to put on this field for the specific project?
Thanks,
Bruno
Quick Solution: Most ADO instances use the prefix 'custom' for new fields. Try "Custom.ReflectedWorkItemId" in your configuration.json to see if that resolves the problem.
More details: It's hard to tell without an actual configuration.JSON file to review. One possible problem is that you need to use the actual and full internal 'Name' of the ReflectedWorkItemID field. This doesn't show in ADO, or the Process Template when created. The recommendation is that you create a query referencing your custom field, and export the WIQL file (query file). Once you export the WIQL file, you can then open the file and see the full syntax of the custom field.
Exporting Queries: If you don't know how to do this, it can be done with VisualStudio. If you don't know how to do that, you can install this extension. It's a handy WIQL import/Export and editor. Install, and your ADO Queries with have an Edit in WIQL Editor option. Create a query that exposes your 'ReflectedWorkItemID' as a column, then edit that query in the WIQL editor and see the full names of the Reflected Work Items ID Feild. https://marketplace.visualstudio.com/items?itemName=ottostreifel.wiql-editor
SELECT
[System.Id],
[System.WorkItemType],
[System.Title],
[System.AssignedTo],
[System.ChangedBy],
[Custom.ReflectedWorkItemId]
FROM workitems
WHERE ...
I found a possible solution. I have created a custom process, change the process from the projects to this new one and add a new field. This is the field I'm using on the configuration.json and now I'm able to migrate work items
To make the migration in the "ReflectedWorkItemIDFieldName" you must do:
"Organization Settings" -> Process -> Select the process where you project are (Basic, Scrum, Agil, or CMMI).
then click on the 3 dots and create a new Inherited process.
Then with the inherited process, you are able to create a new field for each work item type. The name that you type (could be "IronMan") that name will be in your configuration file.

How to pass custom arguments along with standard arguments in a Documentum job method

I configured a job correctly by passing the custom arguments successfully.
Now I want to use the custom as well as standard arguments. But the issue is either standard arguments(job id, user name, docbase name and trace level) are getting passed or the custom arguments only. I am unable to get both types of arguments together.
Could anyone suggest any ways to get that done?
Send standard arguments as custom arguments, i.e. just add it with your custom arguments. Did this before and it work.
In the job properties editor in Documentum Composer select the "Standard Arguments" radio button!
Even if you are using custom attributes, the "Standard Arguments" radio button has to be selected.
I tried to do the same using the custom argument using the Job artifcats and then checking the checkbox "pass standard argument" in DA. But still I was unable to get the custom and standard arguments together.
For resolving this, I first retrieved the job ID from the standard arguments and then fetched the custom arguments using the following code:
IDfId idfJobId = new DfId(stringJobId);
IDfSysObject jobObject = (IDfSysObject) session.getObject(idfJobId);
CustArgument1 = jobObject.getRepeatingString(ATTR_METHOD_ARGS, 0);
if there are multiple arguments we can get it using a for loop by incrementing index i
CustArgument1 = jobObject.getRepeatingString(ATTR_METHOD_ARGS, i);

Maximo - Adding elements to a CustomMboSet using scripting

Is it possible to add to a CustomMboSet in Maximo using scripting? I am writing a custom application using a custom object called TIMESHEET. As part of the application I am writing a (Jython) script that needs to dynamically build up an MboSet (a set of TIMESHEETs). The code retrieves an existing CustomMboSet and attempts to add elements to it. It works when using an out of box MboSet, but when I try to run the same code on a custom MboSet it does not seem to work. No error is thrown, but code below the offending line is not run.
In other words, this works (LABTRANS is an out of box MBO):
myMboSet = mbo.getMboSet("LABTRANS")
newMbo = myMboSet.add()
# Set attributes on newMbo, everything is happy
But this does not (TIMESHEET is a custom MBO):
myMboSet = mbo.getMboSet("TIMESHEET")
newMbo = myMboSet.add()
# Code does not execute after the above line
Anyone have any insight as to why I am seeing this behavior? Does the Maximo scripting framework simply not support the dynamic building up of CustomMboSets? Any help is appreciated. Thanks.
You need to make sure that the relationship exists between the Current MBO and the Custom MBO in the database configuration otherwise it will not work.
Alternatively you can use the following code to create an new mboSet on the fly:
timeSheetMboSet = mxServer.getMboSet("TIMESHEET", userInfo)
mbo.getMboSet(RELATIONSHIPNAME).
LABTRANS and TIMESHEET must be the relationship names to the object in auto script.
If you want to get/add records in any object, use
mxServer.getMboSet(OBJECTNAME, userInfo)
A bit more explanation. You can create your own custom relationship from within your automation script. The trick is to make sure it's not already existing. That's why I use a dollar sign for mine.
variable = mbo.getMboSet(tempRelationshipName,Object,where clause)
previousPhaseSet = mbo.getMboSet("$wophasetranstemp1", "exitdate is null")

How to use Global Property name in my JSON input request using SoapUI?

I have a SoapUI project which contains around 60 plus services. Each service requires some input which will be changed for every execution. So I have created certain Global Properties and assign some values to that properties.
I have to use these properties values in my SoapUI request ( i.e. JSON Format request ).
If it is groovy script means, I will use like this.
String HTiC_Username = com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils.globalProperties['HTiC_Username'].value;
But, how to get the value of the Global Property in the request?
Hope you understand my question. Please provide proper guidance.
Thanks
To dynamically "expand" (i.e. substitute) the value of a property into a test step, the following syntax is used: ${#scope#propertyName}
...where 'scope' refers to the level at which the property has been defined (e.g. Global, Project, TestSuite, TestCase).
So to expand a property named username defined as a Global property, for example, the following code can be used directly within a Request Test Step (e.g within a JSON body, or header value, etc):
${#Global#username}
To access the same property value within a Groovy Test Step, you can use the following syntax:
context.expand('${#scope#propertyName}')
...as in the following example:
context.expand('${#Global#username}')
What we did was the following:
created a test data file to store all the specific input data for the different services (testdata.properties)
Example content of testdata.properties:
Billing_customerID=1234567
OtherService_paymentid=12121212
....
create a SoupUi global parameter (File/Preferences/Global properties): testdata_filepath=C:\...
For specific services we added a Properties test step. You can specify the "Load from" field to our new global parameter: ${#Global#testdata_filepath} Now you can use the Load button to load parameters.
Finally you can reference the parameter in your xml in the following format: ${Properties#Billing_customerID}
Example content of a service with parameter:
...
<BillingCustomerIdentification>
<BillingCustomerID>${#Properties#Billing_customerID}</BillingCustomerID>
</BillingCustomerIdentification>
...
To set up your projects in this manner also helps to automate service tests eg. using Hudson (see my previous SO answer).
If it is too heavy and automation is not a target, you can simply use ${#Global#someinputvariable} format in your xml ;-)

Displaying Custom Attributes in Documentum - Webtop

I am following an article that explains how to use the ICustomAttributeDataHandler class.
I am creating a custom column for the inbox screen, but the problem is that the value I set for my custom attribute is not being reflected on the screen.
As a test I am changing the task name to "whoKnows". But this code is not effecting what is output on the screen:
ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");
(I am able to print debug lines from my custom class when the inbox is viewed, so I know my code is being run.)
Someone on the comments of that article wrote:
the user must call the
"setCustomAttributesInQuery() method
on the dataprovider passing in a
string array of the custom attributes
...what does that meen? Could this be my problem?
thanks.
To be honest, I have already used Webtop, but just as an user. I found a post in the dm developer discussion group that can be useful, though:
For creating a custom column in the
doclist you dont need to go through
this complex procedures. You can use
custom attribute datahandlers for
this.
First in your object list component xml file add your custom column
definition in the "columns" tag. You
can even add static columns instead of
the documentum attributes.
Now create a class which implements the ICustomAttributeDataHandler.
Implement the default the methods getRequiredAttributes and the getData
function.
In getRequiredAttributes add attributes of the object that you are
looking for.
In your getdata method retrieve each row and then based on the
attribute that you see, just set the
value that you want to. 6) Finally
define your class in the app.xml file
There is a section in WDK developement
guide regarding
ICustomAttribuetDataHandlers. Look for
the topic named "Adding custom
attributes to a datagrid".
I'm not sure if this is the final solution, but I hope it helps!
To answer you question about setCustomAttributesInQuery()
every datagrid in WDK is backed by an underlying data provider. You can get this proivder by using the following code.
Datagrid datagrid = (Datagrid)getControl("doclist_grid",com.documentum.web.form.control.databound.Datagrid.class);
DataProvider dp = datagrid.getDataProvider();
Once you've done that, you can call
dp.setCustomAttributesInQuery(myArr);
I'm not actually sure if this is part of the solution to your problem, but you could try this and see where it gets you.
You have to configure the inbox component.
if using classic view, go to inboxlist component and add your custom attribute.
<column>
<attribute>CustomAttributeName</attribute>
<label>Custom Attribute Label</label>
<visible>true</visible>
</column>
Your custom attribute has to be in a custom type that is a sub type of dmi_queue_item, because inboxlist shows only dmi_queue_item objects.
Hope this helps,
Regards,
Tejas.
This may be a non-issue, but based on your code, I can't tell if you're doing this:
ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");
or this:
ICustomAttributeRecordSet rs;
rs.setCustomAttributeValue(i, "taskName", "whoKnows");
You should be calling the setCustomAttributeValue method on the rs object instance, not on the interface.