Tuesday, 19 November 2013

Importing exporting flex projects

Importing exporting flex projects
1.       Flex projects are imported and exported as .fxp
2.       The flex viewer projects are contained in the folder named “eMaps2.5” and exported as eMaps2.5.fxp
3.       When importing suppose we want to extract it into the folder “D:\argis-reloaded”
4.       Open FlexBuilder, it will open default work space.
5.       Open another instance of the FlexBuilder, it will prompt for workspace, give the path     “D:\argis-reloaded” for new workspace. New blank work space will be opened.
6.       Now Import the project, give the path of the .fxp, the extract path will be                             “D:\argis-reloaded\ eMaps2.5\”
7.       After extraction, two folders will be created at the root, D:\argis-reloaded\ .fxpTemp and D:\argis-reloaded\ .metadata
8.       Clean the project, and built it later.

Importing exporting java projects
1.       It is better to have brand new netbeans project.
2.       Copy the “scr” folder in the new project
3.       Copy the “libraries” folder in the new project
4.       Import libraries in the project, by project à properties à Libraries àExternal library files

5.       Clean and build project.

Installing and Configuring Visual Source Safe

Installing Visual Source Safe

0.png


*- VSS works in client server environment. Code base repository is places on the server and all clients share that repository.


*- Code is placed in the Shared Repository from where client or developer team accesses the code repository and maintains it.


*- You must need VSS admin module on the server and VSs client module on the developer machine


*- Firstly we make the server set up and make the code repository. By the VSS admin module you cannot download the source code but we can setup the code repository for the VSS users to work with.


*- Install the Visual Source Safe 2005 both client and admin tools on the server (150 files, 20 folder, 110 mb, 100 mb) Admin only manage the project database and the users of the vss database. The client is used mange the project folders and files and other operations after the data base is created. The client tools populate the newly created project folders with the project files.


*- Make the folder “VSS-Database” somewhere suitable on the server and give permissions read or write or both for all the client PCs IP of the different team members working on the projects. Initially we can go with “Every One” with “Full Control”. This only single folder contains the information about all the projects, users and their permission and backups of the different projects.

13- You need to share the VSS-Database folder on the network so that the others can access the VSS data base file on the network. As we give the IP we get the folder containing the VSS .ini file. Open that file; Only authorized users can open and access the contents of the VSS-Database folder.

*- Start VSS-Admin, create New VSS Database, set the folder path to new created folder “VSS-Database” on the server. Do next; this will create files and folders in the “VSS-Database” and also the .ini file. The clients will use VSS-Client to access the Server pc by IP, then open “VSS-Database” folder and double click the .ini file, it will prompt for the user name password, give it, If the WRITE access is not given to the folder, the error comes for the user.


*- By default the Admin, Default PC Name and Guest users are created in the VSS database. You keep or delete them as necessary.


*- Create new users for the VSS, and note down their passwords, and very simple dialog is there for user permission and grants, read access or both read and write access.



*- Install the VSS-Clients on all client machines and access the VSS database and give user name and password and access the code repository


*- For each project, there could be one VSS database or there can be one VSS database containing all projects related to a team. So database could be project oriented or team oriented. In case of team-oriented database, a big folder contains the different folders for different projects and the then different teammates are given permissions to different projects. All team members log in the same VSS database, and every user see the projects, files and folders on which different users has access according to different projects on which he is working.

*- By default, the permissions wizards are disabled, following figures show how to make them enabled.


2.png


3.png

4.png

*- VSS client component is used to access the code repository. You access the server PC by the IP and select the .ini files. This .ini is the database file of the VSS server. You prompt for the username password after that you are available with the list of projects or one project hosted on that data base.


*- VSS Sever component can make new project in one database file and make multiple project available under one data base file


*- You can make different Users for the VSS database and set their user name passwords and set their preferences like the read, write, delete, access scope to different files and folders, usually delete option is not given to the client or developers.


*- Normally you make a new blank folder on the hard disk, set the working folder to that newly making folder and get the whole source code downloaded to that newly made folder. This works fine when the whole source code is ok


*- Sometimes, the project include the client specific files, those are not needed by the clients, every client has its own version of files, flex projects has this problem. The outer 3 files included in the workspace are not needed in the downloaded files, every developer has its own version of these files, in this situation it is good to make a blank project in this case, and import the subset of the application in to it.


*- Setting the Working folder actually synchronize the local copy of the project with the server copy of the project, both projects have same folder structure, setting the one root folder make the things ok for the rest of the directory structure.


*- After setting working folder the files are not read-only, you need to make them read-only using the Window Explorer or you Check out all files and then Check in all files. But this second way is not preferred. You may lose update files on your local PC in the process of check in and check out. Second approach is safe is the local copy and server copy are same and synchronized.


11- Check out, draw something out mean download the file for writing, Check in, draw something in, and upload the file after doing work.


12- For Java projects, only put the SRC folder on the VSS all other folders and libraries will be exclusive to the different clients.


*- Copy the Flex and Java source code on the server.


*- Make the following folders using the VSS-Client on the VSS server: “Java Projects” and the “Flex Projects”. Open VSS-Client on the Server, create folder with same names as “Java Projects” and the “Flex Projects”. Now drag and drop the contents of these folders from the Window Explorer to the Projects Pane in the VSS-Client. After drag-drop, select the recursive option selected. After copying, Flex and Java source code folders should be deleted.

*- When you drag and drop the files to the new project using the VSS Client, the options come, set the dragged folder as the working folder for new project. Select OK at this.


*- Make Blank folders using the Window Explorer on the clients: “Java Projects” and the “Flex Projects”


*- Open VSS-Client on the clients, same folders will appear in the VSS database those we have created on the server. Now map these folders to the folders on the client machines using the “Set Working Folder” option. Now do the recursive “Get Latest” for the root project folders. All is done.


*- Sharing VSS files means, they are viewable in two different projects but VSS maintains one copy internally. All check in and check outs are reflected in both project. And files are available to the users of both projects and all users can manipulate files according to their assigned rights and permissions.


*- I think BRANCHING is the reverse of SHARING.



*- Renaming a project on server cause loss of “Working Folder” settings for all clients and they are needed to be set again.



Creating Trigger & Sequence in Oracle using Toad

Creating Trigger & Sequence in Oracle using Toad

*- As Oracle has no auto-increment numeric field, it is done by the combination of Sequence and Trigger for the Table. Sequence is an independent object that keeps track of the sequence number. Trigger or Java code uses this value for the primary key next value.

*- We have two options for the primary key insertion, a. Use the combination of Trigger and Sequence and Java code do not insert the primary key in the insert query in the java code. b. Do not use trigger only call sequence in the Java code to get the next value, and use this next value in the insert query in the Java code. This approach is the only solution when we need newly inserted primary key back for further SQL operations in a transaction. Using the approach b is best, because insert operation may be invoked from the several BLL classes those may need the newly inserted primary key. So all insert DAL operations should return the primary key always.

*- Check out in the Table tab that Triggers exits for table or not, Trigger has association with the Table, but the Sequence is an independent Oracle object and it has nothing to do with the Table. Convention for sequence name is SEQ_TABLENAME_CT and for trigger name is TRG_TABLENAME_CT.

*- Open three editors, one for the Table, one for the Sequence and one for Trigger.

*- Check out the table data for the last value of the auto increment column suppose it is 122

*- Open the sequence pane; right click the sequence if it already exist and Recreate it and adjust the sequence value, Set the Start With = 122

A2.bmp


4- If does not exist then, create new sequence and adjust the values for the auto-increment values

A1.bmp


5- Name the sequence as SEQ_TABLENAME_CT, and the set the:*Start With*: value as desired


6- Press execute button to create the sequence.


7- Now go on Table tab and the Trigger tab and Add New Trigger button


8- Give the trigger name as TGR_TABLENAME_CT


9- Check the insert check box, this mean this trigger will be called at the time of insert. Before means, the trigger will be invoked before the insert query.

A3.bmp


10- Press the Send to Editor Button; this will open the trigger script in the editor. 1. Remove the two lines; 2. update the Sequence-Name and 3. Update the Primary-Key-Name.


11- Remove following two lines

   :NEW.CreatedDate := SYSDATE;
   :NEW.CreatedUser := USER;


12- Update sequence name as follows.
SELECT SEQ_TABLE_NAME.NEXTVAL INTO tmpVar FROM dual;


13- Update primary key column as follows.
:NEW.PRIMARY_KEY_COLUMN:= tmpVar;



14- Execute or Run the trigger, all is well.