public static string GetTarget_DestinationContentName(string specificDestinationContentName, InformationOutput informationOutput)
 {
     string destinationContentName = string.IsNullOrEmpty(specificDestinationContentName) ?
                                         informationOutput.DestinationContentName : specificDestinationContentName;
     if (string.IsNullOrEmpty(destinationContentName))
         return "bulkdump.all";
     return destinationContentName;
 }
 public static AuthenticatedAsActiveDevice GetTarget_AuthenticatedAsActiveDevice(InformationOutput informationOutput)
 {
     var authenticationID = informationOutput.AuthenticatedDeviceID;
     if (string.IsNullOrEmpty(authenticationID))
         return null;
     VirtualOwner owner = VirtualOwner.FigureOwner(informationOutput);
     return AuthenticatedAsActiveDevice.RetrieveFromOwnerContent(owner, authenticationID);
 }
 public static string GetTarget_LocalContentURL(string localContentName, InformationOutput informationOutput)
 {
     var invalidFilenameChars = Path.GetInvalidFileNameChars();
     bool hasInvalidFilenameCharacter = localContentName.Any(invalidFilenameChars.Contains);
     if(hasInvalidFilenameCharacter)
         throw new ArgumentException("Invalid filename character in localContentName: " + localContentName, "localContentName");
     bool requiresLocalName = informationOutput.LocalContentURL.EndsWith("/");
     bool hasLocalContentName = String.IsNullOrEmpty(localContentName) == false;
     if (requiresLocalName)
     {
         if(String.IsNullOrEmpty(localContentName))
             throw new ArgumentException("Valid argument missing for localContentName", "localContentName");
         return informationOutput.LocalContentURL + localContentName;
     } else if(hasLocalContentName)
         throw new ArgumentException("InformationOutput LocalContentUrl needs to end to / to support localContentName");
     return informationOutput.LocalContentURL;
 }
 public static TBEmailValidation GetTarget_EmailValidation(TBAccount owningAccount, TBCollaboratingGroup owningGroup, InformationOutput informationOutput, string[] ownerEmailAddresses)
 {
     TBEmailValidation emailValidation = new TBEmailValidation();
     var confirmation = new TBInformationOutputConfirmation();
     emailValidation.InformationOutputConfirmation = confirmation;
     if (owningAccount != null && owningGroup != null)
         throw new InvalidDataException("Both owning account and owning group cannot be defined");
     if (owningAccount == null && owningGroup == null)
         throw new InvalidDataException("Both owning account and owning group must not be null");
     if (owningAccount != null)
         confirmation.AccountID = owningAccount.ID;
     if (owningGroup != null)
         confirmation.GroupID = owningGroup.ID;
     confirmation.InformationOutputID = informationOutput.ID;
     emailValidation.ValidUntil = DateTime.UtcNow.AddMinutes(30);
     emailValidation.Email = ownerEmailAddresses.FirstOrDefault();
     if (emailValidation.Email == null)
         throw new InvalidDataException("Owner must have at least one email address defined");
     return emailValidation;
 }
Exemple #5
0
 public static void SendOutputJoinEmail(TBEmailValidation emailValidation, InformationOutput informationOutput, string[] ownerEmailAddresses)
 {
     string urlLink = GetUrlLink(emailValidation.ID);
     var confirmation = emailValidation.InformationOutputConfirmation;
     bool isAccount = confirmation.AccountID != null;
     string ownerID = isAccount
                          ? confirmation.AccountID
                          : confirmation.GroupID;
     string emailMessageFormat = InstanceConfiguration.EmailOutputJoinMessageFormat;
     string message = String.Format(emailMessageFormat, informationOutput.OutputDescription,
                                    isAccount ? "account" : "collaboration group", ownerID, urlLink);
     string subject = String.Format(InstanceConfiguration.EmailOutputJoinSubjectFormat, ownerID);
     foreach (string emailAddress in ownerEmailAddresses)
     {
         SendEmail(FromAddress, emailAddress, subject, message);
     }
 }
 private void CopyContentFrom(InformationOutput sourceObject)
 {
     OutputDescription = sourceObject.OutputDescription;
             DestinationURL = sourceObject.DestinationURL;
             DestinationContentName = sourceObject.DestinationContentName;
             LocalContentURL = sourceObject.LocalContentURL;
             AuthenticatedDeviceID = sourceObject.AuthenticatedDeviceID;
             IsValidatedAndActive = sourceObject.IsValidatedAndActive;
 }
partial         static void CreateCustomDemo(ref InformationOutput customDemoObject);
 public static InformationOutput CreateDefault()
 {
     var result = new InformationOutput();
             return result;
 }
 public static string GetTarget_DestinationURL(InformationOutput informationOutput)
 {
     return informationOutput.DestinationURL;
 }
 public static void ExecuteMethod_VerifyValidOutput(InformationOutput informationOutput)
 {
     if (informationOutput.IsValidatedAndActive == false)
         throw new SecurityException("InformationOutput is not active");
 }
 public static void ExecuteMethod_PushToInformationOutput(IContainerOwner owner, InformationOutput informationOutput, string destinationUrl, string destinationContentName, string localContentUrl, AuthenticatedAsActiveDevice authenticatedAsActiveDevice)
 {
     if(authenticatedAsActiveDevice == null)
         throw new NotSupportedException("Push not currently supported without authenticated as device connection");
     DeviceSupport.PushContentToDevice(authenticatedAsActiveDevice, localContentUrl, destinationContentName);
 }
 public static void ExecuteMethod_SendEmailConfirmation(InformationOutput informationOutput, TBEmailValidation emailValidation, string[] ownerEmailAddresses)
 {
     EmailSupport.SendOutputJoinEmail(emailValidation, informationOutput, ownerEmailAddresses);
 }