Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Plugin assembly version column added
JanezH
#1 Posted : Thursday, May 27, 2010 4:01:26 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 5/26/2010(UTC)
Posts: 8
Location: Slovenija
I have been playing with plugins for a while. Due to frequent plugin updates I missed information on deployed plugin assembly version.

A simple solution follows:

Additional column is added in /Schema/PagePlugin.xml
Code:
...
<column Name="Description" Label="Assembly version" DataIndexInList="Description">
<list width="200" sortable="false"/>
</column>
</columns>
</schema>


PagePluginController (Everest.CmsServices.Controllers) GetFiles method returs an extra column with assembly version info:
Code:
[PermissionFilter(Permission = FolderType.PagePlugin)]
public ActionResult GetFiles()
{
string applicationName = Request.Form["application"];
List<FolderFile> folderFiles = AssemblyFileManager.GetAssemblyFiles(applicationName);
ExtJsonReaderObject jsonReader = new ExtJsonReaderObject(folderFiles.Select(a => new {
FileName = a.FileName,
FilePath = a.FilePath,
Application = a.Application,
Description = GetAssemblyFileDescription(CmsGlobal.ToAbsolutePath(a.FilePath))
}), folderFiles.Count());
// ExtJsonReaderObject jsonReader = new ExtJsonReaderObject(folderFiles, folderFiles.Count);
return Json(jsonReader);
}


... using helper method:
Code:
/// <summary> Get assembly description without locking the file </summary>
/// <param name="fullFilename"> Assembly filename </param>
private string GetAssemblyFileDescription(string fullFilename)
{
try
{
System.Reflection.AssemblyName name = System.Reflection.AssemblyName.GetAssemblyName(fullFilename);
return string.Format("{0}", name.Version);
}
catch
{
return "??";
}
}
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.212 seconds.