Skip to content

Instantly share code, notes, and snippets.

View pmedcraft's full-sized avatar

Phil Medcraft pmedcraft

View GitHub Profile
@pmedcraft
pmedcraft / DownloadFromTridion.cs
Last active March 2, 2017 20:59
C# method for downloading a multimedia asset from SDL Web (Tridion)
private static Dictionary<string, string> DownloadFromTridion(StreamDownloadClient streamDownloadClient, ComponentData multimediaComponent)
{
Dictionary<string, string> downloadInfo = null;
// Prepare file for download in local file system
string originalFileName = Path.GetFileName(multimediaComponent.BinaryContent.Filename);
string downloadFile = Options.MigrationSupportDirectory + originalFileName;
FileStream fs = File.Create(downloadFile);
try
@pmedcraft
pmedcraft / app-settings-sdlweb-to-sdlmediamanager-migration.xml
Last active March 2, 2017 21:00
C# application settings for SDL Web (Tridion) to SDL Media Manager asset migration tool
<appSettings>
<!-- Properties used by the Core Service -->
<add key="HostName" value="hostname-to-the-sdlweb-cme-server.com" />
<add key="ImpersonationUserDomain" value="the-domain"/>
<add key="ImpersonationUserName" value="the-username" />
<add key="ImpersonationUserPassword" value="********" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<!-- Properties used by the Media Manager integration -->
<add key="IssuerName" value="http://localhost:89/IWSTrust13" />
<add key="MediaManagerWebServiceAddress" value="https://customerdomain.sdlmedia.com/WebServices/MediaManager2011.svc" />
@pmedcraft
pmedcraft / core-service-adding-components-to-workflow.java
Last active March 2, 2017 21:02
Adding a list of SDL Web (Tridion) components to Workflow using the SDL Web Core Service in Java
protected void doWorkflow(List<IdentifiableObjectData> updatedComponents) throws Exception {
if (updatedComponents.isEmpty())
return;
try {
// Build the array of components
ArrayOfstring arrayOfComponents = new ArrayOfstring();
for (final IdentifiableObjectData component : updatedComponents) {
arrayOfComponents.getString().add(component.getId().getValue());
}
@pmedcraft
pmedcraft / core-service-java-proxy-using-jaxws-maven-plugin.xml
Last active March 2, 2017 21:03
Getting the Java proxy for the SDL Web (Tridion) Core Service using the jaxws-maven-plugin
<dependencies>
<!-- This is for the JAXWS WsImport -->
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.8</version>
</dependency>
</dependencies>
<build>