Skip to content

Commit

Permalink
Delete and sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ramvibhakar committed Jul 27, 2015
1 parent f28dcfe commit 7c17e7b
Show file tree
Hide file tree
Showing 12 changed files with 717 additions and 538 deletions.
12 changes: 10 additions & 2 deletions KSKInterface/src/data/KSketch_DataListItem.as
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package data {
private var _originalSketchId:int;
private var _version:int;
private var _newVersion:int;

private var _lowerFileName:String;

public function KSketch_DataListItem(fileData:String, fileName:String, originalName:String, id:String,
modified:String, changeDescription:String, sketchId:int, version:int) {
Expand Down Expand Up @@ -63,6 +63,7 @@ package data {
{
_newVersion = _version;
}
_lowerFileName = fileName.toLowerCase();
}

public function set fileData(value:XML):void
Expand Down Expand Up @@ -164,6 +165,13 @@ package data {
{
return _newVersion;
}


public function get lowerFileName():String {
return _lowerFileName;
}

public function set lowerFileName(value:String):void {
_lowerFileName = value;
}
}
}
30 changes: 28 additions & 2 deletions KSKInterface/src/data/KSketch_ListItem.as
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ public class KSketch_ListItem implements IComparator{
private var _created:String;
private var _version:int;
private var _isSaved:Boolean;
private var _uniqueId:String;
private var _lowerFileName:String;

public function KSketch_ListItem() {
this._sketchId = 0;
this._sketchId = -1;
this._fileName = "";
this._thumbnailData = "";
this._created = "";
this._version = 0;
this._isSaved = true;
this._lowerFileName = "";
}

public function fromWebData(webData:Object):void {
Expand All @@ -34,15 +37,22 @@ public class KSketch_ListItem implements IComparator{
this._created = webData.data.created;
this._version = webData.data.version;
this._isSaved = true;
this._lowerFileName = this._fileName.toLowerCase();
}

public function fromCache(cacheData:Object):void {
this._sketchId = cacheData.sketchId;
if(cacheData.sketchId == ""){
this._sketchId = -1;
}else {
this._sketchId = int(cacheData.sketchId);
}
this._fileName = cacheData.fileName;
this._thumbnailData = cacheData.thumbnailData;
this._created = cacheData.created;
this._version = cacheData.version;
this._isSaved = cacheData.isSaved;
this._uniqueId = cacheData.uniqueId;
this._lowerFileName = this._fileName.toLowerCase();
}
public function compare(item1:*, item2:*):int {
if(item1._sketchId < item2._sketchId)
Expand Down Expand Up @@ -99,5 +109,21 @@ public class KSketch_ListItem implements IComparator{
public function set isSaved(value:Boolean):void {
_isSaved = value;
}

public function get uniqueId():String {
return _uniqueId;
}

public function set uniqueId(value:String):void {
_uniqueId = value;
}

public function get lowerFileName():String {
return _lowerFileName;
}

public function set lowerFileName(value:String):void {
_lowerFileName = value;
}
}
}
2 changes: 1 addition & 1 deletion KSKInterface/src/sg/edu/smu/ksketch2/KSketchWebLinks.as
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package sg.edu.smu.ksketch2
public static const url:String = KSketch_Config.host_name+"/app/login.html"; //Page displayed on stagewebview
public static const jsonurlUser:String = KSketch_Config.host_name+"/user/getuser"; //To retrieve user information after login
public static const jsonurlUserMobile:String = KSketch_Config.host_name+"/user/getusermobile"; //To retrieve user information after login using ID
public static const urlUser:String = KSketch_Config.host_name+"/user/urlUser"; //To retrieve user id through URL
public static const urlUser:String = KSketch_Config.host_name+"/user/urlUserV2"; //To retrieve user id through URL

public static const login_success:String = KSketch_Config.host_name+"/app/login_successful";
public static const redirecturl_login:String = KSketch_Config.host_name+"/app/profile.html"; //Indicates successful login
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
private var _monitorTimer:Timer;
private var _webView:StageWebView = new StageWebView();
private var _isLoggedOut:Boolean = false;
private var _token:String = "";
protected function viewActivateHandler(event:ViewNavigatorEvent):void
{
// TODO Auto-generated method stub
Expand Down Expand Up @@ -171,6 +171,7 @@
//get json url
GetUser.url = KSketchWebLinks.jsonurlUserMobile + "?id=" + vars.id;
_token = vars.token;
GetUser.send();
GetUser.addEventListener(FaultEvent.FAULT, faultHandler);
startProgressBar();
Expand All @@ -195,7 +196,7 @@
userData.loginView = this;
userData.listSketches = "";
userData.resolveConflict = 1;
userData.token = _token;
navigator.pushView(KSketch_HomeView, userData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
var finalFileName:String = newFile.name;
var objDoc:Object = KWebData.prepareSketchDocument(userData, finalFileName);
var objDoc:Object = KWebData.prepareSketchDocument(userData, finalFileName,null);
objDoc.save = -1;
objDoc.deleteFlag = 0;
objDoc.version = 1;
Expand Down
Loading

0 comments on commit 7c17e7b

Please sign in to comment.