Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi!!
I want to create menus dynamically.
In briief, I have certain menus with child submenus already .But If I want to add a new menu as parent, I have to do more modifications(only static am able to do).
Is there any way to create menus dynamically get added up in the mashup??
Currently there is no such feature available. We do have an enhancement request open for the dynamic menu manipulation, PSPT-3345.
Ok. Thanks!!
Recently I was asked a similar question. As mentioned there is no current feature but I explored the idea of a container mashup that changes the mashup with a defined menu for different organizations (or group) . The approach is to run a service helper on Mashup load and decide which Mashup to add. This may not be as dynamic as you require but maybe a stop gap.
For example
var ORG1 ="ORG1";
var ORG2 ="ORG2";
var ORG3 ="ORG3";
var params = {
dummyValue: undefined /* STRING */
};
// result: STRING
var dummyOrg = me.GetSessionDummyOrg(params);
if (dummyOrg === ORG1) {
result = "PTC-ORG1-MENU-MASHUP";
} else if( dummyOrg === ORG2 ) {
result = "PTC-ORG2-MENU-MASHUP";
} else if( dummyOrg === ORG3 ) {
result = "PTC-ORG3-MENU-MASHUP";
} else {
result = "PTC-RESTRICTEDORG-MENU-MASHUP";
}
Note : The XXXX-MASHUP string are predefined Mashups with predefined menus
Hi One moment,
If the question it's Menu's can be dynamic, the answer it's totally yes.
You just need to set it the property ConfiguredOrDataDriven to Data-driven and build a service which fills the menu options, that's all.
I will take another look. I did see that and thought it should do what I wanted - Got into coding around the issue to early !
Here is a better version - obviously needs some methods and real data - This is a little different than having multiple mashups
var params = {
infoTableName : "InfoTable",
dataShapeName : "MenuEntry"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(MenuEntry)
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// MenuEntry entry object
var newEntry = new Object();
newEntry.linkDestination = undefined; // STRING - isPrimaryKey = true
newEntry.isDefault = undefined; // BOOLEAN
newEntry.parentMenuId = undefined; // STRING
newEntry.linkTarget = undefined; // STRING
newEntry.imageURL = undefined; // IMAGELINK
newEntry.description = undefined; // STRING
newEntry.menuId = undefined; // STRING
newEntry.linkType = undefined; // STRING - isPrimaryKey = true
newEntry.title = undefined; // STRING
var ORG1 ="ORG1";
var ORG2 ="ORG2";
var ORG3 ="ORG3";
var params = {
dummyValue: undefined /* STRING */
};
// result: STRING
var dummyOrg = me.GetSessionDummyOrg(params);
if (dummyOrg === ORG1) {
// MenuEntry entry object
var newEntry = new Object();
newEntry.isDefault = undefined; // BOOLEAN
newEntry.parentMenuId = undefined; // STRING
newEntry.linkTarget = undefined; // STRING
newEntry.imageURL = undefined; // IMAGELINK
newEntry.description = undefined; // STRING
newEntry.menuId = undefined; // STRING
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu1 ORG1"; // STRING
result.AddRow(newEntry);
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu2 ORG1"; // STRING
result.AddRow(newEntry);
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu3 ORG1"; // STRING
result.AddRow(newEntry);
} else if( dummyOrg === ORG2 ) {
// MenuEntry entry object
var newEntry = new Object();
newEntry.isDefault = undefined; // BOOLEAN
newEntry.parentMenuId = undefined; // STRING
newEntry.linkTarget = undefined; // STRING
newEntry.imageURL = undefined; // IMAGELINK
newEntry.description = undefined; // STRING
newEntry.menuId = undefined; // STRING
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu1 ORG2"; // STRING
result.AddRow(newEntry);
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu2 ORG2"; // STRING
result.AddRow(newEntry);
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu3 ORG2"; // STRING
result.AddRow(newEntry);
} else if( dummyOrg === ORG3 ) {
// MenuEntry entry object
var newEntry = new Object();
newEntry.isDefault = undefined; // BOOLEAN
newEntry.parentMenuId = undefined; // STRING
newEntry.linkTarget = undefined; // STRING
newEntry.imageURL = undefined; // IMAGELINK
newEntry.description = undefined; // STRING
newEntry.menuId = undefined; // STRING
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu1 ORG3"; // STRING
result.AddRow(newEntry);
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu2 ORG3"; // STRING
result.AddRow(newEntry);
newEntry.linkDestination = "PTC-PRG-MU"; // STRING - isPrimaryKey = true
newEntry.linkType = "Mashup"; // STRING - isPrimaryKey = true
newEntry.title = "Menu3 ORG3"; // STRING
result.AddRow(newEntry);
} else {
}