How to generate MS Visio diagram automatically? [closed] - visio

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I have some sort of a table describing a graph of dependencies. Is there any easy way to convert it into a MS Visio diagram?
Like a .CSV format for Excel...
If it is not possible with MS Visio, then is there any software which draws a diagram from a list of graph dependencies?
Thank you.

graphviz is pretty much geared for this sort of thing. I assume you're on Windows since you asked about Visio, so here are the Windows binaries for it.

If your using a newer version of Visio (2003+) you should use the Reverse engineer tool for databases to start your diagram. It will suck all the db tables and relationships into shapes that you can then modify.
Here is a link that will walk you thru the feature: http://office.microsoft.com/en-us/visio/HA101154851033.aspx

I wrote a PowerShell module called VisioPS that may help you (See the downloads section here:
* The VisioPS module is part of my VisioAutomation library on CodePlex)
After installing VisioPS, you an launch an instance of PowerShell and do this:
Import-Module VisioPS
New-VisioApplication
New-VisioDocument
$dg = Import-VisioDirectedGraph c:\foo.xml
Invoke-VisioDraw $dg
The Direct Graph is a simple XML document like this
<directedgraph>
<page>
<renderoptions
usedynamicconnectors="true"
scalingfactor="20"
/>
<shapes>
<shape id="n1" label="FOO1" stencil="server_u.vss" master="Server" url="http://microsoft.com" />
<shape id="n2" label="FOO2" stencil="server_u.vss" master="Email Server" url="http://contoso.com"/>
<shape id="n3" label="FOO3" stencil="server_u.vss" master="Proxy Server" url="\\isotope\public" />
<shape id="n4" label="FOO4" stencil="server_u.vss" master="Web Server">
<customprop name="prop1" value="value1"/>
<customprop name="prop2" value="value2"/>
</shape>
<shape id="n5" label="FOO4" stencil="server_u.vss" master="Application Server" />
</shapes>
<connectors>
<connector id="c1" from="n1" to="n2" label="LABEL1" />
<connector id="c2" from="n2" to="n3" label="LABEL2" color="#ff0000" weight="2" />
<connector id="c3" from="n3" to="n4" label="LABEL1" color="#44ff00" />
<connector id="c4" from="n4" to="n5" label="" color="#0000ff" weight="5"/>
<connector id="c5" from="n4" to="n1" label="" />
<connector id="c6" from="n4" to="n3" label="" weight="10"/>
</connectors>
</page>
</directedgraph>
VisioPS uses MSAGL to perform the layout for the nodes
You could easily take your table of dependencies and create the XML needed
If you look closer at the code in my library, you can also directly create the objects necessary to do the rendering without having to go through the XML at all.

Visio Professional edition will import from a spreadsheet or database, but it does not appear possible to have Visio automatically draw connectors between shapes.

Not sure if that helps, but ARIS Express (http://www.ariscommunity.com/aris-express) has a feature called smart design. You enter your data as a spreadsheet and it automatically generates the diagram. Works for process models, but also for data models or organisational charts.

Graphvis is a plugin to import .gv files in dot format. It will draw the connectors and shapes can be customized, and there are a few initial layout options.

Omnigraffle can be an alternative. In Omnigraffle you won't be able to import a csv, but you will be able to insert items as a list and sort them very easily creating dependencies between elements. Then, there is a function call "Dynamic Diagram" that sorts the diagram automatically. (You can modify the type of diagram and length of connectors)

Related

Trying to make annotated citation style, getting "Error generating citations and bibliography"

I have a question on some csl code.
I am trying to convert the "nature" style which is available through Zotero to an annotated style which gets the annotation by citing the "Extra" field (similar to APA 7th edition annotated).
I am not familiar with coding in csl so I found out thanks to google that all I had to do is add the line
<text variable="note" display="block"/>
before </layout>
(found this info here: https://forums.zotero.org/discussion/19552/annotated-bibliography-in-mla-or-chicago-style)
I did so and now I am getting the following error when generating the style in Zotero's style editor:
Error generating citations and bibliography:
citeproc-js error: Level mismatch error: wanted bib_first but found bib_other
I already checked my code with the CSL style and locale editor (https://validator.citationstyles.org/) and it gives me no errors. Googling this error message does't give any good results. I am trying to use this style in Microsoft Word once it works.
Here are the last couple of lines of the code (if the line <text variable="note" display="block"/> is removed, then the error is gone):
<text macro="editor"/>
<text macro="volume"/>
<text variable="page"/>
<text macro="issuance"/>
<text macro="access"/>
</group>
<text variable="note" display="block"/>
</layout>
</bibliography>
</style>
I would really appreciate if anyone could help with this. Thanks!
I don't think this is in the specifications, but you can't mix second-field-align in the bibliography settings with display set on individual elements (because they're doing the same type of things, so the CSL processor doesn't know what you actually want to do).
I see you found a solution, but that'll not print the annotations on a new line. If you still want that, go back to
<text variable="note" display="block"/>
But then remove the second-field-align from bibliography, i.e. for Nature, turn it into
<bibliography et-al-min="6" et-al-use-first="1" entry-spacing="0" line-spacing="2">
Ok, I was now able to fix this by replacing the line I added with
<text variable="note" prefix=""/>
There is no error message anymore and the citations look great! I will leave this question up, in case anyone is or will be struggling with the same problem.
I haven't tested this, but I think the problem is that you only used display="block" on a single element under <layout/>. Per https://docs.citationstyles.org/en/1.0.1/specification.html#display, "The display attribute ... may be used to structure individual bibliographic entries into one or more text blocks. If used, all rendering elements should be under the control of a display attribute."
If you want the annotations to appear on a new line, I'd try introducing a new <group display="block">...</group> that encompasses the original content of <layout/> in the bibliography section, followed by <text variable="note" display="block"/>.

In Filemaker, is it possible to import into Container fields from XML?

The XML FMPXMLRESULT grammar documentation states:
XML export does not support exporting container field data.
which seems to imply that it's possible to import (it does also specify that you can denote a field as type "CONTAINER" in the XML). However, I have found zero documentation as to how this might be done.
Is it possible? I get that there are ways of getting e.g. an image file into Filemaker after the fact, but can I just specify it in the XML beforehand, negating the need to have additional scripts or post-processing the import (not to mention something that works in Filemaker 11 or below)?
You can import file references, but not binary data. (And you'll have to specify the field as TEXT type in the XML file.) For example:
<?xml version="1.0" encoding="UTF-8"?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="01-25-2011" NAME="FileMaker"
VERSION="ProAdvanced 11.0v3" />
<DATABASE DATEFORMAT="M/d/yyyy" TIMEFORMAT="h:mm:ss a"
LAYOUT="" NAME="" RECORDS="" />
<METADATA>
<FIELD EMPTYOK="YES" MAXREPEAT="1" TYPE="TEXT" NAME="Path" />
</METADATA>
<RESULTSET FOUND="">
<ROW>
<COL>
<DATA>image:test.jpg</DATA>
</COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>
The path must be in FileMaker format; here I used a relative path to test.jpg in the same directory as the file (will only work for local files), but it can also be an absolute path, e.g.:
imagewin:/C:/Some/Path/test.jpg
Your best option is probably to import Base64-encoded data, then use the Base64Decode function to decode it.
importing images, preferably from http
I am not sure what exactly that means. If your XML contains a link to an image, then the only thing you can do with it is import the link as text. If you are using version 12 or higher, you can follow this with the Insert From URL script step (for each imported record).

How to create a repository in ATG?

i would like to know how to create a new repository in ATG. like what all steps are needed to be included? Do i need to create a properties file?
In order to create a new repository, You need to follow these steps if you want to create a repository that uses sql database in as the datastore.
Create a properties file
Create tables you want to map to the repository
Create a definition XML files to map repository item-descriptors and their properties to the respective tables.
MyRepository.properties
$class=atg.adapter.gsa.GSARepository
repositoryName=MyRepository
definitionFiles=atg/test/repositories/MyRepository.xml
XMLToolsFactory=/atg/dynamo/service/xml/XMLToolsFactory
transactionManager=/atg/dynamo/transaction/TransactionManager
idGenerator=/atg/dynamo/service/IdGenerator
dataSource=/atg/dynamo/service/jdbc/JTDataSource
lockManager=/atg/dynamo/service/ClientLockManager
The above properties files ensures that a new repository component is created and MyRepository.xml will be marked as its definition file.
The content of the MyRepository.xml file should be something like below...
MyRepository.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE gsa-template SYSTEM "http://www.atg.com/dtds/gsa/gsa_1.0.dtd">
<gsa-template>
<header>
<name>New Repository creation</name>
<author>Jyothi Prasad Buddha</author>
</header>
<item-descriptor name="myRepo" cache-mode="simple">
<table name="my_repo" type="primary" id-column-names="id">
<!-- properties that may (or may not) be used as primary keys -->
<property name="name" data-types="String" />
<property name="age" data-types="int" />
</table>
</item-descriptor>
</gsa-template>
However you will have to create the the necessary tables before you start atg instance. The above xml files refers to a table named my_repo which has comlumns name and age.
Yes you need to create properties file's for more details you can read RepositoryGuide.pdf from Oracle.
for more detail you can read below blog
http://immuraliraj.blogspot.in/2011/12/atg-repository-basic-concepts.html
Just type
"ATG Creating a repository" on Google
and you would get lot of relevant results on the first page itself. Also be specific which version of ATG are you using, and what you have already done/found in your research. (just a suggestion, so you get good responses).
Yes, you need a properties file when creating a custom repository component. There are a lot of blogs that answer your question with detailed steps.
Check this for example

Adding items to a resource restfully using OpenRasta

I'm using OpenRasta to create a Survey application.
I have a SurveyResource that is accessible at /surveys/{id} and editable at /surveys/{id}/edit
I'd now like to add questions to the survey, as that is the point of a survey, but I'm not sure what the most restful way of doing this is and how to set it up in OR.
I'm thinking I should have a QuestionResource (that has details of the question type, question text, etc) and it should be posted to /surveys/{id}/questions and handled by a question handler, but I can't work out how to configure OR.
I've pushed my project onto github at https://github.com/oharab/OpenSurvey/tree/add_question_to_survey
Can anyone help me?
Ben
it depends on the way you want to model your resources. It's perfectly possible that you'd never explicitly provide access to a single question, and would modify the entire survey document, like so:
PUT /surveys/123
<survey>
<link rel="update" href="/surveys/123" method="PUT"
type="application/vnd.mycorp.survey+xml" />
<question id="age">
<label>How old are you?</label>
<select>
<option>0 - 5</option>
<option>6 - 10</option>
<option>10 - 13</option>
</select>
</question>
</survey>
If you go this route, you could even use HTML, or HTML 5 for your content so it's easy to consume by clients. Now you're just modifying the entire survey document at once.
Alternatively, you might want to separately address each question, giving them an individual URI, which I think is what you're talking about, like so:
GET /survey/123
<survey>
<link rel="add-question" href="/survey/123/questions"
type="application/vnd.mycorp.surveyquestion+xml" method="POST" />
<question>
<link rel="delete" href="/questions/123-age" method="DELETE" />
<link rel="update" href="/questions/123-age" type="application/vnd.mycorp.surveyquestion+xml" method="PUT" />
<label>How old are you?</label>
<select>
<option>0 - 5</option>
<option>6 - 10</option>
<option>10 - 13</option>
</select>
</question>
</survey>
Neither of these is more RESTful than the other, the difference is only in granularity of call. If you need the granularity of the latter, then configure yourself a separate handler per resource as in
using(OpenRastaConfiguration.Manual)
{
ResourceSpace.Has.ResourcesOfType<Survey>().AtUri("/survey/{id}").HandledBy<SurveyHandler>();
ResourceSpace.Has.ResourcesOfType<Question>().AtUri("/questions/{id}").HandleBy<QuestionHandler>();
}

What is the best way to update data for an iPhone app?

I am developing an application for iPhone and one part of it deals with a list of currencies and daily exchange rates. I am using SQLite to store all these rates.
Now I came to the part where I want to make the update part of my database with the new exchange rates.
The first thought was make a request to a server with a specific date and to read back an XML containing something like:
<date value="2010-10-04">
<currency name="EUR" rate="xxx" />
<currency name="USD" rate="yyy" />
<currency name="GBP" rate="zzz" />
........
</date>
<date value="2010-10-05">
<currency name="EUR" rate="xxx" />
<currency name="USD" rate="yyy" />
<currency name="GBP" rate="zzz" />
........
</date>
But now I was thinking isn't it better to make my own format, something like:
#|2010-10-04#EURxxx#USDyyy#GBPzzz#|2010-10-05#EURxxx#USDyyy#GBPzzz##
The separator will be #. Known that always the date takes 11 characters and starts with | and currency code takes 3 characters, I can search the rate until I will find a # sign.
Because I want to send as little data as I can I think this second approach will be better than the usual XML, even if I reduce the XML to:
<d v="2010-10-04">
<c name="EUR" r="xxx" />
<c name="USD" r="yyy" />
<c name="GBP" r="zzz" />
........
</d>
<d v="2010-10-05">
<c name="EUR" r="xxx" />
<c name="USD" r="yyy" />
<c name="GBP" r="zzz" />
........
</d>
What are your pro & cons for this?
XML is easier to read and parse. Unless you're fetching a zillion currencies and daily rates a day, the # of bytes shouldn't be an issue.
JSON format would split the difference between a proprietary format and a standard format. It is somewhat less verbose than XML and has the flexibility and maintainability vodkhang rightly expects.
The pros:
As you already stated, it is shorter, faster to retrieve.
Faster to parse as well
The cons:
If you develop the server side and the other developer on the mobile side, then he may get confused when there are no meanings
It is hard to scale when you have more and more attributes and if you delete or change some attributes, you have to go over all codes to change it.
CFPropertyList is pretty good if you're using PHP as your server-side language.
Easy to integrate with your server code and has built in support in iOS (e.g. an NSDictionary can be created directly from a plist file).
Link: http://code.google.com/p/cfpropertylist/