How to add users and roles in child team area using plain Java RTC API? - rtc

Is it possible to add users and roles in child team area? My code currently can add users and roles in team areas but how can I add them in child team area.
ITeamArea TA = (ITeamArea)teamRepository.itemManager().fetchCompleteItem(newTAHandle,ItemManager.DEFAULT,monitor);
IContributor contributor = teamRepository.contributorManager().fetchContributorByUserId(members,monitor);
ArrayList roles = getTeamRoleName(projectArea,member_roles);
IProcessAreaWorkingCopy areaWc = (IProcessAreaWorkingCopy)service.getWorkingCopyManager().createPrivateWorkingCopy(TA);
areaWc.getTeam().addContributorsSettingRoleCast( new IContributor[] {contributor}, new IRole[] {roles}));
areaWc.save(null);
I was trying to find the hierarchy stuff, but then not finding the option of adding contributors to child team area.
IProjectArea workinCopyProjectArea = (IProjectArea) projectArea.getWorkingCopy();
ITeamAreaHierarchy teamAreaHierarchy = (TeamAreaHierarchy) workinCopyProjectArea.getTeamAreaHierarchy();

That projectArea.getWorkingCopy(); was described as not working in this thread.
While this was:
ProjectAreaWorkingCopy wc = new ProjectAreaWorkingCopy(projectArea);
wc.addMembers(c);

Related

SAP Business One DI API at item creation should inherit some fields from item group

In SAP Business One client, imagine you want to add a new item. You set code, name and group. When you set the group SAP proposes to inherit some fields from such item group. You can choose yes or no.
If you do the same thing with DI API, of course there isn't such a proposal. DI API give for granted that you don't want to inherit fields from the item group.
Is there a way to tell DI API to inherit fields from the item group? Or are we obliged to copy them one by one in our program?
As far as i know this method for maintaining item information from the item group is not exposed to the sdk.
I know that the general ledger information can be maintained using
.GLMethod = SAPbobsCOM.BoGLMethods.glm_ItemClass
but for the other 10(ish) fields you will have to manually set them in your code.
.PlanningSystem = BoPlanningSystem.bop_MRP
.ProcurementMethod = BoProcurementMethod.bom_Make
.OrderIntervals = "Week"
.OrderMultiple = 5
.MinOrderQuantity = 3
.LeadTime = 20
.ToleranceDays = 3
.CostAccountingMethod = BoInventorySystem.bis_Standard

How to get Users associated to a Project in Rally

Right now when we are fetching the project details using -https://Rally_Domain/slm/webservice/v2.0/project/Project_Object_id but Response doesn't have any info about list of users associated to that project
Sure, you can query the ProjectPermission endpoint scoped to that Project.
https://rally1.rallydev.com/slm/webservice/v2.0/projectpermission?query=(Project = /project/120971608896)&fetch=User,Role
You can also include a filter by role if you're looking for just viewers.
https://rally1.rallydev.com/slm/webservice/v2.0/projectpermission?query=((Project = /project/120971608896) AND (Role = "Project Viewer"))&fetch=User

Define a predecessor when using Rally WSAPI to add user story

I'm working on a .NET application to add user stories to our Rally workspace, and I'd like to set one of the user stories as a predecessor to the next one. I can add the stories just fine, but the predecessor/successor relationship isn't being created. I'm not getting any errors, it's just not creating the predecessor. (I'm using the Rally.RestApi .NET library).
I have the _ref value for the first story, and I've tried setting the "Predecessors" property on the DynamicJsonObject to that.
followUpStory["Predecessors"] = firstStoryRef;
I also tried creating a string array, no luck.
followUpStory["Predecessors"] = new string[] { firstStoryRef };
I kept the code examples to a minimum since the stories are being created fine and this is the only issue, but let me know if sharing more would be helpful.
The easiest way is to use the AddToCollection method. Check out the docs:
http://rallytools.github.io/RallyRestToolkitFor.NET/html/efed9f73-559a-3ef8-5cd7-e3039040c87d.htm
So, something like this:
DynamicJsonObject firstStory = new DynamicJsonObject();
firstStory["_ref"] = firstStoryRef;
List<DynamicJsonObject> predecessors = new List<DynamicJsonObject>() { firstStory};
OperationResult updateResult = restApi.AddToCollection(followUpStoryRef, "Predecessors", predecessors);

Membership Server Control in Ektron

Is it possible to customize Membership Server Control? I need only First Name,Last Name and Email field with the Submit and Reset Button in the form and I don't need any tabs for the server control.
Is it possible to do that?
The Membership Control is limited in terms of the customisations you can make. Your best bet is to create an ASPX form that has the fields you need and then to use the Framework API (Ektron.Cms.Framework.User) to create / edit membership users.
You can find all of Ektron's documentation here.
Your best bet would be to use the User Manager of the framework API
http://documentation.ektron.com/cms400/edr/web/edr.htm#FrameworkAPI/User/UserManager.htm%3FTocPath%3D
Framework%2520API%7CUser%7C_____2
Here's a sample.
long UserId = 0;
//user manager is using the API access mode of admin to retrieve the user which overrides the logged in user permission
Ektron.Cms.Framework.User.UserManager uManager = new Ektron.Cms.Framework.User.UserManager(Ektron.Cms.Framework.ApiAccessMode.Admin);
var uData = uManager.GetItem(UserId);
string fn = uData.FirstName;
string ln = uData.LastName;
string email = uData.Email;
uData.Email = "";
uData.FirstName = "";
uData.LastName = "";
uManager.Update(uData);

Siebel - How to get all accounts of an employee with eScript?

how can I get all accounts of am employee?
In the "Siebel Object Interaces Reference" I found an example, how to get all industries of an account:
var myAccountBO = TheApplication().GetBusObject("Account");
var myAccountBC = myAccountBO.GetBusComp("Account");
var myAssocBC = myAccountBC.GetMVGBusComp("Industry");
So I would like to do something like:
var myEmployeeBO = TheApplication().GetBusObject("Employee");
var myEmployeeBC = myAccountBO.GetBusComp("Employee");
var myAssocBC = myAccountBC.GetMVGBusComp("Account");
But I get an error
Semantic Warning around line 23:No such predefined property Account in class BusComp[Employee].MVGFields.
I can see in Tools that there is no Multi Value Link called "Account" in Business Component "Employee", so I can actually understand the error message.
So I wonder how I can get all accounts of an employee.
I found the Business Component "User" which has a Multi Value Link to "Organisation" and another link "User/Account".
Is this what I am looking for?
How can I know? Where is documentation which tells me about the semantics of links? (Is this described in "Siebel data model reference"? I cannot download this document, although I have signed in...) This link could also link a user to the organization it belongs to.
If one of these links IS what I am looking for, what would be the way to go to get the "User" Business Component of a corresponding "Employee" Business Component?
Many questions of a Siebel newb...Thanks for your patience.
Nang. An easy way to approach this (and to learn it) is to figure out how you'd do it in the UI. Then move onto figuring out how to do the same thing in script.
When you say, "get all account of an employee," do you really mean get all accounts where a particular employee is on the account team? In the UI, that would be done by going to: Accounts > All Accounts Across Organizations, and querying for that specific user in the "Account Team" multi-value field.
From that same view, go to Help > About View in the application menu. You'll see in the popup that the view uses the Account business object and the Account business component. A quick examination of the applet you queried on will show you that the "Account Team" field on the applet is really the "Sales Rep" field on the Account business component. Here's how to mimic what we did in the UI, in script:
var boAccount = TheApplication().GetBusObject("Account");
var bcAccount = boAccount.GetBusComp("Account");
bcAccount.SetViewMode(AllView); // like All .. Across Orgs
bcAccount.ClearToQuery();
bcAccount.SetSearchSpec("Sales Rep", "NANG");
bcAccount.ExecuteQuery();
Then you can walk through the list of accounts and do something with each one like this:
// for each account
for (var bIsRowActive = bcAccount.FirstRecord();
bIsRowActive; b = bcAccount.NextRecord())
{
// do something here
}
I hope you're enjoying Siebel.