Global Datatype

Topics: General
Sep 12, 2011 at 11:22 PM
Edited Sep 12, 2011 at 11:48 PM

I currently have data in a Page Datafolder and would like the data to be displayed in the "website items" folder in the content tree instead of showing the data records under the assigned page.  Is there a way to do this?

Sep 13, 2011 at 8:50 AM
Edited Sep 13, 2011 at 8:52 AM

Hello,

But the meaning of the Page datafolders  that data associated with one specific page and this data type has additional field  named "PageId" and they will be shown under the assigned page by design.

Global datatypes can be displayed in the  Website Items (right click on data type -> "Show in Content perspective")

Also  there is a way to show Page datafolders under the "WebSite items" by using Tree Definitions. For example, consider next example to show page datafolders for specific page under Website items"

1. Create MyHomePageDataFolders.xml with content below and put it to the folder \App_Data\Composite\TreeDefinitions\ , (make sure to specify your values for {Namespace.Type}, {FiledName}, {a3055286-0e90-4b04-99dd-fb1a61dde0bf}):

 

<?xml version="1.0" encoding="UTF-8"?>
<ElementStructure xmlns="http://www.composite.net/ns/management/trees/treemarkup/1.0" xmlns:f="http://www.composite.net/ns/function/1.0">
	<ElementStructure.AutoAttachments>
		<NamedParent Name="Content.WebsiteItems" Position="Bottom"/>
	</ElementStructure.AutoAttachments>
	<ElementRoot>
		<Children>
			<Element Label="My Home Page DataFolders" Id="PageFolders">
				<Children>
					<DataElements Type="Namespase.TypeName" Label="${C1:Data:Namespase.TypeName:FieldName}" Display="Auto">
						<Actions>
							<EditDataAction Label="Edit" />
						</Actions>
						<Filters>
							<FieldFilter FieldName="PageId" FieldValue=" a3055286-0e90-4b04-99dd-fb1a61dde0bf"/>
						</Filters>
					</DataElements>
				</Children>
			</Element>
		</Children>
	</ElementRoot>
</ElementStructure>

 

 

2. Go to the Content perspective -> Website Items and check out your tree. If the tree is not shown, check our Tools -> Server log for errors.

Sep 14, 2011 at 2:02 AM

I would probably agree with Inna here. Actually, I'm pretty sure that if you asked your average user they would PREFER Page Datafolders over Global Data folders. Users want to go to the page they want and from there see everything they need to mess around with.

I'd think twice about putting Page Data Folders in the Global Data area... but that's me.

 

Sep 22, 2011 at 8:16 PM

Hi All,

I have problem - Data Type is not shown in Data perspective and under Website Items in Content perspective.

Before all work ok. What could happen?

The latest changes which i made - i renamed the pages. Can that impact?

If yes, what should be changed to correct working? (i have sql-based application)

Thanks!

Sep 23, 2011 at 7:19 AM

Hello,

Are there some errors in Logs? (go to Tools -> Server Log)

What is the type of your Data type - Global, Page Folder or Meta data type?

Sep 23, 2011 at 12:34 PM

Data type - Global, i logged as admin

1. When i run application (i use VS) - i see login/passw window with yellow padlock.

If i enter them, i see page with Tree Services.

If i close it and restart application - i see Composite start page (as was before).

2. When i try to expand 'Website Items' - application stops on line 143 in Composite\Services\Tree\TreeServoces.asmx:

List<ClientElement> clientElements = TreeServicesFacade.GetChildren(clientElement.ProviderName, clientElement.EntityToken, clientElement.Piggybag, serializedSearchToken);

 

Error in VS: TargetInvocationException

3. If i continue running application then i see error widow 'Web Service Error' with message (in Conmposite):

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'System.Data.Linq.Table`1[Composite.Data.GeneratedTypes.DynamicSqlDataProvider.CustomerSiteData_Customer_PublishedEntity]' to type 'System.Linq.IQueryable`1[SiteData.Customer]'.
   at Composite.Plugins.Data.DataProviders.MSSqlServerDataProvider.SqlDataProvider.GetData[T]()
   at Composite.Data.Foundation.PluginFacades.DataProviderPluginFacade.<GetData>b__4[T](IDataProvider provider)
   at Composite.Data.Foundation.PluginFacades.DataProviderPluginFacade.SyncronizedCall[TProvider,TResult](String providerName, SyncronizedCallDelegate`2 func)
   at Composite.Data.Foundation.PluginFacades.DataProviderPluginFacade.GetData[T](String providerName)
   at Composite.Data.DataFacadeImpl.GetData[T](Boolean useCaching, IEnumerable`1 providerNames)
   at Composite.Data.DataFacade.GetData[T](Boolean useCaching, IEnumerable`1 providerNames)
   --- End of inner exception stack trace ---
......

3. In Server log i see:

  9/23/2011 2:32 PM
Validator function markup parse / execution failed with the following error: 'The Function named 'Composite.Utils.Validation.RegularExpressionValidation' is not known.'. The validator attribute is dropped.
InterfaceCodeGenerator Error
  9/23/2011 2:32 PM
Validator function markup parse / execution failed with the following error: 'The Function named 'Composite.Utils.Validation.RegularExpressionValidation' is not known.'. The validator attribute is dropped.
InterfaceCodeGenerator Error
  9/23/2011 2:32 PM
Validator function markup parse / execution failed with the following error: 'The Function named 'Composite.Utils.Validation.RegularExpressionValidation' is not known.'. The validator attribute is dropped.
InterfaceCodeGenerator Error
  9/23/2011 2:31 PM
DENIED 127.0.0.1 access to /composite/services/tree/treeservices.asmx

That's all. The same i see when try to expand 'Global Datatypes' in Data perspective.

Thank you!

Sep 23, 2011 at 12:36 PM

Also i tried to add MyHomePageDataFolders.xml as was described before, but i don't know where i can find guids and should i add all fields.

Sep 23, 2011 at 1:20 PM

Regarding to the Error, It is hard to say what is wrong, but probably assembly cache is broken. Try to follow steps described here to re-gererate Composite.Generated.dll

Sep 23, 2011 at 2:05 PM

Inna,

Thank you.

I made 7 steps. After them i see my global data type correct.

Then i made steps 8 and 9. 9 step is - check that file /Bin/Composite.Generated.dll has been created.

But i don't have the dll.

How it can impact to future site running?

What should i do to create it (if it is mandatory)?

Sep 23, 2011 at 2:11 PM

for example, now i have following error for sitemap:

Error: XSLT Function call markup for failed to parse ('The Function named 'Composite.Navigation.LanguageSwitcher.GetPagesInfo' is not known.'). Please see server log for more details.

Error details:
Failed to get value for function 'Composite.Navigation.LanguageSwitcher'
XSLT Function call markup for failed to parse ('The Function named 'Composite.Navigation.LanguageSwitcher.GetPagesInfo' is not known.'). Please see server log for more details.
Sep 23, 2011 at 2:18 PM

>> But i don't have the dll.

Try to do steps 7 and 8 again. it should be there

>> for example, now i have following error for sitemap:

it is because you did step 3) Rename App_Code to App_Code1. When Composite.Generated.dll is recompiled, you will rename  back App_Code, and this will fix the error

 

Note: This breakdown related with Composite.Generated.dll should be fixed in next release.

 

Sep 23, 2011 at 2:24 PM
Edited Sep 23, 2011 at 2:32 PM

what means 'run composite backend'?

it is casual run?

if yes - the dll is not created...

Sep 23, 2011 at 2:27 PM
 

what means 'run composite backend'?

run Composite console, by pass ~/composite/top.aspx -> fill login form -> log in -> you are in backend

Sep 23, 2011 at 2:41 PM
Edited Sep 23, 2011 at 2:42 PM

If chek the dll after step 12 - then it is present :)

Is that ok?

Inna, thank you!

Sep 24, 2011 at 10:25 PM

Hi All,

Now i have other problem with Global Data type.

I changed Labels for the fields.

But i see old labels on page.

I tried to recreate function properties; clear cache, cookies, etc; remove files from App_Data\Cache\Assembly.

But result is the same.

How can i change fields labels?

And i want to save existent data.

I use sql-based app.

Thank you!

Sep 26, 2011 at 7:10 AM

Hi Olga,

olga_titova wrote:

Hi All,

Now i have other problem with Global Data type.

I changed Labels for the fields.

But i see old labels on page.

In what way do you have labels displayed on a page? Composite.Forms.Renderer?

It would be great if you specified some background on your environment:

  • C1 Build No
  • OS
  • Web Server (IIS6, IIS7, WebMatrix's "IIS Express", Visual Studio's  "Cassini" etc)
  • Web Browser

Thanks

Vitaly

Sep 26, 2011 at 11:27 AM

Hi Vitaly,

Yes, i use Composite.Forms.Rederer.

Environment:

 - C1 -  2.1.4113.99

 - OS - Windows Server 2003

 - Web Server: Visual Studio's (development) and IIS6.0 (hosting)

 - Web Browser - IE7

 Thank you

 


Sep 26, 2011 at 12:34 PM
Edited Sep 26, 2011 at 12:34 PM

Olga,

I can't reproduce the behavior you described on the similar environment.

So I can just make wild guesses now:

1. Any chance you have edited form markup of the datatype in question?

If you have, there should be an XML file under \App_Data\Composite\DynamicTypeForms\:
For example,  if your datatype is "Name.Space.DataType", the form markup will be saved as \App_Data\Composite\DynamicTypeForms\Name\Space\DataType.xml
If this is the case, you should chaneg the Label's values in this file (Please see http://docs.composite.net/C1/Data/Customizing-Datatypes.aspx/Editing-Form-Markup)

2. What version of Forms.Renderer do you use?  Is it 1.4.3?

3. Any chance you have changed the value in the "Name" property of the datatype field instead of the "Label" property?

/Vitaly

Sep 26, 2011 at 6:44 PM
Edited Sep 26, 2011 at 7:45 PM

Vitaly,

Thank you.

I changed xml and it looks ok.

I have other questions about form (Composite.Forms.Renderer).

Now form looks as table with 2 columns. At the same time for Name Label we need less place than for "I Accept" label - we need more text.

Questions:

1. Can i change width for SOME labels, not ALL?

2. Can i add some text between fields? (For example for 'I Accept' we need some sentences, i want to add them before the corresponding checkbox)

3. Can i put widgets UNDER labels?

4. Can i have 2 columns of fields - to make the page wider and shorter?

Thanks

Sep 27, 2011 at 7:31 AM
olga_titova wrote:

Questions:

1. Can i change width for SOME labels, not ALL?

2. Can i add some text between fields? (For example for 'I Accept' we need some sentences, i want to add them before the corresponding checkbox)

3. Can i put widgets UNDER labels?

4. Can i have 2 columns of fields - to make the page wider and shorter?


In terms of Composite.Forms.Renderer, I am afraid not.

You can try and create a custom form for your data type(s). For your inspiration, you can check how the forms are implemented in some packages,
e.g. http://docs.composite.net/Composite.Community.ContactForm

/Vitaly