MAGICINFO DIGITAL SIGNAGE SUPPORT FORUM

Digital Information Displays (Digital Signage) => MagicInfo => Topic started by: [email protected] on June 14, 2010, 11:31:31 AM

Title: customize content upload
Post by: [email protected] on June 14, 2010, 11:31:31 AM
Hi All,

this post is actually a spin-off of another one:
http://www.magicinfopro.com/magic/index.php/topic,251.0.html

Is manual upload to library the only way to make content available to monitors?

Let me explain:
I can browse local resources of MIPro server (C:, D:, etc.). Picking up files from here works perfectly; though I have also a net drive mapped among MIPro server drives, which could be great for users to drop their files.

prob #1: remote files are not visible in the tree view of MIPro Library (I stored them on top level of network drive, no subfolder to open)

prob #2: if ever available to get remote files, did anyone ever try to set up some kind of script to auto-upload them in the library?


Thanks,
Andrea
Title: Re: customize content upload
Post by: [email protected] on June 21, 2010, 09:35:37 AM
Hi All,

this post is actually a spin-off of another one:
http://www.magicinfopro.com/magic/index.php/topic,251.0.html

Is manual upload to library the only way to make content available to monitors?

Let me explain:
I can browse local resources of MIPro server (C:, D:, etc.). Picking up files from here works perfectly; though I have also a net drive mapped among MIPro server drives, which could be great for users to drop their files.

prob #1: remote files are not visible in the tree view of MIPro Library (I stored them on top level of network drive, no subfolder to open)

prob #2: if ever available to get remote files, did anyone ever try to set up some kind of script to auto-upload them in the library?


Thanks,
Andrea

I can manage the sync of remote folder to a local directory, which I keep updated and clean of older files.

My question is: what's the command behind the "Send to library" menu item? anyone experienced in magicinfo SDK?

Andrea
Title: Re: customize content upload
Post by: London-I on June 21, 2010, 06:01:57 PM
Hi, I think I see what you are trying to do, unfortunately I can't help you but it sounds like a great idea, as I see it you will provide an area that users can drop files into to update the screens automatically without having to republish. Is that right or am I reading this wrong?
Title: Re: customize content upload
Post by: [email protected] on June 28, 2010, 02:10:54 PM
Hi, I think I see what you are trying to do, unfortunately I can't help you but it sounds like a great idea, as I see it you will provide an area that users can drop files into to update the screens automatically without having to republish. Is that right or am I reading this wrong?

correct. The idea was to make users totally autonomous on this, without the need to have someone (with server admin password) inserting files in the library.

I knew from samsung support there's no SDK available. But I'm geeking on a workaround, since library metadata DB is an open MSAccess file (located in C:\Program Files\SEC\MagicInfo Pro) ;)

Ciao,
Andrea
Title: Re: customize content upload
Post by: [email protected] on July 14, 2010, 09:30:54 AM
Hi All,

I found something to workaround the problem, something very rough but effective, needed to run that in a scheduled task...

I cleanup DB entries according to the files in the dropbox folder, then I populate the DB with the attached script (a lot of format make-up, but anyway...).

This loop works, I can open files from display/player menu; though, in the MIP library screen I can't see those entries pushed by script...


If anyone had some time to test it, I'd appreciate


BR,
Andrea



' Populates library table with metadata & writes a log with the list of inserted records

Const adOpenFwdOnly = 0
Const adLockOptimistic = 3
Const adUseClient = 3

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\LocalRepo")

objConnection.Open "DSN=LibraryDB;"
objRecordset.CursorLocation = adUseClient

For Each objFile In objFolder.Files

   'marked tablecolumns are populated by script:
   '**full_path**, relative_path, **file_name**, **file_size**, **make_date**, **reg_date**, resolution, play_time, **file_type**,
   '**category**, **attribute**, upper_location, musician, album_name, **bitrate**, Fourcc, image_event, comment, Add_On

   strFullname = Split(objFile.Name, ".")
   strSQL = "SELECT file_name FROM MEDIA_FILE WHERE file_name ='" & strFullname(0) & "'"
   
   objRecordset.Open strSQL, objConnection, adOpenStatic, adLockOptimistic
   blnTest = objRecordset.EOF
   objRecordset.Close

   if blnTest then
   
      dttm_string = objFile.DateCreated
      date_parts = Split(dttm_string, "/")
      result_dttm = Left(date_parts(2), 4) & "-" & date_parts(1) & "-" & date_parts(0)
      time_parts = Split(dttm_string, ".")
   
      if Right(time_parts(0), 2) \ 12 then
         result_dttm = result_dttm & " PM " & Format(Right(time_parts(0), 2) - 12, "00")
      else
         result_dttm = result_dttm & " AM " & Right(time_parts(0), 2)
      end if
   
      result_dttm = result_dttm & ":" & time_parts(1) & ":" & time_parts(2)
            
      Select Case Len(CStr(objFile.Size))
      
         Case 1, 2, 3
            strFilesize = objFile.Size & " B"
         Case 4, 5, 6
            strFilesize = Round(objFile.Size / 1024, 0) & " KB"
         Case Else
            strFilesize = Round(objFile.Size / 1024 / 1024, 1) & " MB"
      
      End Select
      
      strSQL = "INSERT INTO MEDIA_FILE (full_path, file_name, file_size, " & _
             "make_date, reg_date, file_type, category, attribute, bitrate)" & _
            " VALUES ('" & _
            objFile.Path & "', '" & strFullname(0) & "', '" & strFilesize & "', '" & result_dttm
      
      dttm_string = objFile.DateLastAccessed
      date_parts = Split(dttm_string, "/")
      result_dttm = Left(date_parts(2), 4) & "-" & date_parts(1) & "-" & date_parts(0)
      time_parts = Split(dttm_string, ".")
   
      if Right(time_parts(0), 2) \ 12 then
         result_dttm = result_dttm & " PM " & Format(Right(time_parts(0), 2) - 12, "00")
      else
         result_dttm = result_dttm & " AM " & Right(time_parts(0), 2)
      end if
   
      result_dttm = result_dttm & ":" & time_parts(1) & ":" & time_parts(2)

      strSQL = strSQL & "', '" & result_dttm & "', '." & strFullname(1) & "'"

      Select case strFullname(1)
         case "xls", "xlt", "xla", "xlm", "csv", "doc", "dot", "pdf", "ppt", "pps", "pot"
            strCat = "Office"
         case "jpg", "jpeg", "gif", "bmp", "png"
            strCat = "Image"
         case "fla", "swf"
            strCat = "Flash"
         case else
            strCat = ""
      end select
      
      strSQL = strSQL & ", '" & strCat & "', false, 0)"
            
      objConnection.Execute strSQL
      
   end if

Next 'objFolder.Files

objConnection.Close

Set objConnection = nothing
Set objRecordset = nothing
Set objFSO = nothing
Set objFolder = nothing
Set objFile = nothing