Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8cfa8b19
authored
Sep 16, 2016
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Changed Comments string.
parent
c313256c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
app/src/main/java/com/vsoft/uoflservicenow/db/managers/CatalogueItemManager.java
app/src/main/java/com/vsoft/uoflservicenow/db/managers/CatalogueVariableManager.java
app/src/main/java/com/vsoft/uoflservicenow/db/managers/MyIncidentsManager.java
app/src/main/java/com/vsoft/uoflservicenow/db/managers/CatalogueItemManager.java
View file @
8cfa8b19
...
@@ -105,7 +105,7 @@ public class CatalogueItemManager implements DBConstants {
...
@@ -105,7 +105,7 @@ public class CatalogueItemManager implements DBConstants {
}
}
}
}
/*Check this catalogue is exist in local DB or not
/*Check this catalogue
Item
is exist in local DB or not
* If doesn't exist in local, save it
* If doesn't exist in local, save it
* If exist in local, update the local item with data from server item.
* If exist in local, update the local item with data from server item.
* */
* */
...
@@ -117,7 +117,7 @@ public class CatalogueItemManager implements DBConstants {
...
@@ -117,7 +117,7 @@ public class CatalogueItemManager implements DBConstants {
catalogueItem
.
setCatalogueId
(
catalogueId
);
catalogueItem
.
setCatalogueId
(
catalogueId
);
save
(
catalogueItem
,
DBConstants
.
SYNC_FLAG_NONE
);
save
(
catalogueItem
,
DBConstants
.
SYNC_FLAG_NONE
);
}
else
{
}
else
{
/*Update complete local
Expense object with response Expense
object*/
/*Update complete local
CatalogueItem object with response CatalogueItem
object*/
catalogueItem
.
setCatalogueId
(
catalogueId
);
catalogueItem
.
setCatalogueId
(
catalogueId
);
catalogueItem
.
setId
(
localCatalogueItem
.
getId
());
catalogueItem
.
setId
(
localCatalogueItem
.
getId
());
update
(
catalogueItem
,
DBConstants
.
SYNC_FLAG_NONE
);
update
(
catalogueItem
,
DBConstants
.
SYNC_FLAG_NONE
);
...
@@ -125,7 +125,7 @@ public class CatalogueItemManager implements DBConstants {
...
@@ -125,7 +125,7 @@ public class CatalogueItemManager implements DBConstants {
}
}
}
else
{
}
else
{
/*That means there is no CatalogueItem category in server response, then all local items should be deleted those are contain sys_id*/
/*That means there is no CatalogueItem category in server response, then all local items should be deleted those are contain sys_id*/
/*localCatalogueItemList is contain all local Catalogues */
/*localCatalogueItemList is contain all local Catalogue
Item
s */
List
<
CatalogueItem
>
localCatalogueItemList
=
getAllCatalogueItems
(
catalogueId
);
List
<
CatalogueItem
>
localCatalogueItemList
=
getAllCatalogueItems
(
catalogueId
);
if
(
localCatalogueItemList
!=
null
&&
!
localCatalogueItemList
.
isEmpty
())
{
if
(
localCatalogueItemList
!=
null
&&
!
localCatalogueItemList
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
localCatalogueItemList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
localCatalogueItemList
.
size
();
i
++)
{
...
...
app/src/main/java/com/vsoft/uoflservicenow/db/managers/CatalogueVariableManager.java
View file @
8cfa8b19
...
@@ -91,7 +91,7 @@ public class CatalogueVariableManager implements DBConstants {
...
@@ -91,7 +91,7 @@ public class CatalogueVariableManager implements DBConstants {
public
static
void
handleGetVariable
(
long
catalogueItemId
,
List
<
CatalogueVariable
>
serverVariableList
)
{
public
static
void
handleGetVariable
(
long
catalogueItemId
,
List
<
CatalogueVariable
>
serverVariableList
)
{
if
(
serverVariableList
!=
null
&&
!
serverVariableList
.
isEmpty
())
{
if
(
serverVariableList
!=
null
&&
!
serverVariableList
.
isEmpty
())
{
/*variableSysIdMap contain all server response catalogue
s
Sys Id*/
/*variableSysIdMap contain all server response catalogue
Variable
Sys Id*/
HashMap
<
String
,
Integer
>
variableSysIdMap
=
new
HashMap
<>(
0
);
HashMap
<
String
,
Integer
>
variableSysIdMap
=
new
HashMap
<>(
0
);
Integer
intObj
=
Integer
.
valueOf
(
1
);
Integer
intObj
=
Integer
.
valueOf
(
1
);
for
(
int
i
=
0
;
i
<
serverVariableList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
serverVariableList
.
size
();
i
++)
{
...
@@ -99,7 +99,7 @@ public class CatalogueVariableManager implements DBConstants {
...
@@ -99,7 +99,7 @@ public class CatalogueVariableManager implements DBConstants {
variableSysIdMap
.
put
(
sysId
,
intObj
);
variableSysIdMap
.
put
(
sysId
,
intObj
);
}
}
/*localVariableList is contain all local
Catalogues
*/
/*localVariableList is contain all local
catalogueVariable
*/
List
<
CatalogueVariable
>
localVariableList
=
getAllVariable
(
catalogueItemId
);
List
<
CatalogueVariable
>
localVariableList
=
getAllVariable
(
catalogueItemId
);
if
(
localVariableList
!=
null
&&
!
localVariableList
.
isEmpty
())
{
if
(
localVariableList
!=
null
&&
!
localVariableList
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
localVariableList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
localVariableList
.
size
();
i
++)
{
...
@@ -136,7 +136,7 @@ public class CatalogueVariableManager implements DBConstants {
...
@@ -136,7 +136,7 @@ public class CatalogueVariableManager implements DBConstants {
}
}
}
else
{
}
else
{
/*That means there is no CatalogueVariable in server response, then all local items should be deleted those are contain sys_id*/
/*That means there is no CatalogueVariable in server response, then all local items should be deleted those are contain sys_id*/
/*localVariableList is contain all local
Catalogu
es */
/*localVariableList is contain all local
catalogueVariabl
es */
List
<
CatalogueVariable
>
localVariableList
=
getAllVariable
(
catalogueItemId
);
List
<
CatalogueVariable
>
localVariableList
=
getAllVariable
(
catalogueItemId
);
if
(
localVariableList
!=
null
&&
!
localVariableList
.
isEmpty
())
{
if
(
localVariableList
!=
null
&&
!
localVariableList
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
localVariableList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
localVariableList
.
size
();
i
++)
{
...
...
app/src/main/java/com/vsoft/uoflservicenow/db/managers/MyIncidentsManager.java
View file @
8cfa8b19
...
@@ -15,7 +15,7 @@ import java.util.List;
...
@@ -15,7 +15,7 @@ import java.util.List;
/**
/**
*
*
* @author Kunj on 1
1-08
-2016.
* @author Kunj on 1
6-09
-2016.
*/
*/
public
class
MyIncidentsManager
implements
DBConstants
{
public
class
MyIncidentsManager
implements
DBConstants
{
...
@@ -77,7 +77,7 @@ public class MyIncidentsManager implements DBConstants {
...
@@ -77,7 +77,7 @@ public class MyIncidentsManager implements DBConstants {
public
static
void
handleGetIncident
(
List
<
Incident
>
serverIncidentList
)
{
public
static
void
handleGetIncident
(
List
<
Incident
>
serverIncidentList
)
{
if
(
serverIncidentList
!=
null
&&
!
serverIncidentList
.
isEmpty
())
{
if
(
serverIncidentList
!=
null
&&
!
serverIncidentList
.
isEmpty
())
{
/*incidentSysIdMap contain all server response
catalogues Sys Id
*/
/*incidentSysIdMap contain all server response
Incident Number
*/
HashMap
<
String
,
Integer
>
incidentSysIdMap
=
new
HashMap
<>(
0
);
HashMap
<
String
,
Integer
>
incidentSysIdMap
=
new
HashMap
<>(
0
);
Integer
intObj
=
Integer
.
valueOf
(
1
);
Integer
intObj
=
Integer
.
valueOf
(
1
);
for
(
int
i
=
0
;
i
<
serverIncidentList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
serverIncidentList
.
size
();
i
++)
{
...
@@ -95,14 +95,14 @@ public class MyIncidentsManager implements DBConstants {
...
@@ -95,14 +95,14 @@ public class MyIncidentsManager implements DBConstants {
if
(
localIncidentNumber
!=
null
if
(
localIncidentNumber
!=
null
&&
!
localIncidentNumber
.
isEmpty
()
&&
!
localIncidentNumber
.
isEmpty
()
&&
!
incidentSysIdMap
.
containsKey
(
localIncidentNumber
))
{
&&
!
incidentSysIdMap
.
containsKey
(
localIncidentNumber
))
{
//Update
sys_id
with empty string because required to delete locally
//Update
number
with empty string because required to delete locally
localIncident
.
setNumber
(
""
);
localIncident
.
setNumber
(
""
);
delete
(
localIncident
);
delete
(
localIncident
);
}
}
}
}
}
}
/*Check this
catalogue
is exist in local DB or not
/*Check this
Incident
is exist in local DB or not
* If doesn't exist in local, save it
* If doesn't exist in local, save it
* If exist in local, update the local item with data from server item.
* If exist in local, update the local item with data from server item.
* */
* */
...
@@ -113,14 +113,14 @@ public class MyIncidentsManager implements DBConstants {
...
@@ -113,14 +113,14 @@ public class MyIncidentsManager implements DBConstants {
if
(
localIncident
==
null
)
{
if
(
localIncident
==
null
)
{
save
(
incident
,
DBConstants
.
SYNC_FLAG_NONE
);
save
(
incident
,
DBConstants
.
SYNC_FLAG_NONE
);
}
else
{
}
else
{
/*Update complete local
Catalogue object with response Catalogue
object*/
/*Update complete local
Incident object with response Incident
object*/
incident
.
setId
(
localIncident
.
getId
());
incident
.
setId
(
localIncident
.
getId
());
update
(
incident
,
DBConstants
.
SYNC_FLAG_NONE
);
update
(
incident
,
DBConstants
.
SYNC_FLAG_NONE
);
}
}
}
}
}
else
{
}
else
{
/*That means there is no Incident in server response, then all local items should be deleted those are contain
sys_id
*/
/*That means there is no Incident in server response, then all local items should be deleted those are contain
number
*/
/*localIncidentList is contain all local
Catalogues
*/
/*localIncidentList is contain all local
Incident
*/
List
<
Incident
>
localIncidentList
=
getAllIncidents
();
List
<
Incident
>
localIncidentList
=
getAllIncidents
();
if
(
localIncidentList
!=
null
&&
!
localIncidentList
.
isEmpty
())
{
if
(
localIncidentList
!=
null
&&
!
localIncidentList
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
localIncidentList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
localIncidentList
.
size
();
i
++)
{
...
@@ -129,7 +129,7 @@ public class MyIncidentsManager implements DBConstants {
...
@@ -129,7 +129,7 @@ public class MyIncidentsManager implements DBConstants {
if
(
localIncidentNumber
!=
null
if
(
localIncidentNumber
!=
null
&&
!
localIncidentNumber
.
isEmpty
())
{
&&
!
localIncidentNumber
.
isEmpty
())
{
//Update
sys_id
with empty string because required to delete locally
//Update
number
with empty string because required to delete locally
localIncident
.
setNumber
(
""
);
localIncident
.
setNumber
(
""
);
delete
(
localIncident
);
delete
(
localIncident
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment