Java Agent in Domino designer not signed after import - lotus-notes

I imported a java-agent into an iNotes application using DXLImporter. The agent seems to be signed using my User Id. When imported into the host application, I am receiving the fowllowing error in domino designer:
Could not open the editor: Error - Document is not signed..
I tried to configure the agents before exporting them as DXL. I also configured my DXLImporter like this:
dip.ReplaceDBProperties = False
'Don't import any documents
dip.DocumentImportOption = DXLIMPORTOPTION_IGNORE
dip.ReplicaRequiredForReplaceOrUpdate = False
'Use ACL of host DB
dip.ACLImportOption = DXLIMPORTOPTION_IGNORE
dip.DesignImportOption = DXLIMPORTOPTION_REPLACE_ELSE_CREATE
I would like to ignore my signature or to programmatically sign the stuff with the User Id of the host application if this is possible.

You can easily use the sign method of NotesDatabase- Class to sign the whole database, or just some specific elements or even one specific element. Check out this link for the designer help for is method.
Here is an excerpt of the linked site:
Call notesDatabase.Sign( [ documentType% ] [ , existingSigsOnly ] [ , nameStr$] [ , nameStrIsNoteID ] )
Parameters
documentType%
Integer. Optional. One of the following constants.
DBSIGN_DOC_ACL (64) signs the ACL
DBSIGN_DOC_AGENT (512) signs all agents
DBSIGN_DOC_ALL (32767) (default) signs all elements except data documents' active content
DBSIGN_DOC_DATA (1) signs all data documents' active content (hotspots)
DBSIGN_DOC_FORM (4) signs all forms
DBSIGN_DOC_HELP (256) signs the "About Database" and "Using Database" documents
DBSIGN_DOC_ICON (16) signs the icon
DBSIGN_DOC_REPLFORMULA (2048) signs the replication formula
DBSIGN_DOC_SHAREDFIELD (1024) signs all shared fields
DBSIGN_DOC_VIEW (8) signs all views
existingSigsOnly
Boolean. Optional.
True to sign only elements with existing signatures.
False (default) to sign all elements.
nameStr
String. Optional. Programmatic name or note ID of a single design element. If this parameter is not specified, all design elements of type parameter 1 are signed.
nameStrIsNoteID
Boolean. Optional.
True if parameter 3 represents a note ID.
False (default) if parameter 3 represents a programmatic name.
For your example it would be something like:
call db.sign(DBSIGN_DOC_AGENT, False, "NameOfYourAgent", False)

Related

Terraform variable user inputs long key value pair

I am using a 3rd party app called Morpheus (not a fan of it but its enforced)
I built some modules which are easy enough to request the end user selecting a "Catalog item" to be provisioned and asked for name, and drop down list with ex: instance size, etc.
My issue is thou, I need the user to enter in 1 long string of key value pair to be added to an attribute.
for example
parameters = [var.params]
and the end user inputs in the text field
"example1": "value1", "example2": "value2"
but of course this does not work. I tried {"example1": "value1", "example2": "value2"} and
parameters = [jsondecode(var.params)]
also does not work. Stuck on what / how to request end user to enter in the values in a specific format. The txt box is 1 liner btw :(, hence why im not a fan of morpheus but whatev's

Determining Current User for Generic Inquiry

I want to create a number of generic inquiries that lists the leads or other items for the user that's currently logged into Acumatica.
The answer to the question [Current logged in user for GI / Reports in 4.2] (Current logged in user for GI / Reports in 4.2) does not work for me in a generic inquiry. It works as described for reports.
We are using Acumatica 5.20.1757.
Using only PX.Data.AccessInfo in the generic inquiry results in the error: Sequence contains no elements. Using it in a cross join with another table gives: "Invalid object name: AccessInfo. What don't I understand/know?
While the answer above worked quite well, this gets rid of the need to select a name and configure access rights. The following example uses leads.
Provide values for Site Map Title and Site Map Location, found just below the Inquiry Title field/
On the Tables tab, select PX.Data.AccessInfo, PX.Objects.CR.Contact, PX.Object.EP.EPEmployee, PX.SM.LoginTrace, and PX.SM.Users. Accept the defaults for the alias, which will populate once you leave the line.
On the Relations tab:
a) set, Active checked, Parent Table Contact Join Type ** Left **Child Table EPEmployee, Parent Field ownerID Condition Equals Child Field pKID
b) set Active checked, Parent Table Users Join Type ** Inner **Child Table EPEmployee, Parent Field contactID Condition Equals Child Field defContactID
c) set Active checked, Parent Table Users Join Type ** Inner **Child Table LoginTrace, Parent Field username Condition Equals Child Field username
On the Parameters tab set Name ** to Username, **Schema Field to AccessInfo.UserName and **Display Name ** to User Name. Active should not be checked unless you want to check the value of the field.
9 lines were set to meet my specific conditions. Here they are.
a) Active True, Start Brackets (, Data Field Users.IsOnline Condition Equals, From Schema True, Value 1 True, End Brackets , Operator And
b) Active True, Start Brackets , Data Field LoginTrace.ScreenID Condition Equals, From Schema False, Value 1 GI000009 (yours might be different), End Brackets , Operator And
c) Active False, Start Brackets , Data Field LoginTrace.Date Condition Equals, From Schema False, Value 1 Now(), End Brackets ), Operator And
d) Active True, Start Brackets , Data Field Users.UserName Condition Equals, From Schema False, Value 1 =[LoginTrace.Username], End Brackets , Operator And
e) Active False, Start Brackets , Data Field LoginTrace.Username Condition Equals, From Schema False, Value 1 =[EPEmployee.UserID], End Brackets , Operator And
f) Active True, Start Brackets ((, Data Field Contact.ContactType Condition Equals, From Schema FALSE, Value 1 LD, End Brackets , Operator Or
g) Active True, Start Brackets , Data Field Contact.ContactType Condition Equals, From Schema FALSE, Value 1 PN, End Brackets ), Operator And
g) Active True, Start Brackets , Data Field Contact.Status Condition Equals, From Schema True, Value 1 Converted, End Brackets , Operator Or
h) Active True, Start Brackets , Data Field Contact.Status Condition Equals, From Schema True, Value 1 Open, End Brackets ), Operator Or
On the Grouping tab, set Active to True, and Data Field to Contact.ContactID
Sort order, results grid, and Entry point are up to you.
Notes: I found this GI failed in a different query where the LoginTrace.ScreenID condition was left out. It was not tried with left joins for the inner joins, but should have worked.
I just designed a generic inquiry that lists all sales orders created by the user currently logged in for a customer that uses 4.2 of Acumatica. Here are the steps.
At the Tables tab of the Generic Inquiry screen, 2 tables need to be added in addition of the other desired tables (in this example, SO.SOOrder): Data.AccessInfo and SM.Users.
At the Relations tab, the table relation should be created between the desired tables and SM.Users. The Join Type must be Left. Ex.: SOOrder Left Join Users.
The relation must be established using the pKID field of the Users table. Ex.: SOOrder.CreatedByID Equals Users.pKID.
At the Parameters tab, add a line and give it a name like UserName. The Schema Field would then be AccessInfo.UserName. The From Schema option must be activated.
At the Conditions tab, the Data Field Users.UserName Equals the parameter added in #4 as the value.
If you do not want the user to change the default username defined as parameter, make sure to review the access rights of that field in the different roles.

SAS script to list all SAS server users from metadata

I need a way to import a list of all SAS users from SAS metadata into an Excel worksheet. I was considering doing this using the SAS plugin for Microsoft Office to create a dynamic data source the retrieves the list of users dynamically from the SAS server. If I am to do this I need to know how to do this in SAS code.
Does anyone know how I would write a SAS script to display a list of all users in SAS metadata, or if this is even possible?
I've been trying to find something online but haven't had any luck.
I have full administrator privileges, so no problem there.
Thanks!
Thanks to Joe in the comments I found the answer I need:
http://support.sas.com/documentation/cdl/en/lrmeta/63180/HTML/default/viewer.htm#p1k9zipe59ha2an1pq34gu143lay.htm
I used the very last example in this page, modified to do a PROC PRINT instead of exporting to an Excel sheet. In Enterprise Guide I created a new program as follows:
/*Connect to the metadata server using the metadata system options as
shown in the first example. */
data work.Identities;
/* The LENGTH statement defines the lengths of variables for function arguments. */
length IdentId IdentName DispName ExtLogin IntLogin DomainName $32
uri uri2 uri3 uri4 $256;
/* The LABEL statement assigns descriptive labels to variables. */
label
IdentId = "Identity Id"
IdentName = "Identity Name"
DispName = "Display Name"
ExtLogin = "External Login"
IntLogin = "Is Account Internal?"
DomainName = "Authentication Domain";
/* The CALL MISSING statement initializes the output variables to missing values. */
call missing(IdentId, IdentName, DispName, ExtLogin, IntLogin, DomainName,
uri, uri2, uri3, uri4);
n=1;
n2=1;
/* The METADATA_GETNOBJ function specifies to get the Person objects in the repository.
The n argument specifies to get the first person object that is returned.
The uri argument will return the actual uri of the Person object. The program prints an
informational message if no objects are found. */
rc=metadata_getnobj("omsobj:Person?#Id contains '.'",n,uri);
if rc<=0 then put "NOTE: rc=" rc
"There are no identities defined in this repository"
" or there was an error reading the repository.";
/* The DO statement specifies a group of statements to be executed as a unit.
The METADATA_GETATTR function gets the values of the Person object's Id, Name,
and DisplayName attributes. */
do while(rc>0);
objrc=metadata_getattr(uri,"Id",IdentId);
objrc=metadata_getattr(uri,"Name",IdentName);
objrc=metadata_getattr(uri,"DisplayName",DispName);
/* The METADATA_GETNASN function gets objects associated via the
InternalLoginInfo association. The InternalLoginInfo association returns
internal logins. The n2 argument specifies to return the first associated object
for that association name. The URI of the associated object is returned in
the uri2 variable. */
objrc=metadata_getnasn(uri,"InternalLoginInfo",n2,uri2);
/* If a Person does not have any internal logins, set their IntLogin
variable to 'No' Otherwise, set to 'Yes'. */
IntLogin="Yes";
DomainName="**None**";
if objrc<=0 then
do;
put "NOTE: There are no internal Logins defined for " IdentName +(-1)".";
IntLogin="No";
end;
/* The METADATA_GETNASN function gets objects associated via the Logins association.
The Logins association returns external logins. The n2 argument specifies to return
the first associated object for that association name. The URI of the associated
object is returned in the uri3 variable. */
objrc=metadata_getnasn(uri,"Logins",n2,uri3);
/* If a Person does not have any logins, set their ExtLogin
variable to '**None**' and output their name. */
if objrc<=0 then
do;
put "NOTE: There are no external Logins defined for " IdentName +(-1)".";
ExtLogin="**None**";
output;
end;
/* If a Person has many logins, loop through the list and retrieve the name of
each login. */
do while(objrc>0);
objrc=metadata_getattr(uri3,"UserID",ExtLogin);
/* If a Login is associated to an authentication domain, get the domain name. */
DomainName="**None**";
objrc2=metadata_getnasn(uri3,"Domain",1,uri4);
if objrc2 >0 then
do;
objrc2=metadata_getattr(uri4,"Name",DomainName);
end;
/*Output the record. */
output;
n2+1;
/* Retrieve the next Login's information */
objrc=metadata_getnasn(uri,"Logins",n2,uri3);
end; /*do while objrc*/
/* Retrieve the next Person's information */
n+1;
n2=1;
rc=metadata_getnobj("omsobj:Person?#Id contains '.'",n,uri);
end; /*do while rc*/
/* The KEEP statement specifies the variables to include in the output data set. */
keep IdentId IdentName DispName ExtLogin IntLogin DomainName;
run;
/* The PROC PRINT statement writes a basic listing of the data. */
proc print data=work.Identities label;
run;
/* The PROC EXPORT statement can be used to write the data to an Excel spreadsheet. */
/* Change DATA= to the data set name you specified above. */
/* Change OUTFILE= to an appropriate path for your system. */
/*
proc export data=work.Identities
dbms=EXCE
outfile="C:\temp\Identities.xls"
replace;
run;
*/
PROC PRINT DATA=work.Identities;
When this was executed it created a SAS Report. I exported that Report as a .srx file and then used the SAS Plugin for Microsoft Office to add the report into an Excel worksheet (the "Reports" button).
I then right-clicked on the cell where the report was added and clicked Properties, and then set it to automatically update whenever the document is opened.
It's a great way to review users as an administrator. Rather than having to check each system individually to see if a user exists (when they leave the company for example) I have a sheet for each of our SAS systems, a sheet for each of our Teradata systems (auto-updated using a query run through ODBC), and another sheet auto-updated from a separate spreadsheet that contains the list of our MicroStrategy users. It makes checking all systems as simple as a single Ctrl + F.
If you just want to extract the list of users in SAS you can compile this macro and run:
%mm_getusers(outds=myusers)
Disclaimer - I wrote it, and we use it in our commercial product (https://datacontroller.io) so users can see group memberships when applying permissions within the tool.

How to assign a value to an Orchard ContentPickerField from code?

I am working on an Orchard site that needs to be able to use some customized forms to create new content items.
To handle this I'm using a controller to display a form and then trying to create the new content items on post back by populating the dynamic items and then sending them through the ContentManagerService's Create() function.
This is working ok until I got to the content picker field I have as part of my content item.
In my project I have a content type of Question Record that has a SubmittedBy field that is a Content Picker Field.
Here is what I can see in the immediate window while processing the post back:
> dynamic q = _questionService.NewQuestion("Why doesn't this work?");
{Custom.Website.Models.Question}
base {Orchard.ContentManagement.ContentPart}: {Custom.Website.Models.Question}
IsNew: true
OriginalQuestion: "Why doesn't this work?"
Summary: null
> q.QuestionRecord
{Orchard.ContentManagement.ContentPart}
base {System.Dynamic.DynamicObject}: {Orchard.ContentManagement.ContentPart}
ContentItem: {Orchard.ContentManagement.ContentItem}
Fields: Count = 5
Id: 0
PartDefinition: {Orchard.ContentManagement.MetaData.Models.ContentPartDefinition}
Settings: Count = 0
TypeDefinition: {Orchard.ContentManagement.MetaData.Models.ContentTypeDefinition}
TypePartDefinition: {Orchard.ContentManagement.MetaData.Models.ContentTypePartDefinition}
Zones: {Orchard.UI.ZoneCollection}
> q.QuestionRecord.SubmittedBy
{Orchard.ContentPicker.Fields.ContentPickerField}
base {Orchard.ContentManagement.ContentField}: {Orchard.ContentPicker.Fields.ContentPickerField}
ContentItems: null
Ids: {int[0]}
The ContentItems property is read-only and the Ids when assigning a new int[] to the Ids array I get a System.ObjectDisposedException with the message: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.
Are there any workarounds to get this value set in code or do I need to create my own property to store the related content item ids? It would be very helpful to have the admin interface of the ContentPickerField also available.
Thanks.
If you have a reference to the ContentPickerField, you can assign it a value using the Ids property.
In example (assuming your content type has a part called Question which has a field called SubmittedBy):
var submittedByField = ((dynamic)q.ContentItem).Question.SubmittedBy;
sbmittedByField.Ids = new[] { submittedById };
As Bertrand mentioned, the format to access a content field is: contentItem.PartName.FieldName.
If you attached a field to a type directly via the admin, the part name has the same name as the type name, hence contentItem.TypeName.FieldName (where TypeName is actually the name of the implicitly created part).

UserControl that embeds another user control, how to access embedded form fields?

I have a long form that the user has to fill out.
So I broke the form into logical units and created another user control for some elements (they will be reused elsewhere).
So say the form has these fields:
UserControl3.ascx
Username
password
email -- usercontrol2.ascx
address -- usercontrol2.ascx
city -- usercontrol2.ascx
state -- usercontrol2.ascx
So now in the codebehidn of usercontrol3.ascx, how will I access the usercontrol2.ascx's fields so I can write to the db?
Something like this works, but it is just not elegant:
Dim txtBox as TextBox = Ctype(parentControl.Controls(Index), System.Web.UI.Controls.TextBox)
stringVariable = txtBox.Text
The correct way to do it is to implement properties for your parentControl that access child's controls properties.
Public Property AddressField() as string
Set(byval value as string)
txtAddressField.Text = value
End Set
Get
Return txtAddressField.Text
End Get
End Property
if user control 3 contains user control 2, I would modify the code for user control 2 to expose public properties for the information that you need to retreive.
edit
There are other ways of doing it, but the property route is the safest route, and avoids strong dependencies between the two controls.

Resources