How to to overwrite Properties of search fields of Smart Filter Bar using local annotation file - sapui5

I’m trying to overwrite smart filter bar search fields properties such as “Label”, “Required” using local annotations file
Annotation file - annotation related to ArtcleNumber field
<Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm"
Target="XXX/ArticleNumber">
<Annotation Term="Common.ValueList">
<Record>
<PropertyValue Property="Label" String="Article"/>
<PropertyValue Property="CollectionPath"
String="ArticleFilterSet"/>
<PropertyValue Property="SearchSupported"
Bool="true"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty"
PropertyPath="ArticleNumber"/>
<PropertyValue Property="ValueListProperty"
String="Article"/>
</Record>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="Article"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
But Label is not getting overwrite from annotation file. Still It is taken from back end service metadata file
Please Help me on this. thanks

Related

smartfield annotation - valuehelp dropdown - does not show description

I have a problem where the smartfield (build in xml view using WebIDE) does not show the description of the key field instead just shows the key field in both the dropdown list columns.
example : 1(1) and the expectation is 1( local tax ) .
My service is built using tcode : SEGW and using WebIDE to develop the ui and annotation for the dropdown as a fixed list.
I see a solution smartfield annotation - valuehelp dropdown , but I am unable to add the sap:text to my service in SEGW.
Problem :
Issue Screenshot
Annotation in WebIDE:
</Annotations>
<Annotations Target="Metadata.ET_FV60Header/Pmethod">
<Annotation Term="Common.Text" String="Text1"/>
<Annotation Term="Common.ValueListWithFixedValues" Bool="true"/>
<Annotation Term="Common.ValueList">
<Record>
<PropertyValue Property="CollectionPath" String="VH_PmtMethSet"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterInOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="Pmethod"/>
<PropertyValue Property="ValueListProperty" String="Zlsch"/>
<Annotation Term="Common.Label" String="Text1"/>
</Record>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="Text1"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
I was able to solve the problem by adding the property "sap:text" to my entity definition in SAP using the following;
Open the corresponding ZCL*MPC_EXT class using tcode SE80 or SE24.
Redefine the method "DEFINE" under the above class. Additional properties can be added here in this method for services created via tcode : SEGW.
Code to be added under DEFINE method
** ET_Entity is my Value Help Entity data model name ( not entity set)
** FIELD_ID is the key property under the above entity to which we want to display the description in the dropdown list.
** FIELD_DESC is the property that contains the description.
Entity metadata :
Entity Data definition for Value Help( as Drop Down list )
You could do the same by adding a further annotation (targeting a specific property of the "helper" entity set) directly in WebIDE as follows:
<Annotations Target="Metadata.VH_PmtMeth/Zlsch">
<Annotation Term="Common.Text" Path="Text1"/>
</Annotations>

Is there any option to kill a job running for longer time on remote machine by rundeck itself?

I need to kill a rundeck job by itself when the job runs more than 2hours on remote machine,is there a possibility
You can set a timeout value in "Timeout" textbox (When creating or editing your job go to the "Other" tab an see that option, check this. You can use values in seconds (like 10s), minutes (like 5m), hours (like 2h), or days (like 2d), also, you can pass an option defined with that value.
I leave a job definition example to test:
<joblist>
<job>
<context>
<options preserveOrder='true'>
<option name='timeout' value='5s' />
</options>
</context>
<defaultTab>nodes</defaultTab>
<description></description>
<dispatch>
<excludePrecedence>true</excludePrecedence>
<keepgoing>false</keepgoing>
<rankOrder>ascending</rankOrder>
<successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
<threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<id>13ba3f6b-f921-4ab5-95ba-56eb335eed4b</id>
<loglevel>INFO</loglevel>
<name>HugeDelay</name>
<nodeFilterEditable>false</nodeFilterEditable>
<nodefilters>
<filter>name: node01</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<plugins />
<schedule>
<month month='*' />
<time hour='13' minute='19' seconds='0' />
<weekday day='*' />
<year year='*' />
</schedule>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<exec>sleep 30; echo "hi"</exec>
</command>
</sequence>
<timeout>${option.timeout}</timeout>
<uuid>13ba3f6b-f921-4ab5-95ba-56eb335eed4b</uuid>
</job>
</joblist>

Failed importing: Attribute "name" was already specified for element "option"

<joblist>
<job>
<context>
<options preserveOrder='true'>
<option name='PDATE' value='${DATE:yyyyMMdd}' />
<option name='TSTAMP' value='${DATE:yyyy-MM-dd&apos;T&apos;HH.mm.ssXX}' />
</options>
</context>
<description>Load Adjustment Transactions</description>
<dispatch>
<excludePrecedence>true</excludePrecedence>
<keepgoing>false</keepgoing>
<rankOrder>ascending</rankOrder>
<successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
<threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<group>PointsUpdate</group>
<id>6475eb91-926f-476b-bf05-85f5e8b22eae</id>
<loglevel>INFO</loglevel>
<name>sglp-jbadjust</name>
<nodeFilterEditable>true</nodeFilterEditable>
<nodefilters>
<filter>.*</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<schedule>
<dayofmonth />
<month day='*' month='*' />
<time hour='00' minute='00' seconds='00' />
<year year='*' />
</schedule>
<scheduleEnabled>false</scheduleEnabled>
<sequence keepgoing='false' strategy='sequential'>
<command>
<exec>echo one ${option.PDATE} two ${option.TSTAMP} three</exec>
</command>
</sequence>
</job>
</joblist>
git-import importing this gives me errors, but I do not know why:
Failed importing: rundeck/jobs/PointsUpdate_0014.xml: rundeck.controllers.JobXMLException: Unable to parse xml: org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 110; Attribute "name" was already specified for element "option".
Importing into the Rundeck GUI works fine, no errors reported, and options are correct.
I just imported your job and also tested using Tomcat 9 + Rundeck 2.4.3 + Linux. I'm not able to reproduce this error. May you provide additional data about Rundeck version,installation method,OS?
Importing using GIT
Importing using GUI

Nantcontrib <record> task

I am trying to attach a log file to email.
My code is:
**<loadtasks assembly=".../tasks.dll" />
<record name="c:foo\log.txt" action="Start" />
<target name="email">
<mail
from="abc#foo.com"
tolist="xyz#foo.com"
subject="Build"
message="Build Failed"
mailhost="smtp.anywhere.net">
<files>
<include name="c:foo\log.txt" />
</files>
<attachment>
<include name="c:foo\log.txt" />
</attachment>
</mail>
</target>
<record name="c:foo\log.txt" action="Close" />**
My command is:
nant -f:filename.build email -l:c:foo\log.txt
I get following error:
System.Security.SecurityException: Request for the permission of type 'System.Se
curity.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMa
rk& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileSystemInfo.get_FullName()
at NAnt.Contrib.Tasks.RecordTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
When i dont use <record> tasks it gives another error like, could not attach txt file. bcoz it being used by another process.
Why am I getting this error?
i do something like flush in record task , just before sending email then copy the file to attach in email , hope this workaround works
<echo>${emailsubject}</echo>
<echo>Sending Email</echo>
<echo>Attaching File : ${build.log.dir}/email_${build.log.filename}</echo>
<echo>Attaching File : ${path.vsshelper.log}/logs/email_${build.log.getlistoffiles}</echo>
<record name="${build.log.dir}/${build.log.filename}" action="Flush" level="Verbose"/>
<sleep milliseconds="5000" />
<copy file= "${build.log.dir}/${build.log.filename}" tofile="${build.log.dir}/email_${build.log.filename}" />
<copy file= "${path.vsshelper.log}/logs/${build.log.getlistoffiles}" tofile="${path.vsshelper.log}/logs/email_${build.log.getlistoffiles}" />
Make sure that the file is closed before you try to email it.

How to add bunch of external tools into Visual Studio IDE using Powershell command?

I'm able to add third party tools by manually using External Tools - which is available in the Visual Studio IDE. But my requirement is, need to add more tools by executing powershell script. Is this possible?
Yes, you could use StudioShell to work with Visual Studio's DTE object. See here and here for some examples.
You could also do this using an exported xml file, or just create on in your powershell script like what is done here
Basic jist of it:
param($installPath, $toolsPath, $package, $project)
# Determine fully qualified path to a temp file
$fileName = [System.IO.Path]::GetTempPath() + [System.Guid]::NewGuid().ToString() + ".vssettings";
# Create User Settings file:
'<UserSettings>
<ApplicationIdentity version="9.0"/>
<ToolsOptions/>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_ExternalTools" Category="{E8FAE9E8-FBA2-4474-B134-AB0FFCFB291D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_ExternalTools" PackageName="Visual Studio Environment Package">
<PropertyValue name="Launch Powershell.Command">powershell.exe</PropertyValue>
<PropertyValue name="Launch Powershell.Arguments">"& ''$(ProjectDir)\Myscript.ps1''"</PropertyValue>
<PropertyValue name="Launch Powershell.InitialDirectory">"$(ProjectDir)"</PropertyValue>
<PropertyValue name="Launch Powershell.SourceKeyName"/>
<PropertyValue name="Launch Powershell.UseOutputWindow">true</PropertyValue>
<PropertyValue name="Launch Powershell.PromptForArguments">false</PropertyValue>
<PropertyValue name="Launch Powershell.CloseOnExit">true</PropertyValue>
<PropertyValue name="Launch Powershell.IsGUIapp">false</PropertyValue>
<PropertyValue name="Launch Powershell.SaveAllDocs">true</PropertyValue>
<PropertyValue name="Launch Powershell.UseTaskList">false</PropertyValue>
<PropertyValue name="Launch Powershell.Unicode">false</PropertyValue>
<PropertyValue name="Launch Powershell.Package">{00000000-0000-0000-0000-000000000000}</PropertyValue>
<PropertyValue name="Launch Powershell.NameID">0</PropertyValue>
<PropertyValue name="ToolNames">Launch Powershell</PropertyValue>
</Category>
</Category>
</UserSettings>' >> $fileName
# Perform the import of the custom tool
$project.DTE.ExecuteCommand("Tools.ImportandExportSettings", "/import:""$fileName""");
"--Remove file"
Remove-Item -path $fileName
NOTE: In order to utilize the Visual Studio DTE, you need to use a third party extension such as PSCX (PowerShell Community Extension)