Creating Media entities and style definitions through scripting
How can i go for creating Media entities and style definitions through service scripting?
How can i go for creating Media entities and style definitions through service scripting?
For style:
var params = {
name: "MyStyle12" /* STRING */,
description: undefined /* STRING */,
content: { "content":
{ "params" : "",
backgroundColor: "",
displayString: "",
fontEmphasisBold: false,
fontEmphasisItalic: false,
fontEmphasisUnderline: false,
foregroundColor: "",
image: "",
lineColor: "",
lineStyle: "solid",
lineThickness: 1,
secondaryBackgroundColor: "",
textSize: "normal",
description: ""
//name: "TestScriptStyle"
//tags: [] /* JSON */,
}
}
//tags: undefined /* TAGS */}
};
// no return
Resources["EntityServices"].CreateStyleDefinition(params);
For media ,the content type requires is image ,so get the content type from LoadImage and then use it there liek this :
var params1 = {
proxyScheme: undefined /* STRING */,
headers: undefined /* JSON */,
ignoreSSLErrors: undefined /* BOOLEAN */,
useNTLM: undefined /* BOOLEAN */,
workstation: undefined /* STRING */,
useProxy: undefined /* BOOLEAN */,
proxyHost: undefined /* STRING */,
url: undefined /* STRING */,
timeout: undefined /* NUMBER */,
proxyPort: undefined /* INTEGER */,
password: undefined /* STRING */,
domain: undefined /* STRING */,
username: undefined /* STRING */
};
// result: IMAGE
var result = Resources["ContentLoaderFunctions"].LoadImage(params);
var params = {
name: undefined /* STRING */,
description: undefined /* STRING */,
content: result /* IMAGE */,
tags: undefined /* TAGS */
};
// no return
Resources["EntityServices"].CreateMediaEntity(params);
Thanks ,
Mukul Narang
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.