Transferring data with clipboard
Sometimes it would be nice to transfer topics and association to some other application such as Microsoft Excel and Word. Wandora enables you to copy topics to clipboard where you can paste them to other applications. Moreover you can import data back to Wandora through clipboard. Lets see an example.
Import sample topic map ArtofNoise.xtm to Wandora and open topic title. Then select some of the instance topics as shown below and select Topics > Copy > Copy base names from the context menu.
Now you have copied all selected instance topics to clipboard and you can paste the data to Excel for example. Below is a screenshot of Excel after the data insertion.
The example was quite simple but Wandora can also copy with more more complicated queries. You can for example copy all class topics of selected topic or players within the topics that are selected.
Furthermore you can copy additional data with the selected topics. For example selecting Copy also > Copy also classes copies to clipboard not only the selected topic base names but also class topics associated to the selected topics. Below is an example where previous selection was copied and pasted to Excel with Copy also > Copy also classes. You should notice that all our topics were classified as titles. Column B is empty if topic has no class. If topic has multiple classes they are placed to subsequent columns.
The interesting point is that you can copy topics and topic elements from other applications and paste them to Wandora. Wandora tries to match injected base names to existing topics or proposes topic creation if the topic does not exist. Once again lets see the injection through an example. We copied few instances of title topic with classes to Excel. Now suppose we have found out that the Beatback (title) is also a remix. We may want to mark the title as a remix. Lets write remix to the title's Excel's column C.
Now select everything in Excel (A1-C8) and copy cells to clipboard. Go back to Wandora and select Topics > Paste also > Paste also classes from the context menu of instances table of title topic. Wandora confirms the injection. If you allow the injection, Wandora checks if all injected topics have given classes. When Wandora notices that Beatback (title) has no class remix it adds it as a class to the Beatback (title). As Wandora does not contain at all the remix topic, Wandora also asks whether or not it should create new topic with base name remix. You should be very careful with the topic creation feature as all typos end up to the created topics.
If you allow the topic creation new topic is created with a base name remix and the topic is set as a class of Beatback (title). Notice that clipboard data did not contain any subject identifier for the new topic. Topics created during the injection are given a default subject identifier. Of course you can change the subject identifier later.
So where is the beef, you may ask. Wandora allows you to edit the classes anyway. We have noticed that sometimes it is easier to check if the topics and associations are all right with external application such as Excel or even Notepad. This is the case if we have thousands of unchecked topics. Moreover it is just nice to copy topics from Wandora when someone wants to have a list of certain topics and is not familiar with Wandora or topic maps. And last but not least your source data usually origins application that just doesn't support topic map export. Instead of entering all data by hand to Wandora you could transfer data to a simple text editor and inject modified data to Wandora via clipboard.
Wandora allows the user to copy and inject associations via clipboard. Associations are little trickier compared to classes as they contain association type, multiple roles, and players. Let's try this in reality. Below is a screenshot with a large association table of U2's records. We have selected the row with topic Rattle and Hum (03111b11), and revealed the context menu right clicking the cell. We want to copy association and select Copy associations > Copy associations with tab text.
As a result the clipboard contains all information required to construct the association between U2 and record named Rattle and Hum. Now open Excel or any other spreadsheet application (or just notepad) and paste clipboard text there. Your application should now look something like this.
As you may see the cell
- A1 contains association's type
- A2 and B2 contain association roles.
- A3 and B3 contain association players. A3's role is A2 and B3's role is B2.
If you had copied more than one association there would be more lines following the 3rd line each containing players of one associations. If your association had more than two players, they should have been placed to columns C, D, and so forth.
The key point is that you can edit the association in Excel (or in any other application) and inject it back to Wandora as long as the clipboard format remains same. You may even compose new associations in your favorite application and paste them to Wandora. Associations may contain both existing and new topics. Wandora confirms the topic creation from user.
Topic and association injection interprets text on clipboard as base names. You have to inject subject identifiers and other internal structures of a topic separately.
In our experience the Linux version of Java limits clipboard text size to 256KB. Trying to paste bigger chunks of association text into Wandora raises an exception:
java.lang.NullPointerException at org.wandora.application.tools.associations.PasteAssociations.execute(PasteAssociations.java:114) at org.wandora.application.tools.AbstractWandoraTool.run(AbstractWandoraTool.java:201) at java.lang.Thread.run(Thread.java:722)
To overcome the problem you can paste your data in smaller pieces.