Skip to content

Commit

Permalink
Merge pull request #12 from dropbox/jack/4.7
Browse files Browse the repository at this point in the history
4.7 build
  • Loading branch information
chadduffey authored Dec 21, 2016
2 parents 153066e + 2b97e76 commit 4541ab6
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 24 deletions.
Binary file modified Installer/DBAdminToolkit.Setup.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions Source/DBAdminToolkit.Setup/DBAdminToolkit.Setup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -813,15 +813,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Dropbox Business Admin Toolkit"
"ProductCode" = "8:{DA3A284F-68C0-4E69-AD41-15D440508950}"
"ProductCode" = "8:{7BBED41D-E5BB-44F1-ABE0-4D4E4A005E4C}"
"PackageCode" = "8:{4F507568-2104-402C-812B-BF0F65944546}"
"UpgradeCode" = "8:{F6F4214B-C1CB-4F20-B1B3-35E1B7262F93}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:4.6.2"
"ProductVersion" = "8:4.7.0"
"Manufacturer" = "8:Dropbox Enterprise Services"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
4 changes: 2 additions & 2 deletions Source/DfBAdminToolkit.Common/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.6.2.0")]
[assembly: AssemblyFileVersion("4.6.2.0")]
[assembly: AssemblyVersion("4.7.0.0")]
[assembly: AssemblyFileVersion("4.7.0.0")]
31 changes: 21 additions & 10 deletions Source/DfBAdminToolkit/Presenter/DataMigrationPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ protected override void UnWireViewEvents() {
}
}

public void UpdateSettings() {
public void UpdateSettings()
{
OnDataChanged(this, new EventArgs());
}

Expand All @@ -65,17 +66,21 @@ private void SearchItems(
IMemberServices service,
TeamListViewItemModel owner,
IDataMigrationModel model,
IMainPresenter presenter) {
IMainPresenter presenter)
{
bool SuppressStatus = ApplicationResource.SuppressFilenamesInStatus;
try {
try
{
service.ListFolderUrl = ApplicationResource.ActionListFolder;
service.UserAgentVersion = ApplicationResource.UserAgent;
IDataResponse response = service.ListFolders(
new MemberData() {
MemberId = owner.TeamId
}, model.AccessToken);
if (response.StatusCode == HttpStatusCode.OK) {
if (response.Data != null) {
if (response.StatusCode == HttpStatusCode.OK)
{
if (response.Data != null)
{
string content = response.Data as string;
dynamic jsonDataSearch = JsonConvert.DeserializeObject<dynamic>(content);
IDictionary<string, long> folderMap = new Dictionary<string, long>();
Expand All @@ -101,7 +106,8 @@ private void SearchItems(
ItemSizeByte = 0
};
}
else {
else
{
string serverModified = entry["server_modified"].ToString();
string serverModifiedDate = string.Empty;
if (!string.IsNullOrEmpty(serverModified))
Expand Down Expand Up @@ -190,7 +196,8 @@ private void SearchItems(
ItemSizeByte = 0
};
}
else {
else
{
string serverModified = entry["server_modified"].ToString();
string serverModifiedDate = string.Empty;
if (!string.IsNullOrEmpty(serverModified))
Expand Down Expand Up @@ -246,7 +253,9 @@ private void SearchItems(
}
}
}
} catch (Exception ex) {
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Expand Down Expand Up @@ -281,7 +290,8 @@ private IList<TeamListViewItemModel> SearchOwner(
dynamic emailObj = profile["email"];
dynamic name = profile["name"];
dynamic status = profile["status"];
if (status != null && (status[".tag"].ToString().Equals("active") || status[".tag"].ToString().Equals("suspended"))) {
if (status != null && (status[".tag"].ToString().Equals("active") || status[".tag"].ToString().Equals("suspended") || status[".tag"].ToString().Equals("invited")))
{
string teamId = idObj.Value as string;
string email = emailObj.Value as string;
string firstName = name["given_name"].ToString();
Expand Down Expand Up @@ -310,7 +320,8 @@ private IList<TeamListViewItemModel> SearchOwner(
bool hasMore = jsonData["has_more"];
string cursor = jsonData["cursor"];

while (hasMore) {
while (hasMore)
{
service.ListMembersContinuationUrl = ApplicationResource.ActionListMembersContinuation;
IDataResponse responseCont = service.ListMembersContinuation(new MemberData() {
Cursor = cursor
Expand Down
81 changes: 73 additions & 8 deletions Source/DfBAdminToolkit/Presenter/DumpUserContentPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class DumpUserContentPresenter

public string[] ContextMenuItemText { get; set; }

private static readonly object insertLock = new object();

public DumpUserContentPresenter(IDumpUserContentModel model, IDumpUserContentView view)
: base(model, view) {
}
Expand Down Expand Up @@ -63,10 +65,12 @@ protected override void UnWireViewEvents() {
}
}

protected override void CleanUp() {
protected override void CleanUp()
{
}

public void UpdateSettings() {
public void UpdateSettings()
{
OnDataChanged(this, new EventArgs());
}

Expand Down Expand Up @@ -94,7 +98,6 @@ private bool SearchFiles(
{
string content = response.Data as string;
dynamic jsonDataSearch = JsonConvert.DeserializeObject<dynamic>(content);

int entryCount = 0;
if (jsonDataSearch["entries"] != null)
{
Expand All @@ -109,13 +112,13 @@ private bool SearchFiles(
model.MemberList.RemoveAt(i);
}
}

int total = 0;
for (int i = 0; i < entryCount; i++)
{
TeamListViewItemModel lvItem = null;
if (jsonDataSearch["entries"][i][".tag"].ToString().Equals("file"))
{
TeamListViewItemModel lvItem = new TeamListViewItemModel()
lvItem = new TeamListViewItemModel()
{
Email = item.Email,
TeamId = item.TeamId,
Expand All @@ -124,7 +127,10 @@ private bool SearchFiles(
FileSize = FileUtil.FormatFileSize(Convert.ToInt64(jsonDataSearch["entries"][i]["size"].ToString())),
IsChecked = true
};
model.MemberList.Add(lvItem);
lock (insertLock)
{
model.MemberList.Add(lvItem);
}
SyncContext.Post(delegate
{
presenter.UpdateProgressInfo(string.Format("Searching Files For : {0} File Count: {1}", item.Email, (++total)));
Expand All @@ -134,10 +140,68 @@ private bool SearchFiles(
if (entryCount > 0)
{
filesAdded = true;
}
}
bool hasMore = jsonDataSearch["has_more"];
string cursor = jsonDataSearch["cursor"];

while (hasMore)
{
service.ListFolderUrl = ApplicationResource.ActionListFolderContinuation;
service.UserAgentVersion = ApplicationResource.UserAgent;
IDataResponse responseCont = service.ListFolders(
new MemberData()
{
MemberId = item.TeamId,
Cursor = cursor
}, model.UserAccessToken);

string contentCont = responseCont.Data as string;
dynamic jsonDataSearchCont = JsonConvert.DeserializeObject<dynamic>(contentCont);

int entryCountCont = 0;
if (jsonDataSearchCont["entries"] != null)
{
entryCountCont = jsonDataSearchCont["entries"].Count;
}

int totalCont = 0;
for (int i = 0; i < entryCountCont; i++)
{
TeamListViewItemModel lvItem = null;
if (jsonDataSearchCont["entries"][i][".tag"].ToString().Equals("file"))
{
lvItem = new TeamListViewItemModel()
{
Email = item.Email,
TeamId = item.TeamId,
FileName = jsonDataSearchCont["entries"][i]["name"].ToString(),
FilePath = jsonDataSearchCont["entries"][i]["path_lower"].ToString(),
FileSize = FileUtil.FormatFileSize(Convert.ToInt64(jsonDataSearchCont["entries"][i]["size"].ToString())),
IsChecked = true
};
lock (insertLock)
{
model.MemberList.Add(lvItem);
}

SyncContext.Post(delegate
{
presenter.UpdateProgressInfo(string.Format("Searching Files For : {0} File Count: {1}", item.Email, (++totalCont)));
}, null);
}
}
if (entryCountCont > 0)
{
filesAdded = true;
}
hasMore = jsonDataSearchCont["has_more"];
cursor = jsonDataSearchCont["cursor"];
}
}
}
} catch (Exception ex) {
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return filesAdded;
Expand Down Expand Up @@ -382,6 +446,7 @@ private void OnCommandContextMenuClicked(object sender, Common.DataExchange.Data
else
{
MemberServices service = new MemberServices(ApplicationResource.BaseUrl, ApplicationResource.ApiVersion);
model.MemberList.Clear();
foreach (TeamListViewItemModel item in selectedLvItems)
{
SearchFiles(service, item, model, presenter);
Expand Down
4 changes: 2 additions & 2 deletions Source/DfBAdminToolkit/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.6.2.0")]
[assembly: AssemblyFileVersion("4.6.2.0")]
[assembly: AssemblyVersion("4.7.0.0")]
[assembly: AssemblyFileVersion("4.7.0.0")]

0 comments on commit 4541ab6

Please sign in to comment.