|
I know what you are thinking, a programming question in the lounge, what is this outrage?!
But wait! there is no code involve!
In fact I am not interested in code, it's more like a conceptual and rhetorical question.
I wonder what to do about resources in my documents editor.
The problem: I am making this fantasy documents editor.
one can create / edit: image (& icon), (fantasy) maps, text, and tabular data.
- image, map and tabular data can contain images
- text document can contain anything (i.e. text, obviously, but also table, images and map snapshots)
document come standalone. one doesn't make a "project" with multiple assets, like a C# project...
instead one create a map, or create a text document, etc...
(this seems like the right approach, just like one doesn't make "project" with word, excel, power point)
now how do these document reference each other? that's my conundrum...
idea 1: copy each sub-document in current document.
problems 1: document can easily balloon in size, with same subdocument can be added multiple times
problem 2: document can be really small, but a resource, say a background image, can be humongous in size (and repeated in multiple document) and it's hard to make a nice and concise UI to take care of that
idea 2: each resource will be reference by some custom URI
problem 1: uri scheme is difficult. if it's absolute path on disk, what if the user move the folder containing everything? is it's relative, what if the user move only that file or work on a copy in another directory
idea 3: image are copied (too bad for duplicates or big images)(by duplicates I mean I could have 5 small documents becoming 5 big documents because of 1 single huge background image), tabular data are copied in (no biggies), maps are snapshoted (i.e. what is copied: picture of are of interest + 1 or 2 hint path / URL)
problem 1: big image can waste lots space, map do not update live
anyway that's the concept I am thinking about, and wondering how to tackle in the most user friendly and efficient fashion...
Any ideas or tips?
[EDIT]
After some though, here is a quicker and better question, perhaps...
To clarify, it's not an algorithm question at all, more like a design question...
Where should I put the stuff? copy or not?
And if I reference (some? all?) how could I reference smartly?
Also, if I reference, obviously the user can move thing around breaking all reference. But how could I improve the user experience so that he will intuitively know what to do to maintain reference?
[Edit2]
Decided... I obviously need to pack everything together.. if the files is emailed, the file should still work!
will go with option 3 (copy image, inline table, copy map as a screenshot" + some meta data: position, zoom and hint location)
and I am gonna provide a simple resource management tool.. basically a table with (thumbnail, size and search and replace button), should be ease to make it reusable and should help with size management
modified 14-Nov-18 19:35pm.
|
|
|
|
|
If you want something usable that will save much programming time, look at programs like Xara Designer (or their cheaper versions). They even have a 'Cloud' version that appears to tackle everything you are setting out to do.
Or just have a look at their approach, and reverse engineer it with the changes you want.
I'm certain there are other programs out there, that's just one I've used in the past that your post brought to mind.
Can't give you advise about the data structure behind it - I'm guessing it is probably a list of some nature. Might even boil down to a vector of objects, but not trivial to implement.
Good luck with it!
|
|
|
|
|
Mmm.... I think my program will be more useful to me that Xara designer, after looking at it!
Regardless... My conundrum with resource reference remains...
To clarify, it's not an algorithm question at all, more like a design question... Where should I put the stuff? copy or not?
if I reference (some? all?) how could I reference smartly?
if I reference: obviously the user can move thing around breaking all reference. How could I improve the user experience so that he will intuitively know what to do with reference?
|
|
|
|
|
Create a reference directory that the user specifies per the project? Or they specify the main project file, and it creates a subdirectory under that parent directory named '?Resources' (if my Dos memory is correct, ie, if the project file was called 'MyProject.jnk' a subdir would be created called MyProjectResources, with all of the files referenced placed in it.
Make it so that the references are placed in it by your program, so the files would probably be duplicated on the drive somewhere, but it gives you a sane way to copy the project around. Otherwise you risk going mad, methinks.
That would be my initial approach. Take your pick of others.
|
|
|
|
|
Specify a resource (e.g. a file name), defaulting to resources (files) in the same location as the document. Allow for qualification, from the default, by providing a full path (URI) or relative path (to the document). Extra points for allowing a user-chosen default folder/directory (different from the document).
|
|
|
|
|
i decided to copy everything / embed all resources.. after all if one email a word document, the word document is expected to work fine on recipient computer
gotta add a common resource viewer control which show thumbnail, size, and search and replace button
|
|
|
|
|
Yeah, makes sense to me...my suggestion may be a bit "anti-KISS" now-a-days. I started in the era of too few bits, so I'm still fighting a tendency towards ill-advised efficiency. I'm getting better at being wasteful (and more productive), but its a constant down-hill battle
Anyhow, best of luck with your project!
|
|
|
|
|
Another option I've seen in some drafting programs is 'Pack and Go', where the program gives you the option to pull all of the resources together into a directory (which includes the main work file) so you can zip that directory up and send it to anyone. Until you do that, the resource files are located anywhere, including on the network.
|
|
|
|
|
i decided to copy everything / embed all resources.. after all if one email a word document, the word document is expected to work fine on recipient computer
gotta add a common resource viewer control which show thumbnail, size, and search and replace button
|
|
|
|
|
That sounds like Solidworks to me
modified 6-Sep-22 21:01pm.
|
|
|
|
|
Solidworks has it. Autodesk has a similar solution.
|
|
|
|
|
Packing everything together is the right approach. Linking is an optimisation that you probably do not need and it magnifies the complexity.
There is still a lot of work to do. If it is possible to open source your editor(s) could these be created by forking existing open source projects and modifying them?
Good luck on this project, it sounds fun.
|
|
|
|
|
yeah.. I was heading toward approach 3... packing most things by defaults
and, in the case of maps, including an image and a "custom link"
and having a resource list viewer where one can, if one wants, explicitly change the behavior (from embedded to link) and explicitly define the link (hence the user would be aware of dependency, since he created it explicitly)
|
|
|
|
|
I'd advise you to avoid XML "solutions", because they increase the required man-hours exponentially, with no measurable gain.
A few alternatives:
-- If you do it in HTML, you can open the page in a browser and "save as mht", which packages the whole page and its local resources into a single archive that reopens the page in a browser when double-clicked. This has the added advantage that you can (but don't have to) use resources on the Internet, which will be retrieved by the browser when the page is opened (so changes and updates are handled painlessly).
-- Single-sourcing (which is the name of the system you want) in MS Word works with scripts that use IncludeText statements, and is easy enough to implement (there should be plenty of information and examples on the web; if not, just ask).
-- If you've got money to burn, get FrameMaker or MadCap Flare.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
too technical. was not really a programming question!
|
|
|
|
|
Do squirrels watch Nutflix?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yes!
The Italian squirrel do so while snacking on Nutella, and the American ones do so while snacking on beer nuts.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
It does appear to be the rodent-ertainment is travelling down.
|
|
|
|
|
Only if a gambling ape is a chipmonk;
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
They Planter themselves on the couch.
But I'm having a hard time imagining a squirrel chilling.
|
|
|
|
|
|
You get an upvote fur that one.
|
|
|
|
|
This stuff is bennevisicial to no-one!
|
|
|
|
|
My dear Griffington,
What kind of Nutflix would you expect, in the Soapbox?
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
Oh sure. Owls like who-lu, tropical animals prefer Amazon, and the insects still stick with the classic antennae.
|
|
|
|
|