Free Essay

Ewew

In:

Submitted By sonimca19
Words 1014
Pages 5
KXchange Folder Navigation
User logins to KXChange and views landing page

Folders will be displayed in Left navigation tree and files will be displayed on right

Check Folder details exist in KXChange Database?

NO
Folder will be shown in navigation tree with different color scheme and files will not be displayed.

Yes
Folder will be shown in navigation tree and files will come on the right.
Yes

User will click on folder to get the folders and files beneath it.

1. After successfully login in KXchange, user will go on landing page.
Landing Page * <kxweb> / home.html * kx.js * Create a file kx-dev.js which gets – kxtoken * Include this file in home.html
Navigation Bar A. Make a $.Ajax call to kxapp/api/content/repository/<kxtoken> a. Get box auth token. b. Get folder/0 – {KXchange , EnterpiseFolder1, Marketing} c. Check which folders are in the KXContentMap table. d. Call getContentTree (boxAuthToken, level, parent, content_flag) for folders in A.c e. Show them in Repository according to sequence stored in KXContentMap. f. Show other folders in My Documents
Use jstree.js to build the Repository Tree
Use HTML5.pushState for page transitions.
File Contents
Discussions
Messages
Pseudo Code for Client Side
Methods on client side: Method | Parameter | Description | Format | getFolders | rootId | Contains folder id | String | buildList | jsonData, IsChildExist | Recursive Method | JSON, boolean |

Pseudo Code for Client Side
BoxFolderTree.js

On document.ready()

{ getFolders('0'); {

getFolders(rootID)
{
// call rest service method

/BoxService.svc/api/repository/+ _KXTOKEN;

//Method return JSON Data to client, now read the JSON Data.

On Success :read the Jsondata success: function (data) {

//Calling recursive method (buildList(data, isChildList);
BuildList method returns HTML and we will bind this HTML to DIV where ID=0;
}

buildList(jsonData, true);
{
HTML will create folders and display under Root folder in Tree View.

//Checking first that data.ChildList==”object” or not
{
if (typeof (data.Childlist) === 'object') { // An array will return 'object' if (isChildList) {
//Checking that current folder is Root folder or not.
(If yes) then
{
html += '<a href="#" onclick="getFiles(' + data.id + ')">' + ROOTNAME+ '</a>';

else
{
//Here we are changing the color of folders that are not exists in KXChange Database.

if(data.iskxfolder==1) html += '<a href="#" onclick="getFiles(' + data.id + ')">' + data.name + '</a>'; else

html += '<a style="color:Red;" href="#" onclick="getFiles(' + data.id + ')">' + data.name + '</a>';

}

//Now will check its ChildList exists or not, If exists then we will call this method recursively to build the tree.

if (data.Childlist != undefined) $.each(data.Childlist, function (index, ChildList) { html += buildList(ChildList, true); Calling recursively same method (and wrapping it in a div) });

} return html;

}

//On click of any folder from tree we will call getFiles(folderid).

getFiles(FolderID, ListOfFiles // ‘|’ seperated)
{
//Calling KXService URL

var resturl = KXAPPURL + '/BoxService.svc/api/repository/' + _KXTOKEN + '/' + folderid;

// GET FILE LIST from service

Call Service GetRepositoryFile() - get List<BoxFile>

// Binding logic
}

Server Side

Methods on Server side: Method | Parameter | Description | Format | GetRepository | String strtoken | Contains authToken | String | CreateRepository | rootFolder, TreeLevel | First parameter contains BoxFolder class object and second contains Level of Tree that we need. | Object,String |

Method 1:- GetRepository(String strtoken)
{
//Getting box token GetBoxTokenInfo(strtoken);

//Now creating BoxFolder class object and assigning ID=0 to property and passing the object to CreateRepository Method with TreeLevel Depth.

BoxFolder rootFolder = new BoxFolder(); rootFolder.id = "0"; CreateRepository(ref rootFolder, TreeDepth.DEFAULT_REPOSITORY_LEVEL);

// Create Repository method is void type recursive method.

void CreateRepository(ref BoxFolder boxFolder, int FolderLevel)
{
//On start of this method checking FolderLevel is less than 0. If yes then return.

//calling GetBoxFolderResponse METHOD with folder id that return all the folders exists under passed folder ID and getting data in folderItemsResp that is object of BoxFolderResponse class.

BoxFolderResponse folderItemsResp = GetBoxFolderResponse(boxFolder.id);

//Now go for every entry that contains in folderItemsResp object.

for (int i = 0; i < folderItemsResp.entries.Length; i++)
{
Now take data of each entries in object of BoxFolderItem class.
BoxFolderItem boxFolderItem = folderItemsResp.entries[i];

And check BoxFolderItem object is equals to Folder or not if yes then
{
//Creating object of BoxFolder class and adding data in it if (boxFolderItem.type == FolderType.FOLDER) {

//Added extra property in BoxFolder class to check folders on root exists in database or not.

BoxFolder CurrentboxFolder = new BoxFolder();
CurrentboxFolder.id = boxFolderItem.id;
CurrentboxFolder.name = boxFolderItem.name;
CurrentboxFolder.sequence_id = boxFolderItem.sequence_id;
CurrentboxFolder.type = boxFolderItem.type;
CurrentboxFolder.etag = boxFolderItem.etag;
//Calling a method name “IsKxFolder(folderId)” to check folder id exists in KXDatabase or not(Used tables are “boxcontent” and “kxcontentmap”.
--stored procedure name:- “up_CheckKXFolder” iFolderStatus = kxService.IsKxFolder(boxFolderItem.id); if (iFolderStatus == 1) { CurrentboxFolder.iskxfolder = 1; } else { CurrentboxFolder.iskxfolder = 0; }

//Now adding data in to BoxFolder Type List and Calling again CreateRepository method with Current Folder ID and minus 1 from the Root level parameter. boxFolder.Childlist.Add(CurrentboxFolder); CreateRepository(ref CurrentboxFolder, FolderLevel - 1);

}
}

Method 2: Methods to Get File Details

List<BoxFile> GetRepositoryFile(string FolderID, String FilesList)
{
If ( GOTO_BOX_FOR_FILE == true ) // from web.config
{
// go to Box and get the files for folderId = FolderID From the files list build the FilesList string again with ‘|’ seperator FilesList = “”; Call GetBoxFolderResponse() For each entries { If item is a file add the id to FilesList with ‘|’ }
}

// Go to database to get all the file properties Call Stored Proc - pass files list - FilesList Stored proc gets all the file attributes from BoxXContent table Stored proc returns dataset with all file attributes

// Create the List of BoxFile and return For Every row in the Dataset { Create a BoxFile object from the row values Add to a List of BoxFiles } return the List of BoxFiles
}

List<BoxFile> GetFiles(List<string> FileID)

{
//Creating a list to return
List<BoxFile> lstFileDetails = new List<BoxFile>();

//for loop to get details for each fileID in list and add the details to lstFileDetails and return lstFileDetails for (int i = 0; i < FileID.Count; i++)
{

BoxFile boxfile=new BoxFile();

boxfile =GetBoxFileResponse(file ID)// this method get the details of file from box

lstFileDetails.add(boxfile);

}
}
Return lstFileDetails();

Internal BoxFile getBoxFolderResponse(fileid)
{
Return boxfile detail;
}

Similar Documents

Free Essay

Ewew

...经水洗之后晒干粉碎成面的全天然食品。   Whole Grain Vs Whole Wheat Vs Whole Meal Vs Granary Refined Bread? Which is best? What to choose? By Ike Muoma Bsc (Hon) Few foods can claim to play such a prominent part of the staple diet in so many different cultures around the world as bread. From French breads to Mexican Tortillas, rye breads to Indian Naan. All as well as many more have been a universal part of many cultures diet for hundreds of years providing essential nutrients such as vitamins & minerals, proteins as well as fibre and carbohydrates. With all said very few people would know the difference or health benefits between the different breads. To most, apart from the taste, a loaf of bread is a loaf of bread. One or two may recognise that wholemeal has health benefits over white bread but out of these few would be able to pin point these benefits. And ask most people what the differences between Whole Meal, Whole Grain, Whole Wheat and Refined White Bread very few would be able to say for sure. So what is the difference and health benefits some of those breads stacked on the super market shelves? What breads are the best when say on a calorie controlled or to low cholesterol high fibre diets? To know the answer to all these questions a discussion of grains is needed. Breads are usually made from wheat flour, but may be made from any variety of grains, and may contain seeds, nuts, and fruits for flavour and texture. Whole grain or Wholeweat breads are seen as those being the most nutritionally...

Words: 1555 - Pages: 7

Free Essay

Ewew

...5/14/2016 Strategy Implementation ­ Meaning and Steps in Implementing a Strategy    Search MSG Home (index.html)  /  Library (all­subjects.htm)  /  Marketing (all­subjects.htm#marketing)  /  Strategic Management (strategic­management­articles.htm)  /  Strategy Implementation ­ Meaning and Steps in Implementing a Strategy Strategy Implementation ­ Meaning and Steps in Implementing a Strategy Strategy implementation is the translation of chosen strategy into organizational action so as to achieve strategic goals and objectives. Strategy implementation is also defined as the manner in which an organization should develop, utilize, and amalgamate organizational structure, control systems, and culture to follow strategies that lead to competitive advantage and a better performance. Organizational structure allocates special value developing tasks and roles to the employees and states how these tasks and roles can be correlated so as maximize efficiency, quality, and customer satisfaction­the pillars of competitive advantage. But, organizational structure is not sufficient in itself to motivate the employees. An organizational control system is also required. This control system equips managers with motivational incentives for employees as well as feedback on employees and organizational performance. Organizational culture refers to the specialized collection of values, attitudes, norms and beliefs shared by organizational members and groups. ...

Words: 2185 - Pages: 9

Free Essay

Jk Rowling

...wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew ew ew ewe w ewe wew ew ew ewew ew ew ew...

Words: 925 - Pages: 4