Global page in smartface - smartface.io

I am new in the smartface and I saw Faruk's video yesterday. In the video I saw a page name of which is "Global" contains some variables created automatically when one write some text in the text area of an object. But I could not find a page like that (Global). How can I open that page in order to declare some variables?
I get some errors on debugging as I cannot declare variables that I named them writting their names without quotes in the text attribute of the object.

You can find it in the ~/[your_project_name]_data/Script/ folder.
By the way, if you use version 4.3.x, the file name is Global_Smartface.js.

You can open the Global page in Smartface from the "Script Editor".
When you press "Scripts", script files will be listed. Find "Global" in this list and press on it. Global.Smartface.js will be opened.
If you want more information about using script editor, you should see the link below :
http://www.smartface.io/developer/guides/general/script-editor/

Related

Can't find .py files for new doctypes

Complete newbie here. Built a new site and a new app. Installed the new app. Want to add a custom script, but can't find the ".py" files for the doctypes I created.
The "Custom?" checkbox is left checked and greyed out.
I am logged in as an administrator and I set the site developer_mode config to 1.
(I know I can add custom scripts from the gui, but still, it's sometimes more convenient to work on my own IDE).
Basicaly I want to create a table as a child ("Reciepe") of a doctype ("Dishes"). The table should have a data field (quantity) and a select field (raw_material). I want to populate the raw_material with var_name field from another doctype ("Raw Materials", which also has their prices, thus allowing me to calculate the cost of each dish).
Inside the sites directory, there will be site_config.json file. Ensure developer_mode is present in that file.
$ cat sites/dev.localhost/site_config.json
Clear the cache b running
$ bench clear-cache
After that, go to Browser console and verify developer_mode, user.
If these 2 values are shown correctly in browser console, then Custom? will be unchecked and .py files will be generated.
I followed the tutorial and created the app "library_management". The py-files were created here:
/home/myuser/frappe-bench/apps/library_management/library_management/library_management/doctype

How to generate t3d file automatically?

I am trying to create a data.t3d file for my TYPO3 sitepackage.
How can I generate this file based on my custom configuration automatically without usind the wizard every time?
I am using TYPO3 8.7.2
Thanks
First of all the most important question: How often do you generate this file? Please note that this is no backup! In most cases you create your sitepackage, export the file and place it in the Initialisation directory. So there is no need to do it often.
One solution to have the same settings for every export (which is more useful I think) is to create a "Preset".
How to create a preset?
You can create a preset when opening the import/export-module and changing to the "File & Preset"-Tab.
Enter a title for your preset and click "Save".
How to load a preset?
To load a preset you select the preset in the "File & Preset"-Tab and press "Load".
Hopefully this will help you.

Checks before renaming element in Eclipse Application

I'm currently writing an RCP application with custom editors. I'm trying to check if the file that is to be renamed is open in an editor. Using a custom RenameParticipant I can check this and prevent the rename operation, but this happens AFTER the user has entered a new name. I would like the check to happen before. Is this possible?
First, you need to obtain the editors that are opened in your RCP application. Eclipse allows you to do this by means of the following line:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
Then, you have to check whether your file is opened in one of these editors. To do this, you can iterate the resulting array. Each of the elements of the array is of type IEditorReference. You can get the file that is opened in each editor reference by means of the method getEditorInput().

How to force Word to do a SaveAs on generated document

We have a system where we are generating a report as a Word document (using RDLC).
The report is created in a temporary directory, and then Word is launched to display it to the user.
Word is launched, and the report loaded by:
_wordApplication = (Word.Application)Activator.CreateInstance(Type.GetTypeFromProgID("Word.Application"));
object tempFileNameObj = documentPath;
_wordDocument = _wordApplication.Documents.Open(ref tempFileNameObj);
What I want is to convince Word that this is really a newly created, unsaved file, so it will give the user a SaveAs dialog when they save it (rather than save back to the temporary location).
Ideally, I would like to be able to specify the target directory, and offer a default name.
While the Word is being launched, I can do what I like using Automation, but after Word has been launched, my application will be disconnected from Word, and I would prefer not to leave any macros floating around in the document.
You can rename your .doc file to .dot (Word Template) and if you launch it afterwards, it will create a new File looking exactely like your .doc
If you're not using a macro I believe that the only way to archieve this would be to save the file that they will download be a read-only or user defined template file this way if they wan't to make changes to it they wil have to save it with another name in their computer to save the changes made. If you can use a macro you can archieve more options and even force a save as dialog when the document is opened or when it's closed. I hope this helps as I couldn't find any more information without using a macro.

Display Message Box to copy code section from it using Powershell script

I am building install.ps1 script for Nuget pacakge and would like to open popup message at the end with some message , i have already achieved by following.
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[Windows.Forms.MessageBox]::Show("Test message ", "Test", [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
It will open popup message as per shown in below fig.
Instead of this i would like put some config code here that user can copy from box as per below fig
Please suggest me if anyone has done similar popup box before!
You won't be able to customize Windows.Forms.MessageBox to add what your looking for. In order to do what your looking for you'll need to create a custom form. An easy way of doing this is to use Primal Forms Community Edition which can be found here. You'll need to register for free to reach the download. There's a paid for version to so don't confuse that with the free CE edition. This tool gives you a Visual Studio like forms editor where you can drag and drop controls to a form and save the Powershell script. You'll need to create an event handler for the copy to text to clipboard button. After you saved the code generated by PrimalForms CE you will need to edit it to add the code for the event handlers. An example of how you can set the clip board with Powershell can be found here.
Users can copy the message box text simply by pressing the Ctrl+C key combination.