+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Allow attachments on templates

  1. #1
    Join Date
    Mar 2008
    Posts
    1,634

    Default Allow attachments on templates

    As far as I can tell, it's not allowed. Here's a good reason: now that (in Lyons) templates can do pretty much anything an extension can do, it becomes necessary to have somewhere to put all the support files that go with it, like javascript files, images, whatever. Attaching those files to the template is the ideal solution, as far as I can tell.

    Is there any real reason to disallow it?

  2. #2
    Join Date
    May 2009
    Location
    Houston, Tx
    Posts
    237

    Default

    Quote Originally Posted by neilw View Post
    As far as I can tell, it's not allowed. Here's a good reason: now that (in Lyons) templates can do pretty much anything an extension can do, it becomes necessary to have somewhere to put all the support files that go with it, like javascript files, images, whatever. Attaching those files to the template is the ideal solution, as far as I can tell.

    Is there any real reason to disallow it?
    *Like*
    I agree. There should be a better way to manage the source files that Templates hold. Currently all my source files are housed in an IT's eyes only section where the IT guys can learn about what I wrote. :P
    To err is human; to make real mess, you need a computer.
    Follow me on Twitter

  3. #3
    Join Date
    Sep 2008
    Posts
    195

    Default

    I'm working on the packaging tools so you can take templates and samples and easily distribute them, and i actually assumed that templates could have attachments for resources. So, let me find out what the issue is there and whether we can resolve it.

    In the meantime, the packaging write-up is here:

    http://developer.mindtouch.com/Deki/...Touch_Packages

    and developer.mindtouch.com supports this now, so if you want to give it a try and let me know if it's useful to you (even lacking attachments on templates), let me know. I'll also open an official thread on packaging shortly.
    Arne Claassen - Software Architect
    Found a bug? Report it.
    Follow me on Twitter!

  4. #4
    Join Date
    Mar 2008
    Posts
    1,634

    Default

    Quote Originally Posted by arnec View Post
    I'm working on the packaging tools so you can take templates and samples and easily distribute them, and i actually assumed that templates could have attachments for resources. So, let me find out what the issue is there and whether we can resolve it.
    Cool.

    In the meantime, the packaging write-up is here:

    http://developer.mindtouch.com/Deki/...Touch_Packages

    and developer.mindtouch.com supports this now, so if you want to give it a try and let me know if it's useful to you (even lacking attachments on templates), let me know. I'll also open an official thread on packaging shortly.
    That looks verrrrrry interesting. When you say "developer.mindtouch.com supports this now" does that mean that my wiki running 9.02.4 doesn't?

    I haven't worked through all the details yet, but it looks like it'll be highly useful. Two comments, even before I have figured out exactly how it works:

    (1) Having access to this functionality in the GUI (a special page perhaps?) would be highly desirable, because a user who wants to import a packaged template is not necessarily someone who has root access to the wiki console. Much of the functionality requires no more permissions than a typical user would have, so I don't see why not make it more easily accessible (of course this takes work, so I understand it's not there initially).

    (2) What happens to links? There are at least three different use cases here I can think of off-hand:
    a. I'm migrating a wiki page from one Deki instance to another. The page has internal links, some to pages in the package and some to other pages in the source wiki. After import in the new wiki, what is the state of the links?
    b. Some of my links in the source page are to file attachments. The URI of attachments is unrelated to the path of the attachment (this is probably the primary source of difficulty here). Does the export/import process know how to translate the links for attached files that are being exported/imported?
    c. I have links to attached files inside Dekiscript inside my templates. How can I ensure that these links will get properly updated after the package is imported?

    The "self:res" notation in xml extensions solves this problem, but I'm not aware of any similar mechanism available for referring to files attached to a page (or in Dekiscript).

  5. #5
    Join Date
    Sep 2008
    Posts
    195

    Default

    Quote Originally Posted by neilw View Post
    That looks verrrrrry interesting. When you say "developer.mindtouch.com supports this now" does that mean that my wiki running 9.02.4 doesn't?
    Correct. Developer was upgraded to trunk last night. You will need at least trunk for import/export to work.

    Quote Originally Posted by neilw View Post
    (1) Having access to this functionality in the GUI (a special page perhaps?) would be highly desirable, because a user who wants to import a packaged template is not necessarily someone who has root access to the wiki console. Much of the functionality requires no more permissions than a typical user would have, so I don't see why not make it more easily accessible (of course this takes work, so I understand it's not there initially).
    I'll see if we can make this a Special: page instead of control panel.

    Quote Originally Posted by neilw View Post
    (2) What happens to links? There are at least three different use cases here I can think of off-hand:
    a. I'm migrating a wiki page from one Deki instance to another. The page has internal links, some to pages in the package and some to other pages in the source wiki. After import in the new wiki, what is the state of the links?
    b. Some of my links in the source page are to file attachments. The URI of attachments is unrelated to the path of the attachment (this is probably the primary source of difficulty here). Does the export/import process know how to translate the links for attached files that are being exported/imported?
    c. I have links to attached files inside Dekiscript inside my templates. How can I ensure that these links will get properly updated after the package is imported?
    I don't have all the facts on links and import/export, but i believe all links are imported and treated as relative to the import location (for links that were not absolute before). So if you are referering to pages that are not exported, those links will go bad. I don't think we do anything to dekiscript, so for it work it needs to already have been coded with relative locations in mind. Finally the attachment story is why we want to allow attachments on templates, so dekiscript in templates that needs to files, can refer to them relative to itself.
    Last edited by arnec; 08-05-2009 at 07:03 PM. Reason: speeling :)
    Arne Claassen - Software Architect
    Found a bug? Report it.
    Follow me on Twitter!

  6. #6
    Join Date
    Mar 2008
    Posts
    1,634

    Default

    Quote Originally Posted by arnec View Post
    So if you are referring to pages that are not exported, those links will go bad. I don't think we do anything to dekiscript, so for it work it needs to already have been coded with relative locations in mind. Finally the attachment story is why we want to allow attachments on templates, so dekiscript in templates that needs to files, can refer to them relative to itself.
    Maybe I'm missing something, but how do I refer to an attachment with any sort of relative notation? When I insert a link to an attachment using the "insert link" dialog, I get a direct URI for the attachment that has absolutely no relative information in it.

    I really would like to be able to do this, so I'm hoping it's merely something I've overlooked.

  7. #7
    Join Date
    Sep 2008
    Posts
    195

    Default

    As i updated in the packaging thread, it is export that is responsible for rewriting your Uri's to be relative to the export root (for documents that are children of the export root). So no, you don't refer to attachments by a relative path. Sorry for the misinformation
    Arne Claassen - Software Architect
    Found a bug? Report it.
    Follow me on Twitter!

  8. #8
    Join Date
    Sep 2008
    Posts
    195

    Default

    Oh, and I almost forgot, attachments to templates is now possible on trunk and with that in the upcoming Minneopa (9.08)
    Arne Claassen - Software Architect
    Found a bug? Report it.
    Follow me on Twitter!

  9. #9
    Join Date
    May 2009
    Location
    Houston, Tx
    Posts
    237

    Default

    Quote Originally Posted by arnec View Post
    Oh, and I almost forgot, attachments to templates is now possible on trunk and with that in the upcoming Minneopa (9.08)
    WOOOOOOOOOOOOO! Finally! I'm excited.
    To err is human; to make real mess, you need a computer.
    Follow me on Twitter

  10. #10
    Join Date
    Jul 2009
    Location
    Girona, SPAIN
    Posts
    547

    Default

    Hey, I imagine another functionality to the template attachments, and it difers a lot to just a store for resources, this can be done easily somewere else.

    The functionality, what I have in mind it's to copy the atachments to the page destination (like tags on the last release), then you can use this file attachments as templates to make some work done ( imagine, on a task creation that you can put the Word template for a proposal, or some Excel to calculate the amout, ... )

    Excuses for my english.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts