Umbraco - Try to read document properties programatically but always getting null - umbraco

I am writing a console application to read content from my umbraco database. I am unable to get following simple code to work
var doc = new Document(1081);
Console.WriteLine("Package Id: {0}", doc.getProperty("packageId").Value);
There is a document in Umbraco and I have created content against that document. The content node is published and has id of 1081. The first line works fine and returns me the correct content node but second line fails to retrieve the property named packageId. There is a property with this name on the document type and I can see this value in the xml of the content node in cmsContentXml table in Umbraco database.
Is running this inside a console application a problem? I do not seem me to think so otherwise the first line of code would not have worked either.

Related

How can I post updates for deleted records using TEMSDataSetResource in RAD Server 11

I have created a simple new Rad Server Package with resource with a data module to access a Firebird 3.05 database running on Ubuntu 18.0.4. I included sample endpoints and a database endpoint with one table from the database.
I modified the created FDQuery to return a subset of the records.
select * from EXPENSES where COMPANYID = :COMPANYID
It indicated the FireDACFBDriver was not found, and instead of adding the PhysFBDriverLink, I deleted the FireDACFBDriver in the project source and it asked to add back the FireDACIBDriver and it works. This is besides the point, I think, but just full disclosure. I have tried the PhysFBLink with same results, but have had trouble switching back and forth to Linux deploy, so this works for testing I believe.
The client app consists of a TEMSFireDACClient, a FDSchemaAdapter, FD TAble Adapter, FDMemTable and datasource and dbgrid and three buttons.
Button1
Expenses.GetEndpoint.Params.Clear()
expenses.GetEndpoint.Params.AddItem(
'CompanyID','10000080');
Expenses.GetData();
Button2
FDMemTable1.delete;
Button3
Expenses.GetEndpoint.Params.Clear();
expenses.GetEndpoint.Params.AddItem(
'CompanyID','10000080');
Expenses.PostUpdates;
Button One retrieves multiple rows, and button two deletes a row locally, and button 3 tries to apply the table updates back to the server.
When attempting to post updates. I get the following error:
EMS Error: Resource error. Request parameter not found: COMPANYID.
This works when the resource SQL is SELECT * FROM EXPENSES. Is it just that the TEMSDataSetResources can only work on the full table, or Is there something simple I am missing or a reference available for how to accomplish this?
I have tried creating a manual delete endpoint with:
delete from EXPENSES where EXPENSEID = #####
However, that is another post maybe if I have to go there. I cannot get around and error converting Unicode to integer variant when passing the parameter.

Item Tree not being populated from link selector in Sitecore 9.2

Whenever we try to add a link using any of the link types (including media links), we get the empty Sitecore Items tree in the dialog window:
Link Selector Dialog
The tree list only shows the top level /sitecore and nothing else. Are we missing a configuration somewhere or is this a bug that needs to get reported?
If there are no errors in the console then you receive a successful response with 200 status, but empty item[] in JSON response. So, this is a matter of configuration. Please check the template of your item and make sure that you have specified the correct data source for the link field. In case if the data source path is invalid or empty you will get the empty tree.
This issue stemmed from a pipeline patch that was created to catch Glass Mapper generated processor errors. Once removed we had the tree list populating as it should.

Suitelink Reference Table

I work with Wonderware software. One of the objects used to perform communication between Wonderware and the PLC is called Suitelink. In it, I have a table defined that has the name of one of my application fields on the left side and the name of the PLC tag providing its value on the right.
Once this saved and activated (deployed) the PLC tags will feed values in the field attributes to Wonderware.
Does anyone know where is this list saved in the system?
I am working at a web page and want to retrieve this list dynamically so I can have the page updated based on the current live value of the PLC tag being used.
I have looked in the database but could not find it.
C:\ProgramData\Wonderware\DAServer
Then within there you'll have several subfolders for your DA Servers. Open the subfolder to find a *.AAcfg file and your contents are in there in what looks like an XML format. You'll be hunting for all the <DeviceItem> tags

How to find component inside P:Datalist in primefaces?

I have component hierarchy such as this
Form>P:DataList
>DataTable1
>DataTable2
When I see the generated html code or developers tool in ie, I found
the client id generated for the datatables are
form:datalist:0:DataTable
form:datalist:1:DataTable
However when I invoke
ViewRoot.findComponent
with the above client Id,
it return null.When I removed the "rowIndex" value i.e 0/1
it then only returns the first datatable.
How to make it work so that I can find both the data tables
from backend using their Ids?

Modifying error messages for Command Objects embedded in controller

I am trying to modify the messages.properties file for form input validated by a Command Object that is in specified in the controller. The output I get from the standard error message (that I modified slightly to assure I was hitting that specific one) is:
email cannot be empty test class com.dashboard.RegisterController$DashboardUserRegistrationCommand
but no variant of com.dashboard.RegisterController$DashboardUserRegistrationCommand.null.message
works
I am wondering what the correct specification should be.
Try to put DashboardUserRegistrationCommand outside (below) of RegisterController but still in the same file. Then com.dashboard.DashboardUserRegistrationCommand.. should work.
i.e. com.dashboard.DashboardUserRegistrationCommand.message.nullable
The typical layout of error messages is:
${packageName}.${className}.${propertyName}.${errorCode}
So for your example it would be:
com.dashboard.DashboardUserRegistrationCommand.message.nullable
In the Grails Reference on the right hand side there is a header titled 'Constraints'. On each page of the specific constraints listed under that header the ${errorCode} value is listed at the bottom of the page.
And sometimes you have to restart a run-app to get new messages to populate in a Grails project.
Just to help others in the future, I had the same issues and my problem was the way I was defining my key, I use now:
For default messages:
default.null.message=Write a value for {0}
For commmand error messages:
my.package.UserCommand.name.nullable=Please tell us your name
It is strange that sometimes you use nullable and sometimes you use null. The best thing is going to the Grails Constraints directly and check how is it done for example:
http://grails.org/doc/latest/ref/Constraints/nullable.html

Resources