How can I add a property set value "intern" automatically to each new repository on artifactory 7.x? - properties

I created the property set confidentiality level in Actifactory 7 instance. My property ser contains all values (""öffentlich,"intern" and "vertraulich") described as a selection list.
I assigned the value level "intern" as default manually to my old repositories.But now I want to automate this property set with "intern" so that the "intern" property set is automatically added to each new repository.I readed the Jfrog documentation about property set and found nothing there.
But I'd rather add the "intern" property for the new repositories automatically in the future.
I added some pictures to show you ,what I already did.

Open Tree view of Artifacts > navigate to your repository > Open Properties Tab > Select/add properties > Check mark Recursive. (When checked, the property will be added to the selected folder and to all of the artifacts, folders and sub-folders under the current selection). Attached the image.

You can use the REST API to create a repository and while creating the repository, you can pass the property sets data as mentioned here.

Related

How to change the image displayed on a button at runtime in Visual Basic?

I am trying to change the Image attribute associated with a button when the button is clicked.
I have added the image I want to display (called "Black Pawn.png") as a resource within the solution and (from searching around and looking at similar questions) am trying to set the image attribute to it as shown below:
Private Sub boardButtonA2_Click(sender As Object, e As EventArgs) Handles boardButtonA2.Click
Dim sprites As Object = My.Resources.ResourceManager
boardButtonA2.Image = sprites.GetObject("Black Pawn.png")
End Sub
But when I click the button, the default image on it just disappears and is replaced with nothing instead of Black Pawn.png.
I am pretty new to using Visual Basic and Visual Studio so I may have failed to have added the image as a resource properly but I can see the image in the Solution Explorer above the form the button is in.
Any help or advice would be a great help.
Thanks.
EDIT:
Having thought more about the potential scenario, I'm wondering whether this answer is actually relevant. Your example code uses a hard-coded String but I'm wondering whether the actual String really would be a user selection. I'll leave it here anyway.
ORIGINAL:
There's no reason to use a hard-coded String to get a resource. If the String was from user entry then maybe, depending on the circumstances. As it is though, you should be using the dedicated property for that resource. That means using this:
boardButtonA2.Image = My.Resources.Black_Pawn
Just be aware that a new object is created every time you get a resource from My.Resources. For that reason, don't keep getting the same property over and over. If you need to use a resource multiple times, get it once and assign it to a field, then use that field multiple times, e.g.
Private blackPawnImage As Image
Private Function GetBlackPawnImage() As Image
If blackPawnImage Is Nothing Then
blackPawnImage = My.Resources.Black_Pawn
End If
Return blackPawnImage
End Function
and then:
boardButtonA2.Image = GetBlackPawnImage()
Also, I suggest that you change the name of the property to BlackPawn rather than Black_Pawn. You can change it to whatever you want on the Resources page of the project properties.
EDIT:
If this application is a chess game then you definitely will need every resource image for the playing pieces so you probably ought to get all of them at load and assign them to variables, then use them from those variables over the course of the game.
(I am assuming the question is for WinForms, if it isn't I will remove this answer)
When adding images as resources to a project, you have to pay attention to the name given to the resource after it is imported - the name can be changed if you want.
The image below is from one of my projects:
The name of the files on disk are:
CSV - Excel.png
GreenDot.png
RedDot.png
To fix your problem change the line:
boardButtonA2.Image = sprites.GetObject("Black Pawn.png")
to be:
boardButtonA2.Image = sprites.GetObject("Black_Pawn")
I don't think adding the image by going into Project > Add Existing Item properly added the image as a resource.
I instead went into *Project > (Solution Name) Properties > Resources > Images > Add Existing Item * and added it that way and was then able to get it working using jmcilhinney's method (I think my original method/a variation of it would work too but theirs is better).

How to access and switch between two non-default Contacts folders?

In the display of maps in Outlook I see a folder 'Contactpersonen' and another 'Centraal adresboek'.
The first shows up as:
mobiel#avantsanare.nl
..Contactpersonen
and the other:
Public folders - mobiel#avantsanare.nl
..All public folder
..Avant Sanare
.. Centraal Adresboek
These are copies for different purposes.
What do I have to specify here:
Set myContactsFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
to get access to these two folders to add/delete/change items in these folders to keep them synchronized?
I want to do this from MSAccess following the Outlook object model.
Instead of using Namespace.GetDefaultFolder, you would need to drill down to these folders either through the Namespace.Folders collection or the Namespace.Stores collection.

How do I store a variable permanently in a Word 2010 document using VBA?

I know how to use variables in Word 2010 using VBA. However, they are all reset when the document in closed and reopened.
How do I store a variable permanently in a Word document?
This can be used:
Sub Test()
ActiveDocument.Variables.Add Name:="PermanentVar", Value:=100
'ActiveDocument.Variables("PermanentVar").Delete
End Sub
Check if it is retained:
Private Sub Document_Open()
Msgbox ActiveDocument.Variables("PermanentVar")
End Sub
Ref MS kb Link
Ref SO link
Use a custom document property instead. These are stored on the Word document permanently, and can be edited and retrieved using VBA.
To create a custom property, go to File > Properties > Advanced Properties (this will be in a slightly different place in older version of Word but will still be there somewhere...).
Go to the Custom tab from the advanced properties, and fill in the name of your custom document property, the field type (you can select text, date, number or a Yes/No flag, which should cover off most options), and a starting value - you have you include a starting value or the Add button will be greyed out. Click Add.
You now have a custom property in your document, and you can use VBA to manipulate and reference it.
To change the value of your property, use the following code:
Application.ActiveDocument.CustomDocumentProperties.Item(1).Value = "Your new value..."
Item(1) is set because this is reference the first custom document property in your document. If you have more than one custom property, you'll need to change the number to reference the correct property, or write some VBA that will reference the property by name.
To pass the property to a variable, use the following code:
strYourVariable = Application.ActiveDocument.CustomDocumentProperties.Item(1).Value

Save a user popup selection in a custom Automator Action

Using Xcode 5.* for a cocoa-applescript automator action.
Interface is a a simple popup menu that gets populated using an outlet with:
tell thePopupMenu to removeAllItems()
tell thePopupMenu to addItemsWithTitles_(theList)
When the action is used in a workflow (a Service actually), I want the next time it is run and the action dialog shows up (I will have "Options:Show when run" selected), I want the popup menu to change the selection to the last one that was selected. Right now, the default first item shows, even though last time it was run, the user selected a different item in the popup menu.
My thought was that I need to capture a change in the popup menu with a Sent Action handler, and then set some type of default. I have a working handler:
on thePopupMenuSentAction_(sender)
set popupValue to (popupSelectedValue of my parameters()) as string
-- save this selection somewhere???
end
What's the right way to save this? Do I use User Defaults? My Bindings are currenly all tied through Parameter object/controller. If I should use User Defaults, can someone give example code for setting up User Defaults, and then how to get and set a new value using Cocoa-Applescript?
If I can get the name string of the menu item saved somewhere, I can get the string and then change the selection of the popup menu in the
on opened {}
-- set up the action interface
end
handler which gets called just before the action is displayed each time.
Thanks for any help,
Joe
I did mine a bit differently. I will assume you are referring to what XCode calls a "pop up button" (somewhat misleading). I did not use the parameters at all, although that is probably better for larger projects. Have a look at the code:
script Insert_Picture_into_Powerpoint_Slide_Show
property parent : class "AMBundleAction"
property menuChoices : {"Insert a Beginning", "Insert at End"}
property menuSelection : missing value
if (menuSelection as string) is "missing value"
set menuSelection to 0 as integer -- sets default value
end if
end script
I bound Content Values to File's Owner and under Model Key Path I put menuChoices.
Then you just bind the Selected Index to File's Owner and for the Model Key Path type menuSelection.
Defaults
On the initial run, if the user does not click anything, the menuSelection will be missing value. Because I couldn't find a way around this, I created a conditional which tests for this and sets it to the first choice by default (the one that is shown when you add the action).
When the user selections one of the menu choices, the choice is remembered on sequential runs.

Class-level Static Variable per Instance

I'm trying to do the following:
I need a static variable to get a ListItemCollection from a List control (I can do this, but if I don't set it as Shared It's not preserving the values as it should). The thing is that this class is a SharePoint webpart, so I most probably will be using the webpart more than once, and I need this variable to be unique to each webpart, which shared doesn't accomplish.
I tried everything you can imagine. I placed a Static variable within a Sub (shared and not shared), I tried it with Properties (also Shared and not shared)...
Any Ideas are welcome.
Thanks.
By definition, static members are per-class (or per-thread with a ThreadStatic attribute).
If you need to save the property on the webpart, add the WebPartStorageAttribute on the property, also throw on a FriendlyNameAttribute on there to make it clean:
C# Version:
[FriendlyNameAttribute("What the setting will be called")]
[WebPartStorage(Storage.Shared)]
private string MyStringThatGetsSaved { get; set; }
VB.Net Version:
<WebPartStorage(Storage.Personal), FriendlyNameAttribute("What the setting will be called")>
Private mMyStringThatGetsSaved As String
Public Property MyStringThatGetsSaved () As String
Get
Return mMyStringThatGetsSaved
End Get
Set(ByVal Value As String)
mMyStringThatGetsSaved = Value
End Set
End Property
Is this what you're after? If not can you clarify a bit further?
I finally went on another way, I just added some checkboxes to the toolpart and setted the properties on the webpart.
Anyway, what I was trying to do is:
Have a Web Part that changes its controls on Edit & Browse mode. In Edit mode I show two ListBox controls, two buttons (add, remove). When I click the add button, the value has to be removed from the left ListBox and be added to the right ListBox, so far so good I was able to make this functionality with no problems... The thing is when I go back to Browse mode I need to use the items in the ListBox from the right to show (so I added a ListItemCollection control that would store the values from the ListBox on the right), the text of the item and a TextBox control, then the user would enter their text in that textbox and hit the "Search" button and a search query would be executed.
My problem is that when I go from Edit to Browse the ListItemCollection variable I added is getting restarted. So I declared it as Shared, and that does work, but when I add a new instance of the WebPart, they have the same fields displayed... I don't know if there is a way of doing a Static Class-Level variable that is unique to each instance, so I went the ToolPart way...