Jump to content
Ketarin forum

Template prototyping limitations?


rome
 Share

Recommended Posts

I love the idea of prototyping the templates, and I created one to play with.

I did notice, however, a strange behavior I wouldn't expect -

 

1. Changing settings doesn't seem to update -

Say I change

<IgnoreFileInformation>true</IgnoreFileInformation>

to

<IgnoreFileInformation>false</IgnoreFileInformation>

After updating the applications, the checkbox is still checked.

 

2. Reverting changes doesn't take effect:

Say I change

<Name><placeholder name="Name of application" variable="name" /></Name>

to

<Name><placeholder name="Name of application" variable="name" /> (Portable)</Name>

and then back again,

Ketarin doesn't even notify me the xml was changed, and I have to manually remove the (Portable).

 

It wasn't throughoutly tested, but could it be quirks of the templating system?

Link to comment
Share on other sites

1) It sounds like you're talking about updating the template to apply static values across a group. That's not really the way templates work - it's more for coping with specific changes in the variable assignment classes. While I haven't looked at the code for this specific functionality, I would assume that it does not alter non-variable-related values, since they could have been modified to any value by the user. If it did, it could really screw up customized app profiles with stuff like 'share' and 'watch' altered.

 

2) To really provide much of a response to this we'll need to see examples of your template code and how it's used. The snippets you've included above just aren't enough to go on. It's probably related to 1 above, in that once a value is assigned, "it's in there".

Link to comment
Share on other sites

What does variable assignment classes mean?

 

Here is the code if it would help to explain.

Note that I changed name to appName (I realize it's not conventional to XML using camelCase).

 

<?xml version='1.0' encoding='utf-8'?>
<Jobs>
 <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <Name>
  <placeholder name="Name of application" variable="appName" />
   </Name>
   <Category>
  <placeholder name="Category" />
   </Category>
   <UserAgent>{sfua}</UserAgent>
   <CanBeShared>true</CanBeShared>
   <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
   <DeletePreviousFile>true</DeletePreviousFile>
   <DownloadBeta>Default</DownloadBeta>
   <Enabled>true</Enabled>
   <ExclusiveDownload>false</ExclusiveDownload>
   <FileHippoId />
   <FixedDownloadUrl>{dlUrl:urldecode}</FixedDownloadUrl>
   <HttpReferer>{dlRedirect:urldecode}</HttpReferer>
   <IgnoreFileInformation>true</IgnoreFileInformation>
   <PreviousLocation />
   <SetupInstructions />
   <ShareApplication>false</ShareApplication>
   <SourceType>FixedUrl</SourceType>
   <TargetPath>{target-install}</TargetPath>
   <UserNotes>
  <placeholder name="Application description" variable="appDescription" />
   </UserNotes>
   <VariableChangeIndicator>appVersion</VariableChangeIndicator>
   <WebsiteUrl>
  <placeholder name="Application website" variable="appWebsite" />
   </WebsiteUrl>
   <Variables>
  <item>
    <key>
	  <string>appDescription</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>(?<=tagline.*?<p>)(.*?)(?=</p)</Regex>
	    <Url>{dlPage}</Url>
	    <Name>appDescription</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>appName</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex><title>(.*?)(?=\sPortable)</Regex>
	    <Url>{dlPage}</Url>
	    <Name>appName</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>appSource</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <TextualContent>
		  <placeholder name="Source of application" value="PortableApps" />
	    </TextualContent>
	    <Name>appSource</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>appType</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <TextualContent>
		  <placeholder name="Type of application" value="Portable" />
	    </TextualContent>
	    <Name>appType</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>appVersion</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>(?<=Portable_.*?)[0-9.]{2,}(?=\.paf)</Regex>
	    <Url>{dlPage}</Url>
	    <Name>appVersion</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>appWebsite</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>^.*href="(.*?)(?=".learn more)</Regex>
	    <Url>{dlPage}</Url>
	    <Name>appWebsite</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>dlPage</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <TextualContent>
		  <placeholder name="Application Page URL" />
	    </TextualContent>
	    <Name>dlPage</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>dlRedirect</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <TextualContent>
		  <placeholder name="Download redirect path" value="http://portableapps.com/bouncer?t=" />
	    </TextualContent>
	    <Name>dlRedirect</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>dlUrl</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>[^"'=]+(?>\.exe)</Regex>
	    <Url>{dlPage}</Url>
	    <Name>dlUrl</Name>
	  </UrlVariable>
    </value>
  </item>
   </Variables>
 </ApplicationJob>
</Jobs>

 

And one last thing -

If I do want to change static values, the only way would be to export, search and replace and import back?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.