Skip to content

Instantly share code, notes, and snippets.

View YMA-MDL's full-sized avatar
🎯
Focusing

Yoann Maingon YMA-MDL

🎯
Focusing
View GitHub Profile
var httpWebRequest = (HttpWebRequest) WebRequest.Create("https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXX");
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
using(var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream())) {
string json = "{\"text\":\"test message from Aras Innovator to Slack\"," +
"\"username\":\"Innovator\"}";
streamWriter.Write(json);
streamWriter.Flush();
// retrieve the document name
String documentName = this.getProperty("name");
// retrieve the document id
String documentID = this.getID();
// create the POST web request
var httpWebRequest = (HttpWebRequest) WebRequest.Create("https://hooks.slack.com/services/XXXXX/XXXXX/XXXXXXXXXX");
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
<AML>
<Item action="edit" type="ItemType" id="8B0779BD0C174C0A875E37F7D78B9B57">
<Relationships>
<Item action="add" type="Property">
<data_type>foreign</data_type>
<name>foreigntest2</name>
<data_source >DF1F9AA824E045FCA06794B7CDEFB345</data_source>
<foreign_property type="Property">B8CBB2ED30B041EDB4278C58CD73FD86</foreign_property>
</Item>
</Relationships>
System.Diagnostics.Debugger.Break();
// Example request
// <Item type="tha_Node" id="E2E7D574B0E2449DA6367CD0F8D01448" project="Proj1" fromStream="Trunk" fromVersion="1" toStream="Trunk">...
Innovator inn = this.getInnovator();
// Get the main node informations
string proj = this.getAttribute("project");
if (proj == null) return inn.newError("Project is required");
string fromStream = this.getAttribute("fromStream");
if (fromStream == null) return inn.newError("fromStream is required");
@YMA-MDL
YMA-MDL / amlCall.java
Created September 23, 2016 09:06
java example for AML call
String nameSpace = "http://www.aras-corp.com/";
String remoteMethod = "ApplyItem";
String characterEncoding = "UTF-8";
String SOAPmessage = "<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><SOAP-ENV:Body><ApplyItem xmlns:m='http://www.aras-corp.com/'>" + context.XML_Buffer + "</ApplyItem></SOAP-ENV:Body></SOAP-ENV:Envelope>";
// Create new URL object and HttpURLConnection object
java.net.URL url = new java.net.URL(context.InnovatorService);
java.net.HttpURLConnection httpConnection = (java.net.HttpURLConnection) url.openConnection();
// Convert the message to a byte array
byte[] messageBytes = SOAPmessage.getBytes();
import java.net.*;
import java.io.*;
import java.security.*;
import java.math.*;
class filecheckin
{
public static String calcMD5(String s) {
MessageDigest m = null;
@YMA-MDL
YMA-MDL / ExcelToClassification.vb
Last active September 23, 2016 09:28
Tranforms an classification stored in Excel to Aras Item classification
' source columns are from 6 to 10 and are ordered alphabetically starting on col 6 to 10.
Sub ListToClassStructure()
Dim colStart As String
colStart = "f"
Dim i As Integer
i = 2
@YMA-MDL
YMA-MDL / reqSafetyElt.xml
Created January 31, 2017 19:17
reqSafety Element (S1000D)
<xs:element name="reqSafety">
<xs:complexType>
<xs:complexContent>
<xs:extension base="aras:text">
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
@YMA-MDL
YMA-MDL / reqSafety.css
Created January 31, 2017 19:20
reqSafety CSS for preText
.reqSafety::before {
content: "Safety conditions \A";
white-space: pre;
text-align: center;
font-size: 1.6em;
font-weight: bold;
}
@YMA-MDL
YMA-MDL / gitLabToGitGraph.js
Last active September 1, 2023 08:54
Rendering a gitgraph in Aras PLM Solution, from a git extract (from gitlab)
require([
"./gitgraph/gitgraph.min.js",
"./gitgraph/lodash.js"
], function() {
var myTemplateConfig = {
colors: [ "#66ff66", "#00ffff", "#9999ff", "#ff6699", "#ff9966", "#3399ff", "#ff3300" ], // branches colors, 1 per column
branch: {
lineWidth: 6,
spacingX: 40,