Is there a way to create a static field in the model generated for swagger codegen? - swagger

I am trying to use swagger-codegen (the maven plugin) to generate my models. But I need one of my fields to be static. I was wondering if there's a property I could use in my yaml file to indicate that the field is static. Does anyone have an existing example I could look at?

Related

EF 6 Database first programmatically generate edmx

I'm trying to create the edmx file as part of an automated build process in order to ensure the code is in sync with the DB.
The emdx diagram doesn't use the complete DB so I have used EntityStoreSchemaGenerator and EntityModelSchemaGenerator in System.Data.Entity.Design in order to only include the tables, views and stored procedures needed.
I can then use the generated csdl, msl and ssdl files to create an edmx file.
The issue is that FunctionImport tags are not generated and nor are complex type tags.
These tags are generated when using the edmx designer tool.
From what I gather, the edmx designer tool uses the same generator calls (in System.Data.Entity.Design)
but seems to produce those extra tags.
Is there a way to programmatically get these additional tags auto generated preferably (although not essential) using the System.Data.Entity.Design library?

Umbraco Database Query

I want to add a property for a document type in Umbraco. After that, I want to add content using the newly edited document type. Finally, I want to edit the property value of the content and save it into the database. I want to do this using a SQL command in SQL Server Management Studio, given that I have installed Umbraco and I can access the Umbraco database.
You shouldn't do these things directly in the database with Umbraco. In fact, part of your requirements (adding content) wouldn't display on the front end if you did it in the database, as doing so would not fire the events needed to add your new content to the site XML cache.
Ideally you should be doing this in code, using the API. You don't mention which version of Umbraco you're using, so I'll assume the latest (7). That being the case, you ca use the various service APIs to accomplish your requirements. You'd use the ContentType Service to create your new Document Type, and the Content Service to add the content of your new type.
For more information, refer to the Umbraco services reference page: here
As Tim says it's not a good idea to do this with SQL, an alternative solution is to do it with a package. An Umbraco package contains an XML document, it is also possible there to make an adjustment in the XML (if the goal is a generated change)

Clarification needed about generating jax-ws client stubs in order to consume a webservice

I have on the one hand a wsdl url/file and on the other hand a number of xsd schema files (are the latte called binding files?).
All of these describe a webservice that I would like to consume using jax-ws.
I understand I need to generate client stubs using the wsimport utility.
I have a requirement for one distinct package per xsd schema/binding file for the generated stubs files. The generated stubs for the wsdl would be located in another package.
Does that make sense?
Is this possible? If so how?
I am missing something?
edit: I don't fully understand the difference of intent between files generated against the wsdl and files generated against the xsd binding files as when using wsimport. Can someone please explain?
baleto
first thing the xjb files are used to resolve conflicts and customizing schemas.
You can create a distinct package for a XSD if it has a specfic namespace defined for it.
For example you need a package name like com.foo.healthcare.claims then you need to have a name space for the schema as http://www.foo.com/healthcare/claims.

How to localize ActiveReport 7.0 XML PageReports rdlx

We have a huge number of Page Reports created using ActiveReport (*.rdlx files)
We use them from our ASP.NET MVC web appolication.
All captions and other stuff were initially created on English
Now we need to add a multilanguage support there so, somehow we need all existing texts be inserted in resource file and so we can then add translations
Is there a way to achive this task quickly, without going to each report field and manually extracting it into resource file?
Documentation says that once you change Language property, resource files will be created, but seems it is not working for XML reports, or there shouldbe a trick
For the reports designed with Code-behind, resource files are created pretty much the same as if you will create a Windows form... but I fail to find out how to do this for XML reports.
Page Reports support a localization; however it doesn't do so with a resource file.
This is mentioned off-hand in a single sentence on the page about Localization with ActiveReports 7.
Setting up a localized value in a Page Report is done the same was as you do in a Section Report. Simply change the report's Language property and then set new textbox values. At report runtime the appropriate value for the textbox will get used.
As I mentioned above, this doesn't generate a separate .resx file; instead if you inspect the resulting .rdlx you'll find a custom dd:LocalizationResources element is created that specifies the language setting and the new values for report elements.
The Localize property you are referring to in the documentation and in the code-behind reports are for the code-based "Section Layout" Reports but won't work for XML-based "Page Layout" reports (if you look at the generated code for the report, you'll see that the designer is just generating a bunch of code to localize the report).
Since code-behind reports support custom code or you can add references to another DLL you can write a simple function to localize captions. There is a good example of localizing this for .rdl reports here, you can use exactly the same approach with the ActiveReports' .rdlx files.
During that initial configuration of the report to be localizable you'll either have to manually change each static string to a Code.LocalizedValue call or maybe you could write a simple script to find each //Textbox/Value elements and replace it with a similar call. A simple script with a combination of xpath and regex could do help you automate the initial configuration of the report. To localize something other than a Textbox Value in the report (e.g. report parameter, labels/bookmarks), you'll need to replace the text of a different element than the Textbox Value but the concept is the same.
Of course, I am assuming you are localizing the static strings in your report. If you want to localize the values from the database then you'll have to do that differently (comment if you need help and I'll explain).

Symfony's autogenerated model classes' function location

i'm working on a symfony project and i generated a set of model classes called Base<name>.php, <name>.php, <name>Peer.php and Base<name>Peer.php
I did the famous jobeet tutorial and i still have doubts about locating functions in these files of the model. So my question is:
What kind of functions i have to put in which file?
or expressed other way
How i know where to locate a function in these files?
thank you very much
You should never edit the files prefixed with Base, they can be overwritten if you change something in your schema and regenerate these files.
The custom methods you are writing yourself should be in the Peer class.
To easily locate a method, I use a good IDE like PDT that parses the files and allows searching methods.

Resources