[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread TW Tones
I have a solution that I will publish if there is a demand.

   - A view template that appears on the $:/Import tiddler when it has the 
   field status = complete
  - The ability to save (rename as this tiddler has the 
  created/modified date of the import) this to a date/time titled tiddler 
as 
  an "import record" with a system-object field set to import-record.
   - A view template for tiddlers with the system-object field set to 
   import-record.
  - Uses a list[] filter to extract the list of titles
  - Amongst other tools button(s) to set the import or created dates 
  with or without $timestamp=yes on the imported tiddlers.
  - If you choose to update modified or created, it would enter the 
  recent list
 - I would prefer a separate tab to list tiddler by imported date 
 and not loose the created/modified info if available.
  
This is part of a larger import tools project I am working on. 

   - My only issue now is how to import with a prefix if desired to import 
   without overwriting existing tiddlers. 
   - This needs intervention in the import to tiddler process before status 
   = complete.


Regards
Tony


Regards
Tony

On Tuesday, July 21, 2020 at 9:49:42 AM UTC+10, Mat wrote:
>
> Also this might be of interest:
>
> https://github.com/Jermolene/TiddlyWiki5/issues/1554
>
> <:-)
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6b85079d-5538-4af9-8e89-35b44898f5c6o%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread Mat
Also this might be of interest:

https://github.com/Jermolene/TiddlyWiki5/issues/1554

<:-)

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c3dfc857-7ee9-4206-8f4f-574b2744821ao%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread Eric Shulman
Combining my "fixup" button solution with Saq's idea about getting the 
links directly from the $:/Import tiddler, gives the following:

<$button> set missing created/modified fields
<$list filter="[[$:/Import]links[]!has[created]]">
   <$action-setfield created=<> modified=<
> />



-e


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/39cffd75-37a7-436a-b3cc-852823b6c509o%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread TW Tones
Josua,

Remember that tiddlers you may import, or other files may bring created or 
modified dates with them. These dates can be meaningful so I recommend 
against changing them. I am building additional import tools but they are 
not ready yet, however post import you get a list of imported tiddlers you 
can extract using the list[] operator, a button that set a new import-date 
field to now or the import tiddlers created date, using $timestamp=no would 
record the import date without changing the import tiddlers created and 
modified dates. Giving what you want but retaining fundamental information 
that may prove useful in the future.

Don't compromise your future!

Regards
Tony

On Tuesday, July 21, 2020 at 2:39:00 AM UTC+10, Joshua Baller wrote:
>
> I have a wiki (5.1.22) that is partly updated through importing large sets 
> (1000s) of tiddlers from a few JSON files on an approx. weekly basis 
> (knowledge base, the information is being maintained and updated on a 
> different system). I would like to know the last edit/update dates for a 
> particular tiddler was imported in this way, however when imported the 
> 'created' and 'modified' fields are left blank. 
>
> My preference would be to simply have the field populated on import as 
> this seemed like the expected behavior. Is there a setting I'm missing to 
> get this to occur? Otherwise is there are way to target only the recently 
> imported tiddlers to have their 'created' dates populated?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ed78c1a6-0c40-4550-87d8-25ef2f54b492o%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread Joshua Baller


On Monday, July 20, 2020 at 1:05:05 PM UTC-5, Saq Imtiaz wrote:
>
> @Joshua
>
> One other thought I had was to parse the $:/Import tiddler for a more 
>> targeted list of tiddlers to modify, but I can't think of a straight 
>> forward way of doing that.
>>
>
> [[$:/Import]links[]]
>
>
Beautiful, thank you. I was unfamiliar with the 'links' keyword. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8dc2363e-c67e-444a-ac0e-8d96eba78d8co%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread Saq Imtiaz
Potentially this thread might be of interest as well:

https://groups.google.com/forum/?oldui=1#!starred/tiddlywiki/GG3dqXkQWTw

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b596c3d2-7d8c-43ed-9936-e0aaed152d12o%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread Saq Imtiaz
@Joshua

One other thought I had was to parse the $:/Import tiddler for a more 
> targeted list of tiddlers to modify, but I can't think of a straight 
> forward way of doing that.
>

[[$:/Import]links[]]


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e21bbb56-192d-423b-b9db-2c600d26d91do%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread Joshua Baller

>
>  While it might seem to you to be the expected behavior, importing 
> tiddlers will NEVER add or alter any fields in the incoming tiddlers.  This 
> is by design, since there may be unwanted side-effects of changing the 
> tiddler definitions, even if it is just to add a "created" or "modified" 
> date.
>

Yeah, perhaps 'expected' behavior was the wrong choice of words. 

Thanks for the snippet, that seems like a good fallback solution.

One other thought I had was to parse the $:/Import tiddler for a more 
targeted list of tiddlers to modify, but I can't think of a straight 
forward way of doing that.

On Monday, July 20, 2020 at 12:07:18 PM UTC-5, Eric Shulman wrote:
>
> On Monday, July 20, 2020 at 9:39:00 AM UTC-7, Joshua Baller wrote:
>>
>> I have a wiki (5.1.22) that is partly updated through importing large 
>> sets (1000s) of tiddlers from a few JSON files on an approx. weekly basis 
>> (knowledge base, the information is being maintained and updated on a 
>> different system). I would like to know the last edit/update dates for a 
>> particular tiddler was imported in this way, however when imported the 
>> 'created' and 'modified' fields are left blank. 
>>
>> My preference would be to simply have the field populated on import as 
>> this seemed like the expected behavior. Is there a setting I'm missing to 
>> get this to occur? Otherwise is there are way to target only the recently 
>> imported tiddlers to have their 'created' dates populated?
>>
>
> While it might seem to you to be the expected behavior, importing tiddlers 
> will NEVER add or alter any fields in the incoming tiddlers.  This is by 
> design, since there may be unwanted side-effects of changing the tiddler 
> definitions, even if it is just to add a "created" or "modified" date.
>
> However, you *can* perform a "fixup" process after importing, by using the 
> following button:
> <$button> set missing created/modified fields
> <$list filter="[all[tiddlers]!is[system]!has[created]]">
><$action-setfield created=<> modified=<
> > />
> 
> 
>
> This button does a $list to find all tiddlers that do not have a "created" 
> field
> (excluding system tiddlers... those starting with "$:/").  For each 
> tiddler it finds,
> it sets the "created" AND "modified" fields of that tiddler to the current 
> datetime,
> using the standard 17-digit TWCore date format for those fields.
>
> enjoy,
> -e
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ca2efad6-91f5-4092-913d-3285ec6d9f79o%40googlegroups.com.


[tw5] Re: How do I get the 'created' or 'modified' fields to populate on import?

2020-07-20 Thread Eric Shulman
On Monday, July 20, 2020 at 9:39:00 AM UTC-7, Joshua Baller wrote:
>
> I have a wiki (5.1.22) that is partly updated through importing large sets 
> (1000s) of tiddlers from a few JSON files on an approx. weekly basis 
> (knowledge base, the information is being maintained and updated on a 
> different system). I would like to know the last edit/update dates for a 
> particular tiddler was imported in this way, however when imported the 
> 'created' and 'modified' fields are left blank. 
>
> My preference would be to simply have the field populated on import as 
> this seemed like the expected behavior. Is there a setting I'm missing to 
> get this to occur? Otherwise is there are way to target only the recently 
> imported tiddlers to have their 'created' dates populated?
>

While it might seem to you to be the expected behavior, importing tiddlers 
will NEVER add or alter any fields in the incoming tiddlers.  This is by 
design, since there may be unwanted side-effects of changing the tiddler 
definitions, even if it is just to add a "created" or "modified" date.

However, you *can* perform a "fixup" process after importing, by using the 
following button:
<$button> set missing created/modified fields
<$list filter="[all[tiddlers]!is[system]!has[created]]">
   <$action-setfield created=<> modified=<
> />



This button does a $list to find all tiddlers that do not have a "created" 
field
(excluding system tiddlers... those starting with "$:/").  For each tiddler 
it finds,
it sets the "created" AND "modified" fields of that tiddler to the current 
datetime,
using the standard 17-digit TWCore date format for those fields.

enjoy,
-e


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/210e64a5-c498-454d-b66f-4ef6732197edo%40googlegroups.com.