Changing custom block content through a table in autocad - autocad

So I have custom blocks, (essentially just labels) and I'm wondering if I can update the content in these blocks using a table (instead of editing the block through the block editor), either an autocad table or maybe through external like excel.. Does anybody know if that is possible?

What you are describing is essentially a dynamic block in AutoCAD: you can either use multiple visibility states, with each visibility state containing different block geometry (perhaps with some objects common to all states), or a lookup table parameter to alter constrained properties of the block geometry.
There are many tutorials & documentation in the AutoCAD user manual describing what I have suggested above.

Related

Implementing a reusable APEX form validation definition for multiple, similar page items

I am currently using APEX 4.0. I would like to make a validation that would apply for multiple fields in a form. For example, I want specific fields to only accept a Y or N, and they must be uppercase letters. As of now, I have one validation for each field. Is there a way to make a single validation that would apply to all these fields?
Creating Re-Usable Form Validations in Oracle Application Express (APEX)
This solution was developed on a Apex instance hosted on Oracle OTN (apex.oracle.com). This instance is currently at version 4.2.5, but the design elements discussed within this solution should still be compatible across the versions from 4.0.0 and 4.2.5.
The way you can approach your form design is not necessarily to catch exceptions through a validation step once the form has been completed and submitted.
Instead, simply consider limiting the choices that the user can choose in their input, and control how that input is interpreted once it is submitted as changes to your data table.
Pre-Validate By Defining Restrictive Value Choices
Here is an example of the OP requirement defined as a "Shared Component" through the "Application Builder" menu. Create a named LOV (list of values) with a static definition. Here, you can define the value pairs of:
DISPLAY, which is anything user friendly you want the user to see. Even if Y or N is pretty self-explanatory, explore other options such as spelling it out (such as: YES) or combining the real value with the display (such as: Y (Yes)).
RETURN VALUE, which is where you enforce what goes into your database. In this case, the uppercase, single character values mentioned in the OP requirements would go here.
This is what that LOV definition looks like:
APEX LOV (list of values) Design Screen
Eliminate Free-form Data Form Item Display Types
Following with the initial concept of a limiting LOV, convert all your form items to use display-types which use a "List of Values" definition pointing to your "Shared Component" (or Named LOV).
Use the SAME LOV definition for questions requiring the same input rules. Now the user has no way of changing the data values outside of the OP definition, and there is some flexibility to use more instructive/descriptive display values so that they are more likely to make the right selection as well.
This is an example of how a input form with the same input data types can accomplish this task with no additional validation:
Sample APEX Form Design with Reusable Input Restriction Rules
In this example, I experimented with a few form item styles, including
The standard text-box entry field. (Problematic without coupling it with additional validation logic).
Select-list entry items worked the best. See the discussion at the end of this solution for more explanation on choosing specifics such as specifying "null field values".
Radio group selection buttons work well to as they provide a visual layout of the valid form choices without additional drilling-down or scrolling.
All three options used the same LOV definition.
Examples of Data Input Using LOV Enforced Restrictions
After experimenting with different kinds of inputs, here's a few things that may be helpful depending on the situation or the deeper requirements of this OP or other readers.
DISPLAY EXTRA VALUES should be left as set to NO. This is the reason for restricting the input possibilities in the first place.
DISPLAY NULL VALUE is best as NO if all answers require a response. If NULL is possible, there is a useful third (defaulted) value that can be used for additional user-friendliness.
Sample Data Inputs and Values from the LOV Restricted Form
Notice that the free-text entry field presents additional problems with data quality without some other form of validation or checking. The other form fields provided accurate data input reflected through the target database table.
Some Closing Comments and Points for Further Study
This solution is only a partial one with respect to protecting information stored in a database table. It is not uncommon for lots of other systems, applications, programs, api's, etc. to also have access to change or add data to this back-end data source.
What if another group of developers independently created an api for managing data in the same table? Unless they read the documentation of the OP or examined existing data sets already present, their project team may not have designed an accurate interpretation of the rules which sit at this point, only on this particular APEX application.
Depending on how vulnerable your system is, it is also good practice to apply relevant safeguards, such as schema level table constraints (such as check constraints), Not Null constraints (where applicable) and even DEFAULT values settings (established by triggers or table default values).
From the Author...
Again, it isn't all necessary to go to this detail... if the input form of the Apex application offers only two choices: "SOUP" or "SALAD", it is unlikely that "BACON-ORANGE-CHICKEN" will pop up in the table after deploying the application into users' hands.
This kind of design approach skips a server round trip worth of I/O because the user already know what is on the menu at the initial page loading event.
Although the OP request is very simple and generic (Y for YES or N for NO), it presents a useful pattern for more complex input screening procedures that can happen even before the data is submitted.
Good Luck, All!
Onward.

Store translated versions in database for Joomla component

I'm currently developing my first MVC component for Joomla 3.x. All in all I'm bit struggling with language/translation issues in database.
My problem is that I need to store translated content of user generated content which comes from the backend. For example someone enters a new item in German (stored in database) and needs a translation in another language. How to accomplish that in Joomla? I don't like to generate a new item for every different language when the rest is all the same.
I thought about a table "item" and a table "item_language" with that structure (strongly simplified for viewing purposes):
item
id PRIMARY INT
price DOUBLE(4,2)
item_language
itemid PRIMARY INT
language PRIMARY CHAR(5)
name VARCHAR(50)
In item_language I would like to store the different translated versions. In the language field there would be the region code (eg. de-DE) to identify the language.
My problems:
How to display the different (translated) versions in backend?
Is this the right database model?
Any help is appreciated!
You have really found yourself a nice task for a first component in Joomla!
A rather generalist answer:
The database model seems right. Alternatively you could encode in JSON the language data, but this could make later query operations potentially difficult. This way you will only have one table to work with.
As far as I know (if you are using JModel / JTable to manipulate the data) can't do this directly, as JTable is really only designed to manipulate single tables.
What you can do:
For editing: figure a way to represent this graphically ( for your users to see and edit this one to many relationship) and to post this data (language texts as an array) to JModel. In the model you can maintain the desired relationships and save the data using JTable.
Viewing (without editing) shouldn't be an issue, it would be a simple JOIN.
If you are willing to create a basic component on github, I might even give you a hand with JModel / JTable.
I found a way to deal with the things I needed.
Thanks Valentin Despa for guiding me in the right direction :-).
Here the whole procedure (simplified - validations and exact steps omitted):
Define the form fields in the models/forms/site.xml as normal.
In views/site/tmpl/edit.php add self coded Javascript (based on jQuery) to deal with the fields which have content in multiple languages stored as JSON in database.
Clone the original form element and modify the needed attributes (id, name, ...) to display a special version just for the defined languages. As content - extract the JSON for the needed language from original field content and display.
Hide the original field with Javascript and append the customized versions to DOM.
Afterwards in tables/site.php I read the dynamically generated content withJInput and build together the original field by generating JSON and saving to database.
It's working like expected.

How do I create a custom role for entities in Sphinx?

In my project we define threats/risks and countermeasures. I want to keep track and refer to both types of entities in Sphinx, as well as generating a list of both threats/risks and the countermeasures. Let's say I have 30 risks and 50 countermeasures (many-to-many relationship).
I'd be happy just to have a lists of both and the ability to refer to each other by numbers (e.g. "risk #23", "countermeasure #12"). It would be even better if the system could display the relationship automatically.
The content of both is let's say a single paragraph or even shorter, so that's why I dislike to use regular headings. And I cannot refer to items in lists or table rows. So, I'm looking for something like a Figure in Sphinx (numbered, with caption), but then for arbitrary types of entities.
My current approach is to create a custom RST role for this. Is this the right approach? If so, where to start?

Core data, bindings, NSArrayController and table views - how to generate a view of a core data context

I have a working system that lets me build a database containing instances of various entities , all linked together nicely.
Before I knew I would care, I came across a tutorial on using Core Data and bindings, and it went through a complete case where you get a table showing all the entities of some type with a column for each property. It showed both the UI side and the Data model side - not that I need the data model part at this point. Now, darned if I can find it. This is one of those things that is supposed to be easy, and requires virtually no code, but getting exactly the right connections in UIBuilder is not going to happen if I can't find instructions.
Also, I thought I came across an example of something like a query editor where the user could select which properties to sort on, which to match on, etc. Did I imagine that?
Anyone out there know where I can find such?
Sure, you can do this without code:
Add an array controller to your nib.
Bind or connect an outlet for its managed object context
Set the array controller to Entity mode, fill in the entity name, and select Prepares Content.
Bind your table view columns to array controller's arranged objects, and fill in the key name for the model key.
Regarding the query editor, open up the model, and on the Editor menu click Add Fetch Request.
I found at least a partial answer to the query editor question, in this apple tutorial. Not sure how far it will get me, as I prefer to write code where possible, since then I can leave a trail of comments.

database driven form controls

How to do databse driveen jsp page,
Suppose i have 5 text fields,if user wants to put one of the form field as select box.JSp should identify and return the select box if it define in db as select box.
I dont know how to achieve this,can anyone suggest this.
Regards,
Raju komaturi
There are multiple tasks if you want to do this completely. The world at large has not gone this way and so there are not many tools (if any) for this. But basically here are the main ideas.
1) You want a "data dictionary", a collection of meta-data that tells you what the types and sizes of each column are, and the primary and foreign keys are.
2) For your example of "knowing" that a field should be a drop-down, this almost always means that column value is a foreign key to another table. Your code detects this and builds a listbox out of the values in the parent table.
3) You can go so far as to create a complete form generator for simple tables, where all of the HTML is generated, but you always need a way to override this for the more complex forms. If you do this, your data dictionary should also have column descriptions or captions.
There are many many more ideas, but this is the starting point for what you describe.

Resources